Fixes in minor bugs.
This commit is contained in:
parent
e5b109e7da
commit
919c3da18d
16 changed files with 55 additions and 33 deletions
|
@ -29,8 +29,8 @@ $config['base_url'] = SystemConfiguration::$base_url;
|
|||
| the global "config" variable.
|
||||
|
|
||||
*/
|
||||
$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_version'] = '1.0'; // This must be changed manually.
|
||||
$config['ea_release_title'] = ''; // Leave empty for no title or add BETA, TEST etc ...
|
||||
$config['ea_google_sync_feature'] = SystemConfiguration::$google_sync_feature;
|
||||
|
||||
/*
|
||||
|
|
|
@ -619,7 +619,7 @@ class Appointments extends CI_Controller {
|
|||
*/
|
||||
public function ajax_install() {
|
||||
try {
|
||||
// 2nd method using the ci database class.
|
||||
// Create E!A database structure.
|
||||
$file_contents = file_get_contents($this->config->item('base_url') . 'assets/sql/structure.sql');
|
||||
$sql_queries = explode(';', $file_contents);
|
||||
array_pop($sql_queries);
|
||||
|
@ -633,7 +633,13 @@ class Appointments extends CI_Controller {
|
|||
$admin['settings']['username'] = $admin['username'];
|
||||
$admin['settings']['password'] = $admin['password'];
|
||||
unset($admin['username'], $admin['password']);
|
||||
$this->admins_model->add($admin);
|
||||
$admin['id'] = $this->admins_model->add($admin);
|
||||
|
||||
$this->load->library('session');
|
||||
$this->session->set_userdata('user_id', $admin['id']);
|
||||
$this->session->set_userdata('user_email', $admin['email']);
|
||||
$this->session->set_userdata('role_slug', DB_SLUG_ADMIN);
|
||||
$this->session->set_userdata('username', $admin['settings']['username']);
|
||||
|
||||
// Save company settings
|
||||
$this->load->model('settings_model');
|
||||
|
|
|
@ -265,7 +265,7 @@ class Backend extends CI_Controller {
|
|||
public function update() {
|
||||
try {
|
||||
if (!$this->hasPrivileges(PRIV_SYSTEM_SETTINGS, TRUE))
|
||||
throw new Exception('You do not have the required privileges for this task.');
|
||||
throw new Exception('You do not have the required privileges for this task!');
|
||||
|
||||
$this->load->library('migration');
|
||||
|
||||
|
|
|
@ -12,6 +12,14 @@ class Backend_api extends CI_Controller {
|
|||
$this->load->library('session');
|
||||
$this->load->model('roles_model');
|
||||
$this->privileges = $this->roles_model->get_privileges($this->session->userdata('role_slug'));
|
||||
|
||||
// Set user's selected language.
|
||||
if ($this->session->userdata('language')) {
|
||||
$this->config->set_item('language', $this->session->userdata('language'));
|
||||
$this->lang->load('translations', $this->session->userdata('language'));
|
||||
} else {
|
||||
$this->lang->load('translations', $this->config->item('language')); // default
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -176,25 +184,22 @@ class Backend_api extends CI_Controller {
|
|||
->get_setting('notifications', $provider['id']);
|
||||
|
||||
if (!$manage_mode) {
|
||||
$customer_title = 'Your appointment has been successfully booked!';
|
||||
$customer_message = 'Thank you for arranging an appointment with us. '
|
||||
. 'Below you can see the appointment details. Make changes '
|
||||
. 'by clicking the appointment link.';
|
||||
$customer_title = $this->lang->line('appointment_booked');
|
||||
$customer_message = $this->lang->line('thank_your_for_appointment');
|
||||
$customer_link = $this->config->item('base_url') . 'appointments/index/'
|
||||
. $appointment['hash'];
|
||||
|
||||
$provider_title = 'A new appointment has been added to your plan.';
|
||||
$provider_message = 'You can make changes by clicking the appointment '
|
||||
. 'link below';
|
||||
$provider_title = $this->lang->line('appointment_added_to_your_plan');
|
||||
$provider_message = $this->lang->line('appointment_link_description');
|
||||
$provider_link = $this->config->item('base_url') . 'backend/index/'
|
||||
. $appointment['hash'];
|
||||
} else {
|
||||
$customer_title = 'Appointment changes have been successfully saved!';
|
||||
$customer_title = $this->lang->line('appointment_changes_saved');
|
||||
$customer_message = '';
|
||||
$customer_link = $this->config->item('base_url') . 'appointments/index/'
|
||||
. $appointment['hash'];
|
||||
|
||||
$provider_title = 'Appointment changes have been successfully saved!';
|
||||
$provider_title = $this->lang->line('appointment_details_changed');
|
||||
$provider_message = '';
|
||||
$provider_link = $this->config->item('base_url') . 'backend/index/'
|
||||
. $appointment['hash'];
|
||||
|
|
|
@ -24,6 +24,12 @@ class Test extends CI_Controller {
|
|||
return;
|
||||
}
|
||||
|
||||
if (ENVIRONMENT !== 'development') {
|
||||
$this->output->set_output('Tests are available only at development environment. '
|
||||
. 'Please check your "index.php" file settings.');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->load->view('general/test');
|
||||
$this->unit_tests->run_all_tests();
|
||||
}
|
||||
|
|
|
@ -226,7 +226,7 @@ $lang['backend_calendar'] = 'Backend Calendar';
|
|||
$lang['start_date_time'] = 'Start Date / Time';
|
||||
$lang['end_date_time'] = 'End Date / Time';
|
||||
$lang['licensed_under'] = 'Licensed Under';
|
||||
$lang['unexpected_issues_occurred'] = 'Unexpected issues occured!';
|
||||
$lang['unexpected_issues_occurred'] = 'Unexpected issues occurred!';
|
||||
$lang['service_communication_error'] = 'A server communication error occurred, please try again.';
|
||||
$lang['no_privileges_edit_appointments'] = 'You do not have the required privileges to edit appointments.';
|
||||
$lang['unavailable_updated'] = 'Unavailable time period updated successfully!';
|
||||
|
|
|
@ -226,7 +226,7 @@ $lang['backend_calendar'] = 'Backend Kalender';
|
|||
$lang['start_date_time'] = 'Start Datum / Zeit';
|
||||
$lang['end_date_time'] = 'Ende Datum / Zeit';
|
||||
$lang['licensed_under'] = 'Lizenzierte Unter';
|
||||
$lang['unexpected_issues_occured'] = 'Unerwartete Probleme aufgetreten!';
|
||||
$lang['unexpected_issues_occurred'] = 'Unerwartete Probleme aufgetreten!';
|
||||
$lang['service_communication_error'] = 'Während der Kommunikation mit dem Server ist ein Fehler aufgetreten, bitte versuchen Sie es erneut.';
|
||||
$lang['no_privileges_edit_appointments'] = 'Sie haben nicht die Berechtigung, um Termine zu bearbeiten.';
|
||||
$lang['unavailable_updated'] = 'Nicht zur Verfügung stehender Zeitraum erfolgreich erneuert worden!';
|
||||
|
|
|
@ -226,7 +226,7 @@ $lang['backend_calendar'] = 'Ημερολόγιο Backend';
|
|||
$lang['start_date_time'] = 'Ημ. / Ώρα Έναρξης';
|
||||
$lang['end_date_time'] = 'Ημ. / Ώρα Λήξης';
|
||||
$lang['licensed_under'] = 'Σύμφωνα Με Την Άδεια';
|
||||
$lang['unexpected_issues_occured'] = 'Παρουσιάστηκαν απροσδόκητα προβλήματα!';
|
||||
$lang['unexpected_issues_occurred'] = 'Παρουσιάστηκαν απροσδόκητα προβλήματα!';
|
||||
$lang['service_communication_error'] = 'Παρουσιάστηκε σφάλμα κατά την επικοινωνία με τον διακομιστή, παρακαλώ προσπαθήστε ξανά.';
|
||||
$lang['no_privileges_edit_appointments'] = 'Δεν έχετε τα απαραίτητα δικαιώματα για να επεξεργαστείτε ραντεβού.';
|
||||
$lang['unavailable_updated'] = 'Η μη διαθέσιμη περίοδος ενημερώθηκε επιτυχώς!';
|
||||
|
|
|
@ -21,7 +21,7 @@ class Customers_Model extends CI_Model {
|
|||
*/
|
||||
public function add($customer) {
|
||||
// Validate the customer data before doing anything.
|
||||
!$this->validate($customer);
|
||||
$this->validate($customer);
|
||||
|
||||
// :: CHECK IF CUSTOMER ALREADY EXIST (FROM EMAIL).
|
||||
if ($this->exists($customer) && !isset($customer['id'])) {
|
||||
|
@ -103,6 +103,12 @@ class Customers_Model extends CI_Model {
|
|||
* @return int Returns the updated record id.
|
||||
*/
|
||||
private function update($customer) {
|
||||
// Do not update empty string values.
|
||||
foreach ($customer as $key => $value) {
|
||||
if ($value === '')
|
||||
unset($customer[$key]);
|
||||
}
|
||||
|
||||
$this->db->where('id', $customer['id']);
|
||||
if (!$this->db->update('ea_users', $customer)) {
|
||||
throw new Exception('Could not update customer to the database.');
|
||||
|
@ -147,8 +153,7 @@ class Customers_Model extends CI_Model {
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate customer data before the insert or
|
||||
* update operation is executed.
|
||||
* Validate customer data before the insert or update operation is executed.
|
||||
*
|
||||
* @param array $customer Contains the customer data.
|
||||
* @return bool Returns the validation result.
|
||||
|
@ -156,7 +161,6 @@ class Customers_Model extends CI_Model {
|
|||
public function validate($customer) {
|
||||
$this->load->helper('data_validation');
|
||||
|
||||
|
||||
// If a customer id is provided, check whether the record
|
||||
// exist in the database.
|
||||
if (isset($customer['id'])) {
|
||||
|
|
|
@ -81,7 +81,7 @@ class User_Model extends CI_Model {
|
|||
->select('ea_users.id AS user_id, ea_users.email AS user_email, '
|
||||
. 'ea_roles.slug AS role_slug, ea_user_settings.username')
|
||||
->from('ea_users')
|
||||
->join('ea_roles', 'ea_roles.id = ea_users.id_roles', 'innder')
|
||||
->join('ea_roles', 'ea_roles.id = ea_users.id_roles', 'inner')
|
||||
->join('ea_user_settings', 'ea_user_settings.id_users = ea_users.id')
|
||||
->where('ea_user_settings.username', $username)
|
||||
->where('ea_user_settings.password', $password)
|
||||
|
|
|
@ -214,7 +214,7 @@
|
|||
</button>
|
||||
<input type="text" id="filter-existing-customers"
|
||||
placeholder="<?php echo $this->lang->line('type_to_filter_customers'); ?>"
|
||||
style="display: none;" class="input-medium"/>
|
||||
style="display: none;" class="input-medium span4"/>
|
||||
<div id="existing-customers-list" style="display: none;"></div>
|
||||
</legend>
|
||||
|
||||
|
|
|
@ -257,6 +257,7 @@ body .jspTrack {
|
|||
#filter-existing-customers {
|
||||
display: inline-block;
|
||||
height: 14px;
|
||||
min-height: 24px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
@ -312,7 +313,7 @@ body .form-horizontal .controls {
|
|||
}
|
||||
|
||||
#customers-page #customer-appointments {
|
||||
height: 250px;
|
||||
height: 370px;
|
||||
width: 330px;
|
||||
border: 4px solid #E2E2E2;
|
||||
margin-bottom: 20px;
|
||||
|
@ -502,7 +503,7 @@ body .form-horizontal .controls {
|
|||
#users-page #provider-services {
|
||||
border: 4px solid #ccc;
|
||||
width: 340px;
|
||||
height: 140px;
|
||||
height: 387px;
|
||||
overflow-y: scroll;
|
||||
padding: 7px;
|
||||
}
|
||||
|
|
|
@ -548,7 +548,7 @@ var BackendCalendar = {
|
|||
$dialog.find('.modal-message').text(EALang['unexpected_issues_occurred']);
|
||||
$dialog.find('.modal-message').addClass('alert-error');
|
||||
$dialog.find('.modal-message').fadeIn();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Display success message to the user.
|
||||
|
@ -882,7 +882,7 @@ var BackendCalendar = {
|
|||
$('#address').val(c.address);
|
||||
$('#city').val(c.city);
|
||||
$('#zip-code').val(c.zip_code);
|
||||
$('#customer-code').val(c.notes);
|
||||
$('#customer-notes').val(c.notes);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
@ -1920,13 +1920,13 @@ var BackendCalendar = {
|
|||
}
|
||||
});
|
||||
if (missingRequiredField) {
|
||||
throw 'Fields with * are required!';
|
||||
throw EALang['fields_are_required'];
|
||||
}
|
||||
|
||||
// :: CHECK EMAIL ADDRESS
|
||||
if (!GeneralFunctions.validateEmail($dialog.find('#email').val())) {
|
||||
$dialog.find('#email').parents().eq(1).addClass('error');
|
||||
throw 'Invalid email address!';
|
||||
throw EALang['invalid_email'];
|
||||
}
|
||||
|
||||
// :: CHECK APPOINTMENT START AND END TIME
|
||||
|
@ -1935,7 +1935,7 @@ var BackendCalendar = {
|
|||
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!';
|
||||
throw EALang['start_date_before_end_error'];
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -359,7 +359,7 @@ SecretariesHelper.prototype.filter = function(key, selectId, display) {
|
|||
$('#filter-secretaries .results').jScrollPane({ mouseWheelSpeed: 70 });
|
||||
|
||||
if (response.length == 0) {
|
||||
$('#filter-secretaries .results').html('<em>No results found ...</em>')
|
||||
$('#filter-secretaries .results').html('<em>' + EALang['no_records_found'] + '</em>')
|
||||
}
|
||||
|
||||
if (selectId != undefined) {
|
||||
|
|
|
@ -267,7 +267,7 @@ var FrontendBook = {
|
|||
response.exceptions = GeneralFunctions.parseExceptions(response.exceptions);
|
||||
GeneralFunctions.displayMessageBox('Unexpected Issues', 'Unfortunately '
|
||||
+ 'the check appointment time availability could not be completed. '
|
||||
+ 'The following issues occured:');
|
||||
+ 'The following issues occurred:');
|
||||
$('#message_box').append(GeneralFunctions.exceptionsToHtml(response.exceptions));
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@ WorkingPlan.prototype.bindEventHandlers = function() {
|
|||
// Reset previous editable tds
|
||||
var $previousEdt = $(this).closest('table').find('.editable').get();
|
||||
$.each($previousEdt, function(index, edt) {
|
||||
edt.reset();
|
||||
if (edt.reset !== undefined) edt.reset();
|
||||
});
|
||||
|
||||
// Make all cells in current row editable.
|
||||
|
|
Loading…
Reference in a new issue