Пример #1
0
 /**
  * Creates the new reservation in the reservation temp tables and the json data for the form
  *
  * This generates a new reservation, a new reservation does not use the id value, but the reservation_id.
  * the reservation_id is created at the time this method is called and is not committed to the live
  * reservations (stored in rm_reservations) until save.
  *
  * @return 	json
  * @deprecated since RC2
  */
 public function wizardnewJsonAction()
 {
     $data = new stdClass();
     $data->id = RM_Reservations::createReservationID();
     $data->user_id = null;
     // this isn't available until the reservation is saved.
     $data->start_datetime = date("Y-m-d");
     $data->end_datetime = date("Y-m-d");
     // this is the form fields...
     $reservationConfigModel = new RM_ReservationConfig();
     $fields = $reservationConfigModel->getWizardFields();
     foreach ($fields as $field) {
         $jsonFields[] = $field->admin_view_wizard;
     }
     $json = "{\n            data : " . Zend_Json::encode($data) . ",\n            fields : [" . implode(',', $jsonFields) . "]\n            }";
     return array('data' => $json, 'encoded' => true);
 }