Call Broadcast: Implement Date/Time Picker for Start Time field.

This commit is contained in:
fusionate 2023-01-18 22:25:55 +00:00
parent f2d98ebcdf
commit 2980555287
No known key found for this signature in database
4 changed files with 27 additions and 10 deletions

View File

@ -401,8 +401,8 @@ $text['label-broadcast_toll_allow']['ru-ru'] = "Разрешить Платно
$text['label-broadcast_toll_allow']['sv-se'] = "Toll Allow";
$text['label-broadcast_toll_allow']['uk-ua'] = "";
$text['label-accountcode']['en-us'] = "Accountcode";
$text['label-accountcode']['en-gb'] = "Accountcode";
$text['label-accountcode']['en-us'] = "Account Code";
$text['label-accountcode']['en-gb'] = "Account Code";
$text['label-accountcode']['ar-eg'] = "";
$text['label-accountcode']['de-at'] = "Kontoschlüssel"; //copied from de-de
$text['label-accountcode']['de-ch'] = "Kontoschlüssel"; //copied from de-de
@ -464,7 +464,7 @@ $text['label-list_example']['ru-ru'] = "Number|First,Last\nNumber|First,Last\n..
$text['label-list_example']['sv-se'] = "Number|First,Last\nNumber|First,Last\n...";
$text['label-list_example']['uk-ua'] = "Number|First,Last\nNumber|First,Last\n...";
$text['description-start_time']['en-us'] = "Is the time in seconds to start sending calls.";
$text['description-start_time']['en-us'] = "The date and time to begin sending calls.";
$text['description-start_time']['en-gb'] = "";
$text['description-start_time']['ar-eg'] = "";
$text['description-start_time']['de-at'] = ""; //copied from de-de
@ -477,7 +477,7 @@ $text['description-start_time']['fr-fr'] = "";
$text['description-start_time']['he-il'] = "";
$text['description-start_time']['it-it'] = "";
$text['description-start_time']['nl-nl'] = "";
$text['description-start_time']['pl-pl'] = "Jest to czas w sekundach, po którym rozpocznie się wysyłanie połączeń";
$text['description-start_time']['pl-pl'] = "Data i godzina, aby rozpocząć wysyłanie połączeń.";
$text['description-start_time']['pt-br'] = ""; //copied from pt-pt
$text['description-start_time']['pt-pt'] = "";
$text['description-start_time']['ro-ro'] = "";
@ -485,7 +485,7 @@ $text['description-start_time']['ru-ru'] = "";
$text['description-start_time']['sv-se'] = "";
$text['description-start_time']['uk-ua'] = "";
$text['description-accountcode']['en-us'] = "Account code used most often used for billing systems.";
$text['description-accountcode']['en-us'] = "Used most often for billing systems.";
$text['description-accountcode']['en-gb'] = "";
$text['description-accountcode']['ar-eg'] = "";
$text['description-accountcode']['de-at'] = ""; //copied from de-de
@ -590,8 +590,8 @@ $text['description-info']['ru-ru'] = "Введите описание";
$text['description-info']['sv-se'] = "Ange beskrivning här.";
$text['description-info']['uk-ua'] = "Введіть опис";
$text['description-destination']['en-us'] = "Send the call to the extension an IVR Menu, Conference Room, or any other number.";
$text['description-destination']['en-gb'] = "Send the call to the extension an IVR Menu, Conference Room, or any other number.";
$text['description-destination']['en-us'] = "Send the call to an extension, an IVR Menu, Conference Room, or any other number.";
$text['description-destination']['en-gb'] = "Send the call to an extension, an IVR Menu, Conference Room, or any other number.";
$text['description-destination']['ar-eg'] = "";
$text['description-destination']['de-at'] = "Der Anruf wird an eine Nebenstelle, eine Automatische Vermittlung, ein Konferenzraum oder jede andere Nummer weitergeleitet."; //copied from de-de
$text['description-destination']['de-ch'] = "Der Anruf wird an eine Nebenstelle, eine Automatische Vermittlung, ein Konferenzraum oder jede andere Nummer weitergeleitet."; //copied from de-de

View File

@ -191,6 +191,7 @@
}
echo th_order_by('broadcast_name', $text['label-name'], $order_by, $order);
echo th_order_by('broadcast_concurrent_limit', $text['label-concurrent-limit'], $order_by, $order);
echo th_order_by('broadcast_start_time', $text['label-start_time'], $order_by, $order);
echo th_order_by('broadcast_description', $text['label-description'], $order_by, $order);
if (permission_exists('call_broadcast_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
@ -228,6 +229,12 @@
}
echo " </td>\n";
echo " <td>".escape($row['broadcast_concurrent_limit'])."</td>\n";
//determine start date and time
$broadcast_start_reference = $row['update_date'] ?: $row['insert_date'];
if ($row['broadcast_start_time'] && $broadcast_start_reference) {
$broadcast_start_time = date('Y-m-d H:i', strtotime($broadcast_start_reference) + $row['broadcast_start_time']);
}
echo " <td>".escape($broadcast_start_time)."</td>\n";
echo " <td class='description overflow hide-xs'>".escape($row['broadcast_description'])."</td>\n";
if (permission_exists('call_broadcast_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>";

View File

@ -227,7 +227,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//common array items
$array['call_broadcasts'][0]['domain_uuid'] = $domain_uuid;
$array['call_broadcasts'][0]['broadcast_name'] = $broadcast_name;
$array['call_broadcasts'][0]['broadcast_start_time'] = $broadcast_start_time;
$array['call_broadcasts'][0]['broadcast_start_time'] = strtotime($broadcast_start_time) - strtotime('now') >= 0 ? strtotime($broadcast_start_time) - strtotime('now') : null;
$array['call_broadcasts'][0]['broadcast_timeout'] = strlen($broadcast_timeout) != 0 ? $broadcast_timeout : null;
$array['call_broadcasts'][0]['broadcast_concurrent_limit'] = strlen($broadcast_concurrent_limit) != 0 ? $broadcast_concurrent_limit : null;
$array['call_broadcasts'][0]['broadcast_caller_id_name'] = $broadcast_caller_id_name;
@ -280,6 +280,15 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$broadcast_accountcode = $row["broadcast_accountcode"];
$broadcast_description = $row["broadcast_description"];
$broadcast_toll_allow = $row["broadcast_toll_allow"];
$insert_date = $row["insert_date"];
$update_date = $row["update_date"];
//determine start date and time based on insert or update date and 'start time' delay (in seconds)
$broadcast_start_reference = $update_date ?: $insert_date;
if ($broadcast_start_time && $broadcast_start_reference) {
$broadcast_start_time = date('Y-m-d H:i', strtotime($broadcast_start_reference) + $broadcast_start_time);
}
}
unset($sql, $parameters, $row);
}
@ -333,8 +342,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-start_time']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='broadcast_start_time' value=\"".escape($broadcast_start_time)."\">\n";
echo "<td class='vtable' align='left' style='position: relative;'>\n";
echo " <input class='formfld datetimepicker-future' type='text' id='broadcast_start_time' name='broadcast_start_time' value=\"".escape($broadcast_start_time)."\" data-toggle='datetimepicker' data-target='#broadcast_start_time' onblur=\"$(this).datetimepicker('hide');\">\n";
echo "<br />\n";
echo "".$text['description-start_time']."\n";
echo "</td>\n";

View File

@ -601,6 +601,7 @@
//define formatting of individual classes
$('.datepicker').datetimepicker({ format: 'YYYY-MM-DD', });
$('.datetimepicker').datetimepicker({ format: 'YYYY-MM-DD HH:mm', });
$('.datetimepicker-future').datetimepicker({ format: 'YYYY-MM-DD HH:mm', minDate: new Date(), });
$('.datetimesecpicker').datetimepicker({ format: 'YYYY-MM-DD HH:mm:ss', });
});
{/literal}