From 4c8913db76548f1a1ad44482b5ab9c8ce1b8b302 Mon Sep 17 00:00:00 2001 From: mattf Date: Sat, 30 Jun 2007 15:11:13 +0000 Subject: [PATCH] activated the New and Delete list mix functions in admin.php git-svn-id: svn://192.168.202.10@648 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../TO_BE_TRANSLATED_2.0.4.txt | 5 + www/vicidial/admin.php | 108 +++++++++++++++--- 2 files changed, 96 insertions(+), 17 deletions(-) diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt index 25e0b984..9b2e5dbe 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt @@ -72,6 +72,11 @@ CUSTOM CAMPAIGN STATUS MODIFIED|| LIST MIX NOT MODIFIED|| LIST MIX MODIFIED|| You cannot delete the last list_id entry from a list mix|| +LIST MIX ADDED: || +LIST MIX NOT ADDED || +There is already a list mix with this ID in the system|| +LIST MIX NOT DELETED|| +LIST MIX DELETED: || ############################################################ CLIENT diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 7d2a1a69..fbbeec12 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -1065,7 +1065,7 @@ $list_mix_container = ereg_replace(";","",$list_mix_container); # 70612-1451 - Added Callback INACTIVE link for after one week, sort by user/group/entrydate # 70614-0231 - Added Status Categories, ability to Modify Statuses, moved system statuses to sub-section # 70623-1008 - List Mix section now allows modification of list mix entries -# 70629-1721 - List Mix section adding and removing if list entries active +# 70629-1721 - List Mix section adding and removing of list entries active # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time @@ -5694,8 +5694,6 @@ if ($ADD==49) } else { - echo "
LIST MIX MODIFIED: $campaign_id - $vcl_id - $vcl_name\n"; - $stmt="UPDATE vicidial_campaigns_list_mix SET vcl_name='$vcl_name',mix_method='$mix_method',status='$status',list_mix_container='$list_mix_container' where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; $rslt=mysql_query($stmt, $link); @@ -5706,6 +5704,8 @@ if ($ADD==49) fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); fclose($fp); } + + echo "
LIST MIX MODIFIED: $campaign_id - $vcl_id - $vcl_name\n"; } } @@ -5722,8 +5722,6 @@ if ($ADD==49) } else { - echo "
LIST MIX MODIFIED: $campaign_id - $vcl_id - $list_id\n"; - $stmt="SELECT list_mix_container from vicidial_campaigns_list_mix where campaign_id='$campaign_id' and vcl_id='$vcl_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -5740,6 +5738,8 @@ if ($ADD==49) fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); fclose($fp); } + + echo "
LIST MIX MODIFIED: $campaign_id - $vcl_id - $list_id\n"; } } @@ -5816,6 +5816,71 @@ if ($ADD==49) } } } + + ##### ADD a NEW list mix ##### + if ($stage=='NEWMIX') + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) or (strlen($vcl_name) < 2) ) + { + echo "
LIST MIX NOT ADDED - Please go back and look at the data you entered\n"; + echo "
vcl_id must be between 1 and 20 characters in length\n"; + echo "
vcl_name must be at least 2 characters in length\n"; + } + else + { + $stmt="SELECT count(*) from vicidial_campaigns_list_mix where vcl_id='$vcl_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + echo "
LIST MIX NOT ADDED - There is already a list mix with this ID in the system\n"; + } + else + { + $stmt="INSERT INTO vicidial_campaigns_list_mix SET list_mix_container='$list_id|1|100| $status -|',campaign_id='$campaign_id',vcl_id='$vcl_id',vcl_name='$vcl_name',mix_method='$mix_method',status='INACTIVE';"; + $rslt=mysql_query($stmt, $link); + + ### LOG CHANGES TO LOG FILE ### + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./admin_changes_log.txt", "a"); + fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); + fclose($fp); + } + + echo "
LIST MIX ADDED: $campaign_id - $vcl_id - $vcl_name\n"; + } + } + } + + ##### DELETE an existing list mix ##### + if ($stage=='DELMIX') + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($vcl_id) < 1) ) + { + echo "
LIST MIX NOT DELETED - Please go back and look at the data you entered\n"; + echo "
vcl_id must be between 1 and 20 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_campaigns_list_mix where vcl_id='$vcl_id' and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG CHANGES TO LOG FILE ### + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./admin_changes_log.txt", "a"); + fwrite ($fp, "$date|MODIFY LIST MIX |$PHP_AUTH_USER|$ip|$stmt|\n"); + fclose($fp); + } + + echo "
LIST MIX DELETED: $campaign_id - $vcl_id - $vcl_name\n"; + } + } } else { @@ -9062,11 +9127,11 @@ if ( ($ADD==34) or ($ADD==31) ) else {$tablecolor='bgcolor="#9BB9FB"'; $bgcolor='bgcolor="#B9CBFD"';} - echo "
\n"; + echo "

\n"; echo ""; echo "\n"; echo "\n"; + echo "\n"; + echo "     DELETE LIST MIX\n"; echo "\n"; echo "\n"; + echo "List: $MIXdetailsLIST   REMOVE\n"; echo "
\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -9074,7 +9139,8 @@ if ( ($ADD==34) or ($ADD==31) ) echo "\n"; echo "\n"; echo "$vcl_id:\n"; - echo "
Status:\n"; echo "Method:\n"; @@ -9110,7 +9176,7 @@ if ( ($ADD==34) or ($ADD==31) ) echo "
\n"; echo "\n"; - echo "List: $MIXdetailsLIST   REMOVE
\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -9183,16 +9249,24 @@ if ( ($ADD==34) or ($ADD==31) ) } - echo "
ADD NEW LIST MIX
\n"; + echo "

ADD NEW LIST MIX
\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "Mix ID: \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 "Mix Name: Mix Method: "; + echo "
List: Dial Status:  
\n";