diff --git a/doc/translations.xls b/doc/translations.xls index 0352eda3..1ed1d8e0 100644 Binary files a/doc/translations.xls and b/doc/translations.xls differ diff --git a/src/application/config/config.php b/src/application/config/config.php index e9f40ca3..e9b51cd3 100644 --- a/src/application/config/config.php +++ b/src/application/config/config.php @@ -29,8 +29,8 @@ $config['base_url'] = SystemConfiguration::$base_url; | the global "config" variable. | */ -$config['ea_version'] = '1.0'; // This must be changed manually. -$config['ea_release_title'] = 'Dev'; // Leave empty for no title or add BETA, TEST etc ... +$config['ea_version'] = '0.7.1'; // 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; /* diff --git a/src/application/config/migration.php b/src/application/config/migration.php index afa26456..b0704207 100644 --- a/src/application/config/migration.php +++ b/src/application/config/migration.php @@ -8,7 +8,7 @@ | whenever you intend to do a schema migration. | */ -$config['migration_enabled'] = FALSE; +$config['migration_enabled'] = TRUE; /* @@ -21,7 +21,7 @@ $config['migration_enabled'] = FALSE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 0; +$config['migration_version'] = 1; // current /* diff --git a/src/application/controllers/backend.php b/src/application/controllers/backend.php index 038e82a3..56a2edd0 100644 --- a/src/application/controllers/backend.php +++ b/src/application/controllers/backend.php @@ -252,6 +252,34 @@ class Backend extends CI_Controller { $view['role_slug'] = $this->session->userdata('role_slug'); $view['privileges'] = $this->roles_model->get_privileges($this->session->userdata('role_slug')); } + + /** + * This method will update the installation to the latest available + * version in the server. IMPORTANT: The code files must exist in the + * server, this method will not fetch any new files but will update + * the database schema. + * + * This method can be used either by loading the page in the browser + * or by an ajax request. But it will answer with json encoded data. + */ + public function update() { + try { + if (!$this->hasPrivileges(PRIV_SYSTEM_SETTINGS, TRUE)) + throw new Exception('You do not have the required privileges for this task.'); + + $this->load->library('migration'); + + if (!$this->migration->current()) + throw new Exception($this->migration->error_string()); + + echo json_encode(AJAX_SUCCESS); + + } catch(Exception $exc) { + echo json_encode(array( + 'exceptions' => array(exceptionToJavaScript($exc)) + )); + } + } } /* End of file backend.php */ diff --git a/src/application/language/english/translations_lang.php b/src/application/language/english/translations_lang.php index 219d9a8c..478d05b7 100644 --- a/src/application/language/english/translations_lang.php +++ b/src/application/language/english/translations_lang.php @@ -268,4 +268,5 @@ $lang['select_google_calendar'] = 'Select Google Calendar'; $lang['select_google_calendar_prompt'] = 'Select the calendar that you want to sync your appointments. If you do not want to select a specific calendar the default one will be used.'; $lang['google_calendar_selected'] = 'Google calendar has been successfully selected!'; $lang['oops_something_went_wrong'] = 'Oops! Something Went Wrong!'; -$lang['could_not_add_to_google_calendar'] = 'Your appointment could not be added to your Google Calendar account.'; \ No newline at end of file +$lang['could_not_add_to_google_calendar'] = 'Your appointment could not be added to your Google Calendar account.'; +$lang['ea_update_success'] = 'Easy!Appointments has been successfully updated!'; \ No newline at end of file diff --git a/src/application/language/german/translations_lang.php b/src/application/language/german/translations_lang.php index afa4d826..409aadbb 100644 --- a/src/application/language/german/translations_lang.php +++ b/src/application/language/german/translations_lang.php @@ -268,4 +268,5 @@ $lang['select_google_calendar'] = 'Wählen Sie Google Kalender'; $lang['select_google_calendar_prompt'] = 'Wählen Sie den Kalender, den Sie Ihre Termine synchronisieren möchten. Wenn Sie nicht wollen, um einen bestimmten Kalender wählen den Standard, verwendet.'; $lang['google_calendar_selected'] = 'Google-Kalender ausgewählt wurde erfolgreich!'; $lang['oops_something_went_wrong'] = 'Oops! Etwas ist schiefgelaufen!'; -$lang['could_not_add_to_google_calendar'] = 'Ihr Termin konnte nicht in den Google-Kalender-Konto hinzugefügt werden.'; \ No newline at end of file +$lang['could_not_add_to_google_calendar'] = 'Ihr Termin konnte nicht in den Google-Kalender-Konto hinzugefügt werden.'; +$lang['ea_update_success'] = 'Easy!Appointments wurde erfolgreich aktualisiert!'; \ No newline at end of file diff --git a/src/application/language/greek/translations_lang.php b/src/application/language/greek/translations_lang.php index 64187d7b..c29b582c 100644 --- a/src/application/language/greek/translations_lang.php +++ b/src/application/language/greek/translations_lang.php @@ -268,4 +268,5 @@ $lang['select_google_calendar'] = 'Επιλογή Ημερολογίου της $lang['select_google_calendar_prompt'] = 'Επιλέξτε το ημερολόγιο στο οποίο θέλετε να συγχρονίζεται τα ραντεβού σας. Εάν δεν θελήσετε να επιλέξετε ένα συγκεκριμένο ημερολόγιο θα χρησιμοποιηθεί το προεπιλεγμένο.'; $lang['google_calendar_selected'] = 'Το ημερολόγιο της Google επιλέχθηκε επιτυχώς!'; $lang['oops_something_went_wrong'] = 'Ώχ! Κάτι πήγε στραβά!'; -$lang['could_not_add_to_google_calendar'] = 'Το ραντεβού σας δεν μπόρεσε να προστεθεί στον λογαριασμό σας στο Google Calendar.'; \ No newline at end of file +$lang['could_not_add_to_google_calendar'] = 'Το ραντεβού σας δεν μπόρεσε να προστεθεί στον λογαριασμό σας στο Google Calendar.'; +$lang['ea_update_success'] = 'Το Easy!Appointments ενημερώθηκε με επιτυχία!'; \ No newline at end of file diff --git a/src/application/views/appointments/book.php b/src/application/views/appointments/book.php index 1eb4e5f4..dfb16c44 100644 --- a/src/application/views/appointments/book.php +++ b/src/application/views/appointments/book.php @@ -349,7 +349,7 @@ lang->line('back'); ?>
- '; ?> @@ -340,6 +343,10 @@ lang->line('project_issues'); ?> + | + + E!A Blog +


diff --git a/src/assets/css/backend.css b/src/assets/css/backend.css index 34324afb..4d55b823 100644 --- a/src/assets/css/backend.css +++ b/src/assets/css/backend.css @@ -665,9 +665,13 @@ padding: 4px 7px; } #settings-page #about .current-version { - padding: 15px 10px; + padding: 9px 10px; background: #F7F7F7; font-size: 15px; color: #7E7E7E; box-shadow: inset 0px 0px 5px #E0E0E0; +} + +#settings-page #update-ea { + margin-left: 12px; } \ No newline at end of file diff --git a/src/assets/js/backend.js b/src/assets/js/backend.js index 25f1b847..f517db8a 100644 --- a/src/assets/js/backend.js +++ b/src/assets/js/backend.js @@ -103,7 +103,7 @@ var Backend = { $.each(actions, function(index, action) { var actionId = action['label'].toLowerCase().replace(' ', '-'); - notificationHtml += ''; $(document).off('click', '#' + actionId); diff --git a/src/assets/js/backend_calendar.js b/src/assets/js/backend_calendar.js index 9bc0922b..d7dfb9e9 100644 --- a/src/assets/js/backend_calendar.js +++ b/src/assets/js/backend_calendar.js @@ -1863,7 +1863,8 @@ var BackendCalendar = { timeOnlyTitle: EALang['select_time'], timeText: EALang['time'], hourText: EALang['hour'], - minuteText: EALang['minutes'] + minuteText: EALang['minutes'], + firstDay: 1 }); $dialog.find('#start-datetime').val(startDatetime); @@ -1890,7 +1891,8 @@ var BackendCalendar = { timeOnlyTitle: EALang['select_time'], timeText: EALang['time'], hourText: EALang['hour'], - minuteText: EALang['minutes'] + minuteText: EALang['minutes'], + firstDay: 1 }); $dialog.find('#end-datetime').val(endDatetime); }, @@ -1950,6 +1952,8 @@ var BackendCalendar = { resetUnavailableDialog: function() { var $dialog = $('#manage-unavailable'); + $dialog.find('#unavailable-id').val(''); + // Set default time values var start = new Date().toString('dd/MM/yyyy HH:mm'); var end = new Date().addHours(1).toString('dd/MM/yyyy HH:mm'); @@ -1977,7 +1981,8 @@ var BackendCalendar = { timeOnlyTitle: EALang['select_time'], timeText: EALang['time'], hourText: EALang['hour'], - minuteText: EALang['minutes'] + minuteText: EALang['minutes'], + firstDay: 1 }); $dialog.find('#unavailable-start').val(start); @@ -2004,7 +2009,8 @@ var BackendCalendar = { timeOnlyTitle: EALang['select_time'], timeText: EALang['time'], hourText: EALang['hour'], - minuteText: EALang['minutes'] + minuteText: EALang['minutes'], + firstDay: 1 }); $dialog.find('#unavailable-end').val(end); diff --git a/src/assets/js/backend_settings.js b/src/assets/js/backend_settings.js index cbabc926..50471ffe 100644 --- a/src/assets/js/backend_settings.js +++ b/src/assets/js/backend_settings.js @@ -189,6 +189,23 @@ var BackendSettings = { } }, 'json'); }); + + /** + * Event: Update Easy!Appointments DB Schema To Latest Version + */ + $('#update-ea').click(function() { + var postUrl = GlobalVariables.baseUrl + 'backend/update'; + $.post(postUrl, {}, function(response) { + ////////////////////////////////////////////// + console.log('Update EA Response', response); + ////////////////////////////////////////////// + + if (!GeneralFunctions.handleAjaxExceptions(response)) return; + + Backend.displayNotification(EALang['ea_update_success']); + + }, 'json'); + }); } }; diff --git a/src/assets/js/backend_users_secretaries.js b/src/assets/js/backend_users_secretaries.js index 4b404f16..6524df86 100644 --- a/src/assets/js/backend_users_secretaries.js +++ b/src/assets/js/backend_users_secretaries.js @@ -97,18 +97,17 @@ SecretariesHelper.prototype.bindEventHandlers = function() { $('#delete-secretary').click(function() { var secretaryId = $('#secretary-id').val(); - var messageBtns = { - 'Delete': function() { - BackendUsers.helper.delete(secretaryId); - $('#message_box').dialog('close'); - }, - 'Cancel': function() { - $('#message_box').dialog('close'); - } + var messageBtns = {}; + messageBtns[EALang['delete']] = function() { + BackendUsers.helper.delete(secretaryId); + $('#message_box').dialog('close'); + }; + messageBtns[EALang['cancel']] = function() { + $('#message_box').dialog('close'); }; - GeneralFunctions.displayMessageBox('Delete Secretary', 'Are you sure that you want ' - + 'to delete this record? This action cannot be undone.', messageBtns); + GeneralFunctions.displayMessageBox(EALang['delete_secretary'], + EALang['delete_record_prompt'], messageBtns); }); /** @@ -188,7 +187,7 @@ SecretariesHelper.prototype.save = function(secretary) { //console.log('Save Secretary Response:', response); //////////////////////////////////////////////////// if (!GeneralFunctions.handleAjaxExceptions(response)) return; - Backend.displayNotification('Secretary saved successfully!'); + Backend.displayNotification(EALang['secretary_saved']); BackendUsers.helper.resetForm(); $('#filter-secretaries .key').val(''); BackendUsers.helper.filter('', response.id, true); @@ -209,7 +208,7 @@ SecretariesHelper.prototype.delete = function(id) { //console.log('Delete secretary response:', response); ////////////////////////////////////////////////////// if (!GeneralFunctions.handleAjaxExceptions(response)) return; - Backend.displayNotification('Secretary deleted successfully!'); + Backend.displayNotification(EALang['secretary_deleted']); BackendUsers.helper.resetForm(); BackendUsers.helper.filter($('#filter-secretaries .key').val()); }, 'json'); diff --git a/src/assets/js/frontend_book.js b/src/assets/js/frontend_book.js index 8eff96ab..ba705df8 100644 --- a/src/assets/js/frontend_book.js +++ b/src/assets/js/frontend_book.js @@ -243,7 +243,7 @@ var FrontendBook = { * in the meantime the selected appointment date/time wasn't reserved by * another customer or event. */ - $('#book-appointment-form').submit(function(event) { + $('#book-appointment-submit').click(function(event) { var formData = jQuery.parseJSON($('input[name="post_data"]').val()); var postData = { @@ -269,7 +269,7 @@ var FrontendBook = { + 'the check appointment time availability could not be completed. ' + 'The following issues occured:'); $('#message_box').append(GeneralFunctions.exceptionsToHtml(response.exceptions)); - return; + return false; } if (response === true) { @@ -281,8 +281,6 @@ var FrontendBook = { FrontendBook.getAvailableHours($('#select-date').val()); } }, 'json'); - - return false; }); }, diff --git a/src/assets/js/general_functions.js b/src/assets/js/general_functions.js index 61b57559..fb915b65 100644 --- a/src/assets/js/general_functions.js +++ b/src/assets/js/general_functions.js @@ -191,7 +191,7 @@ var GeneralFunctions = { * user opens the "Details" collapse component. * * @param {array} exceptions Contains the exceptions to be displayed. - * @returns {String} Returns the html markup for the exceptions. + * @returns {string} Returns the html markup for the exceptions. */ exceptionsToHtml: function(exceptions) { var html = @@ -200,7 +200,7 @@ var GeneralFunctions = { '
' + '' + - 'Details' + + EALang['details'] + '' + '
'; @@ -222,7 +222,7 @@ var GeneralFunctions = { * This method parse the json encoded strings that are fetched by ajax calls. * * @param {array} exceptions Exception array returned by an ajax call. - * @returns {Array} Returns the parsed js objects. + * @returns {array} Returns the parsed js objects. */ parseExceptions: function(exceptions) { var parsedExceptions = new Array();