mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-22 14:42:23 +03:00
* Minor fixes on backend.
This commit is contained in:
parent
80bb356d16
commit
759f09141c
7 changed files with 166 additions and 13 deletions
|
@ -29,8 +29,8 @@ $config['base_url'] = SystemConfiguration::$base_url;
|
|||
| the global "config" variable.
|
||||
|
|
||||
*/
|
||||
$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 ...
|
||||
$config['ea_version'] = '0.7'; // This must be changed manually.
|
||||
$config['ea_release_title'] = 'Beta'; // Leave empty for no title or add BETA, TEST etc ...
|
||||
$config['ea_google_sync_feature'] = SystemConfiguration::$google_sync_feature;
|
||||
|
||||
/*
|
||||
|
|
|
@ -84,6 +84,13 @@
|
|||
<div id="calendar"></div> <?php // Main calendar container ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// --------------------------------------------------------------------
|
||||
//
|
||||
// MANAGE APPOINTMENT
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
?>
|
||||
<div id="manage-appointment" class="modal hide fade">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
|
@ -103,14 +110,14 @@
|
|||
<div class="control-group">
|
||||
<label for="select-service" class="control-label">Service *</label>
|
||||
<div class="controls">
|
||||
<select id="select-service" class="required"></select>
|
||||
<select id="select-service" class="required span4"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="select-provider" class="control-label">Provider *</label>
|
||||
<div class="controls">
|
||||
<select id="select-provider" class="required"></select>
|
||||
<select id="select-provider" class="required span4"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -211,6 +218,13 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// --------------------------------------------------------------------
|
||||
//
|
||||
// MANAGE UNAVAILALBE
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
?>
|
||||
<div id="manage-unavailable" class="modal hide fade">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
|
|
|
@ -41,6 +41,8 @@
|
|||
<?php if ($privileges[PRIV_USER_SETTINGS]['view'] == TRUE) { ?>
|
||||
<li class="user-tab tab"><a>Current User</a></li>
|
||||
<?php } ?>
|
||||
|
||||
<li class="about-tab tab"><a>About</a></li>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
|
@ -289,4 +291,59 @@
|
|||
</form>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
// ABOUT TAB
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
?>
|
||||
<div id="about" class="tab-content">
|
||||
<h2>Easy!Appointments</h3>
|
||||
<p>
|
||||
<strong>Easy!Appointments</strong> is a highly customizable web application that allows
|
||||
your customers to book appointments with you via the web. Moreover, it
|
||||
provides the ability to sync your data with Google Calendar so you can
|
||||
use them with other services. It is an open source project and you can
|
||||
download and install it even for <strong>commercial use</strong>. Easy!Appointments will
|
||||
run smoothly with your existing website, because it can be installed in
|
||||
a single folder of the server and of course, both sites can share the same
|
||||
database.
|
||||
</p>
|
||||
|
||||
<div class="current-version">
|
||||
Current Version
|
||||
<?php
|
||||
echo $this->config->item('ea_version')
|
||||
. ' ' . $this->config->item('ea_release_title');
|
||||
?>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<h3>Support</h3>
|
||||
<p>
|
||||
If you encounter any problems when using Easy!Appointments you can search the
|
||||
official Google Group for answers. You might also want to create a new issue
|
||||
on the Google Code page in order to help the development progress.
|
||||
<br><br>
|
||||
<a href="https://plus.google.com/communities/105333709485142846840">
|
||||
Google+ Community</a>
|
||||
|
|
||||
<a href="https://groups.google.com/forum/#!forum/easy-appointments">
|
||||
Support Group</a>
|
||||
|
|
||||
<a href="https://code.google.com/p/easy-appointments/issues/list">Project Issues</a>
|
||||
</p>
|
||||
|
||||
<br>
|
||||
|
||||
<h3>License</h3>
|
||||
<p>
|
||||
Easy!Appointments is licensed under the GPLv3 license. By using
|
||||
the code of Easy!Appointments in any way <br> you are agreeing to the
|
||||
terms described in the following url:
|
||||
<a href="http://www.gnu.org/copyleft/gpl.html">http://www.gnu.org/copyleft/gpl.html</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
|
@ -292,6 +292,16 @@
|
|||
|
||||
<br>
|
||||
|
||||
<p>
|
||||
<h3>License</h3>
|
||||
Easy!Appointments is licensed under the GPLv3 license. By using
|
||||
the code of Easy!Appointments in any way <br> you are agreeing to the
|
||||
terms described in the following url:
|
||||
<a href="http://www.gnu.org/copyleft/gpl.html">http://www.gnu.org/copyleft/gpl.html</a>
|
||||
</p>
|
||||
|
||||
<br>
|
||||
|
||||
<button type="button" id="install" class="btn btn-success btn-large">
|
||||
<i class="icon-white icon-ok"></i>
|
||||
Install Easy!Appointments</button>
|
||||
|
|
|
@ -644,4 +644,17 @@ padding: 4px 7px;
|
|||
|
||||
#settings-page .miscellaneous-wrapper {
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
#settings-page #about {
|
||||
max-width: 720px;
|
||||
}
|
||||
|
||||
#settings-page #about .current-version {
|
||||
padding: 15px 10px;
|
||||
background: #EEE;
|
||||
border-bottom: 2px solid #CFCFCF;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #838383;
|
||||
}
|
|
@ -717,6 +717,49 @@ var BackendCalendar = {
|
|||
$('#insert-appointment').click(function() {
|
||||
BackendCalendar.resetAppointmentDialog();
|
||||
var $dialog = $('#manage-appointment');
|
||||
|
||||
// Set the selected filter item and find the next appointment time
|
||||
// as the default modal values.
|
||||
if ($('#select-filter-item option:selected').attr('type') == 'provider') {
|
||||
var $providerOption = $dialog.find('#select-provider option[value="'
|
||||
+ $('#select-filter-item').val() + '"]');
|
||||
if ($providerOption.length == 0) { // Change the services until you find the correct.
|
||||
$.each($dialog.find('#select-service option'), function() {
|
||||
$(this).prop('selected', true).parent().change();
|
||||
if ($providerOption.length > 0)
|
||||
return false;
|
||||
});
|
||||
}
|
||||
$providerOption.prop('selected', true);
|
||||
} else {
|
||||
$dialog.find('#select-service option[value="'
|
||||
+ $('#select-filter-item').val() + '"]').prop('selected', true);
|
||||
}
|
||||
|
||||
var serviceDuration = 0;
|
||||
$.each(GlobalVariables.availableServices, function(index, service) {
|
||||
if (service['id'] == $dialog.find('#select-service').val()) {
|
||||
serviceDuration = service['duration'];
|
||||
return false; // exit loop
|
||||
}
|
||||
});
|
||||
|
||||
var start = new Date();
|
||||
var currentMin = parseInt(start.toString('mm'));
|
||||
|
||||
if (currentMin > 0 && currentMin < 15)
|
||||
start.set({ 'minute': 15 });
|
||||
else if (currentMin > 15 && currentMin < 30)
|
||||
start.set({ 'minute': 30 });
|
||||
else if (currentMin > 30 && currentMin < 45)
|
||||
start.set({ 'minute': 45 });
|
||||
else
|
||||
start.addHours(1).set({ 'minute': 0 });
|
||||
|
||||
$dialog.find('#start-datetime').val(start.toString('dd/MM/yyyy HH:mm'));
|
||||
$dialog.find('#end-datetime').val(start.addMinutes(serviceDuration).toString('dd/MM/yyyy HH:mm'));
|
||||
|
||||
// Display modal form.
|
||||
$dialog.find('.modal-header h3').text('New Appointment');
|
||||
$dialog.modal('show');
|
||||
});
|
||||
|
@ -784,17 +827,17 @@ var BackendCalendar = {
|
|||
* Event: Filter Existing Customers "Change"
|
||||
*/
|
||||
$('#filter-existing-customers').keyup(function() {
|
||||
var key = $(this).val();
|
||||
var key = $(this).val().toLowerCase();
|
||||
var $list = $('#existing-customers-list');
|
||||
$list.empty();
|
||||
$.each(GlobalVariables.customers, function(index, c) {
|
||||
if (c.first_name.indexOf(key) != -1
|
||||
|| c.last_name.indexOf(key) != -1
|
||||
|| c.email.indexOf(key) != -1
|
||||
|| c.phone_number.indexOf(key) != -1
|
||||
|| c.address.indexOf(key) != -1
|
||||
|| c.city.indexOf(key) != -1
|
||||
|| c.zip_code.indexOf(key) != -1) {
|
||||
if (c.first_name.toLowerCase().indexOf(key) != -1
|
||||
|| c.last_name.toLowerCase().indexOf(key) != -1
|
||||
|| c.email.toLowerCase().indexOf(key) != -1
|
||||
|| c.phone_number.toLowerCase().indexOf(key) != -1
|
||||
|| c.address.toLowerCase().indexOf(key) != -1
|
||||
|| c.city.toLowerCase().indexOf(key) != -1
|
||||
|| c.zip_code.toLowerCase().indexOf(key) != -1) {
|
||||
$list.append('<div data-id="' + c.id + '">'
|
||||
+ c.first_name + ' ' + c.last_name + '</div>');
|
||||
}
|
||||
|
@ -817,7 +860,7 @@ var BackendCalendar = {
|
|||
// add him to the listbox.
|
||||
if (serviceId == sid) {
|
||||
var optionHtml = '<option value="' + provider['id'] + '">'
|
||||
+ provider['last_name'] + ' ' + provider['first_name']
|
||||
+ provider['first_name'] + ' ' + provider['last_name']
|
||||
+ '</option>';
|
||||
$('#select-provider').append(optionHtml);
|
||||
}
|
||||
|
@ -1687,6 +1730,11 @@ var BackendCalendar = {
|
|||
$dialog.find('#select-provider').append(option);
|
||||
}
|
||||
});
|
||||
|
||||
// :: CLOSE EXISTING CUSTOMERS FILTER FRAME
|
||||
$('#existing-customers-list').slideUp('slow');
|
||||
$('#filter-existing-customers').fadeOut('slow');
|
||||
$('#select-customer').text('Select');
|
||||
|
||||
// :: SETUP START AND END DATETIME PICKERS
|
||||
// Get the selected service duration. It will be needed in order to calculate
|
||||
|
@ -1747,6 +1795,15 @@ var BackendCalendar = {
|
|||
throw 'Invalid email address!';
|
||||
}
|
||||
|
||||
// :: CHECK APPOINTMENT START AND END TIME
|
||||
var start = Date.parseExact($('#start-datetime').val(), 'dd/MM/yyyy HH:mm');
|
||||
var end = Date.parseExact($('#end-datetime').val(), 'dd/MM/yyyy HH:mm');
|
||||
if (start > end) {
|
||||
$dialog.find('#start-datetime').parents().eq(1).addClass('error');
|
||||
$dialog.find('#end-datetime').parents().eq(1).addClass('error');
|
||||
throw 'Appointment start must be prior to appointment end date!';
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch(exc) {
|
||||
$dialog.find('.modal-message').addClass('alert-error').text(exc).show('fade');
|
||||
|
|
|
@ -137,6 +137,8 @@ var BackendSettings = {
|
|||
} else {
|
||||
$('#user-notifications').removeClass('active');
|
||||
}
|
||||
} else if ($(this).hasClass('about-tab')) {
|
||||
$('#about').show();
|
||||
}
|
||||
|
||||
Backend.placeFooterToBottom();
|
||||
|
|
Loading…
Reference in a new issue