$score = \app\modules\Registrations\GRankModule::calculateScore($params['data']['gRank']['answers']); if (is_numeric($score)) { $params['data']['secondary_rank_data']['grank'] = $score; $params['data']['gRank']['score'] = $score; } } return $chain->next($self, $params, $chain); }, 'validates' => function ($self, $params, $chain) { $validationResult = $chain->next($self, $params, $chain); extract($params); // Check league to see if grank is enabled if (empty($entity->getLeague()->modules->gRank)) { $enabled = false; } else { $enabled = true; } $valid = true; if ($enabled) { if (!isset($entity->gRank->answers)) { $valid = false; $error = 'gRank data missing.'; } else { $score = \app\modules\Registrations\GRankModule::calculateScore($entity->gRank->answers->to('array')); if (!is_numeric($score)) { $valid = false; $params['entity']->errors('gRank.score', implode(', ', $score)); } } } return $valid && $validationResult; }))));
<div class="controls"> <div class="uneditable-input" id="gRank-display-status"></div> <div class="uneditable-input hide" id="gRank-display-experience"></div> <?php echo $this->form->hidden('gRank.answers.experience', array('id' => 'gRank-answers-experience')); ?> <?php echo $this->form->hidden('gRank.score', array('id' => 'gRank-score')); ?> <span class="control-group error"><?php echo $this->form->error('gRank.score'); ?> </span><br /> <?php foreach (GRankModule::getQuestionCategories() as $catName) { echo $this->form->hidden("gRank.answers.{$catName}", array('id' => "gRank-answers-{$catName}")); # echo '<div class="uneditable-input hide" id="gRank-display-' . $catName . '"></div>'; } ?> <a class="btn" href="#" id="gRankShow"></a> </div> </div> </div> <!-- Step Zero: The Disclaimer and Instructions --> <div class="modal hide fade gRankModal" id="gRankStepZero"> <div class="modal-header"> <a class="close" data-dismiss="modal">×</a> <h3><?php echo $modalTitle; ?>
<?php use app\modules\Registrations\GRankModule; $dateFormat = 'l, F jS, Y'; $timeFormat = 'g:ia'; if (isset($registration->gRank) and isset($registration->gRank->answers->experience)) { $gRankMatrix = GRankModule::getQuestionMatrix($registration->gRank->answers->experience); } $this->title("AFDC Leagues"); $subtitle = 'Edit Registrant'; $breadcrumbs = array('Leagues' => 'Leagues::index', $league->name => array('Leagues::view', 'id' => $league->_id), 'Registrants' => array('Leagues::participants', 'id' => $league->_id), 'Edit Registration' => ''); ?> <p><?php echo $this->html->link('Return to participants list', array('Leagues::participants', 'id' => $registration->league_id)); ?> </p> <p><?php echo $this->html->link('Return to registrant detail', array('Registrations::view', 'id' => $registration->_id)); ?> </p>