mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-22 06:32:24 +03:00
* Updated CodeIgniter to version 2.1.4
* Fixed problem with provider availability algorithm. * Fixed minor css issues.
This commit is contained in:
parent
342590ef7d
commit
d51bb2dd7c
13 changed files with 46 additions and 50 deletions
Binary file not shown.
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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'];
|
||||
|
|
|
@ -305,7 +305,7 @@
|
|||
<input type="text" id="zip-code" maxlength="120" />
|
||||
|
||||
<label for="notes">Notes</label>
|
||||
<textarea id="notes" maxlength="500" rows="4"></textarea>
|
||||
<textarea id="notes" maxlength="500" rows="3"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -22,6 +22,7 @@ body .ui-draggable .ui-dialog-titlebar {
|
|||
|
||||
body .ui-dialog {
|
||||
padding: 0;
|
||||
z-index: 2000;
|
||||
}
|
||||
|
||||
body .ui-dialog .ui-dialog-buttonpane {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
* @var string
|
||||
*
|
||||
*/
|
||||
define('CI_VERSION', '2.1.3');
|
||||
define('CI_VERSION', '2.1.4');
|
||||
|
||||
/**
|
||||
* CodeIgniter Branch (Core = TRUE, Reactor = FALSE)
|
||||
|
|
|
@ -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 */
|
||||
/* Location: ./system/libraries/Security.php */
|
||||
|
|
|
@ -1404,7 +1404,7 @@ class CI_DB_active_record extends CI_DB_driver {
|
|||
}
|
||||
else
|
||||
{
|
||||
$not[] = $k.'-'.$v;
|
||||
$not[] = $k2.'-'.$v2;
|
||||
}
|
||||
|
||||
if ($escape === FALSE)
|
||||
|
|
|
@ -1954,7 +1954,7 @@ class CI_Email {
|
|||
}
|
||||
}
|
||||
|
||||
$msg .= "<pre>".$this->_header_str."\n".htmlspecialchars($this->_subject)."\n".htmlspecialchars($this->_finalbody).'</pre>';
|
||||
$msg .= "<pre>".htmlspecialchars($this->_header_str)."\n".htmlspecialchars($this->_subject)."\n".htmlspecialchars($this->_finalbody).'</pre>';
|
||||
return $msg;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue