Changeset 2776

Show
Ignore:
Timestamp:
03/09/10 16:56:30 (2 years ago)
Author:
areski
Message:

fix on archive

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/admin/Public/A2B_call_archiving.php

    r2421 r2776  
    3939 
    4040 
    41 if (! has_rights (ACX_MAINTENANCE)){  
     41if (! has_rights (ACX_MAINTENANCE)) { 
    4242        Header ("HTTP/1.0 401 Unauthorized"); 
    4343        Header ("Location: PP_error.php?c=accessdenied");           
     
    8585$HD_Form -> FieldViewElement ($FG_COL_QUERY); 
    8686 
    87 if ($posted==1)
     87if ($posted==1)
    8888        $SQLcmd = ''; 
    8989        $SQLcmd = do_field($SQLcmd, 'src', 'src'); 
     
    164164} 
    165165 
    166 if ($_SESSION["is_admin"]==0){   
    167         if (strlen($HD_Form -> FG_TABLE_CLAUSE)>0) $HD_Form -> FG_TABLE_CLAUSE.=" AND "; 
    168         $HD_Form -> FG_TABLE_CLAUSE.="cardID=t2.IDCust AND t2.IDmanager='".$_SESSION["pr_reseller_ID"]."'"; 
    169 } 
    170  
    171166//To select just terminatecauseid=ANSWER 
    172 if (!isset($terminatecauseid))
     167if (!isset($terminatecauseid))
    173168        $terminatecauseid="ANSWER"; 
    174169} 
     
    184179if(isset($archive) && !empty($archive)){ 
    185180        $condition = $_SESSION['ss_calllist']; 
    186        if (strpos($condition,'WHERE') <= 0){ 
    187                $condition = " WHERE $condition"; 
    188        
    189 $rec = archive_data($condition, "call"); 
    190 if($rec > 0) 
    191        $archive_message = "The data has been successfully archived"; 
     181    if (strlen($condition) && strpos($condition,'WHERE') === false){ 
     182        $condition = " WHERE $condition"; 
     183   
     184    $rec = archive_data($condition, "call"); 
     185    if($rec > 0) 
     186        $archive_message = "The data has been successfully archived"; 
    192187} 
    193188 
    194189$smarty->display('main.tpl'); 
     190 
    195191?> 
    196192 
     
    484480                        </tr>                    
    485481                </tbody></table> 
    486 </FORM
     482</form
    487483</center> 
    488484 
     
    490486<!-- ** ** ** ** ** Displaying the Archiving message, calls list and Archive action button and link ** ** ** ** ** --> 
    491487<?php 
    492 if(isset($archive) && !empty($archive)){ 
     488 
     489if(isset($archive) && !empty($archive)) { 
    493490        $HD_Form -> CV_NO_FIELDS = ""; 
    494491        print "<div align=\"center\">".$archive_message."</div>"; 
    495492} 
     493 
    496494if (!isset($form_action))  $form_action="list"; //ask-add 
    497495if (!isset($action)) $action = $form_action; 
     
    499497$list = $HD_Form -> perform_action($form_action); 
    500498 
    501       $HD_Form -> create_form ($form_action, $list, $id=null) ; 
    502        $smarty->display('footer.tpl'); 
    503 ?> 
     499$HD_Form -> create_form ($form_action, $list, $id=null) ; 
     500 
     501$smarty->display('footer.tpl'); 
     502