diff --git a/app/email_queue/email_queue.php b/app/email_queue/email_queue.php index e42a44cb2..5969dab72 100644 --- a/app/email_queue/email_queue.php +++ b/app/email_queue/email_queue.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2022-2025 + Portions created by the Initial Developer are Copyright (C) 2022-2026 the Initial Developer. All Rights Reserved. Contributor(s): @@ -39,10 +39,35 @@ $language = new text; $text = $language->get(); +// Set variables from http GET parameters + $page = is_numeric($_GET['page'] ?? '') ? $_GET['page'] : 0; + $order_by = preg_replace('#[^a-zA-Z0-9_\-]#', '', ($_GET['order_by'] ?? 'email_date')); + $order = ($_GET['order'] ?? '') === 'asc' ? 'asc' : 'desc'; + $search = $_GET['search'] ?? ''; + $email_status = $_GET['email_status'] ?? ''; + +// Build the query string + $param = []; + if (!empty($page)) { + $param['page'] = $page; + } + if (!empty($_GET['order_by'])) { + $param['order_by'] = $order_by; + } + if (!empty($_GET['order'])) { + $param['order'] = $order; + } + if (!empty($search)) { + $param['search'] = $search; + } + if (!empty($email_status)) { + $param['email_status'] = $email_status; + } + $query_string = http_build_query($param); + //get the http post data if (!empty($_POST['email_queue']) && is_array($_POST['email_queue'])) { $action = $_POST['action']; - $search = $_POST['search'] ?? ''; $email_queue = $_POST['email_queue']; } @@ -53,7 +78,7 @@ $token = new token; if (!$token->validate($_SERVER['PHP_SELF'])) { message::add($text['message-invalid_token'],'negative'); - header('Location: email_queue.php'); + header('Location: email_queue.php'.($query_string ? '?'.$query_string : '')); exit; } @@ -87,24 +112,15 @@ } //redirect the user - header('Location: email_queue.php'.($search != '' ? '?search='.urlencode($search) : '')); + header('Location: email_queue.php'.($query_string ? '?'.$query_string : '')); exit; } -//get order and order by - $order_by = $_GET["order_by"] ?? null; - $order = $_GET["order"] ?? null; - -//add the search - if (isset($_GET["search"])) { - $search = strtolower($_GET["search"]); - } - //get the count $sql = "select count(email_queue_uuid) "; $sql .= "from v_email_queue "; $sql .= "where true "; - if (isset($search)) { + if (!empty($search)) { $sql .= "and ("; $sql .= " lower(email_from) like :search "; $sql .= " or lower(email_to) like :search "; @@ -112,11 +128,11 @@ $sql .= " or lower(email_body) like :search "; $sql .= " or lower(email_status) like :search "; $sql .= ") "; - $parameters['search'] = '%'.$search.'%'; + $parameters['search'] = '%'.lower_case($search).'%'; } - if (isset($_GET["email_status"]) && $_GET["email_status"] != '') { + if (!empty($email_status)) { $sql .= "and email_status = :email_status "; - $parameters['email_status'] = $_GET["email_status"]; + $parameters['email_status'] = $email_status; } //else { // $sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) "; @@ -127,12 +143,8 @@ //prepare to page the results $rows_per_page = $settings->get('domain', 'paging', 50); - $param = !empty($_GET["email_status"]) ? "&email_status=".urlencode($_GET["email_status"]) : null; - $param .= !empty($search) ? "&search=".urlencode($search) : null; - $param .= !empty($_REQUEST['show']) && $_REQUEST['show'] == 'all' && permission_exists('email_queue_all') ? "&show=all" : null; - $page = !empty($_REQUEST['page']) && is_numeric($_REQUEST['page']) ? $_REQUEST['page'] : 0; - list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page); - list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true); + list($paging_controls, $rows_per_page) = paging($num_rows, $query_string, $rows_per_page); + list($paging_controls_mini, $rows_per_page) = paging($num_rows, $query_string, $rows_per_page, true); $offset = $rows_per_page * $page; //set the time zone @@ -162,18 +174,18 @@ $sql .= "email_retry_count "; $sql .= "from v_email_queue "; $sql .= "where true "; - if (isset($search)) { + if (!empty($search)) { $sql .= "and ("; $sql .= " lower(email_from) like :search "; $sql .= " or lower(email_to) like :search "; $sql .= " or lower(email_subject) like :search "; $sql .= " or lower(email_status) like :search "; $sql .= ") "; - $parameters['search'] = '%'.$search.'%'; + $parameters['search'] = '%'.lower_case($search).'%'; } - if (isset($_GET["email_status"]) && $_GET["email_status"] != '') { + if (!empty($email_status)) { $sql .= "and email_status = :email_status "; - $parameters['email_status'] = $_GET["email_status"]; + $parameters['email_status'] = $email_status; } $sql .= order_by($order_by, $order, 'email_date', 'desc'); $sql .= limit_offset($rows_per_page, $offset); @@ -250,18 +262,18 @@ echo " \n"; - //if (permission_exists('email_queue_all')) { - // if ($_GET['show'] == 'all') { - // echo " \n"; - // } - // else { - // echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$settings->get('theme', 'button_icon_all'),'link'=>'?show=all']); - // } + foreach ($param as $key => $value) { + if ($key !== 'search' && $key !== 'page') { + echo " \n"; + } + } + //if ($show !== 'all' && permission_exists('email_queue_all')) { + // echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$settings->get('theme', 'button_icon_all'),'link'=>'?show=all']); //} echo ""; echo button::create(['label'=>$text['button-search'],'icon'=>$settings->get('theme', 'button_icon_search'),'type'=>'submit','id'=>'btn_search']); @@ -289,7 +301,6 @@ echo "
\n"; echo "\n"; - echo "\n"; echo "
\n"; echo "\n"; @@ -299,7 +310,7 @@ echo " \n"; echo " \n"; } - //if ($_GET['show'] == 'all' && permission_exists('email_queue_all')) { + //if ($show == 'all' && permission_exists('email_queue_all')) { // echo th_order_by('domain_name', $text['label-domain'], $order_by, $order); //} //echo th_order_by('email_date', $text['label-email_date'], $order_by, $order); @@ -307,11 +318,11 @@ echo "\n"; echo "\n"; echo "\n"; - echo th_order_by('email_to', $text['label-email_to'], $order_by, $order); - echo th_order_by('email_subject', $text['label-email_subject'], $order_by, $order); - echo th_order_by('email_status', $text['label-email_status'], $order_by, $order); - echo th_order_by('email_retry_count', $text['label-email_retry_count'], $order_by, $order); - //echo th_order_by('email_action_before', $text['label-email_action_before'], $order_by, $order); + echo th_order_by('email_to', $text['label-email_to'], $order_by, $order, null, null, $query_string); + echo th_order_by('email_subject', $text['label-email_subject'], $order_by, $order, null, null, $query_string); + echo th_order_by('email_status', $text['label-email_status'], $order_by, $order, null, null, $query_string); + echo th_order_by('email_retry_count', $text['label-email_retry_count'], $order_by, $order, null, null, $query_string); + //echo th_order_by('email_action_before', $text['label-email_action_before'], $order_by, $order, null, null, $query_string); echo "\n"; if (permission_exists('email_queue_edit') && $settings->get('theme', 'list_row_edit_button', false)) { echo " \n"; @@ -323,7 +334,7 @@ foreach ($email_queue as $row) { $list_row_url = ''; if (permission_exists('email_queue_edit')) { - $list_row_url = "email_queue_edit.php?id=".urlencode($row['email_queue_uuid']); + $list_row_url = "email_queue_edit.php?id=".urlencode($row['email_queue_uuid']).($query_string ? '&'.$query_string : ''); if (!empty($row['domain_uuid']) && $row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) { $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true'; } @@ -335,7 +346,7 @@ echo " \n"; echo " \n"; } - //if ($_GET['show'] == 'all' && permission_exists('email_queue_all')) { + //if ($show == 'all' && permission_exists('email_queue_all')) { // echo " \n"; //} if (permission_exists('email_queue_edit')) { diff --git a/app/email_queue/email_queue_edit.php b/app/email_queue/email_queue_edit.php index 6bb984d61..105cc78e3 100644 --- a/app/email_queue/email_queue_edit.php +++ b/app/email_queue/email_queue_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2022-2024 + Portions created by the Initial Developer are Copyright (C) 2022-2026 the Initial Developer. All Rights Reserved. Contributor(s): @@ -38,6 +38,32 @@ $language = new text; $text = $language->get(); +// Set variables from http GET parameters + $page = is_numeric($_GET['page'] ?? '') ? $_GET['page'] : 0; + $order_by = preg_replace('#[^a-zA-Z0-9_\-]#', '', ($_GET['order_by'] ?? 'email_date')); + $order = ($_GET['order'] ?? '') === 'asc' ? 'asc' : 'desc'; + $search = $_GET['search'] ?? ''; + $email_status = $_GET['email_status'] ?? ''; + +// Build the query string + $param = []; + if (!empty($page)) { + $param['page'] = $page; + } + if (!empty($_GET['order_by'])) { + $param['order_by'] = $order_by; + } + if (!empty($_GET['order'])) { + $param['order'] = $order; + } + if (!empty($search)) { + $param['search'] = $search; + } + if (!empty($email_status)) { + $param['email_status'] = $email_status; + } + $query_string = http_build_query($param); + //action add or update if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) { $action = "update"; @@ -69,7 +95,7 @@ $token = new token; if (!$token->validate($_SERVER['PHP_SELF'])) { message::add($text['message-invalid_token'],'negative'); - header('Location: email_queue.php'); + header('Location: email_queue.php'.($query_string ? '?'.$query_string : '')); exit; } @@ -98,7 +124,7 @@ //redirect the user if (in_array($_POST['action'], array('copy', 'delete', 'toggle'))) { - header('Location: email_queue_edit.php?id='.$id); + header('Location: email_queue_edit.php?id='.$id.($query_string ? '&'.$query_string : '')); exit; } } @@ -195,7 +221,7 @@ $_SESSION["message"] = $text['message-update']; } //header('Location: email_queue.php'); - header('Location: email_queue_edit.php?id='.urlencode($email_queue_uuid)); + header('Location: email_queue_edit.php?id='.urlencode($email_queue_uuid).($query_string ? '&'.$query_string : '')); return; } } @@ -293,7 +319,7 @@ echo "
\n"; echo "
".$text['title-email_queue']."
\n"; echo "
\n"; - echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$settings->get('theme', 'button_icon_back'),'id'=>'btn_back','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'email_queue.php']); + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$settings->get('theme', 'button_icon_back'),'id'=>'btn_back','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'email_queue.php'.($query_string ? '?'.$query_string : '')]); if ($action == 'update') { if (permission_exists('_add')) { echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$settings->get('theme', 'button_icon_copy'),'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none;','onclick'=>"modal_open('modal-copy','btn_copy');"]); diff --git a/app/fax_queue/fax_queue.php b/app/fax_queue/fax_queue.php index b3a0b6da6..76cfa71ff 100644 --- a/app/fax_queue/fax_queue.php +++ b/app/fax_queue/fax_queue.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2023-2025 + Portions created by the Initial Developer are Copyright (C) 2023-2026 the Initial Developer. All Rights Reserved. */ @@ -49,16 +49,41 @@ $language = new text; $text = $language->get(); +// Set variables from http GET parameters + $page = is_numeric($_GET['page'] ?? '') ? $_GET['page'] : 0; + $order_by = preg_replace('#[^a-zA-Z0-9_\-]#', '', ($_GET['order_by'] ?? 'fax_date')); + $order = ($_GET['order'] ?? '') === 'asc' ? 'asc' : 'desc'; + $search = $_GET['search'] ?? ''; + $show = $_GET['show'] ?? ''; + $fax_status = $_GET['fax_status'] ?? ''; + +// Build the query string + $param = []; + if (!empty($page)) { + $param['page'] = $page; + } + if (!empty($_GET['order_by'])) { + $param['order_by'] = $order_by; + } + if (!empty($_GET['order'])) { + $param['order'] = $order; + } + if (!empty($search)) { + $param['search'] = $search; + } + if (!empty($show) && $show == 'all' && permission_exists('fax_queue_all')) { + $param['show'] = $show; + } + if (!empty($fax_status)) { + $param['fax_status'] = $fax_status; + } + $query_string = http_build_query($param); + //get the http post data if (isset($_REQUEST['action'])) { $action = $_REQUEST['action']; } -//add the search - if (isset($_REQUEST["search"])) { - $search = strtolower($_REQUEST["search"]); - } - //get the fax_queue item checked if (isset($_REQUEST['fax_queue'])) { $fax_queue = $_REQUEST['fax_queue']; @@ -89,19 +114,15 @@ } //redirect the user - header('Location: fax_queue.php'.(!empty($search) ? '?search='.urlencode($search) : '')); + header('Location: fax_queue.php'.($query_string ? '?'.$query_string : '')); exit; } -//get order and order by - $order_by = $_GET["order_by"] ?? null; - $order = $_GET["order"] ?? null; - //get the count $sql = "select count(fax_queue_uuid) "; $sql .= "from v_fax_queue as q "; $sql .= "LEFT JOIN v_users AS u ON q.insert_user = u.user_uuid "; - if (!empty($_GET['show']) && $_GET['show'] == "all" && $permission['fax_queue_all']) { + if ($show == "all" && $permission['fax_queue_all']) { // show faxes for all domains $sql .= "WHERE true "; } @@ -118,7 +139,7 @@ $parameters['user_uuid'] = $user_uuid; } - if (isset($search)) { + if (!empty($search)) { $sql .= "AND ("; $sql .= " LOWER(q.hostname) LIKE :search "; $sql .= " OR LOWER(q.fax_caller_id_name) LIKE :search "; @@ -130,23 +151,20 @@ $sql .= " OR LOWER(q.fax_status) LIKE :search "; $sql .= " OR LOWER(q.fax_accountcode) LIKE :search "; $sql .= ") "; - $parameters['search'] = '%' . $search . '%'; + $parameters['search'] = '%' . lower_case($search) . '%'; } - if (isset($_GET["fax_status"]) && !empty($_GET["fax_status"])) { + if (!empty($fax_status)) { $sql .= "AND q.fax_status = :fax_status "; - $parameters['fax_status'] = $_GET["fax_status"]; + $parameters['fax_status'] = $fax_status; } $num_rows = $database->select($sql, $parameters ?? null, 'column'); unset($sql, $parameters); //prepare to page the results $rows_per_page = $settings->get('domain', 'paging', 50); - $param = !empty($search) ? "&search=".$search : null; - $param = (!empty($_GET['show']) && $_GET['show'] == 'all' && $permission['fax_queue_all']) ? "&show=all" : null; - $page = !empty($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 0; - list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page); - list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true); + list($paging_controls, $rows_per_page) = paging($num_rows, $query_string, $rows_per_page); + list($paging_controls_mini, $rows_per_page) = paging($num_rows, $query_string, $rows_per_page, true); $offset = $rows_per_page * $page; //set the time zone @@ -191,7 +209,7 @@ $sql .= "LEFT JOIN v_users AS u ON q.insert_user = u.user_uuid "; $sql .= "JOIN v_domains AS d ON q.domain_uuid = d.domain_uuid "; - if (!empty($_GET['show']) && $_GET['show'] == "all" && $permission['fax_queue_all']) { + if ($show == "all" && $permission['fax_queue_all']) { // show faxes for all domains $sql .= "WHERE true "; } @@ -208,7 +226,7 @@ $parameters['user_uuid'] = $user_uuid; } - if (isset($search)) { + if (!empty($search)) { $sql .= "AND ("; $sql .= " LOWER(q.hostname) LIKE :search "; $sql .= " OR LOWER(q.fax_caller_id_name) LIKE :search "; @@ -220,12 +238,12 @@ $sql .= " OR LOWER(q.fax_status) LIKE :search "; $sql .= " OR LOWER(q.fax_accountcode) LIKE :search "; $sql .= ") "; - $parameters['search'] = '%' . $search . '%'; + $parameters['search'] = '%' . lower_case($search) . '%'; } - if (isset($_GET["fax_status"]) && !empty($_GET["fax_status"])) { + if (!empty($fax_status)) { $sql .= "AND q.fax_status = :fax_status "; - $parameters['fax_status'] = $_GET["fax_status"]; + $parameters['fax_status'] = $fax_status; } $sql .= order_by($order_by, $order, 'fax_date', 'desc'); @@ -259,24 +277,24 @@ if ($permission['fax_queue_delete'] && $fax_queue) { echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$settings->get('theme', 'button_icon_delete'),'id'=>'btn_delete','name'=>'btn_delete','style'=>'display:none;','onclick'=>"modal_open('modal-delete','btn_delete');"]); } - if ($permission['fax_queue_all']) { - if (!empty($_GET['show']) && $_GET['show'] == 'all') { - echo " \n"; - } - else { - echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$settings->get('theme', 'button_icon_all'),'style'=>'margin-left: 15px;','link'=>'?show=all']); + echo " \n"; + foreach ($param as $key => $value) { + if ($key !== 'search' && $key !== 'page') { + echo " \n"; } } - echo " \n"; + if ($show !== 'all' && permission_exists('fax_queue_all')) { + echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$settings->get('theme', 'button_icon_all'),'style'=>'margin-left: 15px;','link'=>'?show=all']); + } echo " \n"; echo " "; echo button::create(['label'=>$text['button-search'],'icon'=>$settings->get('theme', 'button_icon_search'),'type'=>'submit','id'=>'btn_search']); @@ -308,7 +326,6 @@ echo "\n"; echo "\n"; - echo "\n"; echo "
\n"; echo "
".$text['label-time']."".$text['label-hostname']."".$text['label-email_from']."".$text['label-email_action_after']." ".escape($_SESSION['domains'][$row['domain_uuid']]['domain_name'])."
\n"; @@ -318,25 +335,25 @@ echo " \n"; echo " \n"; } - if (!empty($_GET['show']) && $_GET['show'] == 'all' && $permission['fax_queue_all']) { + if ($show == 'all' && $permission['fax_queue_all']) { echo th_order_by('domain_name', $text['label-domain'], $order_by, $order); } //echo th_order_by('fax_date', $text['label-fax_date'], $order_by, $order); echo "\n"; echo "\n"; if ($permission['fax_queue_all']) { - echo th_order_by('hostname', $text['label-hostname'], $order_by, $order, null, "class='hide-md-dn'"); + echo th_order_by('hostname', $text['label-hostname'], $order_by, $order, null, "class='hide-md-dn'", $query_string); } - echo th_order_by('fax_caller_id_name', $text['label-fax_caller_id_name'], $order_by, $order, null, "class='hide-md-dn'"); - echo th_order_by('fax_caller_id_number', $text['label-fax_caller_id_number'], $order_by, $order); - echo th_order_by('fax_number', $text['label-fax_number'], $order_by, $order); - echo th_order_by('fax_email_address', $text['label-fax_email_address'], $order_by, $order); - echo th_order_by('insert_user', $text['label-insert_user'], $order_by, $order); + echo th_order_by('fax_caller_id_name', $text['label-fax_caller_id_name'], $order_by, $order, null, "class='hide-md-dn'", $query_string); + echo th_order_by('fax_caller_id_number', $text['label-fax_caller_id_number'], $order_by, $order, null, null, $query_string); + echo th_order_by('fax_number', $text['label-fax_number'], $order_by, $order, null, null, $query_string); + echo th_order_by('fax_email_address', $text['label-fax_email_address'], $order_by, $order, null, null, $query_string); + echo th_order_by('insert_user', $text['label-insert_user'], $order_by, $order, null, null, $query_string); //echo th_order_by('fax_file', $text['label-fax_file'], $order_by, $order); - echo th_order_by('fax_status', $text['label-fax_status'], $order_by, $order); - echo th_order_by('fax_retry_date', $text['label-fax_retry_date'], $order_by, $order); - echo th_order_by('fax_notify_date', $text['label-fax_notify_date'], $order_by, $order); - echo th_order_by('fax_retry_count', $text['label-fax_retry_count'], $order_by, $order); + echo th_order_by('fax_status', $text['label-fax_status'], $order_by, $order, null, null, $query_string); + echo th_order_by('fax_retry_date', $text['label-fax_retry_date'], $order_by, $order, null, null, $query_string); + echo th_order_by('fax_notify_date', $text['label-fax_notify_date'], $order_by, $order, null, null, $query_string); + echo th_order_by('fax_retry_count', $text['label-fax_retry_count'], $order_by, $order, null, null, $query_string); if ($permission['fax_queue_edit'] && $settings->get('theme', 'list_row_edit_button', false)) { echo " \n"; } @@ -347,7 +364,7 @@ foreach ($fax_queue as $row) { $list_row_url = ''; if ($permission['fax_queue_edit']) { - $list_row_url = "fax_queue_edit.php?id=".urlencode($row['fax_queue_uuid']); + $list_row_url = "fax_queue_edit.php?id=".urlencode($row['fax_queue_uuid']).($query_string ? '&'.$query_string : ''); if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) { $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true'; } @@ -359,7 +376,7 @@ echo " \n"; echo " \n"; } - if (!empty($_GET['show']) && $_GET['show'] == 'all' && $permission['fax_queue_all']) { + if ($show == 'all' && $permission['fax_queue_all']) { echo " \n"; } echo " \n"; diff --git a/app/fax_queue/fax_queue_edit.php b/app/fax_queue/fax_queue_edit.php index a2da84005..ee681241d 100644 --- a/app/fax_queue/fax_queue_edit.php +++ b/app/fax_queue/fax_queue_edit.php @@ -18,7 +18,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2022-2023 + Portions created by the Initial Developer are Copyright (C) 2022-2026 the Initial Developer. All Rights Reserved. */ @@ -36,6 +36,36 @@ $language = new text; $text = $language->get(); +// Set variables from http GET parameters + $page = is_numeric($_GET['page'] ?? '') ? $_GET['page'] : 0; + $order_by = preg_replace('#[^a-zA-Z0-9_\-]#', '', ($_GET['order_by'] ?? 'fax_date')); + $order = ($_GET['order'] ?? '') === 'asc' ? 'asc' : 'desc'; + $search = $_GET['search'] ?? ''; + $show = $_GET['show'] ?? ''; + $fax_status = $_GET['fax_status'] ?? ''; + +// Build the query string + $param = []; + if (!empty($page)) { + $param['page'] = $page; + } + if (!empty($_GET['order_by'])) { + $param['order_by'] = $order_by; + } + if (!empty($_GET['order'])) { + $param['order'] = $order; + } + if (!empty($search)) { + $param['search'] = $search; + } + if (!empty($show) && $show == 'all' && permission_exists('fax_queue_all')) { + $param['show'] = $show; + } + if (!empty($fax_status)) { + $param['fax_status'] = $fax_status; + } + $query_string = http_build_query($param); + //action add or update if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) { $action = "update"; @@ -73,7 +103,7 @@ $token = new token; if (!$token->validate($_SERVER['PHP_SELF'])) { message::add($text['message-invalid_token'],'negative'); - header('Location: fax_queue.php'); + header('Location: fax_queue.php'.($query_string ? '?'.$query_string : '')); exit; } @@ -101,8 +131,8 @@ } //redirect the user - if (in_array($_POST['action'], array('copy', 'delete', 'toggle') && is_uuid($id))) { - header('Location: fax_queue_edit.php?id='.$id); + if (in_array($_POST['action'], array('copy', 'delete', 'toggle')) && is_uuid($id)) { + header('Location: fax_queue_edit.php?id='.$id.($query_string ? '&'.$query_string : '')); exit; } } @@ -173,7 +203,7 @@ $_SESSION["message"] = $text['message-update']; } //header('Location: fax_queue.php'); - header('Location: fax_queue_edit.php?id='.urlencode($fax_queue_uuid)); + header('Location: fax_queue_edit.php?id='.urlencode($fax_queue_uuid).($query_string ? '&'.$query_string : '')); return; } } @@ -239,7 +269,7 @@ echo "
\n"; echo "
".$text['title-fax_queue']."
\n"; echo "
\n"; - echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$settings->get('theme', 'button_icon_back'),'id'=>'btn_back','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'fax_queue.php']); + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$settings->get('theme', 'button_icon_back'),'id'=>'btn_back','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'fax_queue.php'.($query_string ? '?'.$query_string : '')]); if ($action == 'update') { if (permission_exists('_add')) { echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$settings->get('theme', 'button_icon_copy'),'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
".$text['label-date']."".$text['label-time']." ".escape($row['domain_name'])."".escape($row['fax_date_formatted'])."