public function actionChangeAuthors() { $field = CCoreObjectsManager::getCoreModelField(CRequest::getInt("id")); $field->is_authors = 1 - $field->is_authors; $field->save(); echo $field->is_authors; }
public function actionView() { $group = CStaffManager::getStudentGroup(CRequest::getInt("id")); $this->addActionsMenuItem(array(array("title" => "Назад", "link" => WEB_ROOT . "_modules/_student_groups/public.php?action=index", "icon" => "actions/edit-undo.png"))); $this->setData("group", $group); $this->renderView("__public/_student_groups/view.tpl"); }
public function execute($contextObject) { $result = array(); $studyLoad = new CArrayList(); $load = CIndPlanManager::getLoad(CRequest::getInt("planId")); $studyLoad = $load->getWorksByType(2); foreach ($studyLoad->getItems() as $row) { $dataRow = array(); $dataRow[0] = count($result) + 1; $dataRow[1] = $row->getTitle(); $dataRow[2] = $row->plan_amount; $dataRow[3] = $row->plan_expiration_date; $dataRow[4] = $row->plan_report_type; $dataRow[5] = $row->isExecuted(); $dataRow[6] = $row->comment; $result[] = $dataRow; } for ($i = count($result); $i <= 7; $i++) { $row = array(); for ($j = 0; $j <= 6; $j++) { $row[$j] = ""; } $result[] = $row; } return $result; }
public function actionDel() { $p = CCorriculumsManager::getPractice(CRequest::getInt("id")); $c = $p->corriculum_id; $p->remove(); $this->redirect("index.php?action=edit&id=" . $c); }
public function actionDelete() { $object = CCoreObjectsManager::getCoreModelTask(CRequest::getInt("id")); $model = $object->model_id; $object->remove(); $this->redirect("models.php?action=edit&id=" . $model); }
public function actionDelete() { $object = CBaseManager::getWorkPlanCompetention(CRequest::getInt("id")); $plan = $object->plan_id; $object->remove(); $this->redirect("workplancompetentions.php?action=index&plan_id=" . $plan); }
public function actionDelete() { $object = CBaseManager::getWorkPlanContentSection(CRequest::getInt("id")); $module = $object->module_id; $object->remove(); $this->redirect("workplancontentmodules.php?action=edit&id=" . $module); }
public function execute($contextObject) { $result = array(); $studyLoad = new CArrayList(); $load = CIndPlanManager::getLoad(CRequest::getInt("planId")); $studyLoad = $load->getWorksByType(6); foreach ($studyLoad->getItems() as $row) { $dataRow = array(); $dataRow[0] = count($result) + 1; $dataRow[1] = $row->change_section; $dataRow[2] = $row->change_reason; $dataRow[3] = ""; $dataRow[4] = $row->change_add_date; $dataRow[5] = $row->isExecuted(); $result[] = $dataRow; } for ($i = count($result); $i <= 7; $i++) { $row = array(); for ($j = 0; $j <= 5; $j++) { $row[$j] = ""; } $result[] = $row; } return $result; }
public function actionDelete() { $object = CBaseManager::getWorkPlanTask(CRequest::getInt("id")); if (!is_null($object)) { $goal = $object->goal; $object->remove(); $order = 1; foreach ($goal->tasks as $task) { $task->ordering = $order++; $task->save(); } $this->redirect("workplangoals.php?action=edit&id=" . $goal->getId()); } $items = CRequest::getArray("selectedInView"); $goal = CBaseManager::getWorkPlanGoal(CRequest::getInt("goal_id")); foreach ($items as $id) { $object = CBaseManager::getWorkPlanTask($id); $object->remove(); } $order = 1; foreach ($goal->tasks as $task) { $task->ordering = $order++; $task->save(); } $this->redirect("workplangoals.php?action=edit&id=" . $goal->getId()); }
public function actionGetViewData() { $result = array(); // комиссии по защите дипломов. показываем только комиссии этого года foreach (CActiveRecordProvider::getWithCondition(TABLE_SAB_COMMISSIONS, "year_id=" . CUtils::getCurrentYear()->getId())->getItems() as $ar) { $comm = new CSABCommission($ar); $value = $comm->title; if (!is_null($comm->manager)) { $value .= " " . $comm->manager->getName(); } if (!is_null($comm->secretar)) { $value .= " (" . $comm->secretar->getName() . ")"; } $diplom = CStaffManager::getDiplom(CRequest::getInt("diplom_id")); if (!is_null($diplom)) { $cnt = 0; foreach ($comm->diploms->getItems() as $d) { if (strtotime($diplom->date_act) == strtotime($d->date_act)) { $cnt++; } } $value .= " " . $cnt; } $result[$comm->getId()] = $value; } return $result; }
public function actionDelete() { $object = CBaseManager::getWorkPlanLiterature(CRequest::getInt("id")); $plan = $object->plan; $type = $object->type; $object->remove(); $order = 1; if ($object->type == 1) { foreach ($plan->baseLiterature as $baseLiterature) { $baseLiterature->ordering = $order++; $baseLiterature->save(); } } elseif ($object->type == 2) { foreach ($plan->additionalLiterature as $additionalLiterature) { $additionalLiterature->ordering = $order++; $additionalLiterature->save(); } } elseif ($object->type == 3) { foreach ($plan->internetResources as $internetResources) { $internetResources->ordering = $order++; $internetResources->save(); } } $this->redirect("workplanliterature.php?action=index&plan_id=" . $plan->getId() . "&type=" . $type); }
public function actionDelete() { $event = CGrantManager::getEvent(CRequest::getInt("id")); $id = $event->grant_id; $event->remove(); $this->redirect("index.php?action=edit&id=" . $id); }
public function actionDelete() { $object = CBaseManager::getWorkPlanContentSectionLoadTechnology(CRequest::getInt("id")); $load = $object->load_id; $object->remove(); $this->redirect("workplancontentloads.php?action=edit&id=" . $load); }
public function actionDelete() { $object = CCorriculumsManager::getCompetention(CRequest::getInt("id")); $discipline_id = $object->discipline_id; $object->remove(); $this->redirect("disciplines.php?action=edit&id=" . $discipline_id); }
public function actionDelete() { $validator = CCoreObjectsManager::getCoreModelFieldValidator(CRequest::getInt("id")); $field = $validator->field_id; $validator->remove(); $this->redirect("fields.php?action=edit&id=" . $field); }
public function actionDelete() { $money = CGrantManager::getMoney(CRequest::getInt("id")); $grant_id = $money->period->grant_id; $money->remove(); $this->redirect("index.php?action=edit&id=" . $grant_id); }
public function actionDelete() { $object = CBaseManager::getWorkPlanProjectTheme(CRequest::getInt("id")); $plan = $object->plan_id; $object->remove(); $this->redirect("workplanprojectthemes.php?action=index&plan_id=" . $plan); }
public function actionDelete() { $order = CSABManager::getSABPersonOrder(CRequest::getInt("id")); $person = $order->person_id; $order->remove(); $this->redirect("index.php?action=edit&id=" . $person); }
public function actionDel() { $cycle = CCorriculumsManager::getCycle(CRequest::getInt("id")); $id = $cycle->corriculum_id; $cycle->remove(); $this->redirect("index.php?action=view&id=" . $id); }
public function actionDelete() { $object = CBaseManager::getWorkPlanContentSectionLoad(CRequest::getInt("id")); $section = $object->section_id; $object->remove(); $this->redirect("workplancontentloads.php?action=index§ion_id=" . $section); }
public function actionIndex() { $set = new CRecordSet(); $query = new CQuery(); $set->setQuery($query); $query->select("person.*")->innerJoin(TABLE_STAFF_ORDERS . " as orders", "person.id = orders.kadri_id")->innerJoin(TABLE_PERSON_BY_TYPES . " as type", "person.id = type.kadri_id")->from(TABLE_PERSON . " as person")->order("person.fio asc")->condition("orders.order_active=1"); $PPS = false; if (CRequest::getInt("PPS") == 1) { $query->condition("type.person_type_id=1 and orders.order_active=1"); $PPS = true; } $UVP = false; if (CRequest::getInt("UVP") == 1) { $query->condition("type.person_type_id=3 and orders.order_active=1"); $UVP = true; } $persons = new CArrayList(); foreach ($set->getPaginated()->getItems() as $ar) { $person = new CPersonTime($ar); $persons->add($person->getId(), $person); } $this->setData("paginator", $set->getPaginator()); $this->setData("PPS", $PPS); $this->setData("UVP", $UVP); $this->setData("persons", $persons); $this->renderView("_staff/time/index.tpl"); }
public function actionDelete() { $object = CStaffManager::getPersonPaper(CRequest::getInt("id")); $person = $object->kadri_id; $object->remove(); $this->redirect("index.php?action=edit&id=" . $person); }
public function actionDelete() { $object = CBaseManager::getWorkPlanSelfEducationBlock(CRequest::getInt("id")); $load = $object->load_id; $object->remove(); $this->redirect("workplancontentloads.php?action=edit&id=" . $load); }
/** * Получение данных модели по идентификатору */ private function actionJSONGet() { // получим название класса модели, которую надо пользователю $modelClass = CRequest::getString("model"); // идентификатор $id = CRequest::getInt("id"); // создадим объект, посмотрим, в какой таблице он весь живет /** * @var $model CActiveModel */ $model = new $modelClass(); // проверим, может не реализует нужный интерфейс if (!is_a($model, "IJSONSerializable")) { throw new Exception("Класс " . $modelClass . " не реализует интерфейс IJSONSerializable"); } $modelTable = $model->getRecord()->getTable(); // получим из этой таблицы объект $ar = CActiveRecordProvider::getById($modelTable, $id); if (is_null($ar)) { echo json_encode(null); return; } // создадим новый объект указанного типа /** * @var $model IJSONSerializable */ $model = new $modelClass($ar); // получим json объект модели $jsonObj = $model->toJsonObject(); // добавим к json-объекту перевод $jsonObj->_translation = CCoreObjectsManager::getAttributeLabels($model); // сразу добавим штатную валидацию // может, чуть позже, пока нет echo json_encode($jsonObj); }
public function actionDelete() { $object = CProtocolManager::getNMSProtocolAgendaPoint(CRequest::getInt("id")); $porotocol_id = $object->protocol_id; $object->remove(); $this->redirect("index.php?action=edit&id=" . $porotocol_id); }
public function actionDelete() { $object = CBaseManager::getWorkPlanTask(CRequest::getInt("id")); $goal = $object->goal_id; $object->remove(); $this->redirect("workplangoals.php?action=edit&id=" . $goal); }
public function actionDelete() { $object = CBaseManager::getWorkPlanGoal(CRequest::getInt("id")); $plan = $object->plan_id; $object->remove(); $this->redirect("workplans.php?action=edit&id=" . $plan); }
public function actionDelete() { $object = CDocumentsManager::getFile(CRequest::getInt("id")); $parent = $object->folder_id; $object->remove(); $this->redirect("index.php?action=index&parent=" . $parent); }
public function actionDelete() { $object = CBaseManager::getWorkPlanCriteriaOfEvaluation(CRequest::getInt("id")); $plan = $object->plan; $type = $object->type; $object->remove(); $order = 1; if ($object->type == 1) { foreach ($plan->criteriaExamOfEvaluation as $criteriaExamOfEvaluation) { $criteriaExamOfEvaluation->ordering = $order++; $criteriaExamOfEvaluation->save(); } } elseif ($object->type == 2) { foreach ($plan->criteriaCreditOfEvaluation as $criteriaCreditOfEvaluation) { $criteriaCreditOfEvaluation->ordering = $order++; $criteriaCreditOfEvaluation->save(); } } elseif ($object->type == 3) { foreach ($plan->criteriaMaterialsOfEvaluation as $criteriaMaterialsOfEvaluation) { $criteriaMaterialsOfEvaluation->ordering = $order++; $criteriaMaterialsOfEvaluation->save(); } } $this->redirect("workplancriteriaofevaluation.php?action=index&plan_id=" . $plan->getId() . "&type=" . $type); }
public function actionDelete() { $object = CBaseManager::getWorkPlanAdditionalSupply(CRequest::getInt("id")); $plan = $object->plan_id; $object->remove(); $this->redirect("workplansupplies.php?action=index&plan_id=" . $plan); }