From 9447a2b217269c6e587157929963d12e6548ee0e Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 18 Nov 2014 06:12:52 +0000 Subject: [PATCH] Added options for up to 9 ordered variables within QXZ function output for admin PHP scripts git-svn-id: svn://192.168.202.10@2192 3d104415-ff17-0410-8863-d5cf3c621b8a --- www/vicidial/AST_CLOSERstats.php | 8 ++++---- www/vicidial/admin.php | 10 +++++----- www/vicidial/functions.php | 20 +++++++++++++++++--- www/vicidial/list_split.php | 2 +- www/vicidial/user_group_bulk_change.php | 2 +- www/vicidial/voice_lab.php | 2 +- 6 files changed, 29 insertions(+), 15 deletions(-) diff --git a/www/vicidial/AST_CLOSERstats.php b/www/vicidial/AST_CLOSERstats.php index e7218a8d..ccb8d990 100644 --- a/www/vicidial/AST_CLOSERstats.php +++ b/www/vicidial/AST_CLOSERstats.php @@ -887,10 +887,10 @@ else if ($DID!='Y') { - $MAIN.="TMR1 "._QXZ("(Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered):",75)." $PCTanswer_sec_pct_rt_stat_one%\n"; - $MAIN.="TMR2 "._QXZ("(Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered):",75)." $PCTanswer_sec_pct_rt_stat_two%\n"; - $CSV_text1.="\"TMR1 "._QXZ("(Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered)").":\",\"$PCTanswer_sec_pct_rt_stat_one%\"\n"; - $CSV_text1.="\"TMR2 "._QXZ("(Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered)").":\",\"$PCTanswer_sec_pct_rt_stat_two%\"\n"; + $MAIN.="TMR1 "._QXZ("(Answered within %1s seconds/Answered):",50,'',$Sanswer_sec_pct_rt_stat_one)." $PCTanswer_sec_pct_rt_stat_one%\n"; + $MAIN.="TMR2 "._QXZ("(Answered within %1s seconds/Answered):",50,'',$Sanswer_sec_pct_rt_stat_two)." $PCTanswer_sec_pct_rt_stat_two%\n"; + $CSV_text1.="\"TMR1 "._QXZ("(Answered within %1s seconds/Answered)",0,'',$Sanswer_sec_pct_rt_stat_one).":\",\"$PCTanswer_sec_pct_rt_stat_one%\"\n"; + $CSV_text1.="\"TMR2 "._QXZ("(Answered within %1s seconds/Answered)",0,'',$Sanswer_sec_pct_rt_stat_two).":\",\"$PCTanswer_sec_pct_rt_stat_two%\"\n"; } diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index f6875da2..952cf26c 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -4127,7 +4127,7 @@ if ($ADD==190000000000) {$hh='admin'; $sh='cts'; echo _QXZ("CONTACTS LIST");} if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo _QXZ("CONFERENCE LIST");} if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo _QXZ("AGENT CONFERENCE LIST");} if ($ADD==100000000000000) {$hh='qc'; echo _QXZ("Quality Control");} -if ($ADD==881) {$hh='qc'; echo _QXZ("Quality Control Campaign $campaign_id");} +if ($ADD==881) {$hh='qc'; echo _QXZ("Quality Control Campaign")," $campaign_id";} if ($ADD==550) {$hh='users'; echo _QXZ("Search Form");} if ($ADD==551) {$hh='users'; echo _QXZ("SEARCH PHONES");} if ($ADD==660) {$hh='users'; echo _QXZ("Search Results");} @@ -28651,10 +28651,10 @@ if ($ADD==311111111111) echo "
\n"; $camp_lists = preg_replace('/.$/i','',$camp_lists);; - echo _QXZ("This server has")." $active_carriers "._QXZ("active carriers and $inactive_carriers inactive carriers")."

\n"; - echo _QXZ("This server has")." $active_phones "._QXZ("active phones and $inactive_phones inactive phones")."

\n"; - echo _QXZ("This server has")." $active_confs "._QXZ("active conferences")."

\n"; - echo _QXZ("This server has")." $active_vdconfs "._QXZ("active vicidial conferences")."

\n"; + echo _QXZ("This server has %1s active carriers and %2s inactive carriers",0,'',$active_carriers,$inactive_carriers)."

\n"; + echo _QXZ("This server has %1s active phones and %2s inactive phones",0,'',$active_phones,$inactive_phones)."

\n"; + echo _QXZ("This server has %1s active conferences",0,'',$active_confs)."

\n"; + echo _QXZ("This server has %1s active vicidial conferences",0,'',$active_vdconfs)."

\n"; echo "
\n"; if ($LOGast_delete_phones > 0) { diff --git a/www/vicidial/functions.php b/www/vicidial/functions.php index 90a4c625..ba4ac0cc 100644 --- a/www/vicidial/functions.php +++ b/www/vicidial/functions.php @@ -19,6 +19,7 @@ # 130831-0919 - Changed to mysqli PHP functions # 140319-1924 - Added MathZDC function # 140918-1609 - Added admin QXZ print/echo function with length padding +# 141118-0109 - Added options for up to 9 ordered variables within QXZ function output # ##### BEGIN validate user login credentials, check for failed lock out ##### @@ -418,10 +419,23 @@ function MathZDC($dividend, $divisor, $quotient=0) { } } -# function to print/echo content, options for length included -function _QXZ($English_text, $sprintf=0, $align="l") +# function to print/echo content, options for length, alignment and ordered internal variables are included +function _QXZ($English_text, $sprintf=0, $align="l", $v_one='', $v_two='', $v_three='', $v_four='', $v_five='', $v_six='', $v_seven='', $v_eight='', $v_nine='') { -# $English_text = str_repeat('*', strlen($English_text)); + if (preg_match("/%\ds/",$English_text)) + { + $English_text = preg_replace("/%1s/", $v_one, $English_text); + $English_text = preg_replace("/%2s/", $v_two, $English_text); + $English_text = preg_replace("/%3s/", $v_three, $English_text); + $English_text = preg_replace("/%4s/", $v_four, $English_text); + $English_text = preg_replace("/%5s/", $v_five, $English_text); + $English_text = preg_replace("/%6s/", $v_six, $English_text); + $English_text = preg_replace("/%7s/", $v_seven, $English_text); + $English_text = preg_replace("/%8s/", $v_eight, $English_text); + $English_text = preg_replace("/%9s/", $v_nine, $English_text); + } + ### uncomment to test output + # $English_text = str_repeat('*', strlen($English_text)); if ($sprintf>0) { if ($align=="r") diff --git a/www/vicidial/list_split.php b/www/vicidial/list_split.php index b954bbc2..87c25d16 100644 --- a/www/vicidial/list_split.php +++ b/www/vicidial/list_split.php @@ -244,7 +244,7 @@ if ($submit == "submit" ) $num_lists = ceil( $orig_count / $num_leads ); - echo "

"._QXZ("You are about to split list")." $orig_list "._QXZ("into")." $num_lists "._QXZ("new lists with $num_leads leads in each of the new lists. The new lists will start with list id")." $start_dest_list_id.

\n"; + echo "

"._QXZ("You are about to split list %1s into %2s new lists with %3s leads in each of the new lists. The new lists will start with list id %4s.",0,'',$orig_list,$num_lists,$num_leads,$start_dest_list_id)."

\n"; echo "
\n"; echo "\n"; echo "\n"; diff --git a/www/vicidial/user_group_bulk_change.php b/www/vicidial/user_group_bulk_change.php index 6e4a139d..77ade741 100644 --- a/www/vicidial/user_group_bulk_change.php +++ b/www/vicidial/user_group_bulk_change.php @@ -191,7 +191,7 @@ if ($stage == "one_user_group_change") $stmt="UPDATE vicidial_users set user_group='" . mysqli_real_escape_string($link, $group) . "' where user_group='" . mysqli_real_escape_string($link, $old_group) . "' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); - echo _QXZ("All User Group $old_group Users changed to the")." $group "._QXZ("User Group")."
\n"; + echo _QXZ("All User Group %1s Users changed to the %2s User Group",0,'',$old_group,$group)."
\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; diff --git a/www/vicidial/voice_lab.php b/www/vicidial/voice_lab.php index 6690eb90..915dcaf5 100644 --- a/www/vicidial/voice_lab.php +++ b/www/vicidial/voice_lab.php @@ -172,7 +172,7 @@ if ($NEW_VOICE_LAB > 0) { if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) ) { - echo "


"._QXZ("TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW")."
\n"; + echo "


"._QXZ("TO START YOUR VOICE LAB, DIAL 9%1s ON YOUR PHONE NOW",0,'',$session_id)."
\n"; echo "
"._QXZ("or, you can enter an extension that you want played below")."\n"; echo "\n";