public function unsetMdas($decision_id, $currentMdas = array()) { //select all mdas not in currentMdas $excludedMdaIds = array(); $excludedMdas = Mda::model()->findAll(array('condition' => 'id NOT IN (:mdas)', 'params' => array(':mdas' => implode(',', $currentMdas)))); foreach ($excludedMdas as $key => $mda) { $mapping = MdaDecisionMapping::model()->find('decision_id=:id AND mda_id=:mda', array(':id' => $decision_id, ':mda' => $mda->id)); if ($mapping) { $id = $mapping->mda_id; $mapping->delete(); $excludedMdaIds[] = $id; } } return $excludedMdaIds; }
array( 'type' => 'html', 'header' => 'Status', 'name' => 'implementation_status_id', 'value' => 'TbHtml::labelTb(" ", array("style"=>"width:100%;height:100%;background-color:{$data->getStatusColor($data)}","color" =>"{$data->getStatusColor($data)}"));' ), array( 'class' => 'editable.EditableColumn', 'header'=>'', 'htmlOptions' => array('style' =>$displayable), 'name' => 'responsible_mda_id', 'headerHtmlOptions' => array('style' => 'width: 100px;'.$displayable), 'filter' => TbHtml::listData(Mda::model()->findAll(), "id", "description"), 'editable' => array( 'type' => 'checklist', 'url' => $this->createUrl('eacDecision/ajaxUpdate'), 'source' => TbHtml::listData(Mda::model()->findAll(), 'id', 'description'), 'placement' => 'right', 'emptytext' => '<p class="btn btn-success">Select responsible MDA</p>' ) ), array( 'class' => 'bootstrap.widgets.TbButtonColumn', 'template' => $allowableActions, ), ), )); ?> </div>
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Mda the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Mda::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public function getMDAs() { return Mda::model()->findAll(); }
), 'sex', 'email', 'phone', array( 'name'=>'meac_office_id', 'value'=>'!is_null($data->meacOffice)?$data->meacOffice->description:""', 'filter'=>TbHtml::listData(MeacOffice::model()->findAll(),"id","description") ), array( 'name'=>'mda_id', 'value'=>'!is_null($data->mda)?$data->mda->description:""', 'filter'=>TbHtml::listData(Mda::model()->findAll(),"id","description") ), array( 'name'=>'is_mda', 'value'=>'$data->is_mda?"Yes":"No"' ), array( 'class' => 'editable.EditableColumn', 'name' => 'active', 'value'=>'$data->active?"Yes":"No"', 'editable' => array( 'type' => 'select', 'url' => $this->createUrl('user/ajaxUpdate'), 'source'=>array(0=>'Inactive',1=>'Active'), 'placement'=>'right',
<?php echo $form->textFieldControlGroup($model,'last_name',array('span'=>5,'maxlength'=>100)); ?> <?php echo $form->radioButtonListControlGroup($model,'sex',array('M'=>'Male','F'=>'Female')); ?> <?php echo $form->textFieldControlGroup($model,'email',array('span'=>5,'maxlength'=>100)); ?> <?php echo $form->textFieldControlGroup($model,'phone'); ?> <table style="background-color:#F6F6F6;"> <tr> <td> <?php echo $form->checkBoxControlGroup($model, 'is_mda'); ?> <span class="hint"><i>Tick to select an MDA for the user account</i></span> </td> <td id="meac_office_field" style="<?php echo !$model->is_mda ? 'display:block':'display:none'?>"><?php echo $form->dropDownListControlGroup($model, 'meac_office_id', TbHtml::listData(MeacOffice::model()->findAll(),'id','description'),array('prompt'=>'--select--')); ?></td> <td id="mda_field" style="<?php echo $model->is_mda ? 'display:block':'display:none'?>"><?php echo $form->dropDownListControlGroup($model, 'mda_id', TbHtml::listData(Mda::model()->findAll(),'id','description'),array('prompt'=>'--select--')); ?></td> </tr> </table> <?php echo $form->checkBoxControlGroup($model,'active',array('span'=>5)); ?> <div class="form-actions"> <?php echo TbHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array( 'color'=>TbHtml::BUTTON_COLOR_PRIMARY, 'size'=>TbHtml::BUTTON_SIZE_DEFAULT, )); ?> </div>