diff --git a/application/config/migration.php b/application/config/migration.php index c6de3a74..957d49d0 100755 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 19; +$config['migration_version'] = 20; /* diff --git a/application/controllers/Appointments.php b/application/controllers/Appointments.php index dbd4f8d6..e668511b 100755 --- a/application/controllers/Appointments.php +++ b/application/controllers/Appointments.php @@ -1041,6 +1041,8 @@ class Appointments extends CI_Controller { $appointment['location'] = $service['location']; } + // save customer language (the language which is used to render the booking page) + $customer['language'] = $this->config->item('language'); $customer_id = $this->customers_model->add($customer); $appointment['id_users_customer'] = $customer_id; diff --git a/application/language/english/translations_lang.php b/application/language/english/translations_lang.php index 845cf844..0d4858df 100755 --- a/application/language/english/translations_lang.php +++ b/application/language/english/translations_lang.php @@ -21,6 +21,8 @@ $lang['address'] = 'Address'; $lang['city'] = 'City'; $lang['zip_code'] = 'Zip Code'; $lang['notes'] = 'Notes'; +$lang['language'] = 'Language'; +$lang['no_language'] = 'No language'; $lang['fields_are_required'] = 'Fields with * are required!'; $lang['appointment_confirmation'] = 'Appointment Confirmation'; $lang['confirm'] = 'Confirm'; diff --git a/application/language/french/translations_lang.php b/application/language/french/translations_lang.php index 76ef6a02..b39f3a2f 100755 --- a/application/language/french/translations_lang.php +++ b/application/language/french/translations_lang.php @@ -20,6 +20,8 @@ $lang['address'] = 'Adresse'; $lang['city'] = 'Ville'; $lang['zip_code'] = 'Code postal'; $lang['notes'] = 'Commentaires'; +$lang['language'] = 'Langue'; +$lang['no_language'] = 'Pas de langue'; $lang['fields_are_required'] = 'Les champs avec * sont obligatoires'; $lang['appointment_confirmation'] = 'Confirmez votre rendez-vous'; $lang['confirm'] = 'Confirmation'; diff --git a/application/language/german/translations_lang.php b/application/language/german/translations_lang.php index 2a083d48..400199b9 100755 --- a/application/language/german/translations_lang.php +++ b/application/language/german/translations_lang.php @@ -20,6 +20,7 @@ $lang['address'] = 'Adresse'; $lang['city'] = 'Stadt'; $lang['zip_code'] = 'Postleitzahl'; $lang['notes'] = 'Bemerkungen'; +$lang['language'] = 'Sprache'; $lang['fields_are_required'] = 'Die Felder mit einem * sind Pflichtfelder!'; $lang['appointment_confirmation'] = 'Bitte bestätigen Sie die Terminauswahl'; $lang['confirm'] = 'Bestätigung'; diff --git a/application/migrations/020_add_language_to_users.php b/application/migrations/020_add_language_to_users.php new file mode 100644 index 00000000..2a28bc02 --- /dev/null +++ b/application/migrations/020_add_language_to_users.php @@ -0,0 +1,48 @@ + + * @copyright Copyright (c) 2013 - 2020, Alex Tselegidis + * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link http://easyappointments.org + * @since v1.4.0 + * ---------------------------------------------------------------------------- */ + +/** + * Class Migration_Add_language_to_users + * + * @property CI_DB_query_builder db + * @property CI_DB_forge dbforge + */ +class Migration_Add_language_to_users extends CI_Migration { + /** + * Upgrade method. + */ + public function up() + { + if ( ! $this->db->field_exists('language', 'users')) + { + $fields = [ + 'language' => [ + 'type' => 'VARCHAR', + 'constraint' => '256', + 'default' => '', + 'after' => 'timezone' + ] + ]; + + $this->dbforge->add_column('users', $fields); + } + } + + /** + * Downgrade method. + */ + public function down() + { + $this->dbforge->drop_column('users', 'language'); + } +} diff --git a/application/views/backend/customers.php b/application/views/backend/customers.php index b6ef0c95..9f83ee86 100755 --- a/application/views/backend/customers.php +++ b/application/views/backend/customers.php @@ -132,6 +132,11 @@ +