Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 9 #1545

Closed
wants to merge 32 commits into from
Closed

Patch 9 #1545

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a5ec303
no message
tm8544 Mar 29, 2024
d87026a
no message
tm8544 Mar 29, 2024
c45e36b
Done: Add a check so that this happens if the window.innerWidth is le…
tm8544 Apr 8, 2024
6e452fa
Update booking.js
tm8544 Apr 8, 2024
b1eb76a
Merge pull request #1 from alextselegidis/develop
tm8544 Apr 15, 2024
7a014c4
Update booking.js
tm8544 Apr 15, 2024
f0a15af
Merge pull request #2 from alextselegidis/develop
tm8544 Apr 15, 2024
8ddcacf
Update booking.js
tm8544 Apr 16, 2024
0f55e83
Update array_helper.php
tm8544 Apr 16, 2024
abf4171
Merge pull request #3 from alextselegidis/develop
tm8544 Apr 16, 2024
2ff4c07
Merge remote-tracking branch 'origin/Booking.js' into develop
tm8544 Apr 17, 2024
8a62f4a
Merge remote-tracking branch 'origin/tm8544-patch-1' into develop
tm8544 Apr 17, 2024
e873895
Merge pull request #4 from alextselegidis/develop
tm8544 Apr 27, 2024
dd595c9
Merge pull request #5 from alextselegidis/develop
tm8544 May 9, 2024
42663f2
Merge pull request #6 from alextselegidis/develop
tm8544 May 9, 2024
475ba32
Merge pull request #7 from alextselegidis/develop
tm8544 May 11, 2024
92b01b4
no message
tm8544 May 12, 2024
00e64f1
no message
tm8544 May 13, 2024
69299f4
no message
tm8544 May 13, 2024
8c39569
Merge pull request #8 from alextselegidis/develop
tm8544 May 13, 2024
4208bc0
Update appointments_modal.js
tm8544 May 13, 2024
89bc5c3
Merge pull request #9 from alextselegidis/develop
tm8544 May 13, 2024
8bb5626
Merge pull request #10 from alextselegidis/develop
tm8544 May 14, 2024
54770a8
Merge pull request #11 from alextselegidis/develop
tm8544 May 14, 2024
fb58e31
Merge pull request #12 from alextselegidis/develop
tm8544 May 14, 2024
b3d697b
Merge pull request #13 from alextselegidis/develop
tm8544 May 17, 2024
d1acc60
Merge pull request #14 from alextselegidis/develop
tm8544 May 17, 2024
83ecd5c
Merge pull request #15 from alextselegidis/develop
tm8544 May 18, 2024
fa831ff
Merge pull request #16 from alextselegidis/develop
tm8544 May 20, 2024
ade3867
Missing $lang['fields'] = 'Fields';
tm8544 May 20, 2024
a99efc0
Add missing login message to translations
tm8544 May 20, 2024
a1775ad
RuntimeException massages translated
tm8544 May 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion application/controllers/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function save(): void
{
try {
if (cannot('edit', PRIV_USER_SETTINGS)) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$account = request('account');
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Api_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function save(): void
{
try {
if (cannot('edit', PRIV_SYSTEM_SETTINGS)) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$settings = request('api_settings', []);
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Booking_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function save(): void
{
try {
if (cannot('edit', PRIV_SYSTEM_SETTINGS)) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$settings = request('booking_settings', []);
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/Business_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function save(): void
{
try {
if (cannot('edit', PRIV_SYSTEM_SETTINGS)) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$settings = request('business_settings', []);
Expand Down Expand Up @@ -120,7 +120,7 @@ public function apply_global_working_plan()
{
try {
if (cannot('edit', PRIV_SYSTEM_SETTINGS)) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$working_plan = request('working_plan');
Expand Down
8 changes: 4 additions & 4 deletions application/controllers/Caldav.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function connect_to_server(): void
$user_id = session('user_id');

if (cannot('edit', PRIV_USERS) && (int) $user_id !== (int) $provider_id) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$caldav_url = request('caldav_url');
Expand Down Expand Up @@ -292,7 +292,7 @@ public function get_caldav_calendars(): void
$user_id = session('user_id');

if (cannot('edit', PRIV_USERS) && (int) $user_id !== (int) $provider_id) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$calendars = $this->caldav_sync->get_caldav_calendars($provider_id);
Expand All @@ -318,7 +318,7 @@ public function select_caldav_calendar(): void
$user_id = session('user_id');

if (cannot('edit', PRIV_USERS) && (int) $user_id !== (int) $provider_id) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$calendar_id = request('calendar_id');
Expand Down Expand Up @@ -352,7 +352,7 @@ public function disable_provider_sync(): void
$user_id = session('user_id');

if (cannot('edit', PRIV_USERS) && (int) $user_id !== (int) $provider_id) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$provider = $this->providers_model->find($provider_id);
Expand Down
20 changes: 10 additions & 10 deletions application/controllers/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public function save_appointment(): void
: can('edit', PRIV_CUSTOMERS);

if (!$required_permissions) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$this->customers_model->only($customer, $this->allowed_customer_fields);
Expand All @@ -249,7 +249,7 @@ public function save_appointment(): void
: can('edit', PRIV_APPOINTMENTS);

if (!$required_permissions) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

// If the appointment does not contain the customer record id, then it means that is going to be inserted.
Expand All @@ -268,7 +268,7 @@ public function save_appointment(): void
}

if (empty($appointment['id'])) {
throw new RuntimeException('The appointment ID is not available.');
throw new RuntimeException(lang('id_not_available'));
}

$appointment = $this->appointments_model->find($appointment['id']);
Expand Down Expand Up @@ -333,7 +333,7 @@ public function delete_appointment(): void
{
try {
if (cannot('delete', 'appointments')) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$appointment_id = request('appointment_id');
Expand Down Expand Up @@ -398,7 +398,7 @@ public function save_unavailability(): void
: can('edit', PRIV_APPOINTMENTS);

if (!$required_permissions) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$provider_id = (int) $unavailability['id_users_provider'];
Expand Down Expand Up @@ -431,7 +431,7 @@ public function delete_unavailability(): void
{
try {
if (cannot('delete', PRIV_APPOINTMENTS)) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$unavailability_id = request('unavailability_id');
Expand Down Expand Up @@ -463,7 +463,7 @@ public function save_working_plan_exception(): void
{
try {
if (cannot('edit', PRIV_USERS)) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$date = request('date');
Expand Down Expand Up @@ -495,7 +495,7 @@ public function delete_working_plan_exception(): void
$required_permissions = can('edit', PRIV_CUSTOMERS);

if (!$required_permissions) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$date = request('date');
Expand Down Expand Up @@ -523,7 +523,7 @@ public function get_calendar_appointments_for_table_view(): void
$required_permissions = can('view', PRIV_APPOINTMENTS);

if (!$required_permissions) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$start_date = request('start_date') . ' 00:00:00';
Expand Down Expand Up @@ -620,7 +620,7 @@ public function get_calendar_appointments(): void
{
try {
if (cannot('view', PRIV_APPOINTMENTS)) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$record_id = request('record_id');
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/General_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function save(): void
{
try {
if (cannot('edit', PRIV_SYSTEM_SETTINGS)) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$settings = request('general_settings', []);
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/Google.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public function select_google_calendar(): void
$user_id = session('user_id');

if (cannot('edit', PRIV_USERS) && (int) $user_id !== (int) $provider_id) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$calendar_id = request('calendar_id');
Expand Down Expand Up @@ -417,7 +417,7 @@ public function disable_provider_sync(): void
$user_id = session('user_id');

if (cannot('edit', PRIV_USERS) && (int) $user_id !== (int) $provider_id) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$this->providers_model->set_setting($provider_id, 'google_sync', false);
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Google_analytics_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function save(): void
{
try {
if (cannot('edit', PRIV_SYSTEM_SETTINGS)) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$settings = request('google_analytics_settings', []);
Expand Down
6 changes: 3 additions & 3 deletions application/controllers/Ldap_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function save(): void
{
try {
if (cannot('edit', PRIV_SYSTEM_SETTINGS)) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$settings = request('ldap_settings', []);
Expand Down Expand Up @@ -113,11 +113,11 @@ public function search(): void
{
try {
if (cannot('edit', PRIV_SYSTEM_SETTINGS)) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

if (!extension_loaded('ldap')) {
throw new RuntimeException('The LDAP extension is not loaded.');
throw new RuntimeException(lang('ldap_not_loaded.'));
}

$keyword = request('keyword');
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Legal_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function save(): void
{
try {
if (cannot('edit', PRIV_SYSTEM_SETTINGS)) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$settings = request('legal_settings', []);
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function validate(): void
}

if (empty($user_data)) {
throw new InvalidArgumentException('Invalid credentials provided, please try again.');
throw new InvalidArgumentException(lang('invalid_credentials_provided');
}

$this->session->sess_regenerate();
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Matomo_analytics_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function save(): void
{
try {
if (cannot('edit', PRIV_SYSTEM_SETTINGS)) {
throw new RuntimeException('You do not have the required permissions for this task.');
throw new RuntimeException(lang('no_permissions'));
}

$settings = request('matomo_analytics_settings', []);
Expand Down
2 changes: 1 addition & 1 deletion application/core/EA_Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function json(string $index = null, bool $xss_clean = false)
$input_stream = $CI->input->raw_input_stream;

if (empty($input_stream)) {
throw new RuntimeException('Cannot get JSON attribute from an empty input stream.');
throw new RuntimeException(lang('no_json_from_empty_stream'));
}

$payload = json_decode($input_stream, true);
Expand Down
6 changes: 3 additions & 3 deletions application/core/EA_Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function get_value(string $field, int $record_id): string
return $this->value($field, $record_id);
}

throw new RuntimeException('The "get_value" is not defined in model: ', __CLASS__);
throw new RuntimeException(lang('get_value_not_defined'), __CLASS__);
}

/**
Expand All @@ -92,7 +92,7 @@ public function get_row(int $record_id): array
return $this->find($record_id);
}

throw new RuntimeException('The "get_row" is not defined in model: ', __CLASS__);
throw new RuntimeException(lang('get_row_not_defined'), __CLASS__);
}

/**
Expand Down Expand Up @@ -157,7 +157,7 @@ public function cast(array &$record)
break;

default:
throw new RuntimeException('Unsupported cast type provided: ' . $cast);
throw new RuntimeException(lang('unsupported_cast_type') . $cast);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions application/helpers/date_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function get_date_format(): string
'DMY' => 'd/m/Y',
'MDY' => 'm/d/Y',
'YMD' => 'Y/m/d',
default => throw new RuntimeException('Invalid date format value: ' . $date_format),
default => throw new RuntimeException(lang('invalid_date_format') . $date_format),
};
}
}
Expand All @@ -43,7 +43,7 @@ function get_time_format(): string
return match ($time_format) {
'military' => 'H:i',
'regular' => 'g:i a',
default => throw new RuntimeException('Invalid time format value: ' . $time_format),
default => throw new RuntimeException(lang('invalid_time_format') . $time_format),
};
}
}
Expand Down
65 changes: 65 additions & 0 deletions application/language/arabic/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,4 +479,69 @@
$lang['role'] = 'Role';
$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.';
$lang['customer_is_already_booked'] = 'This customer already has an appointment during the requested reservation period.';
$lang['fields'] = 'Fields';
$lang['invalid_credentials_provided'] = 'Invalid credentials provided, please try again.';
$lang['no_permissions'] = 'You do not have the required permissions for this task.';
$lang['id_not_available'] = 'The appointment ID is not available.';
$lang['ldap_not_loaded'] = 'The LDAP extension is not loaded.';
$lang['no_google_token_for_provider'] = 'No google token available for the provider: ';
$lang['no_json_from_empty_stream'] = 'Cannot get JSON attribute from an empty input stream.';
$lang['get_value_not_defined'] = 'The "get_value" is not defined in model: ';
$lang['get_row_not_defined'] = 'The "get_row" is not defined in model: ';
$lang['unsupported_cast_type'] = 'Unsupported cast type provided: ';
$lang['invalid_date_format'] = 'Invalid date format value: ';
$lang['invalid_time_format'] = 'Invalid time format value: ';
$lang['username_not_in_db'] = 'The username was not found in the database: ';
$lang['provider_has_not_enabled_caldav_sync'] = 'The selected provider does not have the CalDAV sync enabled: ';
$lang['email_not_sent'] = 'Email was not sent: ';
$lang['backup_path_not_writable'] = 'The backup path is not writable: ';
$lang['unsupported_pw_hash_format'] = 'Unsupported password hash format';
$lang['admin_role_not_in_db'] = 'The admin role was not found in the database.';
$lang['admin_not_inserted'] = 'Could not insert admin.';
$lang['admin_setting_not_set'] = 'Could not set the new admin setting value: ';
$lang['admin_setting_record_not_found'] = 'No settings record found for admin with ID: ';
$lang['admin_not_updated'] = 'Could not update admin.';
$lang['admin_record_not_deleted'] = 'Record could not be deleted as the app requires at least one admin user.';
$lang['appointment_not_inserted'] = 'Could not insert appointment.';
$lang['appointment_record_not_updated'] = 'Could not update appointment record.';
$lang['blocked_period_not_inserted'] = 'Could not insert blocked-period.';
$lang['blocked_periods_not_updated'] = 'Could not insert blocked-periods.';
$lang['consent_not_inserted'] = 'Could not insert consent.';
$lang['consent_not_updated'] = 'Could not update consent.';
$lang['customer_role_not_in_db'] = 'The customer role was not found in the database.';
$lang['customer_not_inserted'] = 'Could not insert customer.';
$lang['customer_not_updated'] = 'Could not update customer.';
$lang['provider_role_not_in_db'] = 'The provider role was not found in the database.';
$lang['provider_not_inserted'] = 'Could not insert provider.';
$lang['provider_setting_not_set'] = 'Could not set the new provider setting value: ';
$lang['provider_setting_record_not_found'] = 'No settings record found for provider with ID: ';
$lang['provider_not_updated'] = 'Could not update provider.';
$lang['role_not_inserted'] = 'Could not insert role.';
$lang['role_not_updated'] = 'Could not update role.';
$lang['secretary_role_not_in_db'] = 'The secretary role was not found in the database.';
$lang['secretary_not_inserted'] = 'Could not insert secretary.';
$lang['secretary_setting_not_set'] = 'Could not set the new secretary setting value: ';
$lang['secretary_setting_record_not_found'] = 'No settings record found for secretary with ID: ';
$lang['secretary_not_updated'] = 'Could not update secretary.';
$lang['category_not_inserted'] = 'Could not insert service-category.';
$lang['categories_not_updated'] = 'Could not update service categories.';
$lang['service_not_inserted'] = 'Could not insert service.';
$lang['service_not_updated'] = 'Could not update service.';
$lang['setting_not_inserted'] = 'Could not insert setting.';
$lang['setting_not_updated'] = 'Could not update setting.';
$lang['unavailability_not_inserted'] = 'Could not insert unavailability.';
$lang['unavailability_record_not_updated'] = 'Could not update unavailability record.';
$lang['user_not_inserted'] = 'Could not insert user.';
$lang['user_setting_not_set'] = 'Could not set the new user setting value: ';
$lang['user_setting_record_not_found'] = 'No settings record found for user with ID: ';
$lang['user_not_updated'] = 'Could not update user.';
$lang['webhook_not_inserted'] = 'Could not insert webhook.';
$lang['webhook_not_updated'] = 'Could not update webhook.';
$lang['model_name_is_being_used'] = 'The model name you are loading is the name of a resource that is already being used: ';
$lang['unable_to_locate_model'] = 'Unable to locate the model you have specified: ';
$lang['class'] = 'Class ';
$lang['does_not_extent_ci_model'] = ' doesn\'t extend CI_Model.';
$lang['unable_to_connect_db'] = 'Unable to connect to the database.';
$lang['set_rules_called_with_empty_parameter'] = 'Form_validation: set_rules() called with an empty $rules parameter';
$lang['setting_value_not_found'] = 'The requested setting value was not found: ';
// End