* Fixed Issue #25

* Other minor bug fixes.
This commit is contained in:
alextselegidis@gmail.com 2013-11-21 21:58:51 +00:00
parent 736d301f02
commit 80bb356d16
9 changed files with 64 additions and 53 deletions

View file

@ -409,8 +409,11 @@ class Appointments extends CI_Controller {
$service_duration = $this->services_model->get_value('duration', $_POST['id_services']);
$exclude_appointments = (isset($_POST['exclude_appointment_id']))
? array($_POST['exclude_appointment_id']) : array();
$available_periods = $this->get_provider_available_time_periods(
$_POST['id_users_provider'], $_POST['start_datetime']);
$_POST['id_users_provider'], $_POST['start_datetime'], $exclude_appointments);
$is_still_available = FALSE;

View file

@ -342,8 +342,10 @@ class Backend_api extends CI_Controller {
}
$this->load->model('providers_model');
$this->load->model('appointments_model');
$this->providers_model->set_setting('google_sync', FALSE, $_POST['provider_id']);
$this->providers_model->set_setting('google_token', NULL, $_POST['provider_id']);
$this->appointments_model->clear_google_sync_ids($_POST['provider_id']);
echo json_encode(AJAX_SUCCESS);

View file

@ -369,6 +369,21 @@ class Appointments_Model extends CI_Model {
$this->db->where('id', $unavailable_id);
return $this->db->delete('ea_appointments');
}
/**
* Clear google sync IDs from appointment record.
*
* @param numeric $provider_id The appointment provider record id.
*/
public function clear_google_sync_ids($provider_id) {
if (!is_numeric($provider_id)) {
throw new Exception('Invalid argument type $provider_id (value: "'
. $provider_id . '")');
}
$this->db->update('ea_appointments', array('id_google_calendar' => NULL),
array('id_users_provider' => $provider_id));
}
}
/* End of file appointments_model.php */

View file

@ -26,14 +26,12 @@
<div id="customers-page" class="row-fluid">
<div id="filter-customers" class="filter-records column span4">
<form class="input-append">
<input class="key span7" type="text" />
<button class="filter btn" type="submit">
<i class="icon-filter"></i>
Filter
<input class="key span12" type="text" />
<button class="filter btn" type="submit" title="Filter">
<i class="icon-search"></i>
</button>
<button class="clear btn" type="button">
<i class="icon-remove-circle"></i>
Clear
<button class="clear btn" type="button" title="Clear">
<i class="icon-repeat"></i>
</button>
</form>

View file

@ -36,14 +36,12 @@
<?php // FILTER SERVICES ?>
<div id="filter-services" class="filter-records column span4">
<form class="input-append">
<input class="key span7" type="text" />
<button class="filter btn" type="submit">
<i class="icon-filter"></i>
Filter
<input class="key span12" type="text" />
<button class="filter btn" type="submit" title="Filter">
<i class="icon-search"></i>
</button>
<button class="clear btn" type="button">
<i class="icon-remove-circle"></i>
Clear
<button class="clear btn" type="button" title="Clear">
<i class="icon-repeat"></i>
</button>
</form>
@ -113,14 +111,12 @@
<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 span7" type="text" class="" />
<button class="filter btn" type="submit">
<i class="icon-filter"></i>
Filter
<input class="key span12" type="text" />
<button class="filter btn" type="submit" title="Filter">
<i class="icon-search"></i>
</button>
<button class="clear btn" type="button">
<i class="icon-remove-circle"></i>
Clear
<button class="clear btn" type="button" title="Clear">
<i class="icon-repeat"></i>
</button>
</form>

View file

@ -62,14 +62,12 @@
<div id="admins" class="tab-content">
<div id="filter-admins" class="filter-records column span4">
<form class="input-append">
<input class="key span7" type="text" />
<button class="filter btn" type="submit">
<i class="icon-filter"></i>
Filter
<input class="key span12" type="text" />
<button class="filter btn" type="submit" title="Filter">
<i class="icon-search"></i>
</button>
<button class="clear btn" type="button">
<i class="icon-remove-circle"></i>
Clear
<button class="clear btn" type="button" title="Clear">
<i class="icon-repeat"></i>
</button>
</form>
@ -170,14 +168,12 @@
<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 span7" type="text" />
<button class="filter btn" type="submit">
<i class="icon-filter"></i>
Filter
<input class="key span12" type="text" />
<button class="filter btn" type="submit" title="Filter">
<i class="icon-search"></i>
</button>
<button class="clear btn" type="button">
<i class="icon-remove-circle"></i>
Clear
<button class="clear btn" type="button" title="Clear">
<i class="icon-repeat"></i>
</button>
</form>
@ -378,14 +374,12 @@
<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 span7" type="text" />
<button class="filter btn" type="submit">
<i class="icon-filter"></i>
Filter
<input class="key span12" type="text" />
<button class="filter btn" type="submit" title="Filter">
<i class="icon-search"></i>
</button>
<button class="clear btn" type="button">
<i class="icon-remove-circle"></i>
Clear
<button class="clear btn" type="button" title="Clear">
<i class="icon-repeat"></i>
</button>
</form>

View file

@ -31,6 +31,7 @@ var BackendCalendar = {
'slotMinutes': 30,
'axisFormat': 'HH:mm',
'timeFormat': 'HH:mm{ - HH:mm}',
'allDayText': 'All Day',
'columnFormat': {
'month': 'ddd',
'week': 'ddd d/M',
@ -64,7 +65,6 @@ var BackendCalendar = {
$('#calendar .fc-button-agendaDay').text('Day');
$('#calendar .fc-button-agendaWeek').text('Week');
$('#calendar .fc-button-month').text('Month');
$('#calendar .fc-agenda-allday .fc-agenda-axis').text('All Day');
// Trigger once to set the proper footer position after calendar
// initialization.
@ -1319,7 +1319,6 @@ var BackendCalendar = {
calendarWindowResize: function(view) {
$('#calendar').fullCalendar('option', 'height',
BackendCalendar.getCalendarHeight());
//BackendCalendar.convertTitlesToHtml();
},
/**
@ -1613,9 +1612,6 @@ var BackendCalendar = {
$('#calendar').fullCalendar('getView').visEnd);
$(window).trigger('resize'); // Places the footer on the bottom.
// Change string from "all-day" to "All Day".
$('#calendar .fc-agenda-allday .fc-agenda-axis').text('All Day');
// Remove all open popovers.
$('.close-popover').each(function() {
$(this).parents().eq(2).remove();
@ -1787,7 +1783,7 @@ var BackendCalendar = {
* On some calendar events the titles contain html markup that is not
* displayed properly due to the fullcalendar plugin. This plugin sets
* the .fc-event-title value by using the $.text() method and not the
* $.html() method. So in order for the title to display the html properly
* $.html() method. So in order for the title to displya the html properly
* we convert all the .fc-event-titles where needed into html.
*/
convertTitlesToHtml: function() {
@ -1795,6 +1791,8 @@ var BackendCalendar = {
$('.fc-custom').each(function() {
var title = $(this).find('.fc-event-title').text();
$(this).find('.fc-event-title').html(title);
var time = $(this).find('.fc-event-time').text();
$(this).find('.fc-event-time').html(time);
});
}
};

View file

@ -203,6 +203,7 @@ ProvidersHelper.prototype.bindEventHandlers = function() {
*/
$('#reset-working-plan').click(function() {
$('.breaks').empty();
$('.work-start, .work-end').val('');
BackendUsers.wp.setup(GlobalVariables.workingPlan);
BackendUsers.wp.timepickers(false);
});

View file

@ -234,9 +234,13 @@ var FrontendBook = {
var postData = {
'id_users_provider': formData['appointment']['id_users_provider'],
'id_services': formData['appointment']['id_services'],
'start_datetime': formData['appointment']['start_datetime']
'start_datetime': formData['appointment']['start_datetime'],
};
if (GlobalVariables.manageMode) {
postData.exclude_appointment_id = GlobalVariables.appointmentData.id;
}
var postUrl = GlobalVariables.baseUrl + 'appointments/ajax_check_datetime_availability';
$.post(postUrl, postData, function(response) {