mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-29 01:52:24 +03:00
Fix the booking settings require-notes setting application, as it should check on the appointment notes and not the customer ones
This commit is contained in:
parent
80d91779d7
commit
66dfd36d6d
2 changed files with 4 additions and 2 deletions
|
@ -92,12 +92,16 @@ class Appointments_model extends EA_Model {
|
|||
}
|
||||
|
||||
// Make sure all required fields are provided.
|
||||
|
||||
$require_notes = filter_var(setting('require_notes'), FILTER_VALIDATE_BOOLEAN);
|
||||
|
||||
if (
|
||||
empty($appointment['start_datetime'])
|
||||
|| empty($appointment['end_datetime'])
|
||||
|| empty($appointment['id_services'])
|
||||
|| empty($appointment['id_users_provider'])
|
||||
|| empty($appointment['id_users_customer'])
|
||||
|| (empty($appointment['notes']) && $require_notes)
|
||||
)
|
||||
{
|
||||
throw new InvalidArgumentException('Not all required fields are provided: ' . print_r($appointment, TRUE));
|
||||
|
|
|
@ -101,7 +101,6 @@ class Customers_model extends EA_Model {
|
|||
$require_address = filter_var(setting('require_address'), FILTER_VALIDATE_BOOLEAN);
|
||||
$require_city = filter_var(setting('require_city'), FILTER_VALIDATE_BOOLEAN);
|
||||
$require_zip_code = filter_var(setting('require_zip_code'), FILTER_VALIDATE_BOOLEAN);
|
||||
$require_notes = filter_var(setting('require_notes'), FILTER_VALIDATE_BOOLEAN);
|
||||
|
||||
if (
|
||||
(empty($customer['first_name']) && $require_first_name)
|
||||
|
@ -111,7 +110,6 @@ class Customers_model extends EA_Model {
|
|||
|| (empty($customer['address']) && $require_address)
|
||||
|| (empty($customer['city']) && $require_city)
|
||||
|| (empty($customer['zip_code']) && $require_zip_code)
|
||||
|| (empty($customer['notes']) && $require_notes)
|
||||
)
|
||||
{
|
||||
throw new InvalidArgumentException('Not all required fields are provided: ' . print_r($customer, TRUE));
|
||||
|
|
Loading…
Reference in a new issue