* Updated CodeIgniter to version 2.1.4

* Fixed problem with provider availability algorithm.
* Fixed minor css issues.
This commit is contained in:
alextselegidis@gmail.com 2013-12-05 21:53:27 +00:00
parent 342590ef7d
commit d51bb2dd7c
13 changed files with 46 additions and 50 deletions

Binary file not shown.

View file

@ -494,6 +494,7 @@ class Appointments extends CI_Controller {
$available_periods_with_breaks = array(); $available_periods_with_breaks = array();
if (isset($selected_date_working_plan['breaks'])) { if (isset($selected_date_working_plan['breaks'])) {
if (count($selected_date_working_plan['breaks'])) {
foreach($selected_date_working_plan['breaks'] as $index=>$break) { foreach($selected_date_working_plan['breaks'] as $index=>$break) {
// Split the working plan to available time periods that do not // Split the working plan to available time periods that do not
// contain the breaks in them. // contain the breaks in them.
@ -518,6 +519,12 @@ class Appointments extends CI_Controller {
'start' => $selected_date_working_plan['breaks'][$index]['end'], 'start' => $selected_date_working_plan['breaks'][$index]['end'],
'end' => $selected_date_working_plan['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']
);
}
} }
// Break the empty periods with the reserved appointments. // Break the empty periods with the reserved appointments.

View file

@ -47,8 +47,9 @@ class Backend extends CI_Controller {
$view['secretary_providers'] = array(); $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 = $results[0];
$appointment['customer'] = $this->customers_model->get_row($appointment['id_users_customer']); $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. $view['edit_appointment'] = $appointment; // This will display the appointment edit dialog on page load.

View file

@ -194,7 +194,7 @@ class Backend_api extends CI_Controller {
$customer_link = $this->config->item('base_url') . 'appointments/index/' $customer_link = $this->config->item('base_url') . 'appointments/index/'
. $appointment['hash']; . $appointment['hash'];
$provider_title = 'Appointment details have changed.'; $provider_title = 'Appointment changes have been successfully saved!';
$provider_message = ''; $provider_message = '';
$provider_link = $this->config->item('base_url') . 'backend/index/' $provider_link = $this->config->item('base_url') . 'backend/index/'
. $appointment['hash']; . $appointment['hash'];

View file

@ -305,7 +305,7 @@
<input type="text" id="zip-code" maxlength="120" /> <input type="text" id="zip-code" maxlength="120" />
<label for="notes">Notes</label> <label for="notes">Notes</label>
<textarea id="notes" maxlength="500" rows="4"></textarea> <textarea id="notes" maxlength="500" rows="3"></textarea>
</div> </div>
</div> </div>
</div> </div>

View file

@ -22,6 +22,7 @@ body .ui-draggable .ui-dialog-titlebar {
body .ui-dialog { body .ui-dialog {
padding: 0; padding: 0;
z-index: 2000;
} }
body .ui-dialog .ui-dialog-buttonpane { body .ui-dialog .ui-dialog-buttonpane {

View file

@ -144,7 +144,7 @@ var BackendCalendar = {
$dialog.find('.modal-header h3').text('Edit Appointment'); $dialog.find('.modal-header h3').text('Edit Appointment');
$dialog.find('#appointment-id').val(appointment['id']); $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']); $dialog.find('#select-provider').val(appointment['id_users_provider']);
// Set the start and end datetime of the appointment. // Set the start and end datetime of the appointment.
@ -521,15 +521,10 @@ var BackendCalendar = {
// :: DEFINE SUCCESS EVENT CALLBACK // :: DEFINE SUCCESS EVENT CALLBACK
var successCallback = function(response) { var successCallback = function(response) {
if (response.exceptions) { if (!GeneralFunctions.handleAjaxExceptions(response)) {
response.exceptions = GeneralFunctions.parseExceptions(response.exceptions);
GeneralFunctions.displayMessageBox(GeneralFunctions.EXCEPTIONS_TITLE, GeneralFunctions.EXCEPTIONS_MESSAGE);
$('#messsage_box').append(GeneralFunctions.exceptionsToHtml(response.exceptions));
$dialog.find('.modal-message').text('Unexpected issues occured!'); $dialog.find('.modal-message').text('Unexpected issues occured!');
$dialog.find('.modal-message').addClass('alert-error'); $dialog.find('.modal-message').addClass('alert-error');
$dialog.find('.modal-message').fadeIn(); $dialog.find('.modal-message').fadeIn();
return; return;
} }

View file

@ -34,7 +34,7 @@ if (defined('ENVIRONMENT'))
{ {
case 'development': case 'development':
error_reporting(E_ALL); error_reporting(E_ALL);
ini_set('display_errors', 1); ini_set('display_errors', 1); // custom ini method call
break; break;
case 'testing': case 'testing':
@ -192,13 +192,6 @@ if (defined('ENVIRONMENT'))
define('APPPATH', BASEPATH.$application_folder.'/'); define('APPPATH', BASEPATH.$application_folder.'/');
} }
/**
* --------------------------------------------------------------------
* CHECK IF EASY!APPOINTMENTS IS INSTALLED AND CONFIGURED
* --------------------------------------------------------------------
*/
// If not show the installer instead of the main page.
/* /*
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* LOAD THE BOOTSTRAP FILE * LOAD THE BOOTSTRAP FILE

View file

@ -33,7 +33,7 @@
* @var string * @var string
* *
*/ */
define('CI_VERSION', '2.1.3'); define('CI_VERSION', '2.1.4');
/** /**
* CodeIgniter Branch (Core = TRUE, Reactor = FALSE) * CodeIgniter Branch (Core = TRUE, Reactor = FALSE)

View file

@ -619,17 +619,16 @@ class CI_Security {
$count = 0; $count = 0;
$attribs = array(); $attribs = array();
// find occurrences of illegal attribute strings without quotes // find occurrences of illegal attribute strings with quotes (042 and 047 are octal quotes)
preg_match_all('/('.implode('|', $evil_attributes).')\s*=\s*([^\s>]*)/is', $str, $matches, PREG_SET_ORDER); preg_match_all('/('.implode('|', $evil_attributes).')\s*=\s*(\042|\047)([^\\2]*?)(\\2)/is', $str, $matches, PREG_SET_ORDER);
foreach ($matches as $attr) foreach ($matches as $attr)
{ {
$attribs[] = preg_quote($attr[0], '/'); $attribs[] = preg_quote($attr[0], '/');
} }
// find occurrences of illegal attribute strings with quotes (042 and 047 are octal quotes) // find occurrences of illegal attribute strings without quotes
preg_match_all("/(".implode('|', $evil_attributes).")\s*=\s*(\042|\047)([^\\2]*?)(\\2)/is", $str, $matches, PREG_SET_ORDER); preg_match_all('/('.implode('|', $evil_attributes).')\s*=\s*([^\s>]*)/is', $str, $matches, PREG_SET_ORDER);
foreach ($matches as $attr) foreach ($matches as $attr)
{ {
@ -639,7 +638,7 @@ class CI_Security {
// replace illegal attribute strings that are inside an html tag // replace illegal attribute strings that are inside an html tag
if (count($attribs) > 0) 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); } while ($count);

View file

@ -1404,7 +1404,7 @@ class CI_DB_active_record extends CI_DB_driver {
} }
else else
{ {
$not[] = $k.'-'.$v; $not[] = $k2.'-'.$v2;
} }
if ($escape === FALSE) if ($escape === FALSE)

View file

@ -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; return $msg;
} }

View file

@ -220,7 +220,7 @@ class CI_Migration {
{ {
if ( ! $migrations = $this->find_migrations()) 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; return false;
} }