From 12608585fc2bdbb36ae010b5c9811f84528257c1 Mon Sep 17 00:00:00 2001 From: mattf Date: Wed, 17 Mar 2021 21:43:06 +0000 Subject: [PATCH] Added the ability to see orphan Remote Agent entries(with no valid User account) in admin.php git-svn-id: svn://192.168.202.10@3388 3d104415-ff17-0410-8863-d5cf3c621b8a --- www/vicidial/admin.php | 78 +++++++++++++++++++++++++++-- www/vicidial/help_documentation.txt | 4 +- 2 files changed, 75 insertions(+), 7 deletions(-) diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 9e9dddc4..1f03878b 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -5538,12 +5538,13 @@ if ($SSscript_remove_js > 0) # 210316-0923 - Small fix for 2FA consistency # 210317-0819 - Added lead_all_info Non-Agent API function, Changed lead-modify page links to javascript because of Chrome # 210317-1211 - Fixes for better consistency in password change process, Issue #1261 +# 210317-1736 - Added the ability to see orphan Remote Agent entries(with no valid User account) # # 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-802a'; -$build = '210317-1211'; +$admin_version = '2.14-803a'; +$build = '210317-1736'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -17728,10 +17729,12 @@ if ($ADD==41111) $stmt="SELECT count(*) from vicidial_users where user='$user_start' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); - if ($row[0] < 1) + if ( ($row[0] < 1) and ($stage != 'ORPHAN') ) {echo "
"._QXZ("REMOTE AGENTS NOT MODIFIED - you must use a valid user as the user_start for remote agents")."\n";} else { + if ($row[0] < 1) + {echo "
"._QXZ("This Remote Agent does not have a valid User")."
\n";} ### check for closest remote agents to this account to ensure no overlapping $user_finish = ($user_start + $number_of_lines); $user_finish_length = strlen($user_finish); @@ -35552,7 +35555,7 @@ if ($ADD==31111) echo "\n"; echo "\n"; echo "$NWB#remote_agents-extension_group$NWE\n"; - echo ""._QXZ("Status").": $NWB#remote_agents-status$NWE\n"; + echo ""._QXZ("Status").": $NWB#remote_agents-status$NWE\n"; echo ""._QXZ("Campaign").": \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "
"._QXZ("User ID Start").": ("._QXZ("numbers only, incremented, must be an existing vicidial user").")$NWB#remote_agents-user_start$NWE
"._QXZ("Number of Lines").": ("._QXZ("numbers only").")$NWB#remote_agents-number_of_lines$NWE
"._QXZ("Server IP").": $NWB#remote_agents-server_ip$NWE
"._QXZ("External Extension").": ("._QXZ("dial plan number dialed to reach agents").")$NWB#remote_agents-conf_exten$NWE
"._QXZ("Extension Group").": $NWB#remote_agents-extension_group$NWE
"._QXZ("Status").": $NWB#remote_agents-status$NWE
"._QXZ("Campaign").": $NWB#remote_agents-campaign_id$NWE
"._QXZ("On-Hook Agent").": $NWB#remote_agents-on_hook_agent$NWE
"._QXZ("On-Hook Ring Time").": $NWB#remote_agents-on_hook_ring_time$NWE
\n"; + $temp_chart_title = _QXZ("8 Day call count for this remote-agent"); + horizontal_bar_chart($user_start,'8','remote-agent',$link,'ra_total_calls','call count',1,'','',$temp_chart_title); + echo "
"._QXZ("Inbound Groups").": \n"; + echo "$NWB#remote_agents-closer_campaigns$NWE
\n"; + echo _QXZ("NOTE: It can take up to 30 seconds for changes submitted on this screen to go live")."\n"; exit; } } @@ -42687,6 +42724,9 @@ if ($ADD==10000) $o++; } $user_start_SQL = preg_replace("/,$/","",$user_start_SQL); + $OTHERuser_start_SQL=''; + if (strlen($whereLOGadmin_viewable_groupsSQL) < 1) + {$OTHERuser_start_SQL="where user_start NOT IN($user_start_SQL)";} if (strlen($user_start_SQL) > 2) {$user_start_SQL = "user_start IN($user_start_SQL)";} @@ -42730,6 +42770,34 @@ if ($ADD==10000) $o++; } + ### For users with no User Group restrictions, show all Remote Agents with no user attached + if (strlen($OTHERuser_start_SQL) > 0) + { + $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,extension_group,status,campaign_id from vicidial_remote_agents $whereLOGallowed_campaignsSQL $OTHERuser_start_SQL order by server_ip,campaign_id,user_start;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $OTHERremoteagents_to_print = mysqli_num_rows($rslt); + + $o=0; + while ($OTHERremoteagents_to_print > $o) + { + $row=mysqli_fetch_row($rslt); + if (preg_match('/1$|3$|5$|7$|9$/i', $o)) + {$bgcolor='class="records_list_x"';} + else + {$bgcolor='class="records_list_y"';} + echo " 0) {echo " onclick=\"window.document.location='$PHP_SELF?ADD=31111&remote_agent_id=$row[0]'\"";} echo ">($row[1])"; + echo " $row[2]"; + echo " $row[3]"; + echo " $row[4]"; + echo " ".(preg_match('/^NONE$/', $row[5]) ? _QXZ("$row[5]") : $row[5]).""; + echo " "._QXZ("$row[6]").""; + echo " $row[7]"; + echo ""._QXZ("MODIFY")."\n"; + $o++; + } + } + echo "\n"; } diff --git a/www/vicidial/help_documentation.txt b/www/vicidial/help_documentation.txt index 17d5d3ed..bfe2074c 100644 --- a/www/vicidial/help_documentation.txt +++ b/www/vicidial/help_documentation.txt @@ -1,4 +1,4 @@ -# version: 20210317081901 +# version: 20210317173901 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. Only letters and numbers are allowed in user passwords. 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 or the agent screen. Default is N. @@ -697,7 +697,7 @@ filter_phone_groups-filter_phone_group_id Filter Phone Group ID This is the filter_phone_groups-filter_phone_group_name Filter Phone Group Name This is the name of the Filter Phone Group and is displayed with the ID in select lists where this feature is used. This field should be between 2 and 40 characters. filter_phone_groups-user_group Admin User Group This is the administrative user group for this record, this allows admin viewing of this record restricted by user group. Default is --ALL-- which allows any admin user to view this record. filter_phone_groups-filter_phone_group_description Filter Phone Group Description This is the description of the Filter Phone Group, it is purely for notation purposes only and is not a required field. -remote_agents-user_start User ID Start This is the starting User ID that is used when the remote agent entries are inserted into the system. If the Number of Lines is set higher than 1, this number is incremented by one until each line has an entry. Make sure you create a new user account with a user level of 4 or great if you want them to be able to use the vdremote.php page for remote web access of this account. +remote_agents-user_start User ID Start This is the starting User ID that is used when the remote agent entries are inserted into the system. This MUST be a valid User account in the system. If the Number of Lines is set higher than 1, this number is incremented by one until each line has an entry. Make sure you create a new user account with a user level of 4 or great if you want them to be able to use the vdremote.php page for remote web access of this account. remote_agents-number_of_lines Number of Lines This defines how many remote agent entries the system creates, and determines how many lines it thinks it can safely send to the number below. remote_agents-server_ip Server IP A remote agent entry is only good for one specific server, here is where you select which server you want. remote_agents-conf_exten External Extension This is the number that you want the calls forwarded to. Make sure that it is a full dial plan number and that if you need a 9 at the beginning you put it in here. Test by dialing this number from a phone on the system.