forked from mirrors/easyappointments
Make sure that the duration of a service does not become less than the minimum acceptable value as otherwise it will make problems with the availability generation
This commit is contained in:
parent
e496105fac
commit
76672db959
31 changed files with 42 additions and 2 deletions
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'فترة غير متاحة جديدة';
|
|||
$lang['edit_unavailable_title'] = 'تعديل فترة غير متاحة';
|
||||
$lang['unavailable_saved'] = 'تم حفظ الفترة الغير متاحة بنجاح';
|
||||
$lang['start_date_before_end_error'] = 'تاريخ البداية أكبر من تاريخ الانتهاء.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'بريد الكتروني غير صحيح';
|
||||
$lang['customers'] = 'الزبائن';
|
||||
$lang['details'] = 'التفاصيل';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Нов неработен период';
|
|||
$lang['edit_unavailable_title'] = 'Промяна на неработен период';
|
||||
$lang['unavailable_saved'] = 'Неработен период запазен успешно.';
|
||||
$lang['start_date_before_end_error'] = 'Стартовият период е по-дълъг от крайната дата.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Невалиден адрес на електронна поща.';
|
||||
$lang['customers'] = 'Клиенти';
|
||||
$lang['details'] = 'Детайли';
|
||||
|
|
|
@ -110,6 +110,7 @@ $lang['new_unavailable_title'] = 'Nou període de no disponibilitat';
|
|||
$lang['edit_unavailable_title'] = 'Edita el període de no disponibilitat';
|
||||
$lang['unavailable_saved'] = 'El període de no disponibilitat s\'ha desat correctament.';
|
||||
$lang['start_date_before_end_error'] = 'La data d\'inici és posterior de la de fi.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'L\'adreça de correu electrònic no és vàlida.';
|
||||
$lang['customers'] = 'Clients';
|
||||
$lang['details'] = 'Detalls';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = '新的不可预约时间段';
|
|||
$lang['edit_unavailable_title'] = '编辑不可预定时间段';
|
||||
$lang['unavailable_saved'] = '不可预定时间段保存成功.';
|
||||
$lang['start_date_before_end_error'] = '开始日期数值晚于结束日期.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = '无效电子邮箱地址.';
|
||||
$lang['customers'] = '客户';
|
||||
$lang['details'] = '详细资料';
|
||||
|
|
|
@ -110,6 +110,7 @@ $lang['new_unavailable_title'] = 'Nové období nedostupnosti';
|
|||
$lang['edit_unavailable_title'] = 'Editovat období nedostupnosti';
|
||||
$lang['unavailable_saved'] = 'Období nedostupnosti úspěšně uloženo.';
|
||||
$lang['start_date_before_end_error'] = 'Datum zahájení je vyšší než datum ukončení.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Neplatná emailová adresa.';
|
||||
$lang['customers'] = 'Zákazníci';
|
||||
$lang['details'] = 'Základní údaje';
|
||||
|
@ -418,6 +419,7 @@ $lang['new_unavailable_title'] = 'Nové období nedostupnosti';
|
|||
$lang['edit_unavailable_title'] = 'Editovat období nedostupnosti';
|
||||
$lang['unavailable_saved'] = 'Období nedostupnosti úspěšně uloženo.';
|
||||
$lang['start_date_before_end_error'] = 'Datum zahájení je vyšší než datum ukončení.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Neplatná emailová adresa.';
|
||||
$lang['customers'] = 'Zákazníci';
|
||||
$lang['details'] = 'Základní údaje';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Ny ikke tilgængelig periode';
|
|||
$lang['edit_unavailable_title'] = 'Redigere ikke tilgængelig periode';
|
||||
$lang['unavailable_saved'] = 'Ikke tilgængelig periode er gemt.';
|
||||
$lang['start_date_before_end_error'] = 'Start dato er større end slut dato';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Ugyldig email adresse';
|
||||
$lang['customers'] = 'Kunderne';
|
||||
$lang['details'] = 'Detaljer';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Nieuwe periode waarop men niet beschikbaar is'
|
|||
$lang['edit_unavailable_title'] = 'Bewerk beschikbare periode';
|
||||
$lang['unavailable_saved'] = 'Onbeschikbaar periode succesvol opgeslagen.';
|
||||
$lang['start_date_before_end_error'] = 'De startdatum is later dan de einddatum.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Ongeldig e-mailadres.';
|
||||
$lang['customers'] = 'Klanten';
|
||||
$lang['details'] = 'Details';
|
||||
|
|
|
@ -110,6 +110,7 @@ $lang['new_unavailable_title'] = 'New Unavailable Period';
|
|||
$lang['edit_unavailable_title'] = 'Edit Unavailable Period';
|
||||
$lang['unavailable_saved'] = 'Unavailable period saved successfully.';
|
||||
$lang['start_date_before_end_error'] = 'Start date value is latter than end date.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Invalid email address.';
|
||||
$lang['customers'] = 'Customers';
|
||||
$lang['details'] = 'Details';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Uusi poissaolojakso';
|
|||
$lang['edit_unavailable_title'] = 'Muokkaa poissaolojaksoa';
|
||||
$lang['unavailable_saved'] = 'Poissaolojakso tallennettiin.';
|
||||
$lang['start_date_before_end_error'] = 'Aloituspäivämäärä on loppupäivää myöhäisempi.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Virheellinen sähköpostiosoite.';
|
||||
$lang['customers'] = 'Asiakkaat';
|
||||
$lang['details'] = 'Lisätiedot';
|
||||
|
|
|
@ -109,6 +109,7 @@ $lang['new_unavailable_title'] = 'Nouvelle période d\'indisponibilité';
|
|||
$lang['edit_unavailable_title'] = 'Editer une période d\'indisponibilité';
|
||||
$lang['unavailable_saved'] = 'Période d\'indisponibilité sauvegardée avec succès .';
|
||||
$lang['start_date_before_end_error'] = 'La date de début est ultérieure à la date de fin .';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Adresse email non valide .';
|
||||
$lang['customers'] = 'Clients';
|
||||
$lang['details'] = 'Détails';
|
||||
|
|
|
@ -108,6 +108,7 @@ $lang['new_unavailable_title'] = 'Neuer nicht zur Verfügung stehender Zeitraum'
|
|||
$lang['edit_unavailable_title'] = 'Nicht zur Verfügung stehenden Zeitraum bearbeiten';
|
||||
$lang['unavailable_saved'] = 'Nicht zur Verfügung stehender Zeitraum erfolgreich gespeichert.';
|
||||
$lang['start_date_before_end_error'] = 'Das Startdatum ist größer als das Enddatum.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Ungültige E-Mail-Adresse.';
|
||||
$lang['customers'] = 'Kunden';
|
||||
$lang['details'] = 'Details';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Νέα Μη Διαθέσιμη Περίοδο
|
|||
$lang['edit_unavailable_title'] = 'Επεξεργασία Μη Διαθέσιμης Περιόδου';
|
||||
$lang['unavailable_saved'] = 'Η μη διαθέσιμη περίοδος αποθηκεύτηκε επιτυχώς.';
|
||||
$lang['start_date_before_end_error'] = 'Η ημερομηνία εκκίνησης είναι μεγαλύτερα από την ημερομηνία λήξης.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Λανθασμένη διεύθυνση email.';
|
||||
$lang['customers'] = 'Πελάτες';
|
||||
$lang['details'] = 'Λεπτομέρειες';
|
||||
|
|
|
@ -110,6 +110,7 @@ $lang['new_unavailable_title'] = ' מועד לא זמין חדש';
|
|||
$lang['edit_unavailable_title'] = 'עריכת מועד לא זמין';
|
||||
$lang['unavailable_saved'] = 'מועד לא זמין נשמר בהצלחה!';
|
||||
$lang['start_date_before_end_error'] = 'ערך תאריך ההתחלה גדול מתאריך הסיום!';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'כתובת דוא"ל לא חוקית!';
|
||||
$lang['customers'] = 'לקוחות';
|
||||
$lang['details'] = 'פרטים';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'नए अनुपलब्ध अवधि';
|
|||
$lang['edit_unavailable_title'] = 'अनुपलब्ध अवधि संपादित करें';
|
||||
$lang['unavailable_saved'] = 'अनुपलब्ध अवधि सफलतापूर्वक बचाया.';
|
||||
$lang['start_date_before_end_error'] = 'प्रारंभ दिनांक मान के अंत की तारीख से भी बड़ा है';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'अमान्य ईमेल पता.';
|
||||
$lang['customers'] = 'उपभोक्ता';
|
||||
$lang['details'] = 'विवरण';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Új nem foglalható időpont ';
|
|||
$lang['edit_unavailable_title'] = 'Nem foglalható időpont szerkesztése';
|
||||
$lang['unavailable_saved'] = 'A nem foglalható időpont sikeresen mentve.';
|
||||
$lang['start_date_before_end_error'] = 'A kezdeti időpont későbbre esik, mint vég időpont.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Érvénytelen email cím.';
|
||||
$lang['customers'] = 'Vendégek';
|
||||
$lang['details'] = 'Részletek';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Nuovo perido di indisponibilità';
|
|||
$lang['edit_unavailable_title'] = 'Modifica periodo di indisponibilità';
|
||||
$lang['unavailable_saved'] = 'Periodo di indisponibilità salvato con successo.';
|
||||
$lang['start_date_before_end_error'] = 'La data di inizio è successiva alla data di fine.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Indirizzo e-mail non valido.';
|
||||
$lang['customers'] = 'Clienti';
|
||||
$lang['details'] = 'Dettagli';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = '新規の都合悪い時間';
|
|||
$lang['edit_unavailable_title'] = '都合悪い時間の編集';
|
||||
$lang['unavailable_saved'] = '都合の悪い時間の保存が完了しました。';
|
||||
$lang['start_date_before_end_error'] = '開始時間が終了時間よりも後になっています。';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Emailアドレスのフォーマットエラー';
|
||||
$lang['customers'] = 'お客様';
|
||||
$lang['details'] = '詳細';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Neien Zäitraum deen net zur Verfügung steet'
|
|||
$lang['edit_unavailable_title'] = 'Zäitraum, deen net zur Verfügung steet, änneren';
|
||||
$lang['unavailable_saved'] = 'Zäitraum, deen net zur Verfügung steet erfollegräich gespäichert.';
|
||||
$lang['start_date_before_end_error'] = 'Den Ufanksdatum ass méi héich wéi de Schlussdatum.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Déi E-Mail-Adresse ass ongülteg.';
|
||||
$lang['customers'] = 'Clienten';
|
||||
$lang['details'] = 'Detailer';
|
||||
|
|
|
@ -107,6 +107,7 @@ $lang['new_unavailable_title'] = 'नवीन गहाळ कालावध
|
|||
$lang['edit_unavailable_title'] = 'गहाळ कालावधी संपादित करा';
|
||||
$lang['unavailable_saved'] = 'गहाळ कालावधी यशस्वीरित्या जतन झाला.';
|
||||
$lang['start_date_before_end_error'] = 'प्रारंभ तारीख मूल्याच्या अंतिम तारखेपेक्षा मोठी आहे';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'अवैध ईमेल पत्ता.';
|
||||
$lang['customers'] = 'उपभोक्ता';
|
||||
$lang['details'] = 'विवरण';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Nowy Niedostępny Okres';
|
|||
$lang['edit_unavailable_title'] = 'Edytuj Niedostępny Okres';
|
||||
$lang['unavailable_saved'] = 'Niedostępny okres zapisano pomyślnie.';
|
||||
$lang['start_date_before_end_error'] = 'Wartość początkowa jest większa niż data końcowa.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Niepoprawny adres email.';
|
||||
$lang['customers'] = 'Klienci';
|
||||
$lang['details'] = 'Szczegóły';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Novo Período Indisponível';
|
|||
$lang['edit_unavailable_title'] = 'Edite Período Indisponível';
|
||||
$lang['unavailable_saved'] = 'Período Indisponível salvo com sucesso.';
|
||||
$lang['start_date_before_end_error'] = 'A data início é superior ao valor da data fim.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Email inválido.';
|
||||
$lang['customers'] = 'Clientes';
|
||||
$lang['details'] = 'Detalhes';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Novo Período Indisponível';
|
|||
$lang['edit_unavailable_title'] = 'Edite Período Indisponível';
|
||||
$lang['unavailable_saved'] = 'Período Indisponível guardado com sucesso.';
|
||||
$lang['start_date_before_end_error'] = 'A data início é superior ao valor da data fim.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Email invalido.';
|
||||
$lang['customers'] = 'Clientes';
|
||||
$lang['details'] = 'Detalhes';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Perioada de indisponibilitate noua';
|
|||
$lang['edit_unavailable_title'] = 'Editeaza perioada de indisponibilitate';
|
||||
$lang['unavailable_saved'] = 'Perioada de indisponibilitate a fost salvata.';
|
||||
$lang['start_date_before_end_error'] = 'Data de început se afla dupa data de sfârsit.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Adresa de email este invalida.';
|
||||
$lang['customers'] = 'Clienti';
|
||||
$lang['details'] = 'Detalii';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Новый недоступный период
|
|||
$lang['edit_unavailable_title'] = 'Редактировать недоступный период';
|
||||
$lang['unavailable_saved'] = 'Недоступный период успешно сохранен.';
|
||||
$lang['start_date_before_end_error'] = 'Начальная дата больше чем конечная.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Недействительный e-mail адрес.';
|
||||
$lang['customers'] = 'Заказчики';
|
||||
$lang['details'] = 'Детали';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Nové nedostupné obdobie';
|
|||
$lang['edit_unavailable_title'] = 'Upraviť nedostupné obdobie';
|
||||
$lang['unavailable_saved'] = 'Nedostupné obdobie úspešne uložené.';
|
||||
$lang['start_date_before_end_error'] = 'Dátum začatia je väčší ako dátum konca.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Neplatné emailová adresa.';
|
||||
$lang['customers'] = 'Zákazníci';
|
||||
$lang['details'] = 'Podrobnosti';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Nuevo periodo No disponible';
|
|||
$lang['edit_unavailable_title'] = 'Editar periodo No disponible';
|
||||
$lang['unavailable_saved'] = 'Periodo No disponible guardado exitosamente';
|
||||
$lang['start_date_before_end_error'] = 'La fecha del inicio es posterior a la fecha del final';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Dirección de E-mail inválida';
|
||||
$lang['customers'] = 'Clientes';
|
||||
$lang['details'] = 'Detalles';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Ny låst period';
|
|||
$lang['edit_unavailable_title'] = 'Ändra låst period';
|
||||
$lang['unavailable_saved'] = 'Låst period sparad.';
|
||||
$lang['start_date_before_end_error'] = 'Startdatum är efter slutdatum.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Ogiltig epostadress';
|
||||
$lang['customers'] = 'Kunder';
|
||||
$lang['details'] = 'Detaljer';
|
||||
|
|
|
@ -105,6 +105,7 @@ $lang['new_unavailable_title'] = 'Yeni Uygun Olmayan Zaman Aralığı';
|
|||
$lang['edit_unavailable_title'] = 'Uygun Olmayan Zaman Aralığı Düzenle';
|
||||
$lang['unavailable_saved'] = 'Uygun Olmayan Zaman Aralığı Başarıyla Kaydedildi.';
|
||||
$lang['start_date_before_end_error'] = 'Başlangıç tarihi bitiş tarihinden büyük olamaz.';
|
||||
$lang['invalid_duration'] = 'Invalid duration.';
|
||||
$lang['invalid_email'] = 'Hatalı eposta adresi.';
|
||||
$lang['customers'] = 'Müşteriler';
|
||||
$lang['details'] = 'Detaylar';
|
||||
|
|
|
@ -97,6 +97,11 @@ class Services_model extends EA_Model {
|
|||
{
|
||||
throw new Exception('Service duration is not numeric.');
|
||||
}
|
||||
|
||||
if ((int)$service['duration'] < EVENT_MINIMUM_DURATION)
|
||||
{
|
||||
throw new Exception('The service duration cannot be less than ' . EVENT_MINIMUM_DURATION . ' minutes.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($service['price'] !== NULL)
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
<?= lang('duration_minutes') ?>
|
||||
<span class="text-danger">*</span>
|
||||
</label>
|
||||
<input id="service-duration" class="form-control required" type="number" min="15">
|
||||
<input id="service-duration" class="form-control required" type="number" min="5">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
|
|
@ -269,7 +269,7 @@
|
|||
.hide();
|
||||
|
||||
try {
|
||||
// validate required fields.
|
||||
// Validate required fields.
|
||||
var missingRequired = false;
|
||||
|
||||
$('#services .required').each(function (index, requiredField) {
|
||||
|
@ -283,6 +283,12 @@
|
|||
throw new Error(EALang.fields_are_required);
|
||||
}
|
||||
|
||||
// Validate the duration.
|
||||
if (Number($('#service-duration').val()) < 5) {
|
||||
$('#service-duration').closest('.form-group').addClass('has-error');
|
||||
throw new Error(EALang.invalid_duration);
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (error) {
|
||||
$('#services .form-message')
|
||||
|
|
Loading…
Reference in a new issue