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
This commit is contained in:
mattf
2020-04-07 03:21:49 +00:00
parent bd85bdf7b4
commit 28c4c2c1a8
2 changed files with 113 additions and 65 deletions
+111 -63
View File
@@ -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 "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$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 = "<a href=\"$PHP_SELF?ADD=1300&start_count=$next_count&stage=$stage\">"._QXZ("NEXT")." $next_temp</a> &nbsp; ";
}
else
{
$nextHTML = "<a href=\"$PHP_SELF?ADD=1300&start_count=$next_count&stage=$stage\">"._QXZ("NEXT")." $SSentries_per_page</a> &nbsp; ";
}
}
$next_prev_HTML .= _QXZ("RECORDS")." $start_count - $next_count &nbsp; ";
$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 .= "<a href=\"$PHP_SELF?ADD=1300&start_count=$prev_count&stage=$stage\">"._QXZ("PREVIOUS")." $SSentries_per_page</a> &nbsp; ";
}
$next_prev_HTML .= $nextHTML;
$next_prev_HTML .= " &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </b><a href=\"$PHP_SELF?ADD=1300&status=display_all&stage=$stage\"><font size=1 color=black>"._QXZ("show all DIDs")."</font></a><b> &nbsp; ";
}
}
$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 "<br>"._QXZ("INBOUND DID LISTINGS").":\n";
echo "<img src=\"images/icon_black_inbound.png\" alt=\"Inbound Groups\" width=42 height=42> "._QXZ("INBOUND DID LISTINGS").":\n";
if (strlen($next_prev_HTML) > 10)
{echo "<br><b> &nbsp; $next_prev_HTML</b><br>";}
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<TR BGCOLOR=BLACK>";
echo "<TD><font size=1 color=white>#</TD>";
@@ -40804,23 +40848,23 @@ if ($ADD==10000000000)
echo "<TABLE><TR><TD>\n";
echo "<img src=\"images/icon_phones.png\" width=42 height=42 align=left> <FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$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 = "<a href=\"$PHP_SELF?ADD=10000000000&start_count=$next_count&stage=$stage\">"._QXZ("NEXT")." $next_temp</a> &nbsp; ";
}
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 = "<a href=\"$PHP_SELF?ADD=10000000000&start_count=$next_count&stage=$stage\">"._QXZ("NEXT")." $SSentries_per_page</a> &nbsp; ";
if ($nextnext_count > $phones_count)
{
$next_temp = ($phones_count - $next_count);
$nextHTML = "<a href=\"$PHP_SELF?ADD=10000000000&start_count=$next_count&stage=$stage\">"._QXZ("NEXT")." $next_temp</a> &nbsp; ";
}
else
{
$nextHTML = "<a href=\"$PHP_SELF?ADD=10000000000&start_count=$next_count&stage=$stage\">"._QXZ("NEXT")." $SSentries_per_page</a> &nbsp; ";
}
}
$next_prev_HTML .= _QXZ("RECORDS")." $start_count - $next_count &nbsp; ";
$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 .= "<a href=\"$PHP_SELF?ADD=10000000000&start_count=$prev_count&stage=$stage\">"._QXZ("PREVIOUS")." $SSentries_per_page</a> &nbsp; ";
}
$next_prev_HTML .= $nextHTML;
$next_prev_HTML .= " &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </b><a href=\"$PHP_SELF?ADD=10000000000&status=display_all&stage=$stage\"><font size=1 color=black>"._QXZ("show all phones")."</font></a><b> &nbsp; ";
}
$next_prev_HTML .= _QXZ("RECORDS")." $start_count - $next_count &nbsp; ";
$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 .= "<a href=\"$PHP_SELF?ADD=10000000000&start_count=$prev_count&stage=$stage\">"._QXZ("PREVIOUS")." $SSentries_per_page</a> &nbsp; ";
}
$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 "<br>"._QXZ("PHONE LISTINGS").":\n";
if ($SSentries_per_page > 0)
{echo "<br><br><b> &nbsp; $next_prev_HTML</b><br><br>";}
if (strlen($next_prev_HTML) > 10)
{echo "<br><br><b> &nbsp; $next_prev_HTML</b><br>";}
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
echo "<tr bgcolor=black>";
echo "<td><a href=\"$PHP_SELF?ADD=10000000000&$EXTENlink\"><font size=1 color=white><B>"._QXZ("EXTEN")."</B></a> &nbsp; ";
+2 -2
View File
@@ -1,4 +1,4 @@
# version: 20200406010001
# version: 20200406231801
users-user User ID <QXZ>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.</QXZ>
users-pass Password <QXZ>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.</QXZ>
users-force_change_password Force Change Password <QXZ>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.</QXZ>
@@ -986,7 +986,7 @@ settings-vdc_agent_api_active Agent API Active <QXZ>If set to 1, this will allow
settings-admin_modify_refresh Admin Modify Auto-Refresh <QXZ>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.</QXZ>
settings-nocache_admin Admin No-Cache <QXZ>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.</QXZ>
settings-admin_row_click Admin Row Click <QXZ>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.</QXZ>
settings-entries_per_page Admin Records Per Page <QXZ>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.</QXZ>
settings-entries_per_page Admin Records Per Page <QXZ>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.</QXZ>
settings-user_admin_redirect Admin User Redirect <QXZ>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.</QXZ>
settings-enable_agc_xfer_log Enable Agent Transfer Logfile <QXZ>This option will log to a text logfile on the webserver every time a call is transferred to an agent. Default is 0, disabled.</QXZ>
settings-enable_agc_dispo_log Enable Agent Disposition Logfile <QXZ>This option will log to a text logfile on the webserver every time a call is dispositioned by an agent. Default is 0, disabled.</QXZ>