<div class="row field-row"> <div class="large-<?php echo $form->layoutColumns['label']; ?> column"> <div class="field-label"> Descendants: </div> </div> <div class="large-<?php echo 12 - $form->layoutColumns['label']; ?> column"> <div class="panel" style="margin:0"> <?php $this->widget('CTreeView', array('data' => OphTrOperationbooking_Admission_Letter_Warning_Rule::model()->findAllAsTree($rule, true, 'textPlain'))); ?> </div> </div> </div> <?php } ?> <?php echo $form->errorSummary($rule); ?> <?php echo $form->formActions(array('delete' => $rule->id ? 'Delete' : false)); ?> <?php $this->endWidget();
public function actionDeleteLetterWarningRule($id) { if (!($rule = OphTrOperationbooking_Admission_Letter_Warning_Rule::model()->findByPk($id))) { throw new Exception("Letter warning rule not found: {$id}"); } $errors = array(); if (!empty($_POST)) { if (@$_POST['delete']) { if (!$rule->delete()) { $errors = $rule->getErrors(); } else { Audit::add('admin', 'delete', $id, null, array('module' => 'OphTrOperationbooking', 'model' => 'OphTrOperationbooking_Admission_Letter_Warning_Rule')); $this->redirect(array('/OphTrOperationbooking/admin/viewLetterWarningRules')); } } } $this->jsVars['OE_rule_model'] = 'LetterWarningRule'; $this->render('deleteletterwarningrule', array('rule' => $rule, 'errors' => $errors)); }