* Fixed bugs in backend and front end (booking process)

* Made css changes to backend. 
* Applied qtip into backend control tootips.
This commit is contained in:
alextselegidis@gmail.com 2013-10-18 14:56:12 +00:00
parent 8f90da86be
commit 8da6304f26
18 changed files with 312 additions and 129 deletions

View file

@ -20,6 +20,7 @@ include dirname(dirname(dirname(__FILE__))) . '/configuration.php';
require_once dirname(dirname(dirname(__FILE__))) . '/configuration.php';
$config['base_url'] = SystemConfiguration::$base_url;
$config['ea_version'] = '0.6'; // This must be changed manually.
$config['ea_release_title'] = 'Alpha'; // Leave empty for no title or add BETA, TEST etc ...
/*
|--------------------------------------------------------------------------

View file

@ -303,6 +303,8 @@ class Appointments extends CI_Controller {
* available hours we want to see.
* @param numeric $_POST['service_duration'] The selected service duration in
* minutes.
* @param string $$_POST['manage_mode'] Contains either 'true' or 'false' and determines
* the if current user is managing an already booked appointment or not.
* @return Returns a json object with the available hours.
*/
public function ajax_get_available_hours() {
@ -320,16 +322,15 @@ class Appointments extends CI_Controller {
$empty_periods = $this->get_provider_available_time_periods($_POST['provider_id'],
$_POST['selected_date'], $exclude_appointments);
// Calculate the available appointment hours for the given date.
// The empty spaces are broken down to 15 min and if the service
// fit in each quarter then a new available hour is added to the
// $available hours array.
// Calculate the available appointment hours for the given date. The empty spaces
// are broken down to 15 min and if the service fit in each quarter then a new
// available hour is added to the "$available_hours" array.
$available_hours = array();
foreach($empty_periods as $period) {
foreach ($empty_periods as $period) {
$start_hour = new DateTime($_POST['selected_date'] . ' ' . $period['start']);
$end_hour = new DateTime($_POST['selected_date'] . ' ' . $period['end']);
$end_hour = new DateTime($_POST['selected_date'] . ' ' . $period['end']);
$minutes = $start_hour->format('i');
@ -347,13 +348,13 @@ class Appointments extends CI_Controller {
}
}
$curr_hour = $start_hour;
$diff = $curr_hour->diff($end_hour);
$current_hour = $start_hour;
$diff = $current_hour->diff($end_hour);
while(($diff->h * 60 + $diff->i) > intval($_POST['service_duration'])) {
$available_hours[] = $curr_hour->format('H:i');
$curr_hour->add(new DateInterval("PT15M"));
$diff = $curr_hour->diff($end_hour);
while (($diff->h * 60 + $diff->i) > intval($_POST['service_duration'])) {
$available_hours[] = $current_hour->format('H:i');
$current_hour->add(new DateInterval("PT15M"));
$diff = $current_hour->diff($end_hour);
}
}
@ -366,15 +367,12 @@ class Appointments extends CI_Controller {
if ($_POST['manage_mode'] === 'true') {
$book_advance_timeout = 0;
} else {
$book_advance_timeout = $this->settings_model->get_setting(
'book_advance_timeout');
$book_advance_timeout = $this->settings_model->get_setting('book_advance_timeout');
}
foreach($available_hours as $index=>$value) {
foreach($available_hours as $index => $value) {
$available_hour = strtotime($value);
$current_hour = strtotime('+' . $book_advance_timeout . ' minutes',
strtotime('now'));
$current_hour = strtotime('+' . $book_advance_timeout . ' minutes', strtotime('now'));
if ($available_hour <= $current_hour) {
unset($available_hours[$index]);
}
@ -382,12 +380,11 @@ class Appointments extends CI_Controller {
}
$available_hours = array_values($available_hours);
echo json_encode($available_hours);
} catch(Exception $exc) {
echo json_encode(array(
'exceptions' => array( exceptionToJavaScript($exc) )
'exceptions' => array(exceptionToJavaScript($exc))
));
}
}
@ -463,8 +460,7 @@ class Appointments extends CI_Controller {
$this->load->model('providers_model');
// Get the provider's working plan and reserved appointments.
$working_plan = json_decode($this->providers_model->get_setting('working_plan',
$provider_id), true);
$working_plan = json_decode($this->providers_model->get_setting('working_plan', $provider_id), true);
$where_clause = array(
'DATE(start_datetime)' => date('Y-m-d', strtotime($selected_date)),
@ -474,10 +470,10 @@ class Appointments extends CI_Controller {
$reserved_appointments = $this->appointments_model->get_batch($where_clause);
// Sometimes it might be necessary to not take into account some appointment records
// in order to display what the providers available time periods would be without them.
foreach($exclude_appointments as $excluded_appointment) {
foreach($reserved_appointments as $index=>$appointment) {
if ($appointment['id'] == $excluded_appointment['id']) {
// in order to display what the providers' available time periods would be without them.
foreach ($exclude_appointments as $excluded_id) {
foreach ($reserved_appointments as $index => $reserved) {
if ($reserved['id'] == $excluded_id) {
unset($reserved_appointments[$index]);
}
}
@ -523,9 +519,9 @@ class Appointments extends CI_Controller {
foreach($available_periods_with_breaks as $period) {
foreach($reserved_appointments as $index=>$appointment) {
$appointment_start = date('H:i', strtotime($appointment['start_datetime']));
$appointment_end = date('H:i', strtotime($appointment['end_datetime']));
foreach($reserved_appointments as $index=>$reserved) {
$appointment_start = date('H:i', strtotime($reserved['start_datetime']));
$appointment_end = date('H:i', strtotime($reserved['end_datetime']));
$period_start = date('H:i', strtotime($period['start']));
$period_end = date('H:i', strtotime($period['end']));

View file

@ -187,7 +187,7 @@ class Backend_api extends CI_Controller {
$provider_title = 'A new appointment has been added to your plan.';
$provider_message = 'You can make changes by clicking the appointment '
. 'link below';
$provider_link = $this->config->item('base_url') . 'backend/'
$provider_link = $this->config->item('base_url') . 'backend/index/'
. $appointment['hash'];
} else {
$customer_title = 'Appointment changes have been successfully saved!';

View file

@ -28,6 +28,10 @@
rel="stylesheet"
type="text/css"
href="<?php echo $this->config->base_url(); ?>assets/css/frontend.css">
<link
rel="stylesheet"
type="text/css"
href="<?php echo $this->config->base_url(); ?>assets/css/general.css">
<?php
// ------------------------------------------------------------

View file

@ -3,7 +3,14 @@
Powered by
<a href="http://easyappointments.org">
Easy!Appointments
v<?php echo $this->config->item('ea_version'); ?>
<?php
echo 'v' . $this->config->item('ea_version');
$release_title = $this->config->item('ea_release_title');
if ($release_title != '') {
echo ' - ' . $release_title;
}
?>
</a> |
Licensed Under GPLv3
</div>

View file

@ -129,8 +129,9 @@
<?php // LOGOUT MENU ITEM
// ------------------------------------------------------ ?>
<a href="<?php echo $base_url; ?>user/logout" class="menu-item">
Logout
<a href="<?php echo $base_url; ?>user/logout" class="menu-item"
title="Log out of the system.">
Log Out
</a>
</div>

View file

@ -81,22 +81,22 @@
<input type="hidden" id="service-id" />
<label for="service-name">Name *</label>
<input type="text" id="service-name" class="span6 required" />
<input type="text" id="service-name" class="span12 required" />
<label for="service-duration">Duration (Minutes) *</label>
<input type="text" id="service-duration" class="required" />
<label for="service-price">Price *</label>
<input type="text" id="service-price" class="required" />
<input type="text" id="service-price" class="span12 required" />
<label for="service-currency">Currency</label>
<input type="text" id="service-currency" class="" />
<input type="text" id="service-currency" class="span12" />
<label for="service-category">Category</label>
<select id="service-category"></select>
<select id="service-category" class="span12"></select>
<label for="service-description">Description</label>
<textarea id="service-description" rows="4" class="span6"></textarea>
<textarea id="service-description" rows="4" class="span12"></textarea>
<br/><br/>
<em id="form-message" class="text-error">Fields with * are required!</em>
@ -158,10 +158,10 @@
<input type="hidden" id="category-id" />
<label for="category-name">Name *</label>
<input type="text" id="category-name" class="span7 required" />
<input type="text" id="category-name" class="span12 required" />
<label for="category-description">Description</label>
<textarea id="category-description" rows="4" class="span7"></textarea>
<textarea id="category-description" rows="4" class="span12"></textarea>
</div>
</div>
</div>

View file

@ -39,7 +39,7 @@
<?php } ?>
<?php if ($privileges[PRIV_USER_SETTINGS]['view'] == TRUE) { ?>
<li class="user-tab tab"><a>User</a></li>
<li class="user-tab tab"><a>Current User</a></li>
<?php } ?>
</ul>
@ -61,31 +61,33 @@
<?php } ?>
</legend>
<label for="company-name">Company Name *</label>
<input type="text" id="company-name" data-field="company_name" class="required span4">
<span class="help-block">Company name will be displayed everywhere on the system
(required).</span>
<br>
<label for="company-email">Company Email *</label>
<input type="text" id="company-email" data-field="company_email" class="required span4">
<span class="help-block">This will be the company email address. It will be used
as the sender and the reply address of the system emails (required).</span>
<br>
<label for="company-link">Company Link *</label>
<input type="text" id="company-link" data-field="company_link" class="required span4">
<span class="help-block">Company link should point to the official website of
the company (optional).</span>
<br>
<a href="<?php echo $this->config->base_url(); ?>" target="_blank" class="btn btn-info">
<i class="icon-calendar icon-white"></i>
Go To Booking Page
</a>
<div class="wrapper">
<label for="company-name">Company Name *</label>
<input type="text" id="company-name" data-field="company_name" class="required span12">
<span class="help-block">Company name will be displayed everywhere on the system
(required).</span>
<br>
<label for="company-email">Company Email *</label>
<input type="text" id="company-email" data-field="company_email" class="required span12">
<span class="help-block">This will be the company email address. It will be used
as the sender and the reply address of the system emails (required).</span>
<br>
<label for="company-link">Company Link *</label>
<input type="text" id="company-link" data-field="company_link" class="required span12">
<span class="help-block">Company link should point to the official website of
the company (optional).</span>
<br>
<a href="<?php echo $this->config->base_url(); ?>" target="_blank" class="btn btn-info">
<i class="icon-calendar icon-white"></i>
Go To Booking Page
</a>
</div>
</fieldset>
</form>
</div>
@ -109,7 +111,7 @@
</legend>
<div class="row-fluid">
<div class="span7">
<div class="span7 working-plan-wrapper">
<h4>Working Plan</h4>
<span class="help-block">
Mark below the days and hours that your company will accept appointments.
@ -179,7 +181,7 @@
<input type="text" id="book-advance-timeout" data-field="book_advance_timeout" />
</div>
<div class="span5">
<div class="span5 breaks-wrapper">
<h4>Breaks</h4>
<span class="help-block">
@ -224,7 +226,7 @@
<?php $hidden = ($privileges[PRIV_USER_SETTINGS]['view'] == TRUE) ? '' : 'hidden'; ?>
<div id="user" class="tab-content <?php echo $hidden; ?>">
<form class="row-fluid">
<fieldset class="span5">
<fieldset class="span5 personal-info-wrapper">
<legend>
Personal Info
<?php if ($privileges[PRIV_USER_SETTINGS]['edit'] == TRUE) { ?>
@ -265,7 +267,7 @@
<textarea id="notes" class="span9" rows="3"></textarea>
</fieldset>
<fieldset class="span5">
<fieldset class="span5 miscellaneous-wrapper">
<legend>Miscellaneous</legend>
<label for="username">Username *</label>

View file

@ -28,10 +28,12 @@ root {
}
#header #header-logo span {
float: left;
font-size: 20px;
color: white;
margin-top: 16px;
float: left;
font-size: 20px;
color: white;
margin-top: 16px;
font-weight: bold;
text-shadow: 1px 1px 0px rgb(32, 99, 48);
}
#header #header-menu {
@ -41,25 +43,28 @@ root {
}
#header #header-menu .menu-item {
float: left;
margin-right: 8px;
margin-top: 10px;
padding: 15px 12px;
min-width: 68px;
text-align: center;
font-weight: bold;
color: #FFF;
float: left;
margin-right: 8px;
margin-top: 11px;
padding: 13px 12px;
min-width: 68px;
text-align: center;
font-weight: bold;
color: #FFF;
text-decoration: none;
font-size: 16px;
font-size: 16px;
border-radius: 3px;
}
#header #header-menu .menu-item:hover:not(.active) {
background-color: #247A4B;
background-color: #2A8F57;
border-bottom: 2px solid #2E7244;
}
#header #header-menu .active {
color: #E7FFB3;
text-shadow: 1px 1px 0px #57814D;
color: #C5FFD6;
background: #29A067;
border-bottom: 2px solid #2A7751;
}
#footer {
@ -154,6 +159,13 @@ body .ui-dialog .ui-dialog-buttonpane {
background: #FFFFC2 !important;
}
.working-plan td {
vertical-align: middle;
}
.breaks td {
vertical-align: middle;
}
/* BACKEND CALENDAR PAGE
-------------------------------------------------------------------- */
@ -278,8 +290,13 @@ body .ui-dialog .ui-dialog-buttonpane {
/* BACKEND CUSTOMERS PAGE
-------------------------------------------------------------------- */
#customers-page h2 {
color: #525252;
}
#customers-page #filter-customers {
margin: 15px 0px 15px 15px;
width: 350px;
}
#customers-page .filter-records .results {
@ -289,11 +306,11 @@ body .ui-dialog .ui-dialog-buttonpane {
}
#customers-page #filter-customers .results .customer-row {
padding: 10px 7px; border-radius: 3px;
padding: 10px 7px;
}
#customers-page #filter-customers .results .customer-row:hover {
background-color: #C6E7D5;
#customers-page #filter-customers .results .customer-row:hover:not(.selected-row) {
background-color: #F3F3F3;
cursor: pointer;
}
@ -303,6 +320,7 @@ body .ui-dialog .ui-dialog-buttonpane {
#customers-page .details {
margin: 15px 0 15px 15px;
max-width: 710px;
}
#customers-page .details .btn-toolbar {
@ -315,22 +333,32 @@ body .ui-dialog .ui-dialog-buttonpane {
#customers-page #customer-appointments {
height: 250px;
border: 1px solid #CCC;
border-radius: 3px;
width: 330px;
border: 4px solid #E2E2E2;
margin-bottom: 20px;
overflow-y: auto;
}
#customers-page #customer-appointments .appointment-row {
padding: 7px;
border-bottom: 1px solid #CCC;
border-bottom: 4px solid #E2E2E2;;
}
#customers-page #customer-appointments .appointment-row:hover {
background-color: #C6E7D5;
#customers-page #customer-appointments .appointment-row:hover:not(.selected-row) {
background-color: #F3F3F3;
cursor: pointer;
}
#customers-page #appointment-details {
width: 338px;
}
#customers-page #appointment-details div {
padding: 10px;
background: #F8F8F8;
border-bottom: 4px solid #EEE;
}
#customers-page .details input,
#customers-page .details textarea {
background-color: white;
@ -338,12 +366,16 @@ body .ui-dialog .ui-dialog-buttonpane {
}
#customers-page .selected-row {
background-color: #EFFDF7;
background-color: #CBFFD8;
}
/* BACKEND SERVICES PAGE
-------------------------------------------------------------------- */
#services-page h2 {
color: #525252;
}
#services-page .tab-content {
margin: 15px;
}
@ -356,6 +388,10 @@ body .ui-dialog .ui-dialog-buttonpane {
cursor: pointer;
}
#services-page .filter-records {
width: 350px;
}
#services-page .filter-records .results {
overflow-y: auto;
max-height: 650px;
@ -364,16 +400,15 @@ body .ui-dialog .ui-dialog-buttonpane {
#services-page .service-row {
padding: 10px 7px;
border-radius: 3px;
}
#services-page .service-row:hover {
#services-page .service-row:hover:not(.selected-row) {
cursor: pointer;
background-color: #C6E7D5;
background-color: #F3F3F3;
}
#services-page .selected-row {
background-color: #EFFDF7;
background-color: #CBFFD8;
}
#services-page .filter-records .results hr {
@ -406,11 +441,10 @@ body .ui-dialog .ui-dialog-buttonpane {
#services-page #categories .category-row {
padding: 10px 7px;
border-radius: 3px;
}
#services-page #categories .category-row:hover {
background-color: #C6E7D5;
#services-page #categories .category-row:hover:not(.selected-row) {
background-color: #F3F3F3;
cursor: pointer;
}
@ -421,8 +455,16 @@ body .ui-dialog .ui-dialog-buttonpane {
box-shadow: none;
}
#services-page .details {
max-width: 370px;
}
/* BACKEND USERS PAGE
-------------------------------------------------------------------- */
#users-page h2 {
color: #525252;
}
#users-page .tab-content {
margin: 15px;
}
@ -435,6 +477,10 @@ body .ui-dialog .ui-dialog-buttonpane {
cursor: pointer;
}
#users-page .filter-records {
width: 380px;
}
#users-page .filter-records .results {
overflow-y: auto;
max-height: 650px;
@ -445,25 +491,24 @@ body .ui-dialog .ui-dialog-buttonpane {
#users-page .provider-row,
#users-page .admin-row {
padding: 10px 7px;
border-radius: 3px;
}
#users-page .secretary-row:hover,
#users-page .provider-row:hover,
#users-page .admin-row:hover {
#users-page .secretary-row:hover:not(.selected-row),
#users-page .provider-row:hover:not(.selected-row),
#users-page .admin-row:hover:not(.selected-row) {
cursor: pointer;
background-color: #C6E7D5;
background-color: #F3F3F3;
}
#users-page .selected-row {
background-color: #EFFDF7;
background-color: #CBFFD8;
}
#users-page .details input,
#users-page .details select,
#users-page .details textarea {
background-color: white;
cursor: pointer;
cursor: pointer;
}
#users-page #secretary-notifications.active,
@ -475,8 +520,8 @@ body .ui-dialog .ui-dialog-buttonpane {
#users-page #secretary-providers,
#users-page #provider-services {
border: 2px solid #ccc;
width: 320px;
border: 4px solid #ccc;
width: 340px;
height: 140px;
overflow-y: scroll;
padding: 7px;
@ -510,7 +555,7 @@ body .ui-dialog .ui-dialog-buttonpane {
#users-page #providers .switch-view .current {
color: #FFF;
background: #95E4A8;
background: #95E4A8;
}
#users-page #providers .details-view,
@ -536,8 +581,22 @@ padding: 4px 7px;
#users-page .filter-records .results hr {
margin: 5px 0;
}
#users-page .details {
max-width: 700px;
}
#users-page .working-plan td input[type="text"] {
width: 85px;
margin-bottom: 0px;
}
/* BACKEND SETTINGS PAGE
-------------------------------------------------------------------- */
#settings-page h2 {
color: #525252;
}
#settings-page .tab-content {
margin: 15px;
}
@ -553,6 +612,7 @@ padding: 4px 7px;
#business-logic .working-plan td input[type="text"] {
margin-bottom: 0;
cursor: pointer;
width: 85px;
}
#business-logic .working-plan label.checkbox {
@ -581,13 +641,35 @@ padding: 4px 7px;
#business-logic #book-advance-timeout {
margin: 0;
width: 131px;
}
#business-logic .ui-spinner {
border: none;
width: 145px;
}
#settings-page #user-notifications.active {
background: #B6DCFF;
box-shadow: none;
}
#settings-page #general fieldset .wrapper {
max-width: 400px;
}
#settings-page .working-plan-wrapper {
max-width: 600px;
}
#settings-page .breaks-wrapper {
max-width: 500px;
}
#settings-page .personal-info-wrapper {
max-width: 400px;
}
#settings-page .miscellaneous-wrapper {
max-width: 400px;
}

View file

@ -1,3 +1,12 @@
body .custom-qtip {
border: 2px solid #AFD8C1;
background: #EFFDF6;
font-size: 12px;
line-height: 20px;
color: #258D53;
border-radius: 6px;
}
/* JQUERY UI DATETIME PICKER ADDON
------------------------------------------------------------------------- */
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }

View file

@ -13,6 +13,16 @@ $(document).ready(function() {
$(document).ajaxStop(function() {
$('#loading').hide();
});
$('.menu-item').qtip({
position: {
my: 'top center',
at: 'bottom center'
},
style: {
classes: 'qtip-green qtip-shadow custom-qtip'
}
});
});
/**

View file

@ -101,6 +101,10 @@ var BackendCalendar = {
$('#select-filter-item').prop('disabled', true);
}
if (GlobalVariables.user.role_slug == Backend.DB_SLUG_SECRETARY) {
$('#select-filter-item optgroup:eq(1)').remove();
}
if (GlobalVariables.user.role_slug == Backend.DB_SLUG_SECRETARY) {
// Remove the providers that are not connected to the secretary.
$('#select-filter-item option[type="provider"]').each(function(index, option) {
@ -160,6 +164,27 @@ var BackendCalendar = {
$dialog.modal('show');
}
// Apply qtip to control tooltips.
$('#calendar-toolbar button').qtip({
position: {
my: 'top center',
at: 'bottom center'
},
style: {
classes: 'qtip-green qtip-shadow custom-qtip'
}
});
$('#select-filter-item').qtip({
position: {
my: 'middle left',
at: 'middle right'
},
style: {
classes: 'qtip-green qtip-shadow custom-qtip'
}
});
},
/**
@ -380,8 +405,8 @@ var BackendCalendar = {
GeneralFunctions.displayMessageBox('Delete Appointment', 'Please take a minute '
+ 'to write the reason you are deleting the appointment:', messageButtons);
$('#message_box').append('<textarea id="delete-reason"></textarea>');
$('#delete-reason').css('width', '320px');
$('#message_box').append('<textarea id="delete-reason" rows="3"></textarea>');
$('#delete-reason').css('width', '353px');
} else {
// Do not display confirmation promt.
var postUrl = GlobalVariables.baseUrl + 'backend_api/ajax_delete_unavailable';

View file

@ -343,6 +343,8 @@ CustomersHelper.prototype.display = function(customer) {
$('#customer-appointments').append(html);
});
$('#customer-appointments').jScrollPane({ mouseWheelSpeed: 70 });
$('#appointment-details').empty();
};
/**

View file

@ -96,7 +96,6 @@ var BackendSettings = {
$('#user').find('button').prop('disabled', true);
}
Backend.placeFooterToBottom();
},
@ -152,9 +151,40 @@ var BackendSettings = {
var settings = BackendSettings.settings.get();
BackendSettings.settings.save(settings);
//////////////////////////////////////////////
console.log('Settings To Save: ', settings);
//console.log('Settings To Save: ', settings);
//////////////////////////////////////////////
});
/**
* Event: Username "Focusout"
*
* When the user leaves the username input field we will need to check if the username
* is not taken by another record in the system. Usernames must be unique.
*/
$('#username').focusout(function() {
var $input = $(this);
if ($input.prop('readonly') == true || $input.val() == '') return;
var postUrl = GlobalVariables.baseUrl + 'backend_api/ajax_validate_username';
var postData = {
'username': $input.val(),
'record_exists': ($input.parents().eq(2).find('#user-id').val() != '') ? true : false
};
$.post(postUrl, postData, function(response) {
///////////////////////////////////////////////////////
//console.log('Validate Username Response:', response);
///////////////////////////////////////////////////////
if (!GeneralFunctions.handleAjaxExceptions(response)) return;
if (response == false) {
$input.css('border', '2px solid red');
Backend.displayNotification('Username already exists.');
} else {
$input.css('border', '');
}
}, 'json');
});
}
};
@ -185,6 +215,16 @@ SystemSettings.prototype.save = function(settings) {
if (!GeneralFunctions.handleAjaxExceptions(response)) return;
Backend.displayNotification('Settings saved successfully!');
// Update the logo title on the header.
$('#header-logo span').text($('#company-name').val());
// We need to refresh the working plan.
var workingPlan = BackendSettings.wp.get();
$('.breaks').empty();
BackendSettings.wp.setup(workingPlan);
BackendSettings.wp.timepickers(false);
}, 'json');
};
@ -317,6 +357,9 @@ UserSettings.prototype.save = function(settings) {
if (!GeneralFunctions.handleAjaxExceptions(response)) return;
Backend.displayNotification('Settings saved successfully!');
// Update footer greetings.
$('#footer-user-display-name').text('Hello, ' + $('#first-name').val() + ' ' + $('#last-name').val());
}, 'json');
};

View file

@ -58,6 +58,16 @@ var BackendUsers = {
});
$('#secretary-providers').jScrollPane({ mouseWheelSpeed: 70 });
$('#reset-working-plan').qtip({
position: {
my: 'top center',
at: 'bottom center'
},
style: {
classes: 'qtip-green qtip-shadow custom-qtip'
}
});
// Bind event handlers.
if (defaultEventHandlers) BackendUsers.bindEventHandlers();
},

View file

@ -72,6 +72,7 @@ ProvidersHelper.prototype.bindEventHandlers = function() {
$('#providers .details').find('input, textarea').prop('readonly', false);
$('#provider-password, #provider-password-confirm').addClass('required');
$('#provider-notifications').prop('disabled', false);
$('#providers').find('.add-break, .edit-break, .delete-break, #reset-working-plan').prop('disabled', false);
$('#provider-services input[type="checkbox"]').prop('disabled', false);
$('#providers input[type="checkbox"]').prop('disabled', false);

View file

@ -302,24 +302,14 @@ var FrontendBook = {
var ajaxurl = GlobalVariables.baseUrl + 'appointments/ajax_get_available_hours';
jQuery.post(ajaxurl, postData, function(response) {
///////////////////////////////////////////////////////////////
//console.log('Get Available Hours JSON Response :', response);
//console.log('Get Available Hours JSON Response:', response);
///////////////////////////////////////////////////////////////
if (response.exceptions) {
// Display a friendly message to the user with the exceptions information.
response.exceptions = GeneralFunctions.parseExceptions(response.exceptions);
GeneralFunctions.displayMessageBox('Unexpected Error', 'An unexpected '
+ 'error occured during the available hours calculation. Please '
+ 'refresh the page and try again.');
$('#message_box').append(GeneralFunctions.exceptionsToHtml(response.exceptions));
console.log('Get Available Hours Exceptions:', response.exceptions);
return;
}
if (!GeneralFunctions.handleAjaxExceptions(response)) return;
// The response contains the available hours for the selected provider and
// service. Fill the available hours div with response data.
if (response.length > 0) {
var currColumn = 1;
$('#available-hours').html('<div style="width:50px; float:left;"></div>');

View file

@ -230,7 +230,7 @@ INSERT INTO `ea_roles` (`id`, `name`, `slug`, `is_admin`, `appointments`, `custo
(1, 'Administrator', 'admin', 1, 15, 15, 15, 15, 15, 15),
(2, 'Provider', 'provider', 0, 15, 15, 0, 0, 0, 15),
(3, 'Customer', 'customer', 0, 0, 0, 0, 0, 0, 0),
(4, 'Secretary', 'secretary', 0, 15, 15, 0, 0, 15, 15);
(4, 'Secretary', 'secretary', 0, 15, 15, 0, 0, 0, 15);
INSERT INTO `ea_settings` (`name`, `value`) VALUES
('company_working_plan', '{"monday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"tuesday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"wednesday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"thursday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"friday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"saturday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"sunday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]}}'),