diff --git a/app/extensions/extensions.php b/app/extensions/extensions.php index 2b5a076218..7f5b0f38e7 100644 --- a/app/extensions/extensions.php +++ b/app/extensions/extensions.php @@ -138,7 +138,7 @@ require_once "resources/paging.php"; if (if_group("superadmin")) { echo " \n"; } - echo " "; + echo " "; echo " "; if ($paging_controls_mini != '') { echo "".$paging_controls_mini."\n"; @@ -165,7 +165,7 @@ require_once "resources/paging.php"; echo th_order_by('user_context', $text['label-user_context'], $order_by, $order); echo th_order_by('enabled', $text['label-enabled'], $order_by, $order); echo th_order_by('description', $text['label-description'], $order_by, $order); - echo "\n"; + echo "\n"; if (permission_exists('extension_add')) { if ($_SESSION['limit']['extensions']['numeric'] == '' || ($_SESSION['limit']['extensions']['numeric'] != '' && $total_extensions < $_SESSION['limit']['extensions']['numeric'])) { echo "".$v_link_label_add.""; @@ -178,6 +178,7 @@ require_once "resources/paging.php"; echo "\n"; if ($num_rows > 0) { + foreach($extensions as $row) { $tr_link = (permission_exists('extension_edit')) ? " href='extension_edit.php?id=".$row['extension_uuid']."'" : null; echo "\n"; @@ -209,24 +210,26 @@ require_once "resources/paging.php"; } echo "\n"; echo "\n"; - if ($c==0) { $c=1; } else { $c=0; } - } //end foreach - unset($sql, $extensions, $row_count); - } //end if results - - echo " \n"; - echo " \n"; - if (permission_exists('extension_add')) { - if ($_SESSION['limit']['extensions']['numeric'] == '' || ($_SESSION['limit']['extensions']['numeric'] != '' && $total_extensions < $_SESSION['limit']['extensions']['numeric'])) { - echo "".$v_link_label_add.""; + $c = ($c) ? 0 : 1; } - } - if (permission_exists('extension_delete') && $num_rows > 0) { - echo "".$v_link_label_delete.""; - } - echo " \n"; - echo " \n"; + unset($extensions, $row); + } + + if ($num_rows > 0) { + echo "\n"; + echo " \n"; + if (permission_exists('extension_add')) { + if ($_SESSION['limit']['extensions']['numeric'] == '' || ($_SESSION['limit']['extensions']['numeric'] != '' && $total_extensions < $_SESSION['limit']['extensions']['numeric'])) { + echo "".$v_link_label_add.""; + } + } + if (permission_exists('extension_delete')) { + echo "".$v_link_label_delete.""; + } + echo " \n"; + echo "\n"; + } echo ""; echo ""; @@ -235,19 +238,28 @@ require_once "resources/paging.php"; echo "
".$paging_controls."
\n"; } - echo "

\n"; + echo "

".(($num_rows == 0) ? "

" : null); // check or uncheck all checkboxes if (sizeof($ext_ids) > 0) { echo "\n"; } + if ($num_rows > 0) { + // check all checkboxes + key_press('ctrl+a', 'down', 'document', null, null, "check('all');", true); + + // delete checked + key_press('delete', 'up', 'document', array('#search'), $text['confirm-delete'], 'document.forms.frm.submit();', true); + } + //show the footer require_once "resources/footer.php"; ?> \ No newline at end of file diff --git a/app/voicemails/voicemails.php b/app/voicemails/voicemails.php index e0130a486d..8a52b77eec 100644 --- a/app/voicemails/voicemails.php +++ b/app/voicemails/voicemails.php @@ -145,35 +145,36 @@ else { echo " \n"; echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + if (permission_exists('voicemail_delete') && $num_rows > 0) { + echo ""; + } + echo th_order_by('voicemail_id', $text['label-voicemail_id'], $order_by, $order); + echo th_order_by('voicemail_mail_to', $text['label-voicemail_mail_to'], $order_by, $order); + echo th_order_by('voicemail_file', $text['label-voicemail_file_attached'], $order_by, $order); + echo th_order_by('voicemail_local_after_email', $text['label-voicemail_local_after_email'], $order_by, $order); + echo "\n"; + echo th_order_by('voicemail_enabled', $text['label-voicemail_enabled'], $order_by, $order); + echo th_order_by('voicemail_description', $text['label-voicemail_description'], $order_by, $order); + echo "\n"; + echo "\n"; + $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; if ($num_rows > 0) { - echo "\n"; - echo "
".$text['label-tools'].""; + if (permission_exists('voicemail_add') || permission_exists('voicemail_edit')) { + echo "".$v_link_label_add.""; + } + if (permission_exists('voicemail_delete') && $num_rows > 0) { + echo "".$v_link_label_delete.""; + } + echo "
\n"; - echo "\n"; - if (permission_exists('voicemail_delete') && $num_rows > 0) { - echo ""; - } - echo th_order_by('voicemail_id', $text['label-voicemail_id'], $order_by, $order); - echo th_order_by('voicemail_mail_to', $text['label-voicemail_mail_to'], $order_by, $order); - echo th_order_by('voicemail_file', $text['label-voicemail_file_attached'], $order_by, $order); - echo th_order_by('voicemail_local_after_email', $text['label-voicemail_local_after_email'], $order_by, $order); - echo "\n"; - echo th_order_by('voicemail_enabled', $text['label-voicemail_enabled'], $order_by, $order); - echo th_order_by('voicemail_description', $text['label-voicemail_description'], $order_by, $order); - echo "\n"; - echo "\n"; - foreach($voicemails as $row) { $tr_link = (permission_exists('voicemail_edit')) ? "href='voicemail_edit.php?id=".$row['voicemail_uuid']."'" : null; echo "\n"; @@ -215,53 +216,53 @@ else { echo " \n"; } echo "\n"; - if ($c==0) { $c=1; } else { $c=0; } - } //end foreach - unset($sql, $voicemails, $row_count); + $c = ($c) ? 0 : 1; + } + unset($voicemails, $row); + } + + if ($num_rows > 0) { echo "\n"; echo " \n"; echo "\n"; + } - echo "
".$text['label-tools'].""; - if (permission_exists('voicemail_add') || permission_exists('voicemail_edit')) { - echo "".$v_link_label_add.""; - } - if (permission_exists('voicemail_delete')) { - echo "".$v_link_label_delete.""; - } - echo "
\n"; if (permission_exists('voicemail_add')) { echo "".$v_link_label_add.""; } - if (permission_exists('voicemail_delete') && $num_rows > 0) { + if (permission_exists('voicemail_delete')) { echo "".$v_link_label_delete.""; } echo "
"; - echo "
"; + echo ""; + echo ""; - if (strlen($paging_controls) > 0) { - echo "
".$paging_controls."
\n"; - } - - // check or uncheck all checkboxes - if (sizeof($vm_ids) > 0) { - echo "\n"; + if (strlen($paging_controls) > 0) { + echo "
".$paging_controls."
\n"; + } + + echo "

".(($num_rows == 0) ? "

" : null); + + // check or uncheck all checkboxes + if (sizeof($vm_ids) > 0) { + echo "\n"; + } + if ($num_rows > 0) { // check all checkboxes key_press('ctrl+a', 'down', 'document', null, null, "check('all');", true); // delete checked key_press('delete', 'up', 'document', array('#search'), $text['confirm-delete'], 'document.forms.frm.submit();', true); - } - else { - echo "
"; - echo $text['message-mailbox_not_found']; - } - - echo "

"; //include the footer require_once "resources/footer.php";