diff --git a/src/application/controllers/Appointments.php b/src/application/controllers/Appointments.php index a13bdbbe..66e1cc42 100755 --- a/src/application/controllers/Appointments.php +++ b/src/application/controllers/Appointments.php @@ -479,15 +479,37 @@ class Appointments extends CI_Controller { $customer['id'] = $this->customers_model->find_record_id($customer); } + $provider = $this->providers_model->get_row($appointment['id_users_provider']); + $service = $this->services_model->get_row($appointment['id_services']); + + if (empty($appointment['location'])) { + $location = []; + + if (!empty($provider['address'])) { + $location[] = $provider['address']; + } + + if (!empty($provider['city'])) { + $location[] = $provider['city']; + } + + if (!empty($provider['state'])) { + $location[] = $provider['state']; + } + + if (!empty($provider['zip_code'])) { + $location[] = $provider['zip_code']; + } + + $appointment['location'] = implode(', ', $location); + } + $customer_id = $this->customers_model->add($customer); $appointment['id_users_customer'] = $customer_id; $appointment['is_unavailable'] = (int)$appointment['is_unavailable']; // needs to be type casted $appointment['id'] = $this->appointments_model->add($appointment); $appointment['hash'] = $this->appointments_model->get_value('hash', $appointment['id']); - $provider = $this->providers_model->get_row($appointment['id_users_provider']); - $service = $this->services_model->get_row($appointment['id_services']); - $company_settings = [ 'company_name' => $this->settings_model->get_setting('company_name'), 'company_link' => $this->settings_model->get_setting('company_link'), diff --git a/src/application/controllers/Google.php b/src/application/controllers/Google.php index 3a350443..933f9883 100644 --- a/src/application/controllers/Google.php +++ b/src/application/controllers/Google.php @@ -190,7 +190,8 @@ class Google extends CI_Controller { $event_start = strtotime($google_event->getStart()->getDateTime()); $event_end = strtotime($google_event->getEnd()->getDateTime()); - if ($appt_start != $event_start || $appt_end != $event_end) + if ($appt_start != $event_start || $appt_end != $event_end + || $appointment['notes'] !== $google_event->getDescription()) { $is_different = TRUE; } @@ -199,6 +200,7 @@ class Google extends CI_Controller { { $appointment['start_datetime'] = date('Y-m-d H:i:s', $event_start); $appointment['end_datetime'] = date('Y-m-d H:i:s', $event_end); + $appointment['notes'] = $google_event->getDescription(); $this->appointments_model->add($appointment); } @@ -226,6 +228,7 @@ class Google extends CI_Controller { 'start_datetime' => date('Y-m-d H:i:s', strtotime($event->start->getDateTime())), 'end_datetime' => date('Y-m-d H:i:s', strtotime($event->end->getDateTime())), 'is_unavailable' => TRUE, + 'location' => $event->getLocation(), 'notes' => $event->getSummary() . ' ' . $event->getDescription(), 'id_users_provider' => $provider_id, 'id_google_calendar' => $event->getId(), diff --git a/src/application/language/arabic/translations_lang.php b/src/application/language/arabic/translations_lang.php index 712363dd..641ad909 100755 --- a/src/application/language/arabic/translations_lang.php +++ b/src/application/language/arabic/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/bulgarian/translations_lang.php b/src/application/language/bulgarian/translations_lang.php index 34256468..38e182c3 100755 --- a/src/application/language/bulgarian/translations_lang.php +++ b/src/application/language/bulgarian/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/chinese/translations_lang.php b/src/application/language/chinese/translations_lang.php index e14c9d6b..7302958d 100755 --- a/src/application/language/chinese/translations_lang.php +++ b/src/application/language/chinese/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/danish/translations_lang.php b/src/application/language/danish/translations_lang.php index 593f7a53..0d301b9b 100755 --- a/src/application/language/danish/translations_lang.php +++ b/src/application/language/danish/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/dutch/translations_lang.php b/src/application/language/dutch/translations_lang.php index 20827257..e9b0cdc7 100755 --- a/src/application/language/dutch/translations_lang.php +++ b/src/application/language/dutch/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/english/translations_lang.php b/src/application/language/english/translations_lang.php index 551aeb61..33dc74e3 100755 --- a/src/application/language/english/translations_lang.php +++ b/src/application/language/english/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/finnish/translations_lang.php b/src/application/language/finnish/translations_lang.php index cb7d51f1..8ec16de6 100755 --- a/src/application/language/finnish/translations_lang.php +++ b/src/application/language/finnish/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/french/translations_lang.php b/src/application/language/french/translations_lang.php index cb1ea145..36f5f59c 100755 --- a/src/application/language/french/translations_lang.php +++ b/src/application/language/french/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'J\'ai lu, compris et accepte la {$l $lang['delete_personal_information_hint'] = 'Effacer toutes vos données personnelles du système.'; $lang['delete_personal_information'] = 'Effacer toutes mes données personnelles'; $lang['delete_personal_information_prompt'] = 'Etes-vous sûr(e) de vouloir effacer toutes vos données personnelles ? Cette action est irréversible.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/german/translations_lang.php b/src/application/language/german/translations_lang.php index c1ff67cd..f252cd01 100755 --- a/src/application/language/german/translations_lang.php +++ b/src/application/language/german/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'Ich habe die {$link}Datenschutzerkl $lang['delete_personal_information_hint'] = 'Alle persönlichen Informationen aus dem System löschen.'; $lang['delete_personal_information'] = 'Persönlichen Informationen löschen'; $lang['delete_personal_information_prompt'] = 'Sind Sie sicher, dass Sie Ihre persönlichen Daten löschen möchten? Diese Aktion kann nicht rückgängig gemacht werden.'; +$lang['location'] = 'Ort'; diff --git a/src/application/language/greek/translations_lang.php b/src/application/language/greek/translations_lang.php index 607726ba..b2e234a7 100755 --- a/src/application/language/greek/translations_lang.php +++ b/src/application/language/greek/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'Διάβασα και αποδέχ $lang['delete_personal_information_hint'] = 'Διαγραφή όλων των προσωπικών πληροφοριών από το σύστημα.'; $lang['delete_personal_information'] = 'Διαγραφή Προσωπικών Πληροφοριών'; $lang['delete_personal_information_prompt'] = 'Είστε σίγουρος ότι θέλετε να διαγράψετε τις προσωπικές σας πληροφορίες; Αυτή η ενέργεια δεν μπορεί να αναιρεθεί.'; +$lang['location'] = 'Τοποθεσία'; diff --git a/src/application/language/hindi/translations_lang.php b/src/application/language/hindi/translations_lang.php index 39e912e3..abea1d55 100755 --- a/src/application/language/hindi/translations_lang.php +++ b/src/application/language/hindi/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/hungarian/translations_lang.php b/src/application/language/hungarian/translations_lang.php index 1b07fb87..4e074324 100755 --- a/src/application/language/hungarian/translations_lang.php +++ b/src/application/language/hungarian/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/italian/translations_lang.php b/src/application/language/italian/translations_lang.php index 8911eded..b4625602 100755 --- a/src/application/language/italian/translations_lang.php +++ b/src/application/language/italian/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/japanese/translations_lang.php b/src/application/language/japanese/translations_lang.php index be8d7909..9087afe6 100755 --- a/src/application/language/japanese/translations_lang.php +++ b/src/application/language/japanese/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/luxembourgish/translations_lang.php b/src/application/language/luxembourgish/translations_lang.php index d742dc4d..91dd0e14 100755 --- a/src/application/language/luxembourgish/translations_lang.php +++ b/src/application/language/luxembourgish/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/polish/translations_lang.php b/src/application/language/polish/translations_lang.php index 1066dbe1..d04c6533 100755 --- a/src/application/language/polish/translations_lang.php +++ b/src/application/language/polish/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/portuguese-br/translations_lang.php b/src/application/language/portuguese-br/translations_lang.php index 3ba9c118..390d25bb 100755 --- a/src/application/language/portuguese-br/translations_lang.php +++ b/src/application/language/portuguese-br/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/portuguese/translations_lang.php b/src/application/language/portuguese/translations_lang.php index 15b29a0e..6a5ee8e4 100755 --- a/src/application/language/portuguese/translations_lang.php +++ b/src/application/language/portuguese/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/romanian/translations_lang.php b/src/application/language/romanian/translations_lang.php index 7c9a63a3..cb06b90c 100755 --- a/src/application/language/romanian/translations_lang.php +++ b/src/application/language/romanian/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/russian/translations_lang.php b/src/application/language/russian/translations_lang.php index 2076bfd5..a1f4817a 100755 --- a/src/application/language/russian/translations_lang.php +++ b/src/application/language/russian/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/slovak/translations_lang.php b/src/application/language/slovak/translations_lang.php index 3881b6bb..2f3214ae 100755 --- a/src/application/language/slovak/translations_lang.php +++ b/src/application/language/slovak/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/spanish/translations_lang.php b/src/application/language/spanish/translations_lang.php index e3f2ea3c..cffc8b93 100755 --- a/src/application/language/spanish/translations_lang.php +++ b/src/application/language/spanish/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/language/turkish/translations_lang.php b/src/application/language/turkish/translations_lang.php index 35f199be..1e77b547 100755 --- a/src/application/language/turkish/translations_lang.php +++ b/src/application/language/turkish/translations_lang.php @@ -297,3 +297,4 @@ $lang['read_and_agree_to_privacy_policy'] = 'I have read and agree to the {$link $lang['delete_personal_information_hint'] = 'Delete all personal information from the system.'; $lang['delete_personal_information'] = 'Delete Personal Information'; $lang['delete_personal_information_prompt'] = 'Are you sure that you want to delete your personal information? This action cannot be undone.'; +$lang['location'] = 'Location'; diff --git a/src/application/libraries/Google_sync.php b/src/application/libraries/Google_sync.php index b6f8b4fd..55209ce5 100644 --- a/src/application/libraries/Google_sync.php +++ b/src/application/libraries/Google_sync.php @@ -142,7 +142,8 @@ class Google_Sync { $event = new Google_Event(); $event->setSummary(($service != NULL) ? $service['name'] : 'Unavailable'); - $event->setLocation($company_settings['company_name']); + $event->setDescription($appointment['notes']); + $event->setLocation($appointment['location']); $start = new Google_EventDateTime(); $start->setDateTime(date3339(strtotime($appointment['start_datetime']))); @@ -199,7 +200,8 @@ class Google_Sync { $appointment['id_google_calendar']); $event->setSummary($service['name']); - $event->setLocation($company_settings['company_name']); + $event->setDescription($appointment['notes']); + $event->setLocation($appointment['location']); $start = new Google_EventDateTime(); $start->setDateTime(date3339(strtotime($appointment['start_datetime']))); diff --git a/src/application/views/backend/calendar.php b/src/application/views/backend/calendar.php index b0e0afe6..c02b1086 100755 --- a/src/application/views/backend/calendar.php +++ b/src/application/views/backend/calendar.php @@ -173,6 +173,11 @@ + +