Added show all button (#6249)
* Update call_center_queues.php * Update call_center_agents.php * Update app_config.php * Update app_config.php * Update contacts.php * Update app_config.php * Update ivr_menus.php * Update app_config.php * Update call_flows.php * Update app_config.php * Update conference_centers.php * Update app_config.php * Update voicemails.php * Update app_config.php * Update phrases.php * Update app_config.php * Update recordings.php * Update app_config.php * Update call_recordings.php * Update app_config.php * Update call_broadcast.php * Update app_config.php * Update time_conditions.php * Update app_config.php * Update music_on_hold.php * Update app_config.php * Update conferences.php
This commit is contained in:
@@ -186,7 +186,11 @@
|
||||
//build query for paging and list
|
||||
$sql = "select count(*) ";
|
||||
$sql .= "from v_contacts as c ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "where true ";
|
||||
if ($_GET['show'] != "all" || !permission_exists('contact_all')) {
|
||||
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
}
|
||||
if (!permission_exists('contact_domain_view')) {
|
||||
$sql .= "and ( "; //only contacts assigned to current user's group(s) and those not assigned to any group
|
||||
$sql .= " contact_uuid in ( ";
|
||||
@@ -216,13 +220,15 @@
|
||||
$parameters['user_uuid'] = $_SESSION['user_uuid'];
|
||||
}
|
||||
$sql .= $sql_search;
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$num_rows = $database->select($sql, $parameters, 'column');
|
||||
|
||||
//prepare to page the results
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
$param = "&search=".$search;
|
||||
$param = "&search=".urlencode($search);
|
||||
if ($_GET['show'] == "all" && permission_exists('contact_all')) {
|
||||
$param .= "&show=all";
|
||||
}
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page); //bottom
|
||||
@@ -286,6 +292,14 @@
|
||||
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none;','collapse'=>'hide-sm-dn','onclick'=>"modal_open('modal-delete','btn_delete');"]);
|
||||
}
|
||||
echo "<form id='form_search' class='inline' method='get'>\n";
|
||||
if (permission_exists('contact_all')) {
|
||||
if ($_GET['show'] == 'all') {
|
||||
echo " <input type='hidden' name='show' value='all'>";
|
||||
}
|
||||
else {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?type=&show=all'.($search != '' ? "&search=".urlencode($search) : null)]);
|
||||
}
|
||||
}
|
||||
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown=''>";
|
||||
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','collapse'=>'hide-sm-dn']);
|
||||
//echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','collapse'=>'hide-sm-dn','link'=>'contacts.php','style'=>($search == '' ? 'display: none;' : null)]);
|
||||
@@ -315,6 +329,9 @@
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($contacts ?: "style='visibility: hidden;'").">\n";
|
||||
echo " </th>\n";
|
||||
}
|
||||
if ($_GET['show'] == "all" && permission_exists('contact_all')) {
|
||||
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, $param, "class='shrink'");
|
||||
}
|
||||
echo th_order_by('contact_type', $text['label-contact_type'], $order_by, $order);
|
||||
echo th_order_by('contact_organization', $text['label-contact_organization'], $order_by, $order);
|
||||
echo "<th class='shrink hide-xs'> </th>\n";
|
||||
@@ -340,6 +357,15 @@
|
||||
echo " <input type='hidden' name='contacts[$x][uuid]' value='".escape($row['contact_uuid'])."' />\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
if ($_GET['show'] == "all" && permission_exists('contact_all')) {
|
||||
if (strlen($_SESSION['domains'][$row['domain_uuid']]['domain_name']) > 0) {
|
||||
$domain = $_SESSION['domains'][$row['domain_uuid']]['domain_name'];
|
||||
}
|
||||
else {
|
||||
$domain = $text['label-global'];
|
||||
}
|
||||
echo " <td>".escape($domain)."</td>\n";
|
||||
}
|
||||
echo " <td>".ucwords(escape($row['contact_type']))." </td>\n";
|
||||
echo " <td class='overflow'><a href='".$list_row_url."'>".escape($row['contact_organization'])."</a> </td>\n";
|
||||
echo " <td class='shrink no-link hide-xs center'>";
|
||||
|
||||
Reference in New Issue
Block a user