* Completed the installation process.

* Added tooltip texts on the common controls of backend.
* GUI fixes on several pages.
This commit is contained in:
alextselegidis@gmail.com 2013-10-17 15:31:43 +00:00
parent dcecfd896d
commit 8f90da86be
21 changed files with 237 additions and 108 deletions

View file

@ -19,6 +19,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.
/*
|--------------------------------------------------------------------------

View file

@ -646,35 +646,31 @@ class Appointments extends CI_Controller {
$this->db->query($query);
}
//$this->db->reconnect();
// Insert admin
$this->load->model('admins_model');
$admin = json_decode($_POST['admin'], true);
$admin_role_id = $this->db->get_where('ea_roles', array('slug' => DB_SLUG_ADMIN))->row()->id;
$admin = json_decode($_POST['admin'], true);
$this->db->query('INSERT INTO `ea_users` (`first_name`, `last_name`, `email`, `phone_number`, `id_roles`) VALUES '
. '("' . $admin['first_name'] . '", "' . $admin['last_name'] . '", "' . $admin['email'] . '", "' . $admin['phone_number'] . '", "' . $admin_role_id . '");');
$this->db->query('INSERT INTO `ea_user_settings` (`id_users`, `username`, `password`) VALUES '
. '("' . $this->db->insert_id() . '", "' . $admin['username'] . '", "' . $admin['password'] . '");');
// // Insert admin
// $this->load->model('admins_model');
// $admin = json_decode($_POST['admin'], true);
// $admin['settings']['username'] = $admin['username'];
// $admin['settings']['password'] = $admin['password'];
// unset($admin['username'], $admin['password']);
// $this->admins_model->add($admin);
$admin['settings']['username'] = $admin['username'];
$admin['settings']['password'] = $admin['password'];
unset($admin['username'], $admin['password']);
$this->admins_model->add($admin);
// Save company settings
$this->load->model('settings_model');
$company = json_decode($_POST['company'], true);
$this->db->query('INSERT INTO `ea_settings` (`name`, `value`) VALUES '
. '("company_name", "' . $company['company_name'] . '"),'
. '("company_email", "' . $company['company_email'] . '"),'
. '("company_link", "' . $company['company_link'] . '");');
// $this->load->model('settings_model');
// $company = json_decode($_POST['company'], true);
// $this->settings_model->set_setting('company_name', $company['company_name']);
// $this->settings_model->set_setting('company_email', $company['company_email']);
// $this->settings_model->set_setting('company_link', $company['company_link']);
$this->settings_model->set_setting('company_name', $company['company_name']);
$this->settings_model->set_setting('company_email', $company['company_email']);
$this->settings_model->set_setting('company_link', $company['company_link']);
// Try to send a notification email for the new installation.
// IMPORTANT: THIS WILL ONLY BE USED TO TRACK THE INSTALLATION NUMBER AND
// NO PERSONAL DATA WILL BE USED FOR OTHER CAUSE.
try {
$this->load->library('notifications');
$this->notifications->send_new_installation($company['company_name'],
$company['company_email'], $company['company_link']);
} catch(Exception $exc) {
// Well, I guess we'll never know ...
}
echo json_encode(AJAX_SUCCESS);

View file

@ -188,13 +188,13 @@ class Notifications {
// :: SETUP EMAIL OBJECT AND SEND NOTIFICATION
$mail = new PHPMailer();
$mail->From = $company_settings['company_email'];
$mail->FromName = $company_settings['company_name'];
$mail->From = $company_settings['company_email'];
$mail->FromName = $company_settings['company_name'];
$mail->AddAddress($email); // "Name" argument crushes the phpmailer class.
$mail->IsHTML(true);
$mail->CharSet = 'UTF-8';
$mail->Subject = 'New Account Password';
$mail->Body = $email_html;
$mail->CharSet = 'UTF-8';
$mail->Subject = 'New Account Password';
$mail->Body = $email_html;
if (!$mail->Send()) {
throw new Exception('Email could not been sent. '
@ -203,6 +203,30 @@ class Notifications {
return TRUE;
}
/**
* Sends a simple email to notify for a new installation.
*
* This method will be only used for tracking the number of installations. No personal
* data will be retrieved for any other cause.
*
* @returns bool Returns the "send()" method result.
*/
public function send_new_installation($company_name, $company_email, $company_link) {
$mail = new PHPMailer();
$mail->From = $company_email;
$mail->FromName = 'New Installation: ' . $company_name ;
$mail->AddAddress('info@easyappointments.org');
$mail->IsHTML(true);
$mail->CharSet = 'UTF-8';
$mail->Subject = 'New Easy!Appointments Installation';
$mail->Body = 'Base URL: ' . $this->CI->config->item('base_url') . '<br>'
. 'E!A Version: ' . $this->CI->config->item('ea_version') . '<br>'
. 'Company Name: ' . $company_name . '<br>'
. 'Company Email: ' . $company_email . '<br>'
. 'Company Link: ' . $company_link . '<br>';
return $mail->Send();
}
}
/* End of file notifications.php */

View file

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Book Appointment | <?php echo $company_name; ?></title>
<title>Book Appointment With <?php echo $company_name; ?></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<?php

View file

@ -36,7 +36,7 @@
<div id="calendar-toolbar">
<div id="calendar-filter">
<label for="select-filter-item">Display Calendar</label>
<select id="select-filter-item"></select>
<select id="select-filter-item" title="Select a provider or a service and view the appointments on the calendar."></select>
</div>
<div id="calendar-actions">
@ -100,16 +100,16 @@
<input id="appointment-id" type="hidden" />
<div class="control-group">
<label for="select-service" class="control-label">Service</label>
<label for="select-service" class="control-label">Service *</label>
<div class="controls">
<select id="select-service"></select>
<select id="select-service" class="required"></select>
</div>
</div>
<div class="control-group">
<label for="select-provider" class="control-label">Provider</label>
<label for="select-provider" class="control-label">Provider *</label>
<div class="controls">
<select id="select-provider"></select>
<select id="select-provider" class="required"></select>
</div>
</div>

View file

@ -26,7 +26,7 @@
<div id="customers-page" class="row-fluid">
<div id="filter-customers" class="filter-records column span4">
<form class="input-append">
<input class="key span8" type="text" />
<input class="key span7" type="text" />
<button class="filter btn" type="submit">
<i class="icon-filter"></i>
Filter
@ -41,7 +41,7 @@
<div class="results"></div>
</div>
<div id="details" class="span7 row-fluid">
<div class="details span7 row-fluid">
<div class="btn-toolbar">
<div id="add-edit-delete-group" class="btn-group">
<?php if ($privileges[PRIV_CUSTOMERS]['add'] == TRUE) { ?>

View file

@ -1,8 +1,10 @@
<div id="footer">
<div id="footer-content">
Powered by <a href="http://easyappointments.org">Easy!Appointments</a> |
Copyright &copy; <?php echo date('Y'); ?>
<a href="http://alextselegidis.com">Alex Tselegidis</a> |
Powered by
<a href="http://easyappointments.org">
Easy!Appointments
v<?php echo $this->config->item('ea_version'); ?>
</a> |
Licensed Under GPLv3
</div>

View file

@ -85,7 +85,8 @@
// ------------------------------------------------------ ?>
<?php $hidden = ($privileges[PRIV_APPOINTMENTS]['view'] == TRUE) ? '' : 'hidden'; ?>
<?php $active = ($active_menu == PRIV_APPOINTMENTS) ? 'active' : ''; ?>
<a href="<?php echo $base_url; ?>backend" class="menu-item <?php echo $hidden; ?><?php echo $active; ?>">
<a href="<?php echo $base_url; ?>backend" class="menu-item <?php echo $hidden; ?><?php echo $active; ?>"
title="Manage all the appointment records of the available providers and services.">
Calendar
</a>
@ -93,7 +94,8 @@
// ------------------------------------------------------ ?>
<?php $hidden = ($privileges[PRIV_CUSTOMERS]['view'] == TRUE) ? '' : 'hidden'; ?>
<?php $active = ($active_menu == PRIV_CUSTOMERS) ? 'active' : ''; ?>
<a href="<?php echo $base_url; ?>backend/customers" class="menu-item <?php echo $hidden; ?><?php echo $active; ?>">
<a href="<?php echo $base_url; ?>backend/customers" class="menu-item <?php echo $hidden; ?><?php echo $active; ?>"
title="Manage the registered customers and view their booking history.">
Customers
</a>
@ -101,7 +103,8 @@
// ------------------------------------------------------ ?>
<?php $hidden = ($privileges[PRIV_SERVICES]['view'] == TRUE) ? '' : 'hidden'; ?>
<?php $active = ($active_menu == PRIV_SERVICES) ? 'active' : ''; ?>
<a href="<?php echo $base_url; ?>backend/services" class="menu-item <?php echo $hidden; ?><?php echo $active; ?>">
<a href="<?php echo $base_url; ?>backend/services" class="menu-item <?php echo $hidden; ?><?php echo $active; ?>"
title="Manage the available services and categories of the system.">
Services
</a>
@ -109,7 +112,8 @@
// ------------------------------------------------------ ?>
<?php $hidden = ($privileges[PRIV_USERS]['view'] == TRUE) ? '' : 'hidden'; ?>
<?php $active = ($active_menu == PRIV_USERS) ? 'active' : ''; ?>
<a href="<?php echo $base_url; ?>backend/users" class="menu-item <?php echo $hidden; ?><?php echo $active; ?>">
<a href="<?php echo $base_url; ?>backend/users" class="menu-item <?php echo $hidden; ?><?php echo $active; ?>"
title="Manage the backend users (admins, providers, secretaries).">
Users
</a>
@ -118,7 +122,8 @@
<?php $hidden = ($privileges[PRIV_SYSTEM_SETTINGS]['view'] == TRUE
|| $privileges[PRIV_USER_SETTINGS]['view'] == TRUE) ? '' : 'hidden'; ?>
<?php $active = ($active_menu == PRIV_SYSTEM_SETTINGS) ? 'active' : ''; ?>
<a href="<?php echo $base_url; ?>backend/settings" class="menu-item <?php echo $hidden; ?><?php echo $active; ?>">
<a href="<?php echo $base_url; ?>backend/settings" class="menu-item <?php echo $hidden; ?><?php echo $active; ?>"
title="Set system and user settings.">
Settings
</a>

View file

@ -36,7 +36,7 @@
<?php // FILTER SERVICES ?>
<div id="filter-services" class="filter-records column span4">
<form class="input-append">
<input class="key span8" type="text" />
<input class="key span7" type="text" />
<button class="filter btn" type="submit">
<i class="icon-filter"></i>
Filter
@ -81,22 +81,22 @@
<input type="hidden" id="service-id" />
<label for="service-name">Name *</label>
<input type="text" id="service-name" class="span7 required" />
<input type="text" id="service-name" class="span6 required" />
<label for="service-duration">Duration *</label>
<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="span7 required" />
<input type="text" id="service-price" class="required" />
<label for="service-currency">Currency</label>
<input type="text" id="service-currency" class="span7" />
<label for="service-description">Description</label>
<textarea id="service-description" rows="4" class="span7"></textarea>
<input type="text" id="service-currency" class="" />
<label for="service-category">Category</label>
<select id="service-category" class="span7"></select>
<select id="service-category"></select>
<label for="service-description">Description</label>
<textarea id="service-description" rows="4" class="span6"></textarea>
<br/><br/>
<em id="form-message" class="text-error">Fields with * are required!</em>
@ -113,7 +113,7 @@
<div id="categories" class="tab-content" style="display:none;">
<div id="filter-categories" class="filter-records column span4">
<form class="input-append">
<input class="key span8" type="text" class="" />
<input class="key span7" type="text" class="" />
<button class="filter btn" type="submit">
<i class="icon-filter"></i>
Filter

View file

@ -82,7 +82,7 @@
<br>
<a href="<?php echo $this->config->base_url(); ?>" target="_blank" class="btn btn-primary">
<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>

View file

@ -62,7 +62,7 @@
<div id="admins" class="tab-content">
<div id="filter-admins" class="filter-records column span4">
<form class="input-append">
<input class="key span8" type="text" />
<input class="key span7" type="text" />
<button class="filter btn" type="submit">
<i class="icon-filter"></i>
Filter
@ -170,7 +170,7 @@
<div id="providers" class="tab-content" style="display:none;">
<div id="filter-providers" class="filter-records column span4">
<form class="input-append">
<input class="key span8" type="text" />
<input class="key span7" type="text" />
<button class="filter btn" type="submit">
<i class="icon-filter"></i>
Filter
@ -283,6 +283,10 @@
<div class="working-plan-view provider-view" style="display: none;">
<h2>Working Plan</h2>
<button id="reset-working-plan" class="btn btn-primary"
title="Reset the working plan back to the default values.">
<i class="icon-repeat icon-white"></i>
Reset Plan</button>
<table class="working-plan table table-striped">
<thead>
<tr>
@ -335,8 +339,8 @@
<h2>Breaks</h2>
<span class="help-block">
Add the working breaks during each day. These breaks will be applied for
all new providers.
Add the working breaks during each day. During breaks the provider will
not accept any appointments.
</span>
<div>
@ -374,7 +378,7 @@
<div id="secretaries" class="tab-content" style="display:none;">
<div id="filter-secretaries" class="filter-records column span4">
<form class="input-append">
<input class="key span8" type="text" />
<input class="key span7" type="text" />
<button class="filter btn" type="submit">
<i class="icon-filter"></i>
Filter

View file

@ -45,6 +45,14 @@
var AJAX_SUCCESS = 'SUCCESS';
var AJAX_FAILURE = 'FAILURE';
$(document).ajaxStart(function() {
$('#loading').show();
});
$(document).ajaxStop(function() {
$('#loading').hide();
});
/**
* Event: Install Easy!Appointments Button "Click"
*/
@ -185,9 +193,28 @@
margin-top: 20px;
border-top: 1px solid #EEE;
}
#loading {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
z-index: 999999;
background: rgba(255, 255, 255, 0.75);
}
#loading img {
margin: auto;
display: block;
}
</style>
</head>
<body>
<div id="loading" style="display: none;">
<img src="<?php echo $base_url; ?>assets/images/loading.gif" />
</div>
<header>
<a href="http://easyappointments.org" target="_blank">
<img src="<?php echo $base_url; ?>assets/images/installation-banner.png" alt="Easy!Appointents Installation Banner">

View file

@ -110,14 +110,15 @@ root {
}
body .modal-header {
padding: 9px 15px;
background: #51B173;
border-bottom: 3px solid #3A8154;
padding: 12px 15px;
background: #3DD481;
border-bottom: 4px solid #3A8154;
color: #FFF;
}
body .modal-header h3 {
font-size: 20px;
text-shadow: 1px 1px 1px #134D13;
}
body .jspDrag {
@ -128,6 +129,32 @@ body .jspTrack {
background: #EBEBEB;
}
body .ui-dialog .ui-dialog-titlebar-close {
display: none;
}
body .ui-draggable .ui-dialog-titlebar {
background: #3DD481;
color: #FFF;
text-shadow: 1px 1px 0px #327451;
padding: 14px 10px;
border-bottom: 4px solid #1A865F;
margin-bottom: 10px;
}
body .ui-dialog {
padding: 0;
}
body .ui-dialog .ui-dialog-buttonpane {
padding: .3em 1em .3em .4em;
}
.breaks tr:hover td {
background: #FFFFC2 !important;
}
/* BACKEND CALENDAR PAGE
-------------------------------------------------------------------- */
#calendar-page #calendar-toolbar {
@ -274,15 +301,15 @@ body .jspTrack {
margin: 5px 0;
}
#customers-page #details {
#customers-page .details {
margin: 15px 0 15px 15px;
}
#customers-page #details .btn-toolbar {
#customers-page .details .btn-toolbar {
margin-top: 0px;
}
#customers-page #details div.span5 {
#customers-page .details div.span5 {
margin-left: 0;
}
@ -304,8 +331,8 @@ body .jspTrack {
cursor: pointer;
}
#customers-page #details input,
#customers-page #details textarea {
#customers-page .details input,
#customers-page .details textarea {
background-color: white;
cursor: default;
}
@ -358,6 +385,10 @@ body .jspTrack {
margin-bottom: 10px;
}
#services-page .details .ui-state-disabled {
opacity: 1;
}
#services-page #service-duration {
margin: 0px;
}
@ -383,6 +414,13 @@ body .jspTrack {
cursor: pointer;
}
.details input:read-only,
.details select:disabled,
.details textarea:read-only {
opacity: 0.85;
box-shadow: none;
}
/* BACKEND USERS PAGE
-------------------------------------------------------------------- */
#users-page .tab-content {

View file

@ -27,6 +27,7 @@ var BackendCalendar = {
'defaultView': 'agendaWeek',
'height': BackendCalendar.getCalendarHeight(),
'editable': true,
'firstDay': 1, // Monday
'slotMinutes': 30,
'axisFormat': 'HH:mm',
'timeFormat': 'HH:mm{ - HH:mm}',
@ -67,28 +68,32 @@ var BackendCalendar = {
BackendCalendar.calendarWindowResize();
// Fill the select listboxes of the page.
var optgroupHtml = '<optgroup label="Providers" type="providers-group">';
$.each(GlobalVariables.availableProviders, function(index, provider) {
var hasGoogleSync = (provider['settings']['google_sync'] === '1')
? 'true' : 'false';
if (GlobalVariables.availableProviders.length > 0) {
var optgroupHtml = '<optgroup label="Providers" type="providers-group">';
$.each(GlobalVariables.availableProviders, function(index, provider) {
var hasGoogleSync = (provider['settings']['google_sync'] === '1')
? 'true' : 'false';
optgroupHtml += '<option value="' + provider['id'] + '" '
+ 'type="' + BackendCalendar.FILTER_TYPE_PROVIDER + '" '
+ 'google-sync="' + hasGoogleSync + '">'
+ provider['first_name'] + ' ' + provider['last_name']
+ '</option>';
});
optgroupHtml += '</optgroup>';
$('#select-filter-item').append(optgroupHtml);
optgroupHtml += '<option value="' + provider['id'] + '" '
+ 'type="' + BackendCalendar.FILTER_TYPE_PROVIDER + '" '
+ 'google-sync="' + hasGoogleSync + '">'
+ provider['first_name'] + ' ' + provider['last_name']
+ '</option>';
});
optgroupHtml += '</optgroup>';
$('#select-filter-item').append(optgroupHtml);
}
optgroupHtml = '<optgroup label="Services" type="services-group">';
$.each(GlobalVariables.availableServices, function(index, service) {
optgroupHtml += '<option value="' + service['id'] + '" ' +
'type="' + BackendCalendar.FILTER_TYPE_SERVICE + '">' +
service['name'] + '</option>';
});
optgroupHtml += '</optgroup>';
$('#select-filter-item').append(optgroupHtml);
if (GlobalVariables.availableServices.length > 0) {
optgroupHtml = '<optgroup label="Services" type="services-group">';
$.each(GlobalVariables.availableServices, function(index, service) {
optgroupHtml += '<option value="' + service['id'] + '" ' +
'type="' + BackendCalendar.FILTER_TYPE_SERVICE + '">' +
service['name'] + '</option>';
});
optgroupHtml += '</optgroup>';
$('#select-filter-item').append(optgroupHtml);
}
// Privileges Checks
if (GlobalVariables.user.role_slug == Backend.DB_SLUG_PROVIDER) {
@ -799,7 +804,7 @@ var BackendCalendar = {
*/
getCalendarHeight: function () {
var result = window.innerHeight - $('#footer').height() - $('#header').height()
- $('#calendar-toolbar').height() - 80; // 80 for fine tuning
- $('#calendar-toolbar').height() - 50; // 80 for fine tuning
return (result > 500) ? result : 500; // Minimum height is 500px
},
@ -881,6 +886,8 @@ var BackendCalendar = {
var selDayName = $calendar.fullCalendar('getView')
.start.toString('dddd').toLowerCase();
if (workingPlan[selDayName] == null) return; // go to next loop
// Add unavailable period before work starts.
var calendarDateStart = $calendar.fullCalendar('getView').start;
var workDateStart = Date.parseExact(
@ -961,6 +968,7 @@ var BackendCalendar = {
var currDateEnd = GeneralFunctions.clone(currDateStart).addDays(1);
$.each(workingPlan, function(index, workingDay) {
if (workingDay == null) return; // Go to the next loop.
var start, end;
// Add unavailable period before work starts.
@ -1672,7 +1680,7 @@ var BackendCalendar = {
// :: CHECK REQUIRED FIELDS
var missingRequiredField = false;
$dialog.find('.required').each(function() {
if ($(this).val() === '') {
if ($(this).val() == '' || $(this).val() == null) {
$(this).parents().eq(1).addClass('error');
missingRequiredField = true;
}

View file

@ -136,7 +136,7 @@ CustomersHelper.prototype.bindEventHandlers = function() {
BackendCustomers.helper.resetForm();
$('#add-edit-delete-group').hide();
$('#save-cancel-group').show();
$('#details').find('input, textarea').prop('readonly', false);
$('.details').find('input, textarea').prop('readonly', false);
$('#filter-customers button').prop('disabled', true);
$('#filter-customers .results').css('color', '#AAA');
@ -146,7 +146,7 @@ CustomersHelper.prototype.bindEventHandlers = function() {
* Event: Edit Customer Button "Click"
*/
$('#edit-customer').click(function() {
$('#details').find('input, textarea').prop('readonly', false);
$('.details').find('input, textarea').prop('readonly', false);
$('#add-edit-delete-group').hide();
$('#save-cancel-group').show();
@ -296,8 +296,8 @@ CustomersHelper.prototype.validate = function(customer) {
* Bring the customer form back to its initial state.
*/
CustomersHelper.prototype.resetForm = function() {
$('#details').find('input, textarea').val('');
$('#details').find('input, textarea').prop('readonly', true);
$('.details').find('input, textarea').val('');
$('.details').find('input, textarea').prop('readonly', true);
$('#customer-appointments').html('');
$('#appointment-details').html('');
@ -305,8 +305,8 @@ CustomersHelper.prototype.resetForm = function() {
$('#add-edit-delete-group').show();
$('#save-cancel-group').hide();
$('#details .required').css('border', '');
$('#details #form-message').hide();
$('.details .required').css('border', '');
$('.details #form-message').hide();
$('#filter-customers button').prop('disabled', false);
$('#filter-customers .selected-row').removeClass('selected-row');

View file

@ -392,7 +392,7 @@ ServicesHelper.prototype.filter = function(key, selectId, display) {
$('#filter-services .results').jScrollPane({ mouseWheelSpeed: 70 });
if (response.length == 0) {
$('#filter-services .result').html('<em>No results found ...</em>');
$('#filter-services .results').html('<em>No results found ...</em>');
}
if (selectId != undefined) {
@ -642,7 +642,7 @@ CategoriesHelper.prototype.save = function(category) {
if (!GeneralFunctions.handleAjaxExceptions(response)) return;
Backend.displayNotification('Service saved successfully!');
Backend.displayNotification('Category saved successfully!');
BackendServices.helper.resetForm();
$('#filter-categories .key').val('');
BackendServices.helper.filter('', response.id, true);

View file

@ -96,6 +96,8 @@ var BackendSettings = {
$('#user').find('button').prop('disabled', true);
}
Backend.placeFooterToBottom();
},
/**
@ -137,6 +139,8 @@ var BackendSettings = {
$('#user-notifications').removeClass('active');
}
}
Backend.placeFooterToBottom();
});
/**

View file

@ -92,7 +92,7 @@ ProvidersHelper.prototype.bindEventHandlers = function() {
$('#provider-password, #provider-password-confirm').removeClass('required');
$('#provider-notifications').prop('disabled', false);
$('#provider-services input[type="checkbox"]').prop('disabled', false);
$('#providers').find('.add-break, .edit-break, .delete-break').prop('disabled', false);
$('#providers').find('.add-break, .edit-break, .delete-break, #reset-working-plan').prop('disabled', false);
$('#providers input[type="checkbox"]').prop('disabled', false);
BackendUsers.wp.timepickers(false);
});
@ -184,7 +184,6 @@ ProvidersHelper.prototype.bindEventHandlers = function() {
$('.working-plan-view').hide('fade', function() {
$('.details-view').show('fade');
});
});
/**
@ -197,6 +196,15 @@ ProvidersHelper.prototype.bindEventHandlers = function() {
$('.working-plan-view').show('fade');
});
});
/**
* Event: Reset Working Plan Button "Click".
*/
$('#reset-working-plan').click(function() {
$('.breaks').empty();
BackendUsers.wp.setup(GlobalVariables.workingPlan);
BackendUsers.wp.timepickers(false);
});
};
/**
@ -312,9 +320,10 @@ ProvidersHelper.prototype.resetForm = function() {
$('#provider-services input[type="checkbox"]').prop('disabled', true);
$('#providers .required').css('border', '');
$('#provider-password, #provider-password-confirm').css('border', '');
$('#providers .add-break').prop('disabled', true);
$('#providers .add-break, #reset-working-plan').prop('disabled', true);
BackendUsers.wp.timepickers(true);
$('#providers .working-plan input[type="text"]').timepicker('destroy');
$('#providers .working-plan input[type="checkbox"]').prop('disabled', true);
$('.breaks').find('.edit-break, .delete-break').prop('disabled', true);
$('#edit-provider, #delete-provider').prop('disabled', true);

View file

@ -45,6 +45,7 @@ var FrontendBook = {
$('#select-date').datepicker({
dateFormat: 'dd-mm-yy',
firstDay: 1, // Monday
minDate: 0,
defaultDate: Date.today(),
onSelect: function(dateText, instance) {
@ -272,6 +273,8 @@ var FrontendBook = {
* hours we need to receive.
*/
getAvailableHours: function(selDate) {
$('#available-hours').empty();
// Find the selected service duration (it is going to
// be send within the "postData" object.
var selServiceDuration = 15; // Default value of duration (in minutes).

View file

@ -65,6 +65,7 @@ var GeneralFunctions = {
});
jQuery("#message_box").dialog("open");
jQuery(".ui-dialog .ui-dialog-buttonset button").addClass('btn');
jQuery("#message_box .ui-dialog-titlebar-close").hide();
},

View file

@ -173,8 +173,8 @@ WorkingPlan.prototype.bindEventHandlers = function() {
// Bind editable and event handlers.
tr = $('.breaks tr').get()[1];
BackendSettings.editableBreakDay($(tr).find('.break-day'));
BackendSettings.editableBreakTime($(tr).find('.break-start, .break-end'));
WorkingPlan.prototype.editableBreakDay($(tr).find('.break-day'));
WorkingPlan.prototype.editableBreakTime($(tr).find('.break-start, .break-end'));
$(tr).find('.edit-break').trigger('click');
});
@ -295,7 +295,7 @@ WorkingPlan.prototype.timepickers = function(disabled) {
if (disabled == false) {
// Set timepickers where needed.
$('.working-plan input').timepicker({
$('.working-plan input[type="text"]').timepicker({
'timeFormat': 'HH:mm',
'onSelect': function(datetime, inst) {
// Start time must be earlier than end time.
@ -311,3 +311,10 @@ WorkingPlan.prototype.timepickers = function(disabled) {
$('.working-plan input').timepicker('destroy');
}
};
/**
* Reset the current plan back to the company's default working plan.
*/
WorkingPlan.prototype.reset = function() {
};