diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 3d6ec614..3ac7e8c9 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -1041,17 +1041,21 @@ $list_mix_container = ereg_replace(";","",$list_mix_container); # 70531-1631 - Development on List mix admin interface # 70601-1629 - More development on List mix admin interface, formatting, and added some javascript # 70602-1300 - More development on List mix admin interface, more javascript +# 70608-1459 - Added option to set LIVE Callbacks to INACTIVE after one month # # 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 -$admin_version = '2.0.4-102'; -$build = '70602-1300'; +$admin_version = '2.0.4-103'; +$build = '70608-1459'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); $MT[0]=''; $US='_'; +$month_old = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); +$past_month_date = date("Y-m-d H:i:s",$month_old); + if ($force_logout) { if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) @@ -10758,11 +10762,22 @@ echo "\n"; ###################### if ($ADD==8) { - echo ""; + if ($SUB==89) + { + if ($LOGmodify_users==1) + { + $stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where user='$user' and status='LIVE' and callback_time < '$past_month_date';"; + $rslt=mysql_query($stmt, $link); + echo "
User($user) callback listings LIVE for more than one month have been made INACTIVE\n"; + } + } +$CBinactiveLINK = "
Remove LIVE Callbacks older than one month for this user
"; - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and user='$user' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); +echo ""; + +$stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and user='$user' order by recipient,status desc,callback_time"; +$rslt=mysql_query($stmt, $link); +$cb_to_print = mysql_num_rows($rslt); echo "
USER CALLBACK HOLD LISTINGS: $user\n"; $ADD='82'; @@ -10773,11 +10788,22 @@ $ADD='82'; ###################### if ($ADD==81) { - echo ""; + if ($SUB==89) + { + if ($LOGmodify_campaigns==1) + { + $stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where campaign_id='$campaign_id' and status='LIVE' and callback_time < '$past_month_date';"; + $rslt=mysql_query($stmt, $link); + echo "
campaign($campaign_id) callback listings LIVE for more than one month have been made INACTIVE\n"; + } + } +$CBinactiveLINK = "
Remove LIVE Callbacks older than one month for this campaign
"; - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and campaign_id='$campaign_id' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); +echo ""; + +$stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and campaign_id='$campaign_id' order by recipient,status desc,callback_time"; +$rslt=mysql_query($stmt, $link); +$cb_to_print = mysql_num_rows($rslt); echo "
CAMPAIGN CALLBACK HOLD LISTINGS: $campaign_id\n"; $ADD='82'; @@ -10788,11 +10814,22 @@ $ADD='82'; ###################### if ($ADD==811) { - echo ""; + if ($SUB==89) + { + if ($LOGmodify_lists==1) + { + $stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where list_id='$list_id' and status='LIVE' and callback_time < '$past_month_date';"; + $rslt=mysql_query($stmt, $link); + echo "
list($list_id) callback listings LIVE for more than one month have been made INACTIVE\n"; + } + } +$CBinactiveLINK = "
Remove LIVE Callbacks older than one month for this list
"; - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and list_id='$list_id' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); +echo ""; + +$stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and list_id='$list_id' order by recipient,status desc,callback_time"; +$rslt=mysql_query($stmt, $link); +$cb_to_print = mysql_num_rows($rslt); echo "
LIST CALLBACK HOLD LISTINGS: $list_id\n"; $ADD='82'; @@ -10803,6 +10840,17 @@ $ADD='82'; ###################### if ($ADD==8111) { + if ($SUB==89) + { + if ($LOGmodify_usergroups==1) + { + $stmt="UPDATE vicidial_callbacks SET status='INACTIVE' where user_group='$user_group' and status='LIVE' and callback_time < '$past_month_date';"; + $rslt=mysql_query($stmt, $link); + echo "
user group($user_group) callback listings LIVE for more than one month have been made INACTIVE\n"; + } + } + $CBinactiveLINK = "
Remove LIVE Callbacks older than one month for this user group
"; + echo ""; $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and user_group='$user_group' order by recipient,status desc,callback_time"; @@ -10844,6 +10892,8 @@ echo "LEAD\n"; + +echo "$CBinactiveLINK"; }