コード例 #1
0
 /**
  * detail_section method
  *
  * @param string $id
  * @return void
  */
 public function detail_section($id = null, $section = null)
 {
     $this->InstallerSchedule->id = $id;
     if (!$this->InstallerSchedule->exists()) {
         throw new NotFoundException(__('Invalid Installer'));
     }
     $user_id = $this->loginUser['id'];
     $this->InstallerSchedule->recursive = 1;
     $installerSchedule = $this->InstallerSchedule->read(null, $id);
     App::import('Model', 'ScheduleManager.ScheduleStatus');
     $scheduleStatusModel = new ScheduleStatus();
     $schedule_status = $scheduleStatusModel->find('all', array('conditions' => array('ScheduleStatus.schedule_id' => $id, 'ScheduleStatus.type' => 'Installer Schedule')));
     $this->set(compact('user_id', 'installerSchedule', 'section', 'schedule_status'));
 }
コード例 #2
0
 /**
  * print/pdf view method
  *
  * @param string $id
  * @return void
  */
 public function print_detail($id = null)
 {
     $this->layoutOpt['layout'] = 'report';
     $this->ServiceEntry->id = $id;
     if (!$this->ServiceEntry->exists()) {
         throw new NotFoundException(__('Invalid ServiceEntry'));
     }
     $user_id = $this->loginUser['id'];
     $this->ServiceEntry->recursive = 3;
     $service = $this->ServiceEntry->read(null, $id);
     App::import('Model', 'ScheduleManager.ScheduleStatus');
     $scheduleStatusModel = new ScheduleStatus();
     $schedule_status = $scheduleStatusModel->find('all', array('conditions' => array('ScheduleStatus.schedule_id' => $id, 'ScheduleStatus.type' => 'Service')));
     App::import('Model', 'QuoteManager.Quote');
     $quoteModel = new Quote();
     $quotes = $quoteModel->find('first', array('conditions' => array('Quote.id' => $service['WorkOrder']['quote_id'])));
     $reportTitle = "Service";
     $reportNumber = $service['WorkOrder']['work_order_number'];
     $reportDate = date('l, F d, Y');
     $this->set(compact('user_id', 'service', 'quotes', 'schedule_status', 'reportTitle', 'reportNumber', 'reportDate'));
 }