/** * Returns assignment selection options * @param type $anyone * @param type $showGroups * @param type $showSeparator * @return type */ public static function getAssignmentOptions($anyone = true, $showGroups = true, $showSeparator = true) { $users = User::getNames(); if ($anyone !== true) { unset($users['Anyone']); } if ($showGroups === true) { $groups = Groups::getNames(); if (count($groups) > 0) { if ($showSeparator) { $users = $users + array('' => '--------------------') + $groups; } else { $users = $users + $groups; } } } return $users; }
// $cs->registerScript(__CLASS__, $this->defaultOptions?'jQuery.{$this->mode}picker.setDefaults('.CJavaScript::encode($this->defaultOptions).');':''); // $cs->registerScript(__CLASS__.'#'.$id, $js); $fieldTypes = array(); $fieldLinkTypes = array(); $fieldOptions = array(); foreach ($itemModel->getFields() as $field) { $fieldTypes[$field->fieldName] = $field->type; if (!empty($field->linkType)) { $fieldLinkTypes[$field->fieldName] = $field->linkType; } switch ($field->type) { case 'dropdown': $fieldOptions[$field->fieldName] = Dropdowns::getItems($field->linkType); break; case 'assignment': $fieldOptions[$field->fieldName] = User::getNames() + Groups::getNames(); break; case 'link': $fieldOptions[$field->fieldName] = Yii::app()->request->scriptUrl . X2Model::model($field->linkType)->autoCompleteSource; break; } } $attributeLabels = $model->itemAttributeLabels; //hack tags in $fieldTypes['tags'] = 'tags'; $fieldOptions['tags'] = Tags::getAllTags(); $attributeLabels['tags'] = Yii::t('contacts', 'Tags'); natcasesort($attributeLabels); $comparisonList = array('=' => Yii::t('contacts', 'equals'), '>' => Yii::t('contacts', 'greater than'), '<' => Yii::t('contacts', 'less than'), '<>' => Yii::t('contacts', 'not equal to'), 'list' => Yii::t('contacts', 'in list'), 'notList' => Yii::t('contacts', 'not in list'), 'empty' => Yii::t('contacts', 'empty'), 'notEmpty' => Yii::t('contacts', 'not empty'), 'contains' => Yii::t('contacts', 'contains'), 'noContains' => Yii::t('contacts', 'does not contain')); $criteriaAttr = array(); foreach ($criteriaModels as $criterion) {
</label> <?php echo $form->dropDownList($admin, 'srrId', User::getUserIds()); ?> </div> <div id="group-list" style="<?php echo !empty($admin->serviceDistribution) && $admin->serviceDistribution == "singleGroup" ? "" : "display:none;"; ?> "> <label><?php echo Yii::t('admin', 'Selected Group'); ?> </label> <?php echo $form->dropDownList($admin, 'sgrrId', Groups::getNames()); ?> </div> <?php echo $form->labelEx($admin, 'serviceOnlineOnly'); echo $form->dropDownList($admin, 'serviceOnlineOnly', array('0' => Yii::t('app', 'No'), '1' => Yii::t('app', 'Yes'))); ?> <?php echo CHtml::submitButton(Yii::t('app', 'Save'), array('class' => 'x2-button')) . "\n"; $this->endWidget(); ?> </div> <div class="form"> <b><?php
public function actionGetGroups() { $checked = false; if (isset($_POST['checked'])) { // coming from a group checkbox? $checked = json_decode($_POST['checked']); } elseif (isset($_POST['group'])) { $checked = true; } $id = null; if (isset($_POST['field'])) { $id = $_POST['field']; } $options = array(); if ($checked) { // group checkbox checked, return list of groups echo CHtml::listOptions($id, Groups::getNames(), $options); } else { // group checkbox unchecked, return list of user names $users = User::getNames(); if (!in_array($id, array_keys($users))) { $id = Yii::app()->user->getName(); } echo CHtml::listOptions($id, $users, $options); } }
?> <a onclick="x2.forms.submitForm('chart');" href="#" class="x2-button"><span><?php echo Yii::t('app', 'Go'); ?> </span></a> </div> </div> </div> <div class="x2-chart-container-controls"> <div class="x2-chart-control"> <div class="row"> <?php echo $form->label($model, 'assignedTo', array('label' => Yii::t('charts', 'Select deals assigned to') . ' ')); ?> <?php echo $form->dropDownList($model, 'assignedTo', array_merge(array('0' => 'All'), Groups::getNames(), User::getNames())); ?> <a onclick="x2.forms.submitForm('chart');" href="#" class="x2-button"><span><?php echo Yii::t('app', 'Go'); ?> </span></a> </div> </div> </div> <p class="x2-chart-separator"/> <div class="x2-chart-container-center-large"> <?php $this->widget('X2BubbleChart', array('model' => $sqlView, 'options' => array('other-threshold' => 2, 'statistic' => 'none', 'orderby' => 'dealValue asc', 'slice' => array('part' => $slice), 'x-axis' => array('column' => "round((closeDate-unix_timestamp())/(24*3600))"), 'y-axis' => array('column' => 'round(dealValue)'), 'r-axis' => array('column' => 'confidence', 'label' => "concat('\$',format(dealValue,2))")), 'filters' => $filters, 'chartOptions' => array('title' => Yii::t('charts', 'Deals'), 'axes' => array('yaxis' => array('label' => Yii::t('charts', 'Value'), 'tickOptions' => array('formatString' => '$%d')), 'xaxis' => array('label' => Yii::t('charts', 'Days To Close')))))); ?> </div> <p class="x2-chart-separator"/>