Beispiel #1
0
echo Formatter::formatDateTime($model->dueDate);
//format date from DATETIME
if ($isEvent) {
    echo $form->label($model, 'endDate', array('class' => 'dialog-label'));
    echo Formatter::formatDateTime($model->completeDate);
    //format date from DATETIME
}
echo $form->label($model, 'allDay', array('class' => 'dialog-label'));
echo $form->checkBox($model, 'allDay', array('onChange' => 'giveSaveButtonFocus();', 'disabled' => 'disabled'));
?>
	</div>

	<div class="cell dialog-cell">
		<?php 
echo $form->label($model, 'priority', array('class' => 'dialog-label'));
$priorityArray = Actions::getPriorityLabels();
echo isset($priorityArray[$model->priority]) ? $priorityArray[$model->priority] : "";
?>
	</div>
	<div class="cell dialog-cell">
		<?php 
// assigned to calendar instead of user?
if ($model->assignedTo == null && is_numeric($model->calendarId)) {
    $model->assignedTo = $model->calendarId;
}
echo $form->label($model, 'assignedTo', array('class' => 'dialog-label'));
echo $model->renderAttribute('assignedTo');
?>
    </div>
	<div class="cell dialog-cell">
        <?php 
Beispiel #2
0
        } else {
            //format date from DATETIME
            $actionModel->completeDate = Formatter::formatDateTime($actionModel->completeDate);
        }
        echo X2Html::activeDatePicker($actionModel, 'completeDate', $form->resolveHtmlOptions($actionModel, 'completeDate', array('onClick' => "\$('#ui-datepicker-div').css('z-index', '20');")), 'datetime', array('dateFormat' => Formatter::formatDatePicker('medium'), 'timeFormat' => Formatter::formatTimePicker(), 'ampm' => Formatter::formatAMPM()));
        echo $form->error($actionModel, 'completeDate');
        echo $form->label($actionModel, 'allDay');
        echo $form->checkBox($actionModel, 'allDay');
    }
}
?>
                </div>
                <div class="cell">
                    <?php 
echo $form->label($actionModel, 'priority');
echo $form->dropDownList($actionModel, 'priority', Actions::getPriorityLabels());
if ($actionModel->type == 'event') {
    echo $form->label($actionModel, 'color');
    echo $actionModel->renderInput('color');
}
?>
                </div>
                <div class="cell">
                    <?php 
echo $form->label($actionModel, 'assignedTo');
echo $actionModel->renderInput('assignedTo', array('id' => 'actionsAssignedToDropdown'));
echo $form->error($actionModel, 'assignedTo');
?>
                </div>

                <div class="cell">
Beispiel #3
0
 /**
  * Gets possible values for a field.
  *
  * Note, this is meant to be a stripped-down imitation of what is in
  * {@link X2Model} already. I know this is code duplication, but considering 
  *
  * Note, does not yet handle multiple choice (selecting more than one).
  * 
  * @param Fields $field
  */
 public function fieldOptions(Fields $field)
 {
     switch ($field->type) {
         case 'assignment':
             return X2Model::getAssignmentOptions(true, true, false);
         case 'credentials':
             $typeArr = explode(':', $field->linkType);
             $type = $typeArr[0];
             if (count($typeAlias) > 1) {
                 $uid = Credentials::$sysUseId[$typeAlias[1]];
             } else {
                 $uid = Yii::app()->getSuId();
             }
             if (count($typeArr > 0)) {
                 $uid = $typeArr[1];
             }
             $config = Credentials::getCredentialOptions($this->staticModel, $field->fieldName, $type, $uid);
             return $config['credentials'];
         case 'dropdown':
             // Dropdown options
             $dropdown = Dropdowns::model()->findByPk($field->linkType);
             if ($dropdown instanceof Dropdowns) {
                 return json_decode($dropdown->options, 1);
             }
             break;
         case 'optionalAssignment':
             $options = X2Model::getAssignmentOptions(true, true, false);
             unset($options['Anyone']);
             $options[''] = '';
             return $options;
         case 'rating':
             return range(Fields::RATING_MIN, Fields::RATING_MAX);
         case 'varchar':
             // Special kludge for actions priority dropdown mapping
             if ($field->modelName == 'Actions' && $field->fieldName == 'priority') {
                 return Actions::getPriorityLabels();
             }
             break;
         case 'visibility':
             $permissionsBehavior = Yii::app()->params->modelPermissions;
             return $permissionsBehavior::getVisibilityOptions();
     }
     return array();
 }
Beispiel #4
0

        <?php 
echo $form->label($model, 'allDay', array('class' => 'dialog-label'));
?>
        <?php 
echo $form->checkBox($model, 'allDay', array('onChange' => 'giveSaveButtonFocus();'));
?>
    </div>

    <div class="cell dialog-cell">
        <?php 
echo $form->label($model, 'priority', array('class' => 'dialog-label'));
?>
        <?php 
echo $form->dropDownList($model, 'priority', Actions::getPriorityLabels(), array('onChange' => 'giveSaveButtonFocus();'));
?>
        <?php 
echo $form->label($model, 'color', array('class' => 'dialog-label'));
?>
        <?php 
echo $model->renderInput('color', 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;
Beispiel #5
0
    <div class="action-event-panel" class="row">
        
        <div class="cell">

            <?php 
unset($model->type);
// get the correct label
echo CHtml::activeLabel($model, 'dueDate', array('class' => 'action-due-date-label'));
echo X2Html::activeDatePicker($model, 'dueDate', array('class' => 'action-due-date', 'onClick' => "\$('#ui-datepicker-div').css('z-index', '100');", 'id' => $this->resolveId('action-form-action-due-date')), 'datetime', array('dateFormat' => Formatter::formatDatePicker('medium'), 'timeFormat' => Formatter::formatTimePicker(), 'ampm' => Formatter::formatAMPM()));
?>
        </div><!-- .cell  - the due date and reminder option-->
            
        <div class="cell">
            <?php 
echo CHtml::activeLabel($model, 'priority', array('class' => 'action-priority-label'));
echo $form->dropDownList($model, 'priority', Actions::getPriorityLabels(), array('class' => 'action-priority x2-select'));
?>
        </div><!-- .cell -->
           
        <div class="cell">
            <?php 
/* Assigned To */
?>
            <div class="cell">
                <?php 
/* Users */
echo $form->label($model, 'assignedTo', array('class' => 'action-assigned-to-label'));
echo $model->renderInput('assignedTo', array('class' => 'action-assignment-dropdown'));
?>
            </div><!-- .cell -->
            <div class="cell">