diff --git a/doc/translations.xls b/doc/translations.xls index 40ea3ffb..c0901ce7 100644 Binary files a/doc/translations.xls and b/doc/translations.xls differ diff --git a/src/application/controllers/appointments.php b/src/application/controllers/appointments.php index fce43330..dd3ae942 100644 --- a/src/application/controllers/appointments.php +++ b/src/application/controllers/appointments.php @@ -494,30 +494,37 @@ class Appointments extends CI_Controller { $available_periods_with_breaks = array(); if (isset($selected_date_working_plan['breaks'])) { - foreach($selected_date_working_plan['breaks'] as $index=>$break) { - // Split the working plan to available time periods that do not - // contain the breaks in them. - $last_break_index = $index - 1; - - if (count($available_periods_with_breaks) === 0) { - $start_hour = $selected_date_working_plan['start']; - $end_hour = $break['start']; - } else { - $start_hour = $selected_date_working_plan['breaks'][$last_break_index]['end']; - $end_hour = $break['start']; + if (count($selected_date_working_plan['breaks'])) { + foreach($selected_date_working_plan['breaks'] as $index=>$break) { + // Split the working plan to available time periods that do not + // contain the breaks in them. + $last_break_index = $index - 1; + + if (count($available_periods_with_breaks) === 0) { + $start_hour = $selected_date_working_plan['start']; + $end_hour = $break['start']; + } else { + $start_hour = $selected_date_working_plan['breaks'][$last_break_index]['end']; + $end_hour = $break['start']; + } + + $available_periods_with_breaks[] = array( + 'start' => $start_hour, + 'end' => $end_hour + ); } - + + // Add the period from the last break to the end of the day. $available_periods_with_breaks[] = array( - 'start' => $start_hour, - 'end' => $end_hour + 'start' => $selected_date_working_plan['breaks'][$index]['end'], + 'end' => $selected_date_working_plan['end'] + ); + } else { + $available_periods_with_breaks[] = array( + 'start' => $selected_date_working_plan['start'], + 'end' => $selected_date_working_plan['end'] ); } - - // Add the period from the last break to the end of the day. - $available_periods_with_breaks[] = array( - 'start' => $selected_date_working_plan['breaks'][$index]['end'], - 'end' => $selected_date_working_plan['end'] - ); } // Break the empty periods with the reserved appointments. diff --git a/src/application/controllers/backend.php b/src/application/controllers/backend.php index dc24c83b..407bf919 100644 --- a/src/application/controllers/backend.php +++ b/src/application/controllers/backend.php @@ -47,8 +47,9 @@ class Backend extends CI_Controller { $view['secretary_providers'] = array(); } - if ($appointment_hash != '') { - $results = $this->appointments_model->get_batch(array('hash' => $appointment_hash)); + + $results = $this->appointments_model->get_batch(array('hash' => $appointment_hash)); + if ($appointment_hash != '' && count($results) > 0) { $appointment = $results[0]; $appointment['customer'] = $this->customers_model->get_row($appointment['id_users_customer']); $view['edit_appointment'] = $appointment; // This will display the appointment edit dialog on page load. diff --git a/src/application/controllers/backend_api.php b/src/application/controllers/backend_api.php index 57d74e16..05ec1807 100644 --- a/src/application/controllers/backend_api.php +++ b/src/application/controllers/backend_api.php @@ -194,7 +194,7 @@ class Backend_api extends CI_Controller { $customer_link = $this->config->item('base_url') . 'appointments/index/' . $appointment['hash']; - $provider_title = 'Appointment details have changed.'; + $provider_title = 'Appointment changes have been successfully saved!'; $provider_message = ''; $provider_link = $this->config->item('base_url') . 'backend/index/' . $appointment['hash']; diff --git a/src/application/views/appointments/book.php b/src/application/views/appointments/book.php index a0d38ad6..1ed15b60 100644 --- a/src/application/views/appointments/book.php +++ b/src/application/views/appointments/book.php @@ -305,7 +305,7 @@ - + diff --git a/src/assets/css/general.css b/src/assets/css/general.css index d9f3ee10..7ccebb2b 100644 --- a/src/assets/css/general.css +++ b/src/assets/css/general.css @@ -22,6 +22,7 @@ body .ui-draggable .ui-dialog-titlebar { body .ui-dialog { padding: 0; + z-index: 2000; } body .ui-dialog .ui-dialog-buttonpane { diff --git a/src/assets/js/backend_calendar.js b/src/assets/js/backend_calendar.js index 0b6bdce0..c32255e5 100644 --- a/src/assets/js/backend_calendar.js +++ b/src/assets/js/backend_calendar.js @@ -144,7 +144,7 @@ var BackendCalendar = { $dialog.find('.modal-header h3').text('Edit Appointment'); $dialog.find('#appointment-id').val(appointment['id']); - $dialog.find('#select-service').val(appointment['id_services']); + $dialog.find('#select-service').val(appointment['id_services']).change(); $dialog.find('#select-provider').val(appointment['id_users_provider']); // Set the start and end datetime of the appointment. @@ -521,15 +521,10 @@ var BackendCalendar = { // :: DEFINE SUCCESS EVENT CALLBACK var successCallback = function(response) { - if (response.exceptions) { - response.exceptions = GeneralFunctions.parseExceptions(response.exceptions); - GeneralFunctions.displayMessageBox(GeneralFunctions.EXCEPTIONS_TITLE, GeneralFunctions.EXCEPTIONS_MESSAGE); - $('#messsage_box').append(GeneralFunctions.exceptionsToHtml(response.exceptions)); - + if (!GeneralFunctions.handleAjaxExceptions(response)) { $dialog.find('.modal-message').text('Unexpected issues occured!'); $dialog.find('.modal-message').addClass('alert-error'); $dialog.find('.modal-message').fadeIn(); - return; } diff --git a/src/index.php b/src/index.php index 92fc0978..68ea945e 100644 --- a/src/index.php +++ b/src/index.php @@ -34,7 +34,7 @@ if (defined('ENVIRONMENT')) { case 'development': error_reporting(E_ALL); - ini_set('display_errors', 1); + ini_set('display_errors', 1); // custom ini method call break; case 'testing': @@ -191,13 +191,6 @@ if (defined('ENVIRONMENT')) define('APPPATH', BASEPATH.$application_folder.'/'); } - -/** - * -------------------------------------------------------------------- - * CHECK IF EASY!APPOINTMENTS IS INSTALLED AND CONFIGURED - * -------------------------------------------------------------------- - */ -// If not show the installer instead of the main page. /* * -------------------------------------------------------------------- diff --git a/src/system/core/CodeIgniter.php b/src/system/core/CodeIgniter.php index c16c79c0..e0819c80 100644 --- a/src/system/core/CodeIgniter.php +++ b/src/system/core/CodeIgniter.php @@ -33,7 +33,7 @@ * @var string * */ - define('CI_VERSION', '2.1.3'); + define('CI_VERSION', '2.1.4'); /** * CodeIgniter Branch (Core = TRUE, Reactor = FALSE) diff --git a/src/system/core/Security.php b/src/system/core/Security.php index 00089d76..b0d39b98 100644 --- a/src/system/core/Security.php +++ b/src/system/core/Security.php @@ -619,17 +619,16 @@ class CI_Security { $count = 0; $attribs = array(); - // find occurrences of illegal attribute strings without quotes - preg_match_all('/('.implode('|', $evil_attributes).')\s*=\s*([^\s>]*)/is', $str, $matches, PREG_SET_ORDER); + // find occurrences of illegal attribute strings with quotes (042 and 047 are octal quotes) + preg_match_all('/('.implode('|', $evil_attributes).')\s*=\s*(\042|\047)([^\\2]*?)(\\2)/is', $str, $matches, PREG_SET_ORDER); foreach ($matches as $attr) { - $attribs[] = preg_quote($attr[0], '/'); } - // find occurrences of illegal attribute strings with quotes (042 and 047 are octal quotes) - preg_match_all("/(".implode('|', $evil_attributes).")\s*=\s*(\042|\047)([^\\2]*?)(\\2)/is", $str, $matches, PREG_SET_ORDER); + // find occurrences of illegal attribute strings without quotes + preg_match_all('/('.implode('|', $evil_attributes).')\s*=\s*([^\s>]*)/is', $str, $matches, PREG_SET_ORDER); foreach ($matches as $attr) { @@ -639,7 +638,7 @@ class CI_Security { // replace illegal attribute strings that are inside an html tag if (count($attribs) > 0) { - $str = preg_replace("/<(\/?[^><]+?)([^A-Za-z<>\-])(.*?)(".implode('|', $attribs).")(.*?)([\s><])([><]*)/i", '<$1 $3$5$6$7', $str, -1, $count); + $str = preg_replace('/()(\/?[^><]+?)([^A-Za-z<>\-])(.*?)('.implode('|', $attribs).')(.*?)([\s><]?)([><]*)/i', '$1$2 $4$6$7$8', $str, -1, $count); } } while ($count); @@ -873,4 +872,4 @@ class CI_Security { } /* End of file Security.php */ -/* Location: ./system/libraries/Security.php */ \ No newline at end of file +/* Location: ./system/libraries/Security.php */ diff --git a/src/system/database/DB_active_rec.php b/src/system/database/DB_active_rec.php index 10febb1f..129eaa7b 100644 --- a/src/system/database/DB_active_rec.php +++ b/src/system/database/DB_active_rec.php @@ -1404,7 +1404,7 @@ class CI_DB_active_record extends CI_DB_driver { } else { - $not[] = $k.'-'.$v; + $not[] = $k2.'-'.$v2; } if ($escape === FALSE) diff --git a/src/system/libraries/Email.php b/src/system/libraries/Email.php index 9ec40af9..d01d5c19 100644 --- a/src/system/libraries/Email.php +++ b/src/system/libraries/Email.php @@ -1954,7 +1954,7 @@ class CI_Email { } } - $msg .= "
".$this->_header_str."\n".htmlspecialchars($this->_subject)."\n".htmlspecialchars($this->_finalbody).''; + $msg .= "
".htmlspecialchars($this->_header_str)."\n".htmlspecialchars($this->_subject)."\n".htmlspecialchars($this->_finalbody).''; return $msg; } diff --git a/src/system/libraries/Migration.php b/src/system/libraries/Migration.php index df2dd7ce..ffa640ba 100644 --- a/src/system/libraries/Migration.php +++ b/src/system/libraries/Migration.php @@ -220,7 +220,7 @@ class CI_Migration { { if ( ! $migrations = $this->find_migrations()) { - $this->_error_string = $this->line->lang('migration_none_found'); + $this->_error_string = $this->lang->line('migration_none_found'); return false; }