/**
  * Все роли пользователей
  */
 public function actionGetStaffRoles()
 {
     $res = array();
     foreach (CTaxonomyManager::getCacheTypes()->getItems() as $role) {
         $res[$role->getId()] = $role->getValue();
     }
     echo json_encode($res);
 }
Пример #2
0
 /**
  * Обработчик фильтра сотрудников по типу
  *
  * @static
  * @param $fieldId
  */
 public static function personTypeFilter($field, CModel $model)
 {
     $fieldId = $model::getClassName() . "[" . $field . "]";
     echo '<span id="person_type_selector_button" style="cursor: pointer; " onclick="showPersonTypeSelector(); return false;"><img src="' . WEB_ROOT . 'images/filter.gif">';
     echo '</span>';
     echo '<div id="person_type_selector" style="position: absolute; display: none; border: 1px solid #c0c0c0; background: #ffffff; padding: 5px; z-index: 100; margin-left: 300px; margin-top: -5px; ">';
     foreach (CTaxonomyManager::getCacheTypes()->getItems() as $type) {
         echo '<span><input type="checkbox" onclick="updatePersonListField(\'' . $fieldId . '\'); return true; " value="' . $type->getId() . '" checked>' . $type->getValue() . '</span><br>';
     }
     echo '</div>';
 }