Ejemplo n.º 1
0
 private function _rowToObject(Zend_Db_Table_Row $row)
 {
     $userRow = $row->findParentRow('User_Model_DbTable_Staffmembre', 'Staffmembre');
     $user = new User_Model_Staffmembre();
     $user->setId($userRow->usm_id)->setName($userRow->usm_name);
     $issueStatus = new Project_Model_IssueStatus();
     $issueStatus->setId($row->istut_id)->setTitle($row->istut_title)->setUser($user);
     return $issueStatus;
 }
Ejemplo n.º 2
0
 private function _rowToObject(Zend_Db_Table_Row $row)
 {
     $issueRow = $row->findParentRow('Project_Model_Issue', 'Issue');
     $issue = new Project_Model_Issue();
     $issue->setId($issueRow->iss_id)->setName($issueRow->iss_name);
     $userRow = $row->findParentRow('User_Model_DbTable_Staffmembre', 'Staffmembre');
     $user = new User_Model_Staffmembre();
     $user->setId($userRow->usm_id)->setName($userRow->usm_name);
     $issueComment = new Project_Model_IssueComment();
     $issueComment->setId($row->isc_id)->setContent($row->isc_content)->setDate($row->isc_date)->setIssue($issue)->setUser($user);
     return $issueComment;
 }
Ejemplo n.º 3
0
 /**
  * @todo Wysyłka maila
  * @param type $data
  */
 public function saveFormData($data, Zend_Db_Table_Row $row = null)
 {
     $delegation = new DelegationSettlement();
     $utils = new Logic_Utilities();
     $idConvert = Zend_Controller_Action_HelperBroker::getStaticHelper('IdConvert');
     $uri = 'delegations/accept/id_delegation/' . $idConvert->strToHex($data['id_delegation']);
     $data['id_address_history'] = $this->getCurrentAddress();
     //$data['id_address_history'] = $this->addAddressToHistory();
     try {
         $db = Base_Model_Table::getDefaultAdapter();
         $db->beginTransaction();
         if ($row) {
             if ($data['id_state'] != Logic_ItemAbstract::STATE_NEW_2) {
                 if ($row->id_state != $data['id_state'] && !($row->id_state == Logic_ItemAbstract::STATE_APPROVED_2 && $data['id_state'] == Logic_ItemAbstract::STATE_NEW_2)) {
                     $row->findParentRow('DelegationSettlement')->setFromArray(array_merge($this->getCurrentValuesIds(), $data))->save();
                     $this->saveLocations($row->id, $data['departure']);
                 } else {
                     throw new Exception('Krok który próbowałeś zapisać został już wykonany.');
                 }
             } else {
                 if (!($row->id_state == Logic_ItemAbstract::STATE_APPROVED_2 && $data['id_state'] == Logic_ItemAbstract::STATE_NEW_2)) {
                     $row->findParentRow('DelegationSettlement')->setFromArray(array_merge($this->getCurrentValuesIds(), $data))->save();
                     $this->saveLocations($row->id, $data['departure']);
                 } else {
                     throw new Exception('Delegacja została już wysłana do zatwierdzenia.');
                 }
             }
         } else {
             $idRow = $delegation->createRow(array_merge($this->getCurrentValuesIds(), $data))->save();
             $this->saveLocations($idRow, $data['departure']);
         }
         $db->commit();
     } catch (Exception $exc) {
         $db->rollBack();
         //diee($exc->getTraceAsString());
         throw new Exception("Błąd podczas dodawania nowego rozliczenia! Treść: " . $exc->getMessage());
     }
 }
Ejemplo n.º 4
0
 public function rowToObject(Zend_Db_Table_Row $row)
 {
     $userRow = $row->findParentRow('User_Model_DbTable_Staffmembre', 'Staffmembre');
     $user = new User_Model_Staffmembre();
     $user->setId($userRow->usm_id)->setLogin($userRow->usm_login);
     $project = new Project_Model_Project();
     $project->setId($row->proj_id)->setName($row->proj_name)->setDescription($row->proj_desc)->setDate($row->proj_date)->setStatus($row->proj_statut)->setHomepageUrl($row->proj_hpurl)->setDocUrl($row->proj_docurl)->setUser($user);
     return $project;
 }
Ejemplo n.º 5
0
 public function rowToObject(Zend_Db_Table_Row $row)
 {
     $taskRow = $row->findParentRow('Project_Model_TaskStatus', 'TaskStatus');
     $status = new Project_Model_Mapper_Task();
     $status->setId($taskRow->tskstu_id);
     $userRow = $row->findParentRow('User_Model_DbTable_Staffmembre', 'Staffmembre');
     $user = new User_Model_Staffmembre();
     $user->setId($userRow->usm_id);
     $task = new Project_Model_Task();
     $task->setId($row->tsk_id)->setName($row->tsk_name)->setDescription($row->jal_description)->setDate($row->tsk_date)->setExpectedDate($row->tsk_expectDate)->setDescription($row->tsk_desc)->setStatus($status)->setUser($user);
     return $task;
 }
Ejemplo n.º 6
0
 public function findParentRow(\Zend_Db_Table_Row $row, $parentTable, $ruleKey = null)
 {
     $table = $this->getDbTable();
     $select = $table->select(false)->from($table->info("name"), $table->info("primary"));
     $results = $row->findParentRow($parentTable, $ruleKey, $select);
     return $this->_loadByPrimaryKeys($results);
 }
Ejemplo n.º 7
0
 private function _rowToObject(Zend_Db_Table_Row $row)
 {
     $statusRow = $row->findParentRow('Project_Model_DbTable_IssueStatus', 'IssueStatus');
     $status = new Project_Model_IssueStatus();
     $status->setId($statusRow->istut_id)->setTitle($statusRow->istut_title);
     $typeRow = $row->findParentRow('Project_Model_DbTable_IssueType', 'IssueType');
     $type = new Project_Model_IssueType();
     $type->setId($typeRow->istyp_id)->setTitle($typeRow->istyp_title);
     $projectRow = $row->findParentRow('Project_Model_DbTable_Project', 'Project');
     $projectMapper = new Project_Model_Mapper_Project();
     $project = new Project_Model_Project();
     $project = $projectMapper->rowToObject($projectRow);
     $userRow = $row->findParentRow('User_Model_DbTable_Staffmembre', 'Staffmembre');
     $user = new User_Model_Staffmembre();
     $user->setId($userRow->usm_id)->setLogin($userRow->usm_login);
     $issue = new Project_Model_Issue();
     $issue->setId($row->iss_id)->setName($row->iss_name)->setDescription($row->iss_desc)->setDate($row->iss_date)->setStatus($status)->setType($type)->setProject($project)->setUser($user);
     return $issue;
 }
Ejemplo n.º 8
0
 private function _rowToObject(Zend_Db_Table_Row $row)
 {
     $projectRow = $row->findParentRow('Project_Model_DbTable_Project', 'Project');
     $projectMapper = new Project_Model_Mapper_Project();
     $project = new Project_Model_Project();
     $project = $projectMapper->rowToObject($projectRow);
     $jalon = new Project_Model_Jalon();
     $jalon->setId($row->jal_id)->setName($row->jal_name)->setDescription($row->jal_description)->setDate($row->jal_date)->setProject($project);
     return $jalon;
 }