Ejemplo n.º 1
0
 public function rfiLetterAction()
 {
     $this->_helper->viewRenderer->setNoRender(false);
     $project_id = $this->_getParam("id", -1);
     $rfi_id = $this->_getParam("rfi_id", 0);
     $projectInfo = Application_Model_Projects::GetProjectInfo($project_id);
     $this->view->project_title = $projectInfo->title;
     $this->view->project_job_no = $projectInfo->job_no;
     $this->view->project_ref_no = $projectInfo->ref_no;
     $rfis = Application_Model_RFIs::getRFIsForProject($project_id);
     $rfi = $rfis[$rfi_id];
     $this->view->rfi = $rfi;
     $SentBy = Application_Model_Users::GetUserInfo($rfi->sent_by);
     if (!is_null($SentBy)) {
         $branch_address = $SentBy->Address;
         if (!is_null($branch_address)) {
             $this->view->branch_address = $branch_address->getFormattedAddress();
         }
         $this->view->sender_name = $SentBy->getFormattedName();
         $this->view->sender_title = $SentBy->title;
         $this->view->sender_email = $SentBy->email;
         $this->view->sender_fax = $SentBy->fax;
         $this->view->sender_phone = $SentBy->phone_office;
     }
     $SentTo = Application_Model_Users::GetUserInfo($rfi->sent_to);
     if (!is_null($SentTo)) {
         $recipient_address = $SentTo->Address;
         if (!is_null($recipient_address)) {
             $this->view->recipient_address = $recipient_address->getFormattedAddress();
         }
         $this->view->recipient_name = $SentTo->getFormattedName();
         $this->view->recipient_title = $SentTo->title;
         $this->view->recipient_phone = $SentTo->phone_office;
         $this->view->recipient_fax = $SentTo->fax;
         $this->view->recipient_email = $SentTo->email;
     }
     $ResponseBy = Application_Model_Users::GetUserInfo($rfi->response_by);
     if (!is_null($ResponseBy)) {
         $this->view->response_by_name = $ResponseBy->getFormattedName();
     }
 }