示例#1
0
 function beforeSave($options = array())
 {
     parent::beforeSave($options);
     if (!empty($this->data['Quote']['est_shipping'])) {
         $check_est_date = explode('-', $this->data['Quote']['est_shipping']);
         //			pr($check_est_date);exit;
         if (!isset($check_est_date[1])) {
             $this->data['Quote']['est_shipping'] = $this->formatDate($this->data['Quote']['est_shipping']);
         }
     }
     if (!empty($this->data['Quote']['first_date_measure'])) {
         $this->data['Quote']['first_date_measure'] = $this->formatDate($this->data['Quote']['first_date_measure']);
     }
     if (!empty($this->data['Quote']['second_date_measure'])) {
         $this->data['Quote']['second_date_measure'] = $this->formatDate($this->data['Quote']['second_date_measure']);
     }
     if (!empty($this->data['QuoteStatus']['status_date'])) {
         $this->data['QuoteStatus']['status_date'] = $this->formatDate($this->data['QuoteStatus']['status_date']);
     }
     if (!empty($this->data['QuoteStatus']['status'])) {
         $this->data['Quote']['status'] = $this->data['QuoteStatus']['status'];
     }
     if (!isset($this->data['Quote']['id'])) {
         $this->data['Quote']['created_by'] = $this->loginUser['id'];
     }
     //    cake_debug($this->data['Quote']); exit;
     return true;
 }
 public function beforeSave($options = array())
 {
     parent::beforeSave($options);
     $this->data['QuoteReportsSetting']['departments'] = serialize($this->data['QuoteReportsSetting']['departments']);
 }