echo $form->dropDownList($model, 'color', Actions::getColors(), array('onChange' => 'giveSaveButtonFocus();')); ?> </div> <div class="cell dialog-cell"> <?php if ($model->assignedTo == null && is_numeric($model->calendarId)) { // assigned to calendar instead of user? $model->assignedTo = $model->calendarId; } ?> <?php echo $form->label($model, 'assignedTo', array('class' => 'dialog-label')); ?> <?php echo $form->dropDownList($model, 'assignedTo', $users + X2Calendar::getEditableCalendarNames(), array('id' => 'dialog_actionsAssignedToDropdown', 'onChange' => 'giveSaveButtonFocus();')); ?> <?php /* x2temp */ echo "<br />"; $url = $this->createUrl('groups/getGroups'); echo "<label class=\"dialog-label\">Group?</label>"; echo CHtml::checkBox('group', '', array('id' => 'dialog_groupCheckbox', 'onChange' => 'giveSaveButtonFocus();', 'ajax' => array('type' => 'POST', 'url' => $url, 'update' => '#dialog_actionsAssignedToDropdown', 'complete' => 'function(){ if($("#dialog_groupCheckbox").attr("checked")!="checked"){ $("#dialog_groupCheckbox").attr("checked","checked"); $("#dialog_Actions_visibility option[value=\'2\']").remove(); }else{ $("#dialog_groupCheckbox").removeAttr("checked"); $("#dialog_Actions_visibility").append( $("<option></option>").val("2").html("User\'s Groups") );
if (isset($this->actionMenu)) { $this->beginWidget('zii.widgets.CPortlet', array('title' => Yii::t('app', 'Actions'), 'id' => 'actions')); $this->widget('zii.widgets.CMenu', array('items' => $this->actionMenu)); $this->endWidget(); } if (isset($this->modelClass) && $this->modelClass == 'Actions' && $this->showActions !== null) { $this->beginWidget('zii.widgets.CPortlet', array('title' => Yii::t('actions', 'Show Actions'), 'id' => 'actions-filter')); echo '<div class="form" style="border: none;">'; echo CHtml::dropDownList('show-actions', $this->showActions, array('uncomplete' => Yii::t('actions', 'Uncomplete'), 'complete' => Yii::t('actions', 'Complete'), 'all' => Yii::t('actions', 'All')), array('id' => 'dropdown-show-actions', 'onChange' => 'toggleShowActions();')); echo '</div>'; $this->endWidget(); } if (isset($this->modelClass) && $this->modelClass == 'Calendar') { $user = UserChild::model()->findByPk(Yii::app()->user->getId()); $showCalendars = json_decode($user->showCalendars, true); $editableCalendars = X2Calendar::getEditableCalendarNames(); // list of calendars current user can edit $editableUserCalendars = X2Calendar::getEditableUserCalendarNames(); // list of user calendars current user can edit if (isset($this->sharedCalendars) && $this->sharedCalendars !== null) { $this->beginWidget('zii.widgets.CPortlet', array('title' => Yii::t('calendar', 'Calendars'), 'id' => 'shared-calendar')); $showSharedCalendars = $showCalendars['sharedCalendars']; echo '<ul style="font-size: 0.8em; font-weight: bold; color: black;">'; foreach ($this->sharedCalendars as $calendarId => $calendarName) { if (isset($editableCalendars[$calendarId])) { // check if current user has permission to edit calendar $editable = 'true'; } else { $editable = 'false'; } echo "<li>\n";
//echo $form->error($actionModel,'priority'); ?> <?php echo $form->label($event, 'color'); ?> <?php echo $form->dropDownList($event, 'color', Actions::getColors()); ?> </div> <div class="cell"> <?php echo $form->label($event, 'assignedTo'); ?> <?php echo $form->dropDownList($event, 'assignedTo', $users + X2Calendar::getEditableCalendarNames(), array('id' => 'actionsAssignedToDropdown')); ?> <?php //echo $form->error($actionModel,'assignedTo'); ?> <?php /* x2temp */ echo "<br />"; if ($this instanceof Controller) { $url = $this->createUrl('groups/getGroups'); } else { $url = $this->controller->createUrl('groups/getGroups'); } echo "<label>Group?</label>"; echo CHtml::checkBox('group', '', array('id' => 'eventGroupCheckbox', 'ajax' => array('type' => 'POST', 'url' => $url, 'update' => '#actionsAssignedToDropdown', 'complete' => 'function(){ if($("#groupCheckbox").attr("checked")!="checked"){