From d5481cdeb8b237fa8f9acf2a9c54cf048b114422 Mon Sep 17 00:00:00 2001 From: "chris.pichardo" Date: Tue, 6 Oct 2015 01:51:07 -0400 Subject: [PATCH 1/2] Fixed Issue #56, refresh of the page inserts duplicated appointments in calendar --- src/application/controllers/appointments.php | 46 ++++++++++++++----- .../views/appointments/book_success.php | 1 + 2 files changed, 36 insertions(+), 11 deletions(-) mode change 100644 => 100755 src/application/controllers/appointments.php mode change 100644 => 100755 src/application/views/appointments/book_success.php diff --git a/src/application/controllers/appointments.php b/src/application/controllers/appointments.php old mode 100644 new mode 100755 index 9106480f..ec673b9f --- a/src/application/controllers/appointments.php +++ b/src/application/controllers/appointments.php @@ -207,20 +207,11 @@ class Appointments extends CI_Controller { } catch(Exception $exc) { $view['exceptions'][] = $exc; } - - // :: LOAD THE BOOK SUCCESS VIEW - $view = array( - 'appointment_data' => $appointment, - 'provider_data' => $provider, - 'service_data' => $service, - 'company_name' => $company_settings['company_name'] - ); - } catch(Exception $exc) { $view['exceptions'][] = $exc; } - - $this->load->view('appointments/book_success', $view); + $this->session->set_flashdata('book_exceptions', $view['exceptions']); + redirect('appointments/book_success/'.$appointment['id']); } } @@ -675,6 +666,39 @@ class Appointments extends CI_Controller { )); } } + /** + * GET an specific appointment book and redirect to the success screen. + * + * @param int $appointment_id Contains the id of the appointment to retrieve. + */ + public function book_success($appointment_id) { + //if the appointment id doesn't exist or zero redirect to index + if(!$appointment_id){ + redirect('appointments'); + } + $this->load->model('appointments_model'); + $this->load->model('providers_model'); + $this->load->model('services_model'); + $this->load->model('settings_model'); + //retrieve the data needed in the view + $appointment = $this->appointments_model->get_row($appointment_id); + $provider = $this->providers_model->get_row($appointment['id_users_provider']); + $service = $this->services_model->get_row($appointment['id_services']); + $company_name = $this->settings_model->get_setting('company_name'); + //get the exceptions + $exceptions = $this->session->flashdata('book_success'); + // :: LOAD THE BOOK SUCCESS VIEW + $view = array( + 'appointment_data' => $appointment, + 'provider_data' => $provider, + 'service_data' => $service, + 'company_name' => $company_name, + ); + if($exceptions){ + $view['exceptions'] = $exceptions; + } + $this->load->view('appointments/book_success', $view); + } } /* End of file appointments.php */ diff --git a/src/application/views/appointments/book_success.php b/src/application/views/appointments/book_success.php old mode 100644 new mode 100755 index b47af824..2dbcd59d --- a/src/application/views/appointments/book_success.php +++ b/src/application/views/appointments/book_success.php @@ -44,6 +44,7 @@ ' . $this->lang->line('appointment_registered') . ''; echo '

' . $this->lang->line('appointment_details_was_sent_to_you') . '

'; + echo '

Book a new appointment

'; if ($this->config->item('ea_google_sync_feature')) { echo ' From 5c55272fed5929999333fb59f4a5b45a45176668 Mon Sep 17 00:00:00 2001 From: "chris.pichardo" Date: Tue, 6 Oct 2015 17:22:41 -0400 Subject: [PATCH 2/2] Added the translation to the book appointment link in wizard --- src/application/views/appointments/book_success.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/application/views/appointments/book_success.php b/src/application/views/appointments/book_success.php index 2dbcd59d..c067cee2 100755 --- a/src/application/views/appointments/book_success.php +++ b/src/application/views/appointments/book_success.php @@ -44,8 +44,9 @@ ' . $this->lang->line('appointment_registered') . ''; echo '

' . $this->lang->line('appointment_details_was_sent_to_you') . '

'; - echo '

Book a new appointment

'; - + echo ' + '.$this->lang->line('go_to_booking_page').''; + if ($this->config->item('ea_google_sync_feature')) { echo '