コード例 #1
0
ファイル: Exam.php プロジェクト: MarinKacaj/MarksManager
 /**
  * @param array $params
  * @param bool $isPartOfList [optional]
  */
 function __construct($params, $isPartOfList = false)
 {
     if (!isset($params[self::PROP_ID])) {
         $params[self::PROP_ID] = BasicEntity::UNSAVED_INSTANCE_ID;
     }
     $headID = intval($params[self::PROP_HEAD_ID]);
     $member1ID = intval($params[self::PROP_MEMBER1_ID]);
     $member2ID = intval($params[self::PROP_MEMBER2_ID]);
     $seasonID = intval($params[self::PROP_SEASON_ID]);
     $subjectID = intval($params[self::PROP_SUBJECT_ID]);
     $departmentID = intval($params[self::PROP_DEPARTMENT_ID]);
     $seasonInstance = Season::getBuilder()->getByIdentifier(array(Season::PROP_ID => $seasonID));
     $subjectInstance = Subject::getBuilder()->getByIdentifier(array(Subject::PROP_ID => $subjectID));
     $departmentInstance = Department::getBuilder()->getByIdentifier(array(Department::PROP_ID => $departmentID));
     $this->headID = $headID;
     $this->member1ID = $member1ID;
     $this->member2ID = $member2ID;
     $this->label = self::LABEL;
     $this->id = array(self::PROP_ID => $params[self::PROP_ID]);
     $this->properties[self::PROP_ID] = new IntegerProperty(self::PROP_ID, 'ID', $this->id[self::PROP_ID], false, false);
     $this->properties[self::PROP_SEASON_ID] = new EntityProperty(self::PROP_SEASON_ID, 'Sezon', intval($params[self::PROP_SEASON_ID]), Season::getBuilder()->getList($isPartOfList), true, true, $seasonInstance);
     $this->properties[self::PROP_SUBJECT_ID] = new EntityProperty(self::PROP_SUBJECT_ID, 'Lende', $subjectID, Subject::getBuilder()->getList($isPartOfList), true, true, $subjectInstance);
     $this->properties[self::PROP_DEPARTMENT_ID] = new EntityProperty(self::PROP_DEPARTMENT_ID, 'Dege', $departmentID, Department::getBuilder()->getList($isPartOfList), true, true, $departmentInstance);
     $this->properties[self::PROP_HEAD_ID] = new EntityProperty(self::PROP_HEAD_ID, 'Kryetar Komisioni', $headID, Professor::getBuilder()->getList($isPartOfList), true);
     $this->properties[self::PROP_MEMBER1_ID] = new EntityProperty(self::PROP_MEMBER1_ID, 'Anëtar 1', $member1ID, Professor::getBuilder()->getList($isPartOfList), true);
     $this->properties[self::PROP_MEMBER2_ID] = new EntityProperty(self::PROP_MEMBER2_ID, 'Anëtar 2', $member2ID, Professor::getBuilder()->getList($isPartOfList), true);
     $this->actionHelper = new EntityActionHelper(self::TABLE_NAME, $this);
     $this->isPartOfList = $isPartOfList;
 }
コード例 #2
0
ファイル: Group.php プロジェクト: MarinKacaj/MarksManager
 /**
  * @return string
  */
 public function getDisplayName()
 {
     $departmentID = intval($this->getProperty(self::PROP_DEPARTMENT_ID)->getValue());
     $departmentInstance = Department::getBuilder()->getByIdentifier(array(Department::PROP_ID => $departmentID));
     return $this->getProperty(self::PROP_NAME)->getValue() . ' ' . $departmentInstance->getDisplayName();
 }
コード例 #3
0
ファイル: create.php プロジェクト: MarinKacaj/MarksManager
<?php

/**
 * Created by PhpStorm.
 * User: Marin Kaçaj
 * Date: 6/8/2015
 * Time: 6:14 PM
 */
use fti\adv_db\entity\Department;
require_once dirname(dirname(__FILE__)) . '/includes/loader.php';
require_once dirname(dirname(__FILE__)) . '/pages/createHelper.php';
redirectIfNotSecretary();
$entityBuilder = Department::getBuilder();
buildCreateView($entityBuilder);
require_once dirname(dirname(__FILE__)) . '/pages/formPage.php';
コード例 #4
0
ファイル: delete.php プロジェクト: MarinKacaj/MarksManager
<?php

/**
 * Created by PhpStorm.
 * User: Marin Kaçaj
 * Date: 6/14/2015
 * Time: 4:49 PM
 */
use fti\adv_db\entity\Department;
use fti\adv_db\http\HttpEntityParamBuilder;
use fti\adv_db\nav\ActionNavigator;
require_once dirname(dirname(__FILE__)) . '/includes/session.php';
require_once dirname(dirname(__FILE__)) . '/auth/security.php';
require_once dirname(dirname(dirname(__FILE__))) . '/src/fti/adv_db/functions/auto_loader.php';
spl_autoload_register('class_auto_loader');
redirectIfNotSecretary();
$id = HttpEntityParamBuilder::retrieveFilter(array(Department::PROP_ID));
$departmentInstance = Department::getBuilder()->getByIdentifier($id);
$actionNavigator = new ActionNavigator($departmentInstance);
$actionNavigator->deleteAndRedirect();