当前位置: 首页>>代码示例>>PHP>>正文


PHP X2Model::getAssignmentOptions方法代码示例

本文整理汇总了PHP中X2Model::getAssignmentOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP X2Model::getAssignmentOptions方法的具体用法?PHP X2Model::getAssignmentOptions怎么用?PHP X2Model::getAssignmentOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在X2Model的用法示例。


在下文中一共展示了X2Model::getAssignmentOptions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: paramRules

 public function paramRules()
 {
     $notifTypes = array('auto' => 'Auto', 'custom' => 'Custom');
     $assignmentOptions = array('{assignedTo}' => '{' . Yii::t('studio', 'Owner of Record') . '}', '{user.username}' => '{' . Yii::t('studio', 'Current User') . '}') + X2Model::getAssignmentOptions(false, false);
     // '{assignedTo}', no groups, no 'anyone'
     return array_merge(parent::paramRules(), array('title' => Yii::t('studio', $this->title), 'options' => array(array('name' => 'user', 'label' => Yii::t('studio', 'User'), 'type' => 'assignment', 'options' => $assignmentOptions), array('name' => 'text', 'label' => Yii::t('studio', 'Message'), 'optional' => 1))));
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:7,代码来源:X2FlowCreateNotif.php

示例2: paramRules

 public function paramRules()
 {
     $visOptions = array(1 => Yii::t('actions', 'Public'), 0 => Yii::t('actions', 'Private'));
     $priorityOptions = array('1' => Yii::t('actions', 'Low'), '2' => Yii::t('actions', 'Medium'), '3' => Yii::t('actions', 'High'));
     // $assignmentOptions = array('{assignedTo}'=>'{'.Yii::t('studio','Owner of Record').'}') + X2Model::getAssignmentOptions(false,true);	// '{assignedTo}', groups, no 'anyone'
     $assignmentOptions = array('{assignedTo}' => '{' . Yii::t('studio', 'Owner of Record') . '}') + X2Model::getAssignmentOptions(false, true);
     // '{assignedTo}', groups, no 'anyone'
     return array('title' => Yii::t('studio', $this->title), 'options' => array(array('name' => 'dueDate', 'label' => Yii::t('actions', 'Due Date'), 'type' => 'dateTime', 'optional' => 1), array('name' => 'subject', 'label' => Yii::t('actions', 'Subject'), 'optional' => 1), array('name' => 'description', 'label' => Yii::t('actions', 'Description'), 'type' => 'text'), array('name' => 'assignedTo', 'label' => Yii::t('actions', 'Assigned To'), 'type' => 'dropdown', 'options' => $assignmentOptions), array('name' => 'priority', 'label' => Yii::t('actions', 'Priority'), 'type' => 'dropdown', 'options' => $priorityOptions), array('name' => 'visibility', 'label' => Yii::t('actions', 'Visibility'), 'type' => 'dropdown', 'options' => $visOptions)));
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:9,代码来源:X2FlowCreateAction.php

示例3: actionGetRole

 /**
  * Echo out a series of inputs for a role editor page.
  *
  * This method is called via AJAX from the "Edit Role" portion of the "Manage Roles"
  * page.  Upon selection of a role in the dropdown on that page, this method
  * finds all relevant information about the role and echoes it back as a form
  * to allow for editing of the role.
  */
 public function actionGetRole()
 {
     $output = "";
     $roleInput = FilterUtil::filterArrayInput($_POST, 'Roles');
     if (!empty($roleInput)) {
         $roleName = isset($roleInput['name']) ? filter_var($roleInput['name'], FILTER_SANITIZE_STRING) : '';
         $role = Roles::model()->findByAttributes(array('name' => $roleName));
         if (isset($role)) {
             $usernames = Yii::app()->db->createCommand()->select('a.username')->from('x2_users a')->join('x2_role_to_user b', 'a.id=b.userId')->where('b.roleId=:roleId AND b.type="user"', array(':roleId' => $role->id))->queryColumn();
             $groupIds = Yii::app()->db->createCommand()->select('a.id')->from('x2_groups a')->join('x2_role_to_user b', 'a.id=b.userId')->where('b.roleId=:roleId AND b.type="group"', array(':roleId' => $role->id))->queryColumn();
             $selected = array_merge($usernames, $groupIds);
             $allUsers = X2Model::getAssignmentOptions(false, true, false);
             unset($allUsers['admin']);
             $sliderId = 'editTimeoutSlider';
             $textfieldId = 'editTimeout';
             if (isset($_GET['mode']) && in_array($_GET['mode'], array('edit', 'exception'))) {
                 // Handle whether this was called from editRole or roleException, they
                 // need different IDs to work on the same page.
                 $sliderId .= "-" . $_GET['mode'];
                 $textfieldId .= "-" . $_GET['mode'];
             }
             $timeoutSet = $role->timeout !== null;
             $output .= "\n                    <div class='row' id='set-session-timeout-row'>\n                    <input id='set-session-timeout' type='checkbox' class='left' " . ($timeoutSet ? 'checked="checked"' : '') . ">\n                    <label>" . Yii::t('admin', 'Enable Session Timeout') . "</label>\n                    </div>\n                ";
             $output .= "<div id='timeout-row' class='row' " . ($timeoutSet ? '' : "style='display: none;'") . ">";
             $output .= Yii::t('admin', 'Set role session expiration time (in minutes).');
             $output .= "<br />";
             $output .= $this->widget('zii.widgets.jui.CJuiSlider', array('value' => $role->timeout / 60, 'options' => array('min' => 5, 'max' => 1440, 'step' => 5, 'change' => "js:function(event,ui) {\n                                        \$('#" . $textfieldId . "').val(ui.value);\n                                        \$('#save-button').addClass('highlight');\n                                    }", 'slide' => "js:function(event,ui) {\n                                        \$('#" . $textfieldId . "').val(ui.value);\n                                    }"), 'htmlOptions' => array('style' => 'width:340px;margin:10px 9px;', 'id' => $sliderId)), true);
             $output .= CHtml::activeTextField($role, 'timeout', array('id' => $textfieldId, 'disabled' => $role->timeout !== null ? '' : 'disabled'));
             $output .= "</div>";
             Yii::app()->clientScript->registerScript('timeoutScript', "\n                    \$('#set-session-timeout').change (function () {\n                        if (\$(this).is (':checked')) {\n                            \$('#timeout-row').slideDown ();\n                            \$('#" . $textfieldId . "').removeAttr ('disabled');\n                        } else {\n                            \$('#timeout-row').slideUp ();\n                            \$('#" . $textfieldId . "').attr ('disabled', 'disabled');\n                        }\n                    });\n                    \$('#" . $textfieldId . "').val( \$('#" . $sliderId . "').slider('value') );\n                ", CClientScript::POS_READY);
             $output .= "<script>";
             $output .= Yii::app()->clientScript->echoScripts(true);
             $output .= "</script>";
             $output .= "<div id='users'><label>Users</label>";
             $output .= CHtml::dropDownList('users[]', $selected, $allUsers, array('class' => 'multiselect', 'multiple' => 'multiple', 'size' => 8));
             $output .= "</div>";
             $fields = Fields::getFieldsOfModelsWithFieldLevelPermissions();
             $fieldIds = array_flip(array_map(function ($field) {
                 return $field->id;
             }, $fields));
             $viewSelected = array();
             $editSelected = array();
             $fieldUnselected = array();
             $fieldPerms = RoleToPermission::model()->findAllByAttributes(array('roleId' => $role->id));
             foreach ($fieldPerms as $perm) {
                 if (!isset($fieldIds[$perm->fieldId])) {
                     continue;
                 }
                 if ($perm->permission == 2) {
                     $viewSelected[] = $perm->fieldId;
                     $editSelected[] = $perm->fieldId;
                 } else {
                     if ($perm->permission == 1) {
                         $viewSelected[] = $perm->fieldId;
                     }
                 }
             }
             foreach ($fields as $field) {
                 $fieldUnselected[$field->id] = X2Model::getModelTitle($field->modelName) . " - " . $field->attributeLabel;
             }
             assert(count($fieldUnselected) === count(array_unique(array_keys($fieldUnselected))));
             $output .= "<br /><label>View Permissions</label>";
             $output .= CHtml::dropDownList('viewPermissions[]', $viewSelected, $fieldUnselected, array('class' => 'multiselect', 'multiple' => 'multiple', 'size' => 8, 'id' => 'edit-role-field-view-permissions'));
             $output .= "<br /><label>Edit Permissions</label>";
             $output .= CHtml::dropDownList('editPermissions[]', $editSelected, $fieldUnselected, array('class' => 'multiselect', 'multiple' => 'multiple', 'size' => 8, 'id' => 'edit-role-field-edit-permissions'));
         }
     }
     echo $output;
 }
开发者ID:xl602,项目名称:X2CRM,代码行数:77,代码来源:AdminController.php

示例4: renderModelInput


//.........这里部分代码省略.........
                                    label += "<span style=\\"font-size: 0.6em;\\">";

                                    // add email if defined
                                    if(item.subject) {
                                        label += "<br>";
                                        label += item.subject;
                                    }

                                    label += "</span>";
                                    label += "</a>";

                                    return $( "<li>" )
                                        .data( "item.autocomplete", item )
                                        .append( label )
                                        .appendTo( ul );
                                };
                            }' : '')), 'htmlOptions' => array_merge(array('title' => $field->attributeLabel), $htmlOptions)), true);
                if (isset($oldLinkFieldVal)) {
                    $model->{$fieldName} = $oldLinkFieldVal;
                }
                return $input;
            case 'rating':
                return Yii::app()->controller->widget('X2StarRating', array('model' => $model, 'attribute' => $field->fieldName, 'readOnly' => isset($htmlOptions['disabled']) && $htmlOptions['disabled'], 'minRating' => Fields::RATING_MIN, 'maxRating' => Fields::RATING_MAX, 'starCount' => Fields::RATING_MAX - Fields::RATING_MIN + 1, 'cssFile' => Yii::app()->theme->getBaseUrl() . '/css/rating/jquery.rating.css', 'htmlOptions' => $htmlOptions, 'callback' => 'function(value, link){
                        if (typeof x2 !== "undefined" &&
                            typeof x2.InlineEditor !== "undefined" &&
                            typeof x2.InlineEditor.ratingFields !== "undefined") {

                            x2.InlineEditor.ratingFields["' . $field->modelName . '[' . $field->fieldName . ']"] = value;
                        }
                    }'), true);
            case 'boolean':
                $checkbox = CHtml::openTag('div', X2Html::mergeHtmlOptions($htmlOptions, array('class' => 'checkboxWrapper')));
                $checkbox .= CHtml::activeCheckBox($model, $field->fieldName, array_merge(array('unchecked' => 0, 'title' => $field->attributeLabel), $htmlOptions));
                $checkbox .= CHtml::closeTag('div');
                return $checkbox;
            case 'assignment':
                $oldAssignmentVal = $model->{$fieldName};
                $model->{$fieldName} = !empty($model->{$fieldName}) ? $field->linkType == 'multiple' && !is_array($model->{$fieldName}) ? explode(', ', $model->{$fieldName}) : $model->{$fieldName} : X2Model::getDefaultAssignment();
                $dropdownList = CHtml::activeDropDownList($model, $fieldName, X2Model::getAssignmentOptions(true, true), array_merge(array('title' => $field->attributeLabel, 'id' => $field->modelName . '_' . $fieldName . '_assignedToDropdown', 'multiple' => $field->linkType == 'multiple' ? 'multiple' : null), $htmlOptions));
                $model->{$fieldName} = $oldAssignmentVal;
                return $dropdownList;
            case 'optionalAssignment':
                // optional assignment for users (can be left blank)
                $users = User::getNames();
                unset($users['Anyone']);
                return CHtml::activeDropDownList($model, $fieldName, $users, array_merge(array('title' => $field->attributeLabel, 'empty' => ''), $htmlOptions));
            case 'visibility':
                $permissionsBehavior = Yii::app()->params->modelPermissions;
                return CHtml::activeDropDownList($model, $field->fieldName, $permissionsBehavior::getVisibilityOptions(), array_merge(array('title' => $field->attributeLabel, 'id' => $field->modelName . "_visibility"), $htmlOptions));
                // 'varchar', 'email', 'url', 'int', 'float', 'currency', 'phone'
                // case 'int':
                // return CHtml::activeNumberField($model, $field->fieldNamearray_merge(array(
                // 'title' => $field->attributeLabel,
                // ), $htmlOptions));
            // 'varchar', 'email', 'url', 'int', 'float', 'currency', 'phone'
            // case 'int':
            // return CHtml::activeNumberField($model, $field->fieldNamearray_merge(array(
            // 'title' => $field->attributeLabel,
            // ), $htmlOptions));
            case 'percentage':
                $htmlOptions['class'] = empty($htmlOptions['class']) ? 'input-percentage' : $htmlOptions['class'] . ' input-percentage';
                return CHtml::activeTextField($model, $field->fieldName, array_merge(array('title' => $field->attributeLabel), $htmlOptions));
            case 'currency':
                $fieldName = $field->fieldName;
                $elementId = isset($htmlOptions['id']) ? '#' . $htmlOptions['id'] : '#' . $field->modelName . '_' . $field->fieldName;
                Yii::app()->controller->widget('application.extensions.moneymask.MMask', array('element' => $elementId, 'currency' => Yii::app()->params['currency'], 'config' => array('affixStay' => true, 'decimal' => Yii::app()->locale->getNumberSymbol('decimal'), 'thousands' => Yii::app()->locale->getNumberSymbol('group'))));
                return CHtml::activeTextField($model, $field->fieldName, array_merge(array('title' => $field->attributeLabel, 'class' => 'currency-field'), $htmlOptions));
            case 'credentials':
                $typeAlias = explode(':', $field->linkType);
                $type = $typeAlias[0];
                if (count($typeAlias) > 1) {
                    $uid = Credentials::$sysUseId[$typeAlias[1]];
                } else {
                    $uid = Yii::app()->user->id;
                }
                return Credentials::selectorField($model, $field->fieldName, $type, $uid);
            case 'timerSum':
                // Sorry, no-can-do. This is field derives its value from a sum over timer records.
                return $model->renderAttribute($field->fieldName);
            case 'float':
            case 'int':
                if (isset($model->{$fieldName})) {
                    $oldNumVal = $model->{$fieldName};
                    $model->{$fieldName} = Yii::app()->locale->numberFormatter->formatDecimal($model->{$fieldName});
                }
                $input = CHtml::activeTextField($model, $field->fieldName, array_merge(array('title' => $field->attributeLabel), $htmlOptions));
                if (isset($oldNumVal)) {
                    $model->{$fieldName} = $oldNumVal;
                }
                return $input;
            default:
                return CHtml::activeTextField($model, $field->fieldName, array_merge(array('title' => $field->attributeLabel), $htmlOptions));
                // array(
                // 'tabindex'=>isset($item['tabindex'])? $item['tabindex'] : null,
                // 'disabled'=>$item['readOnly']? 'disabled' : null,
                // 'title'=>$field->attributeLabel,
                // 'style'=>$default?'color:#aaa;':null,
                // ));
        }
    }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:101,代码来源:X2Model.php

示例5: listOption

 public static function listOption($attributes, $name)
 {
     if ($attributes instanceof Fields) {
         $attributes = $attributes->getAttributes();
     }
     $data = array('name' => $name, 'label' => $attributes['attributeLabel']);
     if (isset($attributes['type']) && $attributes['type']) {
         $data['type'] = $attributes['type'];
     }
     if (isset($attributes['required']) && $attributes['required']) {
         $data['required'] = 1;
     }
     if (isset($attributes['readOnly']) && $attributes['readOnly']) {
         $data['readOnly'] = 1;
     }
     if (isset($attributes['type'])) {
         if ($attributes['type'] === 'assignment' || $attributes['type'] === 'optionalAssignment') {
             $data['options'] = AuxLib::dropdownForJson(X2Model::getAssignmentOptions(true, true));
         } elseif ($attributes['type'] === 'dropdown' && isset($attributes['linkType'])) {
             $data['linkType'] = $attributes['linkType'];
             $data['options'] = AuxLib::dropdownForJson(Dropdowns::getItems($attributes['linkType']));
         } elseif ($attributes['type'] === 'link' && isset($attributes['linkType'])) {
             $staticLinkModel = X2Model::model($attributes['linkType']);
             if (array_key_exists('X2LinkableBehavior', $staticLinkModel->behaviors())) {
                 $data['linkType'] = $attributes['linkType'];
                 $data['linkSource'] = Yii::app()->controller->createUrl($staticLinkModel->autoCompleteSource);
             }
         }
     }
     return $data;
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:31,代码来源:X2ConditionList.php

示例6: getGenericCondition

 public static function getGenericCondition($type)
 {
     switch ($type) {
         case 'current_user':
             return array('name' => 'user', 'label' => Yii::t('studio', 'Current User'), 'type' => 'dropdown', 'multiple' => 1, 'options' => X2Model::getAssignmentOptions(false, false), 'operators' => array('=', '<>', 'list', 'notList'));
         case 'month':
             return array('label' => Yii::t('studio', 'Current Month'), 'type' => 'dropdown', 'multiple' => 1, 'options' => Yii::app()->locale->monthNames, 'operators' => array('=', '<>', 'list', 'notList'));
         case 'day_of_week':
             return array('label' => Yii::t('studio', 'Day of Week'), 'type' => 'dropdown', 'multiple' => 1, 'options' => Yii::app()->locale->weekDayNames, 'operators' => array('=', '<>', 'list', 'notList'));
         case 'day_of_month':
             $days = array_keys(array_fill(1, 31, 1));
             return array('label' => Yii::t('studio', 'Day of Month'), 'type' => 'dropdown', 'multiple' => 1, 'options' => array_combine($days, $days), 'operators' => array('=', '<>', 'list', 'notList'));
         case 'time_of_day':
             return array('label' => Yii::t('studio', 'Time of Day'), 'type' => 'time', 'operators' => array('before', 'after'));
             // case 'current_local_time':
         // case 'current_local_time':
         case 'current_time':
             return array('label' => Yii::t('studio', 'Current Time'), 'type' => 'dateTime', 'operators' => array('before', 'after'));
         case 'user_active':
             return array('label' => Yii::t('studio', 'User Logged In'), 'type' => 'dropdown', 'options' => X2Model::getAssignmentOptions(false, false));
         case 'on_list':
             return array('label' => Yii::t('studio', 'On List'), 'type' => 'link', 'linkType' => 'X2List', 'linkSource' => Yii::app()->controller->createUrl(CActiveRecord::model('X2List')->autoCompleteSource));
         case 'has_tags':
             return array('label' => Yii::t('studio', 'Has Tags'), 'type' => 'tags');
         case 'email_open':
             return array('label' => Yii::t('studio', 'Email Opened'), 'type' => 'dropdown', 'options' => array());
         default:
             return false;
             // case 'workflow_status':
             // return array(
             // 'label'=>Yii::t('studio','Workflow Status'),
             // 'workflowId',
             // 'stageNumber',
             // 'started_workflow',
             // 'started_stage',
             // 'completed_stage',
             // 'completed_workflow', */
     }
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:39,代码来源:X2FlowTrigger.php

示例7: paramRules

 public function paramRules()
 {
     $assignmentOptions = array('{assignedTo}' => '{' . Yii::t('studio', 'Owner of Record') . '}') + X2Model::getAssignmentOptions(false, false);
     // '{assignedTo}', no groups, no 'anyone'
     return array('title' => $this->title, 'info' => $this->info, 'options' => array(array('name' => 'user', 'label' => 'User', 'type' => 'dropdown', 'options' => $assignmentOptions), array('name' => 'text', 'label' => 'Message', 'type' => 'text'), array('name' => 'timestamp', 'label' => 'Time', 'type' => 'dateTime')));
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:6,代码来源:X2FlowCreateReminder.php

示例8: array

echo $form->errorSummary($model);
?>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'name');
echo $form->textField($model, 'name', array('maxlength' => 259, 'class' => 'x2-wide-input'));
echo $form->error($model, 'name');
?>
	</div>
        <label><?php 
echo Yii::t('groups', '{users}', array('{users}' => Modules::displayName(true, "Users")));
?>
</label>
        <?php 
$assignmentOptions = array_map(array('CHtml', 'encode'), X2Model::getAssignmentOptions(false, false));
echo CHtml::dropDownList('users[]', isset($selected) ? $selected : "", $assignmentOptions, array('class' => 'multiselect', 'multiple' => 'multiple'));
?>
        <br />

	<div class="row buttons">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Save'), array('class' => 'x2-button'));
?>
	</div>

<?php 
$this->endWidget();
?>

</div><!-- form -->
开发者ID:dsyman2,项目名称:X2CRM,代码行数:31,代码来源:_form.php

示例9: paramRules

 public function paramRules()
 {
     $assignmentOptions = array('{assignedTo}' => '{' . Yii::t('studio', 'Owner of Record') . '}') + X2Model::getAssignmentOptions(false, true);
     return array_merge(parent::paramRules(), array('title' => Yii::t('studio', $this->title), 'modelRequired' => 1, 'options' => array(array('name' => 'assignedTo', 'label' => Yii::t('actions', 'Assigned To'), 'type' => 'dropdown', 'options' => $assignmentOptions), array('name' => 'comment', 'label' => Yii::t('studio', 'Comment'), 'type' => 'text'))));
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:5,代码来源:X2FlowRecordComment.php

示例10: paramRules

 public function paramRules()
 {
     return array('title' => Yii::t('studio', $this->title), 'info' => Yii::t('studio', $this->info), 'options' => array(array('name' => 'user', 'label' => Yii::t('studio', 'User'), 'type' => 'dropdown', 'options' => array('Anyone' => Yii::t('x2flow', 'Anyone')) + X2Model::getAssignmentOptions(false, false), 'operators' => array('=', '<>', 'list', 'notList'), 'optional' => true)));
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:4,代码来源:BaseUserTrigger.php

示例11: actionGetFields

 public function actionGetFields($model)
 {
     if (!class_exists($model)) {
         echo 'false';
         return;
     }
     $fieldModels = X2Model::model($model)->getFields();
     $fields = array();
     foreach ($fieldModels as &$field) {
         if ($field->isVirtual) {
             continue;
         }
         $data = array('name' => $field->fieldName, 'label' => $field->attributeLabel, 'type' => $field->type);
         if ($field->required) {
             $data['required'] = 1;
         }
         if ($field->readOnly) {
             $data['readOnly'] = 1;
         }
         if ($field->type === 'assignment' || $field->type === 'optionalAssignment') {
             $data['options'] = AuxLib::dropdownForJson(X2Model::getAssignmentOptions(true, true));
         } elseif ($field->type === 'dropdown') {
             $data['linkType'] = $field->linkType;
             $data['options'] = AuxLib::dropdownForJson(Dropdowns::getItems($field->linkType));
         }
         if ($field->type === 'link') {
             $staticLinkModel = X2Model::model($field->linkType);
             if (array_key_exists('X2LinkableBehavior', $staticLinkModel->behaviors())) {
                 $data['linkType'] = $field->linkType;
                 $data['linkSource'] = Yii::app()->controller->createUrl($staticLinkModel->autoCompleteSource);
             }
         }
         $fields[] = $data;
     }
     echo CJSON::encode($fields);
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:36,代码来源:StudioController.php

示例12: paramRules

 public function paramRules()
 {
     // $eventTypes = array('auto'=>Yii::t('app','Auto')) + Dropdowns::getItems(113,'app');
     $eventTypes = Dropdowns::getItems(113, 'studio');
     return array('title' => Yii::t('studio', $this->title), 'info' => Yii::t('studio', $this->info), 'options' => array(array('name' => 'type', 'label' => Yii::t('studio', 'Post Type'), 'type' => 'dropdown', 'options' => $eventTypes), array('name' => 'text', 'label' => Yii::t('studio', 'Text'), 'type' => 'text'), array('name' => 'user', 'optional' => 1, 'label' => 'User (optional)', 'type' => 'dropdown', 'options' => array('' => '----------', 'auto' => 'Auto') + X2Model::getAssignmentOptions(false, false)), array('name' => 'createNotif', 'label' => Yii::t('studio', 'Create Notification?'), 'type' => 'boolean', 'defaultVal' => true)));
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:6,代码来源:X2FlowCreateEvent.php

示例13: fieldOptions

 /**
  * 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();
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:54,代码来源:Api2Controller.php

示例14: paramRules

 public function paramRules()
 {
     // $eventTypes = array('auto'=>Yii::t('app','Auto')) + Dropdowns::getItems(113,'app');
     $eventTypes = Dropdowns::getItems(113, 'studio');
     return array_merge(parent::paramRules(), array('title' => Yii::t('studio', $this->title), 'info' => Yii::t('studio', $this->info), 'options' => array(array('name' => 'type', 'label' => Yii::t('studio', 'Post Type'), 'type' => 'dropdown', 'options' => $eventTypes), array('name' => 'text', 'label' => Yii::t('studio', 'Text'), 'type' => 'text'), array('name' => 'visibility', 'label' => Yii::t('studio', 'Visibility'), 'type' => 'dropdown', 'options' => array(1 => Yii::t('admin', 'Public'), 0 => Yii::t('admin', 'Private')), 'defaultVal' => 1), array('name' => 'feed', 'optional' => 1, 'label' => 'User (optional)', 'type' => 'dropdown', 'options' => array('' => '----------', 'auto' => 'Auto') + X2Model::getAssignmentOptions(false, false)), array('name' => 'user', 'optional' => 1, 'label' => 'Author', 'type' => 'dropdown', 'options' => array('admin' => 'admin', 'auto' => Yii::t('studio', 'Auto')) + array_diff_key(X2Model::getAssignmentOptions(false, false), array('admin' => '')), 'defaultVal' => 'admin'), array('name' => 'createNotif', 'label' => Yii::t('studio', 'Create Notification?'), 'type' => 'boolean', 'defaultVal' => true))));
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:6,代码来源:X2FlowCreateEvent.php

示例15: paramRules

 public function paramRules()
 {
     $leadRoutingModes = array('' => 'Free For All', 'roundRobin' => 'Round Robin Distribution', 'roundRobin' => 'Sequential Distribution', 'singleUser' => 'Direct User Assignment');
     return array('title' => Yii::t('studio', $this->title), 'info' => Yii::t('studio', $this->info), 'modelRequired' => 1, 'options' => array(array('name' => 'user', 'label' => 'User', 'type' => 'dropdown', 'options' => array('auto' => Yii::t('studio', 'Use Lead Routing')) + X2Model::getAssignmentOptions(true, true))));
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:5,代码来源:X2FlowRecordReassign.php


注:本文中的X2Model::getAssignmentOptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。