Example #1
0
 public function show()
 {
     $oQuery = $this->db->select()->from('user', null)->joinLeft('client', 'client.id = user.client', null)->where('user.deleted = "no"')->order(array('user.first_name', 'user.last_name'))->columns(array('id' => 'user.id', 'name' => 'CONCAT(user.first_name, " ", user.last_name, IF(client.title IS NOT NULL, CONCAT(" (", client.title, ")"), ""), IF(user.is_admin, " - admin", ""))'));
     $aUsers = array('' => $this->actionController->__('Select user')) + $this->db->fetchPairs($oQuery);
     $aRecord = array('users' => $aUsers);
     if (isset($this->view->{$this->getName()})) {
         $aRecord = array_merge($aRecord, $this->view->{$this->getName()});
     }
     $this->view->{$this->getName()} = $aRecord;
     parent::show();
 }
Example #2
0
 public function show()
 {
     $aTypes = array();
     foreach (self::$_aValidTypes as $sType) {
         $aTypes[$sType] = AM_Model_Db_ApplicationType::typeToText($sType);
     }
     $aRecord = array('types' => $aTypes);
     if (isset($this->view->{$this->getName()})) {
         $aRecord = array_merge($aRecord, $this->view->{$this->getName()});
     }
     $this->view->{$this->getName()} = $aRecord;
     parent::show();
 }
Example #3
0
 /**
  * @return void
  */
 public function show()
 {
     if (!$this->controls['state']->getValue()) {
         $this->controls['state']->setValue(AM_Model_Db_State::STATE_WORK_IN_PROGRESS);
     }
     $aStates = array();
     $aRevisions = array(0 => '---');
     if ($this->primaryKeyValue) {
         $oStates = AM_Model_Db_Table_Abstract::factory('state')->fetchAll(null, array('id ASC'));
         foreach ($oStates as $oState) {
             $aStates[$oState->id] = $oState->title;
         }
     } else {
         $aCriteria = $this->user['is_admin'] ? array() : array('revision.user' => $this->user['id']);
         $aRevisionSet = AM_Model_Db_Table_Abstract::factory('revision')->getRevisionsSortedByOwners($aCriteria);
         foreach ($aRevisionSet as $aRevision) {
             $aRevisions[$aRevision['id']] = sprintf('%s > %s > %s > %s', $aRevision['title_client'], $aRevision['title_application'], $aRevision['title_issue'], $aRevision['title']);
         }
     }
     $aRecord = array('states' => $aStates, 'copy_from_revisions' => $aRevisions);
     if (isset($this->view->{$this->getName()})) {
         $aRecord = array_merge($aRecord, $this->view->{$this->getName()});
     }
     $this->view->{$this->getName()} = $aRecord;
     parent::show();
 }
Example #4
0
 /**
  * @return void
  */
 public function show()
 {
     parent::show();
 }