Ejemplo n.º 1
0
 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))));
 }
 public function paramRules()
 {
     $workflows = Workflow::getList(false);
     // no "none" options
     $workflowIds = array_keys($workflows);
     $stages = count($workflowIds) ? Workflow::getStagesByNumber($workflowIds[0]) : array('---');
     return array_merge(parent::paramRules(), array('title' => $this->title, 'modelClass' => 'modelClass', 'modelRequired' => 1, 'options' => array(array('name' => 'workflowId', 'label' => 'Process', 'type' => 'dropdown', 'options' => $workflows), array('name' => 'stageNumber', 'label' => 'Stage', 'type' => 'dependentDropdown', 'dependency' => 'workflowId', 'options' => $stages, 'optionsSource' => Yii::app()->createUrl('/workflow/workflow/getStageNames')))));
 }
Ejemplo n.º 3
0
 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_merge(parent::paramRules(), 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))));
 }
Ejemplo n.º 4
0
 public function paramRules()
 {
     if (Yii::app()->isInSession) {
         $credOptsDict = Credentials::getCredentialOptions(null, true);
         $credOpts = $credOptsDict['credentials'];
         $selectedOpt = $credOptsDict['selectedOption'];
         foreach ($credOpts as $key => $val) {
             if ($key == $selectedOpt) {
                 $credOpts = array($key => $val) + $credOpts;
                 // move to beginning of array
                 break;
             }
         }
     } else {
         $credOpts = array();
     }
     return array_merge(parent::paramRules(), array('title' => Yii::t('studio', $this->title), 'info' => Yii::t('studio', $this->info), 'options' => array(array('name' => 'from', 'label' => Yii::t('studio', 'Send As:'), 'type' => 'dropdown', 'options' => $credOpts))));
 }
Ejemplo n.º 5
0
 public function paramRules()
 {
     return array_merge(parent::paramRules(), array('title' => Yii::t('studio', $this->title), 'info' => Yii::t('studio', $this->info), 'modelRequired' => 1, 'options' => array()));
 }
Ejemplo n.º 6
0
 public function paramRules()
 {
     return array_merge(parent::paramRules(), array('title' => Yii::t('studio', $this->title), 'info' => Yii::t('studio', $this->info), 'modelRequired' => 'Contacts', 'options' => array(array('name' => 'listId', 'label' => Yii::t('studio', 'List'), 'type' => 'link', 'linkType' => 'X2List', 'linkSource' => Yii::app()->controller->createUrl(CActiveRecord::model('X2List')->autoCompleteSource, array('static' => 1))))));
 }
Ejemplo n.º 7
0
 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'))));
 }
Ejemplo n.º 8
0
 public function paramRules()
 {
     return array_merge(parent::paramRules(), array('title' => Yii::t('studio', $this->title), 'info' => Yii::t('studio', $this->info), 'modelRequired' => 1, 'options' => array(array('name' => 'subject', 'label' => Yii::t('actions', 'Subject'), 'optional' => 1), array('name' => 'description', 'label' => Yii::t('actions', 'Description'), 'type' => 'text'))));
 }
Ejemplo n.º 9
0
 public function paramRules()
 {
     $tagActions = array('add' => Yii::t('studio', 'Add'), 'remove' => Yii::t('studio', 'Remove'), 'clear' => Yii::t('studio', 'Clear All'));
     return array_merge(parent::paramRules(), array('title' => Yii::t('studio', $this->title), 'info' => Yii::t('studio', $this->info), 'modelRequired' => 1, 'options' => array(array('name' => 'tags', 'label' => Yii::t('studio', 'Tags'), 'type' => 'tags', 'optional' => true), array('name' => 'action', 'label' => Yii::t('studio', 'Action'), 'type' => 'dropdown', 'options' => $tagActions))));
 }
Ejemplo n.º 10
0
 public function paramRules()
 {
     return array_merge(parent::paramRules(), array('title' => $this->title, 'modelClass' => 'modelClass', 'options' => array(array('name' => 'attributes'), array('name' => 'modelClass', 'label' => Yii::t('studio', 'Record Type'), 'type' => 'dropdown', 'options' => X2Flow::getModelTypes(true)), array('name' => 'createRelationship', 'label' => Yii::t('studio', 'Create Relationship') . '<span class="x2-hint" title="' . Yii::t('app', 'Check this box if you want a new relationship to be ' . 'established between the record created by this action and the record that' . ' triggered the flow.') . '">&nbsp;[?]</span>', 'type' => 'boolean', 'defaultVal' => false))));
 }
Ejemplo n.º 11
0
 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))));
 }
Ejemplo n.º 12
0
 public function paramRules()
 {
     $httpVerbs = array('GET' => Yii::t('studio', 'GET'), 'POST' => Yii::t('studio', 'POST'), 'PUT' => Yii::t('studio', 'PUT'), 'DELETE' => Yii::t('studio', 'DELETE'));
     return array_merge(parent::paramRules(), array('title' => Yii::t('studio', $this->title), 'info' => Yii::t('studio', $this->info), 'modelClass' => 'API_params', 'options' => array(array('name' => 'url', 'label' => Yii::t('studio', 'URL')), array('name' => 'method', 'label' => Yii::t('studio', 'Method'), 'type' => 'dropdown', 'options' => $httpVerbs), array('name' => 'jsonPayload', 'label' => Yii::t('studio', 'Use JSON payload?'), 'type' => 'boolean', 'defaulVal' => 0), array('name' => 'jsonBlob', 'label' => Yii::t('studio', 'JSON'), 'type' => 'text', 'optional' => 1, 'htmlOptions' => array('style' => 'display: none;')), array('name' => 'attributes', 'optional' => 1), array('name' => 'headers', 'type' => 'attributes', 'optional' => 1))));
 }
Ejemplo n.º 13
0
 public function paramRules()
 {
     $httpVerbs = array('GET' => Yii::t('studio', 'GET'), 'POST' => Yii::t('studio', 'POST'), 'PUT' => Yii::t('studio', 'PUT'), 'DELETE' => Yii::t('studio', 'DELETE'));
     return array_merge(parent::paramRules(), array('title' => Yii::t('studio', $this->title), 'info' => Yii::t('studio', $this->info), 'modelClass' => 'API_params', 'options' => array(array('name' => 'url', 'label' => Yii::t('studio', 'URL')), array('name' => 'method', 'label' => Yii::t('studio', 'Method'), 'type' => 'dropdown', 'options' => $httpVerbs), array('name' => 'attributes', 'optional' => 1), array('name' => 'headers', 'type' => 'attributes', 'optional' => 1))));
 }
Ejemplo n.º 14
0
 public function paramRules()
 {
     $leadRoutingModes = array('' => 'Free For All', 'roundRobin' => 'Round Robin Distribution', 'roundRobin' => 'Sequential Distribution', 'singleUser' => 'Direct User Assignment');
     return array_merge(parent::paramRules(), 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)))));
 }