本文整理汇总了PHP中CRequest::getGlobalRequestVariables方法的典型用法代码示例。如果您正苦于以下问题:PHP CRequest::getGlobalRequestVariables方法的具体用法?PHP CRequest::getGlobalRequestVariables怎么用?PHP CRequest::getGlobalRequestVariables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRequest
的用法示例。
在下文中一共展示了CRequest::getGlobalRequestVariables方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processFormSubmit
/**
* Обработка события сабмита формы
*/
private function processFormSubmit()
{
/**
* При сабмите приходят данные со всех форм, но сабмитится
* за один раз только одна. В связи с этим, сохраняем
* данные из всех форм в бин
*/
foreach (CRequest::getGlobalRequestVariables() as $key => $value) {
if (is_array($value)) {
self::getStatefullFormBean()->getElement($key)->setFormElementValues($value);
}
}
/**
* Обработаем форму, над которой выполняется действие
*/
$element = CRequest::getString("element");
$formData = CRequest::getArray($element);
/**
* В элементе формы могут быть старые ошибки валидации. Почистим их
*/
self::getStatefullFormBean()->getElement($element)->setValidationErrors(array());
/**
* Теперь вызываем их по очереди
*/
foreach ($this->getHandlerNames('submitForm', $element) as $handler) {
if (method_exists($this, $handler)) {
$this->{$handler}($formData, $element);
}
}
}
示例2: actionRemoveGroup
public function actionRemoveGroup()
{
foreach (CRequest::getGlobalRequestVariables()->getItem("selectedInView") as $value) {
$record = CStaffManager::getStudentActivity($value);
if (!is_null($record)) {
$record->remove();
}
}
$this->redirect("?action=index");
}
示例3: actionStatistic
public function actionStatistic()
{
$set = new CRecordSet();
$query = new CQuery();
$query->select("preview.*")->from(TABLE_DIPLOM_PREVIEWS . " as preview")->order("preview.date_preview desc");
$set->setQuery($query);
$isArchive = CRequest::getString("isArchive") == "1";
if (!$isArchive) {
$query->condition('preview.date_preview between "' . date("Y-m-d", strtotime(CUtils::getCurrentYear()->date_start)) . '" and "' . date("Y-m-d", strtotime(CUtils::getCurrentYear()->date_end)) . '"');
}
$this->addActionsMenuItem(array("title" => "Назад", "link" => "?action=index", "icon" => "actions/edit-undo.png"));
if ($isArchive) {
$requestParams = array();
foreach (CRequest::getGlobalRequestVariables()->getItems() as $key => $value) {
if ($key != "isArchive") {
$requestParams[] = $key . "=" . $value;
}
}
$this->addActionsMenuItem(array(array("title" => "Текущий год", "link" => "?" . implode("&", $requestParams), "icon" => "mimetypes/x-office-calendar.png")));
} else {
$requestParams = array();
foreach (CRequest::getGlobalRequestVariables()->getItems() as $key => $value) {
$requestParams[] = $key . "=" . $value;
}
$requestParams[] = "isArchive=1";
$this->addActionsMenuItem(array(array("title" => "Архив", "link" => "?" . implode("&", $requestParams), "icon" => "devices/media-floppy.png")));
}
$prevs = array();
foreach ($query->execute()->getItems() as $ar) {
$prev = new CDiplomPreview(new CActiveRecord($ar));
$prevs[$prev->getId()] = $prev->date_preview;
}
$date_previews = array();
$date_previews = array_count_values($prevs);
//Общее количество предзащит
$count_previews = count($prevs);
//Общее количество защит
$queryAll = new CQuery();
$queryAll->select("diplom.*")->from(TABLE_DIPLOMS . " as diplom");
if (!$isArchive) {
$queryAll->condition('diplom.date_act between "' . date("Y-m-d", strtotime(CUtils::getCurrentYear()->date_start)) . '" and "' . date("Y-m-d", strtotime(CUtils::getCurrentYear()->date_end)) . '"');
}
$count_all = $queryAll->execute()->getCount();
//Всего защит зимой
$queryWinterAll = new CQuery();
$queryWinterAll->select("diplom.*")->from(TABLE_DIPLOMS . " as diplom")->condition('diplom.date_act between "' . (date("Y") - 1) . "-12-01" . '" and "' . date("Y") . "-02-28" . '"');
$count_winter_all = $queryWinterAll->execute()->getCount();
//Всего защит летом
$querySummerAll = new CQuery();
$querySummerAll->select("diplom.*")->from(TABLE_DIPLOMS . " as diplom")->condition('diplom.date_act between "' . date("Y") . "-05-01" . '" and "' . date("Y") . "-06-30" . '"');
$count_summer_all = $querySummerAll->execute()->getCount();
//Из них не имеющие предзащиты зимой
$queryNotPreviewsWinter = new CQuery();
$queryNotPreviewsWinter->select("diplom.*")->from(TABLE_DIPLOMS . " as diplom")->leftJoin(TABLE_DIPLOM_PREVIEWS . " as preview", "diplom.student_id = preview.student_id")->condition('preview.student_id is null and diplom.date_act between "' . (date("Y") - 1) . "-12-01" . '" and "' . date("Y") . "-02-28" . '"');
$count_not_previews_winter = $queryNotPreviewsWinter->execute()->getCount();
//Из них не имеющие предзащиты летом
$queryNotPreviewsSummer = new CQuery();
$queryNotPreviewsSummer->select("diplom.*")->from(TABLE_DIPLOMS . " as diplom")->leftJoin(TABLE_DIPLOM_PREVIEWS . " as preview", "diplom.student_id = preview.student_id")->condition('preview.student_id is null and diplom.date_act between "' . date("Y") . "-05-01" . '" and "' . date("Y") . "-06-30" . '"');
$count_not_previews_summer = $queryNotPreviewsSummer->execute()->getCount();
//Количество предзащит зимой
$queryWinter = new CQuery();
$queryWinter->select("preview.*")->from(TABLE_DIPLOM_PREVIEWS . " as preview")->condition('preview.date_preview between "' . (date("Y") - 1) . "-12-01" . '" and "' . date("Y") . "-02-28" . '"');
$count_previews_winter = $queryWinter->execute()->getCount();
//Количество предзащит летом
$querySummer = new CQuery();
$querySummer->select("preview.*")->from(TABLE_DIPLOM_PREVIEWS . " as preview")->condition('preview.date_preview between "' . date("Y") . "-05-01" . '" and "' . date("Y") . "-06-30" . '"');
$count_previews_summer = $querySummer->execute()->getCount();
//Прошедшие предзащиту зимой
$queryWinterComplete = new CQuery();
$queryWinterComplete->select("preview.*")->from(TABLE_DIPLOM_PREVIEWS . " as preview")->condition('preview.date_preview between "' . (date("Y") - 1) . "-12-01" . '" and "' . date("Y") . "-02-28" . '" and (preview.diplom_percent!=0 and preview.another_view=0)');
$count_previews_winter_complete = $queryWinterComplete->execute()->getCount();
//Прошедшие предзащиту летом
$querySummerComplete = new CQuery();
$querySummerComplete->select("preview.*")->from(TABLE_DIPLOM_PREVIEWS . " as preview")->condition('preview.date_preview between "' . date("Y") . "-05-01" . '" and "' . date("Y") . "-06-30" . '" and (preview.diplom_percent!=0 and preview.another_view=0)');
$count_previews_summer_complete = $querySummerComplete->execute()->getCount();
//Не прошедшие предзащиту зимой
$queryWinterNotComplete = new CQuery();
$queryWinterNotComplete->select("preview.*")->from(TABLE_DIPLOM_PREVIEWS . " as preview")->condition('preview.date_preview between "' . (date("Y") - 1) . "-12-01" . '" and "' . date("Y") . "-02-28" . '" and (preview.diplom_percent=0 or preview.another_view!=0)');
$count_previews_winter_not_complete = $queryWinterNotComplete->execute()->getCount();
//Не прошедшие предзащиту летом
$querySummerNotComplete = new CQuery();
$querySummerNotComplete->select("preview.*")->from(TABLE_DIPLOM_PREVIEWS . " as preview")->condition('preview.date_preview between "' . date("Y") . "-05-01" . '" and "' . date("Y") . "-06-30" . '" and (preview.diplom_percent=0 or preview.another_view!=0)');
$count_previews_summer_not_complete = $querySummerNotComplete->execute()->getCount();
$this->setData("date_previews", $date_previews);
$this->setData("count_all", $count_all);
$this->setData("count_previews", $count_previews);
$this->setData("count_winter_all", $count_winter_all);
$this->setData("count_summer_all", $count_summer_all);
$this->setData("count_not_previews_winter", $count_not_previews_winter);
$this->setData("count_not_previews_summer", $count_not_previews_summer);
$this->setData("count_previews_winter", $count_previews_winter);
$this->setData("count_previews_summer", $count_previews_summer);
$this->setData("count_previews_winter_complete", $count_previews_winter_complete);
$this->setData("count_previews_winter_not_complete", $count_previews_winter_not_complete);
$this->setData("count_previews_summer_complete", $count_previews_summer_complete);
$this->setData("count_previews_summer_not_complete", $count_previews_summer_not_complete);
$this->renderView("_diploms/diplom_preview/stat.tpl");
}
示例4: tableOrder
public static function tableOrder($field, CModel $model = null, $manualSort = false)
{
if (is_null($model)) {
return "";
}
$labels = CCoreObjectsManager::getAttributeLabels($model);
$columnLabels = CCoreObjectsManager::getAttributeTableLabels($model);
if (array_key_exists($field, $columnLabels)) {
$label = $columnLabels[$field];
} elseif (array_key_exists($field, $labels)) {
$label = $labels[$field];
} else {
$label = $field;
}
$exclude = array('order', 'direction');
foreach (CRequest::getGlobalRequestVariables()->getItems() as $key => $value) {
if (!in_array($key, $exclude)) {
if (is_scalar($value)) {
$actions[] = $key . "=" . $value;
}
}
}
/**
* Позволяем сортировать только если поле есть в модели
*/
$showLink = $manualSort;
if (is_a($model, "CActiveModel")) {
if ($model->getDbTableFields()->hasElement($field)) {
$showLink = true;
}
}
$actions[] = "order=" . $field;
if (CRequest::getString("order") == $field) {
if (CRequest::getString("direction") == "") {
$actions[] = "direction=asc";
} elseif (CRequest::getString("direction") == "asc") {
$actions[] = "direction=desc";
} elseif (CRequest::getString("direction") == "desc") {
$actions[] = "direction=asc";
}
} else {
$actions[] = "direction=desc";
}
if ($showLink) {
$label = '<a href="?' . implode($actions, "&") . '">' . $label . '</a>';
}
echo $label;
}
示例5: actionIndex
public function actionIndex()
{
$set = new CRecordSet(false);
$query = new CQuery();
$selectedPerson = null;
$query->select("disser.*")->from(TABLE_PERSON_DISSER . " as disser")->innerJoin(TABLE_PERSON . " as person", "disser.kadri_id = person.id")->condition("disser.disser_type = 'кандидат'")->order("person.fio asc");
$set->setQuery($query);
if (CRequest::getString("order") == "person.fio") {
$direction = "asc";
if (CRequest::getString("direction") != "") {
$direction = CRequest::getString("direction");
}
$query->innerJoin(TABLE_PERSON . " as person", "disser.kadri_id = person.id");
$query->order("person.fio " . $direction);
} elseif (CRequest::getString("order") == "science_spec_id") {
$direction = "asc";
if (CRequest::getString("direction") != "") {
$direction = CRequest::getString("direction");
}
$query->order("science_spec_id " . $direction);
} elseif (CRequest::getString("order") == "study_form_id") {
$direction = "asc";
if (CRequest::getString("direction") != "") {
$direction = CRequest::getString("direction");
}
$query->order("study_form_id " . $direction);
} elseif (CRequest::getString("order") == "scinceMan") {
$direction = "asc";
if (CRequest::getString("direction") != "") {
$direction = CRequest::getString("direction");
}
$query->innerJoin(TABLE_PERSON . " as person", "disser.scinceMan = person.id");
$query->order("person.fio " . $direction);
} elseif (CRequest::getString("order") == "tema") {
$direction = "asc";
if (CRequest::getString("direction") != "") {
$direction = CRequest::getString("direction");
}
$query->order("tema " . $direction);
} elseif (CRequest::getString("order") == "god_zach") {
$direction = "asc";
if (CRequest::getString("direction") != "") {
$direction = CRequest::getString("direction");
}
$query->order("god_zach " . $direction);
} elseif (CRequest::getString("order") == "date_end") {
$direction = "asc";
if (CRequest::getString("direction") != "") {
$direction = CRequest::getString("direction");
}
$query->order("date_end " . $direction);
} elseif (CRequest::getString("order") == "comment") {
$direction = "asc";
if (CRequest::getString("direction") != "") {
$direction = CRequest::getString("direction");
}
$query->order("comment " . $direction);
}
// фильтр по руководителю
if (!is_null(CRequest::getFilter("person"))) {
$query->innerJoin(TABLE_PERSON . " as person", "disser.scinceMan = person.id and person.id = " . CRequest::getFilter("person"));
$selectedPerson = CRequest::getFilter("person");
}
// фильтр по ФИО
if (!is_null(CRequest::getFilter("fio"))) {
$query->innerJoin(TABLE_PERSON . " as person", "disser.kadri_id=person.id and person.id = " . CRequest::getFilter("fio"));
}
// фильтр по теме
if (!is_null(CRequest::getFilter("tema"))) {
$query->condition("disser.id = " . CRequest::getFilter("tema"));
}
// фильтр по комментарию
if (!is_null(CRequest::getFilter("comment"))) {
$query->condition("disser.id = " . CRequest::getFilter("comment"));
}
$isArchive = CRequest::getString("isArchive") == "1";
if (!$isArchive) {
$query->condition('disser.date_end > "' . date("Y-m-d", strtotime(CUtils::getCurrentYear()->date_start)) . '"');
}
if ($isArchive) {
$requestParams = array();
foreach (CRequest::getGlobalRequestVariables()->getItems() as $key => $value) {
if ($key != "isArchive") {
$requestParams[] = $key . "=" . $value;
}
}
$this->addActionsMenuItem(array(array("title" => "Текущий год", "link" => "?" . implode("&", $requestParams), "icon" => "mimetypes/x-office-calendar.png")));
} else {
$requestParams = array();
foreach (CRequest::getGlobalRequestVariables()->getItems() as $key => $value) {
$requestParams[] = $key . "=" . $value;
}
$requestParams[] = "isArchive=1";
$this->addActionsMenuItem(array(array("title" => "Архив", "link" => "?" . implode("&", $requestParams), "icon" => "devices/media-floppy.png")));
}
$managersQuery = new CQuery();
$managersQuery->select("person.*")->from(TABLE_PERSON . " as person")->order("person.fio asc")->innerJoin(TABLE_PERSON_DISSER . " as disser", "person.id = disser.scinceMan");
$managers = array();
foreach ($managersQuery->execute()->getItems() as $ar) {
$person = new CPerson(new CActiveRecord($ar));
//.........这里部分代码省略.........
示例6: actionIndex
//.........这里部分代码省略.........
$direction = "asc";
if (CRequest::getString("direction") != "") {
$direction = CRequest::getString("direction");
}
$query->order("contact_info " . $direction);
} elseif (CRequest::getString("order") == "st.name") {
$direction = "asc";
if (CRequest::getString("direction") != "") {
$direction = CRequest::getString("direction");
}
$query->leftJoin(TABLE_QUESTION_STATUS . " as st", "quest.status = st.id");
$query->order("st.name " . $direction);
} elseif (CRequest::getString("order") == "answer_text") {
$direction = "asc";
if (CRequest::getString("direction") != "") {
$direction = CRequest::getString("direction");
}
$query->order("answer_text " . $direction);
}
// фильтр по пользователю
if (!is_null(CRequest::getFilter("user"))) {
$query->innerJoin(TABLE_USERS . " as user", "quest.user_id = user.id and user.id = " . CRequest::getFilter("user"));
$selectedUser = CRequest::getFilter("user");
}
// фильтр по вопросу
if (!is_null(CRequest::getFilter("question"))) {
$query->condition("quest.id = " . CRequest::getFilter("question"));
}
// фильтр по ответу
if (!is_null(CRequest::getFilter("answer"))) {
$query->condition("quest.id = " . CRequest::getFilter("answer"));
}
// фильтр по контактам
if (!is_null(CRequest::getFilter("contact"))) {
$query->condition("quest.id = " . CRequest::getFilter("contact"));
}
$quests = new CArrayList();
$isArchive = CRequest::getString("isArchive") == "1";
if (!$isArchive) {
if (CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_READ_OWN_ONLY or CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_WRITE_OWN_ONLY) {
$query->condition('quest.user_id = "' . CSession::getCurrentUser()->getId() . '" and (quest.datetime_quest > "' . date("Y-m-d", strtotime(CUtils::getCurrentYear()->date_start)) . '" or quest.datetime_quest is NULL) and quest.status!=5');
} else {
$query->condition('(quest.datetime_quest > "' . date("Y-m-d", strtotime(CUtils::getCurrentYear()->date_start)) . '" or quest.datetime_quest is NULL) and quest.status!=5');
}
} else {
if (CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_READ_OWN_ONLY or CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_WRITE_OWN_ONLY) {
$query->condition('quest.user_id = "' . CSession::getCurrentUser()->getId() . '" and quest.status!=5');
} else {
$query->condition("quest.status!=5");
}
}
if (CRequest::getInt("showAll") == 1) {
if (!$isArchive) {
if (CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_READ_OWN_ONLY or CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_WRITE_OWN_ONLY) {
$query->condition('quest.user_id = "' . CSession::getCurrentUser()->getId() . '" and (quest.datetime_quest > "' . date("Y-m-d", strtotime(CUtils::getCurrentYear()->date_start)) . '" or quest.datetime_quest is NULL)');
} else {
$query->condition('quest.datetime_quest > "' . date("Y-m-d", strtotime(CUtils::getCurrentYear()->date_start)) . '" or quest.datetime_quest is NULL');
}
} else {
if (CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_READ_OWN_ONLY or CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_WRITE_OWN_ONLY) {
$query->condition('quest.user_id = "' . CSession::getCurrentUser()->getId() . '"');
}
}
$showAll = true;
}
foreach ($set->getPaginated()->getItems() as $ar) {
$quest = new CQuestion($ar);
$quests->add($quest->getId(), $quest);
}
if ($isArchive) {
$requestParams = array();
foreach (CRequest::getGlobalRequestVariables()->getItems() as $key => $value) {
if ($key != "isArchive") {
$requestParams[] = $key . "=" . $value;
}
}
$this->addActionsMenuItem(array(array("title" => "Текущий год", "link" => "?" . implode("&", $requestParams), "icon" => "mimetypes/x-office-calendar.png")));
} else {
$requestParams = array();
foreach (CRequest::getGlobalRequestVariables()->getItems() as $key => $value) {
$requestParams[] = $key . "=" . $value;
}
$requestParams[] = "isArchive=1";
$this->addActionsMenuItem(array(array("title" => "Архив", "link" => "?" . implode("&", $requestParams), "icon" => "devices/media-floppy.png")));
}
$usersQuery = new CQuery();
$usersQuery->select("user.*")->from(TABLE_USERS . " as user")->order("user.fio asc")->innerJoin(TABLE_QUESTION_TO_USERS . " as quest", "user.id = quest.user_id");
$users = array();
foreach ($usersQuery->execute()->getItems() as $ar) {
$user = new CUser(new CActiveRecord($ar));
$users[$user->getId()] = $user->getName();
}
$this->setData("isArchive", $isArchive);
$this->setData("showAll", $showAll);
$this->setData("quests", $quests);
$this->setData("users", $users);
$this->setData("selectedUser", $selectedUser);
$this->setData("paginator", $set->getPaginator());
$this->renderView("_question_answ/index.tpl");
}
示例7: actionIndex
//.........这里部分代码省略.........
}
// фильтр по рецензенту
if (!is_null(CRequest::getFilter("recenz"))) {
$query->innerJoin(TABLE_PERSON . " as person", "diplom.recenz_id = person.id and person.id = " . CRequest::getFilter("recenz"));
}
// фильтр по оценке
if (!is_null(CRequest::getFilter("mark"))) {
$query->innerJoin(TABLE_MARKS . " as mark", "diplom.study_mark = mark.id and mark.id = " . CRequest::getFilter("mark"));
}
// фильтр по комментарию
if (!is_null(CRequest::getFilter("comment"))) {
$query->condition("diplom.id = " . CRequest::getFilter("comment"));
}
// получение дипломных тем
$diploms = new CArrayList();
$isApprove = CRequest::getString("isApprove") == "1";
$isArchive = CRequest::getString("isArchive") == "1";
if (!$isArchive) {
if (CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_READ_OWN_ONLY or CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_WRITE_OWN_ONLY) {
$query->condition('diplom.kadri_id = "' . CSession::getCurrentPerson()->getId() . '" and diplom.date_act between "' . date("Y-m-d", strtotime(CUtils::getCurrentYear()->date_start)) . '" and "' . date("Y-m-d", strtotime(CUtils::getCurrentYear()->date_end)) . '"');
} else {
$query->condition('diplom.date_act between "' . date("Y-m-d", strtotime(CUtils::getCurrentYear()->date_start)) . '" and "' . date("Y-m-d", strtotime(CUtils::getCurrentYear()->date_end)) . '"');
}
} else {
if (CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_READ_OWN_ONLY or CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_WRITE_OWN_ONLY) {
$query->condition("diplom.kadri_id = " . CSession::getCurrentPerson()->getId());
}
}
//Не имеющие предзащиты зимой
if (CRequest::getInt("winterNotPreviews") == 1) {
$query->leftJoin(TABLE_DIPLOM_PREVIEWS . " as preview", "diplom.student_id = preview.student_id");
$query->condition('preview.student_id is null and diplom.date_act between "' . (date("Y") - 1) . "-12-01" . '" and "' . date("Y") . "-02-28" . '"');
}
//Не имеющие предзащиты летом
if (CRequest::getInt("summerNotPreviews") == 1) {
$query->leftJoin(TABLE_DIPLOM_PREVIEWS . " as preview", "diplom.student_id = preview.student_id");
$query->condition('preview.student_id is null and diplom.date_act between "' . date("Y") . "-05-01" . '" and "' . date("Y") . "-06-30" . '"');
}
foreach ($set->getPaginated()->getItems() as $item) {
$diplom = new CDiplom($item);
$diploms->add($diplom->getId(), $diplom);
}
/**
* Формируем меню
*/
$this->addActionsMenuItem(array(array("title" => "Печать по шаблону", "link" => "#", "icon" => "devices/printer.png", "template" => "formset_diploms_theme"), array("title" => "Добавить тему ВКР", "link" => "?action=add", "icon" => "actions/list-add.png"), array("title" => "Список студентов", "link" => WEB_ROOT . "_modules/_students/index.php", "icon" => "apps/system-users.png"), array("title" => "Групповые операции", "link" => "#", "icon" => "apps/utilities-terminal.png", "child" => array(array("title" => "Удалить выделенные", "icon" => "actions/edit-delete.png", "form" => "#MainView", "link" => "index.php", "action" => "Delete"), array("title" => "Сменить дату защиты", "icon" => "actions/edit-redo.png", "form" => "#MainView", "link" => "index.php", "action" => "changeDateAct"), array("title" => "Сменить место практики", "icon" => "actions/edit-redo.png", "form" => "#MainView", "link" => "index.php", "action" => "changePractPlace")))));
if ($isArchive) {
$requestParams = array();
foreach (CRequest::getGlobalRequestVariables()->getItems() as $key => $value) {
if ($key != "isArchive") {
$requestParams[] = $key . "=" . $value;
}
}
$this->addActionsMenuItem(array(array("title" => "Текущий год", "link" => "?" . implode("&", $requestParams), "icon" => "mimetypes/x-office-calendar.png")));
} else {
$requestParams = array();
foreach (CRequest::getGlobalRequestVariables()->getItems() as $key => $value) {
$requestParams[] = $key . "=" . $value;
}
$requestParams[] = "isArchive=1";
$this->addActionsMenuItem(array(array("title" => "Архив", "link" => "?" . implode("&", $requestParams), "icon" => "devices/media-floppy.png")));
}
$this->addActionsMenuItem(array(array("title" => "Утверждение темы", "link" => "#", "icon" => "apps/accessories-text-editor.png", "child" => array(array("title" => "Утвердили полностью", "icon" => "actions/edit-find-replace.png", "form" => "#MainView", "link" => "index.php?type=1", "action" => "approveTheme"), array("title" => "Утвердили c правкой", "icon" => "actions/edit-find-replace.png", "form" => "#MainView", "link" => "index.php?type=2", "action" => "approveTheme"), array("title" => "Утвердили c переформулировкой", "icon" => "actions/edit-find-replace.png", "form" => "#MainView", "link" => "index.php?type=3", "action" => "approveTheme"), array("title" => "Не утвердили, но смотрели", "icon" => "actions/edit-find-replace.png", "form" => "#MainView", "link" => "index.php?type=4", "action" => "approveTheme"), array("title" => "Отменить утверждение темы", "icon" => "actions/edit-find-replace.png", "form" => "#MainView", "link" => "index.php?type=0", "action" => "approveTheme")))));
$managers = array();
foreach ($managersQuery->execute()->getItems() as $ar) {
$person = new CPerson(new CActiveRecord($ar));
$managers[$person->getId()] = $person->getName();
}
$studentGroups = array();
foreach ($groupsQuery->execute()->getItems() as $ar) {
$group = new CStudentGroup(new CActiveRecord($ar));
$studentGroups[$group->getId()] = $group->getName();
}
$this->setData("isArchive", $isArchive);
$this->setData("isApprove", $isApprove);
$this->setData("studentGroups", $studentGroups);
$this->setData("diplomManagers", $managers);
$this->setData("currentPerson", $currentPerson);
$this->setData("currentGroup", $currentGroup);
$this->setData("diploms", $diploms);
$this->setData("paginator", $set->getPaginator());
if (!$isApprove) {
$requestParams = array();
foreach (CRequest::getGlobalRequestVariables()->getItems() as $key => $value) {
$requestParams[] = $key . "=" . $value;
}
$requestParams[] = "isApprove=1";
$this->addActionsMenuItem(array(array("title" => "Утверждение тем ВКР", "link" => "?" . implode("&", $requestParams), "icon" => "actions/bookmark-new.png")));
$this->renderView("_diploms/index.tpl");
} else {
$requestParams = array();
foreach (CRequest::getGlobalRequestVariables()->getItems() as $key => $value) {
if ($key != "isApprove") {
$requestParams[] = $key . "=" . $value;
}
}
$this->addActionsMenuItem(array(array("title" => "Список тем ВКР", "link" => "?" . implode("&", $requestParams), "icon" => "actions/format-justify-center.png")));
$this->renderView("_diploms/approve.tpl");
}
}