From 28c4c2c1a85dd704d38e055a9fad26907b5bbd8c Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 7 Apr 2020 03:21:49 +0000 Subject: [PATCH] Small changes to entries_per_page display in admin.php (w/ display all), also added it for DIDs git-svn-id: svn://192.168.202.10@3220 3d104415-ff17-0410-8863-d5cf3c621b8a --- www/vicidial/admin.php | 174 ++++++++++++++++++---------- www/vicidial/help_documentation.txt | 4 +- 2 files changed, 113 insertions(+), 65 deletions(-) diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index ebdfd54b..f5389668 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -4646,12 +4646,13 @@ else # 200405-1805 - Added entries_per_page system setting option, fixed phone relocate conf file load issue # 200405-2339 - Added warnings for inactive voicemail server # 200406-0033 - Fix for Remote Agents where user deleted +# 200406-2319 - Small changes to entries_per_page display(w/ display all), also added it for DIDs # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time -$admin_version = '2.14-747a'; -$build = '200406-0033'; +$admin_version = '2.14-748a'; +$build = '200406-2319'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -40166,35 +40167,78 @@ if ($ADD==1300) echo "
\n"; echo ""; - $DIDlink='stage=DIDDOWN'; - $DESClink='stage=DESCDOWN'; - $CARRIERlink='stage=CARRIERDOWN'; - $ACTIVElink='stage=ACTIVEDOWN'; - $GROUPlink='stage=GROUPDOWN'; - $ROUTElink='stage=ROUTEDOWN'; - $REClink='stage=RECDOWN'; + $DIDlink="stage=DIDDOWN&status=$status"; + $DESClink="stage=DESCDOWN&status=$status"; + $CARRIERlink="stage=CARRIERDOWN&status=$status"; + $ACTIVElink="stage=ACTIVEDOWN&status=$status"; + $GROUPlink="stage=GROUPDOWN&status=$status"; + $ROUTElink="stage=ROUTEDOWN&status=$status"; + $REClink="stage=RECDOWN&status=$status"; $SQLorder='order by did_pattern'; - if (preg_match("/DIDUP/i",$stage)) {$SQLorder='order by did_pattern asc'; $DIDlink='stage=DIDDOWN';} - if (preg_match("/DIDDOWN/i",$stage)) {$SQLorder='order by did_pattern desc'; $DIDlink='stage=DIDUP';} - if (preg_match("/DESCUP/i",$stage)) {$SQLorder='order by did_description asc'; $DESClink='stage=DESCDOWN';} - if (preg_match("/DESCDOWN/i",$stage)) {$SQLorder='order by did_description desc'; $DESClink='stage=DESCUP';} - if (preg_match("/CARRIERUP/i",$stage)) {$SQLorder='order by did_carrier_description asc'; $CARRIERlink='stage=CARRIERDOWN';} - if (preg_match("/CARRIERDOWN/i",$stage)) {$SQLorder='order by did_carrier_description desc'; $CARRIERlink='stage=CARRIERUP';} - if (preg_match("/ACTIVEUP/i",$stage)) {$SQLorder='order by did_active asc'; $ACTIVElink='stage=ACTIVEDOWN';} - if (preg_match("/ACTIVEDOWN/i",$stage)) {$SQLorder='order by did_active desc'; $ACTIVElink='stage=ACTIVEUP';} - if (preg_match("/GROUPUP/i",$stage)) {$SQLorder='order by user_group asc'; $GROUPlink='stage=GROUPDOWN';} - if (preg_match("/GROUPDOWN/i",$stage)) {$SQLorder='order by user_group desc'; $GROUPlink='stage=GROUPUP';} - if (preg_match("/ROUTEUP/i",$stage)) {$SQLorder='order by did_route asc'; $ROUTElink='stage=ROUTEDOWN';} - if (preg_match("/ROUTEDOWN/i",$stage)) {$SQLorder='order by did_route desc'; $ROUTElink='stage=ROUTEUP';} - if (preg_match("/RECUP/i",$stage)) {$SQLorder='order by record_call asc'; $REClink='stage=RECDOWN';} - if (preg_match("/RECDOWN/i",$stage)) {$SQLorder='order by record_call desc'; $REClink='stage=RECUP';} + if (preg_match("/DIDUP/i",$stage)) {$SQLorder='order by did_pattern asc'; $DIDlink="stage=DIDDOWN&status=$status";} + if (preg_match("/DIDDOWN/i",$stage)) {$SQLorder='order by did_pattern desc'; $DIDlink="stage=DIDUP&status=$status";} + if (preg_match("/DESCUP/i",$stage)) {$SQLorder='order by did_description asc'; $DESClink="stage=DESCDOWN&status=$status";} + if (preg_match("/DESCDOWN/i",$stage)) {$SQLorder='order by did_description desc'; $DESClink="stage=DESCUP&status=$status";} + if (preg_match("/CARRIERUP/i",$stage)) {$SQLorder='order by did_carrier_description asc'; $CARRIERlink="stage=CARRIERDOWN&status=$status";} + if (preg_match("/CARRIERDOWN/i",$stage)) {$SQLorder='order by did_carrier_description desc'; $CARRIERlink="stage=CARRIERUP&status=$status";} + if (preg_match("/ACTIVEUP/i",$stage)) {$SQLorder='order by did_active asc'; $ACTIVElink="stage=ACTIVEDOWN&status=$status";} + if (preg_match("/ACTIVEDOWN/i",$stage)) {$SQLorder='order by did_active desc'; $ACTIVElink="stage=ACTIVEUP&status=$status";} + if (preg_match("/GROUPUP/i",$stage)) {$SQLorder='order by user_group asc'; $GROUPlink="stage=GROUPDOWN&status=$status";} + if (preg_match("/GROUPDOWN/i",$stage)) {$SQLorder='order by user_group desc'; $GROUPlink="stage=GROUPUP&status=$status";} + if (preg_match("/ROUTEUP/i",$stage)) {$SQLorder='order by did_route asc'; $ROUTElink="stage=ROUTEDOWN&status=$status";} + if (preg_match("/ROUTEDOWN/i",$stage)) {$SQLorder='order by did_route desc'; $ROUTElink="stage=ROUTEUP&status=$status";} + if (preg_match("/RECUP/i",$stage)) {$SQLorder='order by record_call asc'; $REClink="stage=RECDOWN&status=$status";} + if (preg_match("/RECDOWN/i",$stage)) {$SQLorder='order by record_call desc'; $REClink="stage=RECUP&status=$status";} - $stmt="SELECT did_id,did_pattern,did_description,did_carrier_description,did_active,did_route,record_call,user_group from vicidial_inbound_dids where did_pattern!='did_system_filter' $LOGadmin_viewable_groupsSQL $SQLorder;"; + $limitSQL=''; + $next_prev_HTML=''; + if ($SSentries_per_page > 0) + { + $stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern!='did_system_filter' $LOGadmin_viewable_groupsSQL"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + $dids_count = $row[0]; + + if ( ($dids_count > $SSentries_per_page) and ($status != 'display_all') ) + { + if (strlen($start_count) < 1) {$start_count=0;} + $next_count = ($start_count + $SSentries_per_page); + $nextnext_count = ($next_count + $SSentries_per_page); + if ($next_count > $dids_count) + {$next_count = $dids_count;} + else + { + if ($nextnext_count > $dids_count) + { + $next_temp = ($dids_count - $next_count); + $nextHTML = ""._QXZ("NEXT")." $next_temp   "; + } + else + { + $nextHTML = ""._QXZ("NEXT")." $SSentries_per_page   "; + } + } + $next_prev_HTML .= _QXZ("RECORDS")." $start_count - $next_count   "; + $limitSQL="limit $SSentries_per_page"; + if ($start_count > 0) + { + $prev_count = ($start_count - $SSentries_per_page); + $limitSQL="limit $start_count,$SSentries_per_page"; + $next_prev_HTML .= ""._QXZ("PREVIOUS")." $SSentries_per_page   "; + } + $next_prev_HTML .= $nextHTML; + $next_prev_HTML .= "           "._QXZ("show all DIDs")."   "; + } + } + + $stmt="SELECT did_id,did_pattern,did_description,did_carrier_description,did_active,did_route,record_call,user_group from vicidial_inbound_dids where did_pattern!='did_system_filter' $LOGadmin_viewable_groupsSQL $SQLorder $limitSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $dids_to_print = mysqli_num_rows($rslt); - echo "
"._QXZ("INBOUND DID LISTINGS").":\n"; + echo "\"Inbound "._QXZ("INBOUND DID LISTINGS").":\n"; + if (strlen($next_prev_HTML) > 10) + {echo "
  $next_prev_HTML
";} echo "
\n"; echo ""; echo ""; @@ -40804,23 +40848,23 @@ if ($ADD==10000000000) echo "
#
\n"; echo " "; - $EXTENlink='stage=EXTENDOWN'; - $EXTENNUMlink='stage=EXTENNUMDOWN'; - $PROTOlink='stage=PROTODOWN'; - $SERVERlink='stage=SERVERDOWN'; - $STATUSlink='stage=STATUSDOWN'; + $EXTENlink="stage=EXTENDOWN&status=$status"; + $EXTENNUMlink="stage=EXTENNUMDOWN&status=$status"; + $PROTOlink="stage=PROTODOWN&status=$status"; + $SERVERlink="stage=SERVERDOWN&status=$status"; + $STATUSlink="stage=STATUSDOWN&status=$status"; $SQLorder='order by extension,server_ip'; - if (preg_match("/EXTENUP/i",$stage)) {$SQLorder='order by extension asc'; $EXTENlink='stage=EXTENDOWN';} - if (preg_match("/EXTENDOWN/i",$stage)) {$SQLorder='order by extension desc'; $EXTENlink='stage=EXTENUP';} - if (preg_match("/EXTENNUMUP/i",$stage)) {$SQLorder='order by CAST(extension as SIGNED INTEGER) desc'; $EXTENNUMlink='stage=EXTENNUMDOWN';} - if (preg_match("/EXTENNUMDOWN/i",$stage)) {$SQLorder='order by CAST(extension as SIGNED INTEGER) asc'; $EXTENNUMlink='stage=EXTENNUMUP';} - if (preg_match("/PROTOUP/i",$stage)) {$SQLorder='order by protocol asc'; $PROTOlink='stage=PROTODOWN';} - if (preg_match("/PROTODOWN/i",$stage)) {$SQLorder='order by protocol desc'; $PROTOlink='stage=PROTOUP';} - if (preg_match("/SERVERUP/i",$stage)) {$SQLorder='order by server_ip asc'; $SERVERlink='stage=SERVERDOWN';} - if (preg_match("/SERVERDOWN/i",$stage)) {$SQLorder='order by server_ip desc'; $SERVERlink='stage=SERVERUP';} - if (preg_match("/STATUSUP/i",$stage)) {$SQLorder='order by status asc'; $STATUSlink='stage=STATUSDOWN';} - if (preg_match("/STATUSDOWN/i",$stage)) {$SQLorder='order by status desc'; $STATUSlink='stage=STATUSUP';} + if (preg_match("/EXTENUP/i",$stage)) {$SQLorder='order by extension asc'; $EXTENlink="stage=EXTENDOWN&status=$status";} + if (preg_match("/EXTENDOWN/i",$stage)) {$SQLorder='order by extension desc'; $EXTENlink="stage=EXTENUP&status=$status";} + if (preg_match("/EXTENNUMUP/i",$stage)) {$SQLorder='order by CAST(extension as SIGNED INTEGER) desc'; $EXTENNUMlink="stage=EXTENNUMDOWN&status=$status";} + if (preg_match("/EXTENNUMDOWN/i",$stage)) {$SQLorder='order by CAST(extension as SIGNED INTEGER) asc'; $EXTENNUMlink="stage=EXTENNUMUP&status=$status";} + if (preg_match("/PROTOUP/i",$stage)) {$SQLorder='order by protocol asc'; $PROTOlink="stage=PROTODOWN&status=$status";} + if (preg_match("/PROTODOWN/i",$stage)) {$SQLorder='order by protocol desc'; $PROTOlink="stage=PROTOUP&status=$status";} + if (preg_match("/SERVERUP/i",$stage)) {$SQLorder='order by server_ip asc'; $SERVERlink="stage=SERVERDOWN&status=$status";} + if (preg_match("/SERVERDOWN/i",$stage)) {$SQLorder='order by server_ip desc'; $SERVERlink="stage=SERVERUP&status=$status";} + if (preg_match("/STATUSUP/i",$stage)) {$SQLorder='order by status asc'; $STATUSlink="stage=STATUSDOWN&status=$status";} + if (preg_match("/STATUSDOWN/i",$stage)) {$SQLorder='order by status desc'; $STATUSlink="stage=STATUSUP&status=$status";} $limitSQL=''; $next_prev_HTML=''; @@ -40831,32 +40875,36 @@ if ($ADD==10000000000) $row=mysqli_fetch_row($rslt); $phones_count = $row[0]; - if (strlen($start_count) < 1) {$start_count=0;} - $next_count = ($start_count + $SSentries_per_page); - $nextnext_count = ($next_count + $SSentries_per_page); - if ($next_count > $phones_count) - {$next_count = $phones_count;} - else + if ( ($phones_count > $SSentries_per_page) and ($status != 'display_all') ) { - if ($nextnext_count > $phones_count) - { - $next_temp = ($phones_count - $next_count); - $nextHTML = ""._QXZ("NEXT")." $next_temp   "; - } + if (strlen($start_count) < 1) {$start_count=0;} + $next_count = ($start_count + $SSentries_per_page); + $nextnext_count = ($next_count + $SSentries_per_page); + if ($next_count > $phones_count) + {$next_count = $phones_count;} else { - $nextHTML = ""._QXZ("NEXT")." $SSentries_per_page   "; + if ($nextnext_count > $phones_count) + { + $next_temp = ($phones_count - $next_count); + $nextHTML = ""._QXZ("NEXT")." $next_temp   "; + } + else + { + $nextHTML = ""._QXZ("NEXT")." $SSentries_per_page   "; + } } + $next_prev_HTML .= _QXZ("RECORDS")." $start_count - $next_count   "; + $limitSQL="limit $SSentries_per_page"; + if ($start_count > 0) + { + $prev_count = ($start_count - $SSentries_per_page); + $limitSQL="limit $start_count,$SSentries_per_page"; + $next_prev_HTML .= ""._QXZ("PREVIOUS")." $SSentries_per_page   "; + } + $next_prev_HTML .= $nextHTML; + $next_prev_HTML .= "           "._QXZ("show all phones")."   "; } - $next_prev_HTML .= _QXZ("RECORDS")." $start_count - $next_count   "; - $limitSQL="limit $SSentries_per_page"; - if ($start_count > 0) - { - $prev_count = ($start_count - $SSentries_per_page); - $limitSQL="limit $start_count,$SSentries_per_page"; - $next_prev_HTML .= ""._QXZ("PREVIOUS")." $SSentries_per_page   "; - } - $next_prev_HTML .= $nextHTML; } $stmt="SELECT extension,protocol,server_ip,dialplan_number,voicemail_id,status,fullname,messages,old_messages,user_group from phones $whereLOGadmin_viewable_groupsSQL $SQLorder $limitSQL"; @@ -40864,8 +40912,8 @@ if ($ADD==10000000000) $phones_to_print = mysqli_num_rows($rslt); echo "
"._QXZ("PHONE LISTINGS").":\n"; - if ($SSentries_per_page > 0) - {echo "

  $next_prev_HTML

";} + if (strlen($next_prev_HTML) > 10) + {echo "

  $next_prev_HTML
";} echo "
\n"; echo ""; echo "
"._QXZ("EXTEN")."   "; diff --git a/www/vicidial/help_documentation.txt b/www/vicidial/help_documentation.txt index d1e94062..1bf07c5a 100644 --- a/www/vicidial/help_documentation.txt +++ b/www/vicidial/help_documentation.txt @@ -1,4 +1,4 @@ -# version: 20200406010001 +# version: 20200406231801 users-user User ID This field is where you put the users ID number, can be up to 8 digits in length, Must be at least 2 characters in length. users-pass Password This field is where you put the users password. Must be at least 2 characters in length. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters. users-force_change_password Force Change Password If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N. @@ -986,7 +986,7 @@ settings-vdc_agent_api_active Agent API Active If set to 1, this will allow settings-admin_modify_refresh Admin Modify Auto-Refresh This is the refresh interval in seconds of the modify screens in this admin interface. Setting this to 0 will disable it, setting it below 5 will mostly make the modify screens unusable because they will refresh too quickly to change fields. This option is useful in situations where more than one manager is controlling settings on an active campaign or in-group so that the settings are refreshed frequently. Default is 0. settings-nocache_admin Admin No-Cache Setting this to 1 will set all admin pages to web browser no-cache, so every screen has to be reloaded every time it is viewed, even if clicking back on the browser. Default is 0 for disabled. settings-admin_row_click Admin Row Click Setting this to 1 will allow you to click on a row to go to a record link in addition to being able to go to the record link by clicking on the text link. Default is 1 for enabled. -settings-entries_per_page Admin Records Per Page This setting will allow you to set the maximum number of records that can appear on an admin page listing. Currently only works for Phones. Default is 0 for disabled. +settings-entries_per_page Admin Records Per Page This setting will allow you to set the maximum number of records that can appear on an admin page listing. Currently only works for Phones and DIDs. Default is 0 for disabled. settings-user_admin_redirect Admin User Redirect If enabled, you can define a URL that an admin web user is redirected to when they log in to the admin screens. This is often used for level 7 report only users to be sent to a single report without seeing the admin screens at all. Default is 0 for disabled. settings-enable_agc_xfer_log Enable Agent Transfer Logfile This option will log to a text logfile on the webserver every time a call is transferred to an agent. Default is 0, disabled. settings-enable_agc_dispo_log Enable Agent Disposition Logfile This option will log to a text logfile on the webserver every time a call is dispositioned by an agent. Default is 0, disabled.