Changeset 2769

Show
Ignore:
Timestamp:
03/05/10 16:45:22 (2 years ago)
Author:
areski
Message:

Feature : add direct mailing option on customer View

Files:

Legend:

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

    r2421 r2769  
    4040 
    4141 
    42 if (! has_rights (ACX_CALLBACK)){  
    43           Header ("HTTP/1.0 401 Unauthorized"); 
    44            Header ("Location: PP_error.php?c=accessdenied");        
    45            die();           
     42if (! has_rights (ACX_CALLBACK)) { 
     43    Header ("HTTP/1.0 401 Unauthorized"); 
     44    Header ("Location: PP_error.php?c=accessdenied"); 
     45    die(); 
    4646} 
    4747 
  • trunk/admin/Public/A2B_mass_mail.php

    r2432 r2769  
    105105if(!empty($HD_Form -> FG_TABLE_CLAUSE)) { 
    106106        $HD_Form -> FG_TABLE_CLAUSE .= " AND email <> ''"; 
     107        if($_REQUEST['id']!=null) 
     108        { 
     109                $HD_Form -> FG_TABLE_CLAUSE .= " AND id = '".$_REQUEST['id']."'";        
     110        } 
    107111        $list_customer = $instance_cus_table -> Get_list ($HD_Form -> DBHandle, $HD_Form -> FG_TABLE_CLAUSE, null, null, null, null, $limit_massmail, 0);                        
    108112} else { 
    109113        $sql_clause = "email <> ''"; 
     114        if($_REQUEST['id']!=null) 
     115        { 
     116                $sql_clause .= " AND id = '".$_REQUEST['id']."'";        
     117        } 
    110118        $list_customer = $instance_cus_table -> Get_list ($HD_Form -> DBHandle, $sql_clause, null, null, null, null, $limit_massmail, 0); 
    111119} 
     
    197205<script language="JavaScript" src="javascript/card.js"></script> 
    198206<div class="toggle_hide2show"> 
     207<?php 
     208        if($_REQUEST['id']==null) 
     209        { 
     210?> 
    199211<center><a href="#" target="_self" class="toggle_menu"><img class="toggle_hide2show" src="<?php echo KICON_PATH; ?>/toggle_hide2show.png" onmouseover="this.style.cursor='hand';" HEIGHT="16"> <font class="fontstyle_002"><?php echo gettext("SEARCH CUSTOMERS");?> </font></a></center> 
    200212        <div class="tohide" style="display:none;"> 
    201  
    202 <?php 
    203 // #### CREATE SEARCH FORM 
     213<?php 
     214        }  
     215?> 
     216<?php 
     217        if($_REQUEST['id']==null) 
     218        { 
     219        // #### CREATE SEARCH FORM 
    204220        $HD_Form -> create_search_form(); 
     221        } 
    205222?> 
    206223 
     
    237254        } else { 
    238255                if(is_array($list_customer) || $nb_customer > 1) { 
     256 
     257                if($_REQUEST['id']==null) 
     258                { 
    239259?> 
    240260        <tr>  
     
    242262                <td align="center"> <span class="viewhandler_span1"><?php echo gettext("The mass mail tool is limited to 2000 mails. You can use the search module to send on different group of customer and overpass this limit.");?></span></td> 
    243263        </tr> 
     264<?php    
     265                }        
     266?> 
    244267        <tr>  
    245268                <td><span class="viewhandler_span1">&nbsp;</span></td> 
     
    254277                    <?php 
    255278                        $link_to_customer = CUSTOMER_UI_URL; 
    256                          
     279                        if($nb_customer==1) 
     280                        {        
     281                                echo "<input type=\"hidden\" name=\"id\" value=".$_REQUEST['id'].">"; 
     282                        } 
    257283                        if(is_array($list_customer)){ 
    258284                                        for($key=0; $key < $nb_customer && $key <= 100; $key++){ 
    259285                                                echo "<a href=A2B_entity_card.php?form_action=ask-edit&id=".$list_customer[$key]['id']." target=\"_blank\">".$list_customer[$key][1]."</a>"; 
    260286                                                if ($key + 1 != $nb_customer) echo ", "; 
    261                                                         echo "<input type=\"hidden\" name=\"hd_email[]\" value=".$list_customer[$key][0].">"; 
     287                                                        echo "<input type=\"hidden\" name=\"hd_email[]\" value=".$list_customer[$key][1].">"; 
    262288                                                if ($key == 100) { 
    263289                                                        echo "<br><a href=\"A2B_entity_card.php?atmenu=card&stitle=Customers_Card&section=1\" target=\"_blank\">".gettext("Click on list customer to see them all")."</a>"; 
  • trunk/admin/Public/form_data/FG_var_card.inc

    r2731 r2769  
    268268        $HD_Form -> FG_OTHER_BUTTON3 = true; 
    269269        $HD_Form -> FG_OTHER_BUTTON4 = true; 
     270        $HD_Form -> FG_OTHER_BUTTON5 = true; 
    270271        $FN_COLUMN_ID="col".($FG_COL_QUERY_COUNT);//get numbers of rows for needed fields 
    271272        $FN_COLUMN_USERNAME="col".($FG_COL_QUERY_COUNT+1); 
     
    275276        $HD_Form -> FG_OTHER_BUTTON3_LINK="A2B_entity_payment.php?form_action=ask-add&card_id=|$FN_COLUMN_ID|"; 
    276277        $HD_Form -> FG_OTHER_BUTTON4_LINK="A2B_entity_subscriber.php?form_action=ask-add&id=|$FN_COLUMN_ID|"; 
     278        $HD_Form -> FG_OTHER_BUTTON5_LINK="A2B_mass_mail.php?form_action=ask-add&id=|$FN_COLUMN_ID|"; 
    277279        $HD_Form -> FG_INFO_LINK = "A2B_card_info.php?id="; 
    278280        //FOR INFO , DEL, EDIT  the image is already in Image_Path 
     
    281283        $HD_Form -> FG_OTHER_BUTTON3_IMG = Images_Path . "/money.png"; 
    282284        $HD_Form -> FG_OTHER_BUTTON4_IMG = Images_Path . "/book_add.png"; 
     285        $HD_Form -> FG_OTHER_BUTTON5_IMG = Images_Path . "/email.png"; 
    283286        $HD_Form -> FG_OTHER_BUTTON1_ALT=gettext("Auto Create SIP Config"); 
    284287        $HD_Form -> FG_OTHER_BUTTON2_ALT=gettext("Auto Create IAX Config"); 
    285288        $HD_Form -> FG_OTHER_BUTTON3_ALT = gettext('Add Payment to this Card'); 
    286289        $HD_Form -> FG_OTHER_BUTTON4_ALT = gettext('Add New Subscription to this Card'); 
     290        $HD_Form -> FG_OTHER_BUTTON5_ALT = gettext('Email to this Customer'); 
    287291} 
    288292 
  • trunk/common/lib/Form/Class.FormHandler.inc.php

    r2673 r2769  
    134134        var $FG_OTHER_BUTTON3=false; 
    135135        var $FG_OTHER_BUTTON4=false; 
     136        var $FG_OTHER_BUTTON5=false; 
    136137         
    137138 
     
    148149        var $FG_OTHER_BUTTON3_LINK      = ''; 
    149150        var $FG_OTHER_BUTTON4_LINK      = ''; 
     151        var $FG_OTHER_BUTTON5_LINK      = ''; 
    150152         
    151153        var $FG_EDITION_IMG     = 'edit.png'; 
     
    157159        var $FG_OTHER_BUTTON3_IMG = ''; 
    158160        var $FG_OTHER_BUTTON4_IMG = ''; 
    159          
     161        var $FG_OTHER_BUTTON5_IMG = ''; 
     162 
    160163        var $FG_OTHER_BUTTON1_FORBIDDEN_KEY     = array(); 
    161164        var $FG_OTHER_BUTTON2_FORBIDDEN_KEY     = array(); 
    162165        var $FG_OTHER_BUTTON3_FORBIDDEN_KEY     = array(); 
    163166        var $FG_OTHER_BUTTON4_FORBIDDEN_KEY     = array(); 
    164          
     167        var $FG_OTHER_BUTTON5_FORBIDDEN_KEY     = array();               
     168 
    165169        var $FG_EDIT_PAGE_CONFIRM_BUTTON        = ''; 
    166170        var $FG_DELETE_PAGE_CONFIRM_BUTTON      = ''; 
     
    281285        var $FG_OTHER_BUTTON3_ALT = ''; 
    282286        var $FG_OTHER_BUTTON4_ALT = ''; 
     287        var $FG_OTHER_BUTTON5_ALT = ''; 
    283288         
    284289        var $FG_OTHER_BUTTON1_HTML_CLASS = ''; 
     
    286291        var $FG_OTHER_BUTTON3_HTML_CLASS = ''; 
    287292        var $FG_OTHER_BUTTON4_HTML_CLASS = ''; 
     293        var $FG_OTHER_BUTTON5_HTML_CLASS = ''; 
    288294         
    289295        var $FG_OTHER_BUTTON1_HTML_ID = ''; 
     
    291297        var $FG_OTHER_BUTTON3_HTML_ID = ''; 
    292298        var $FG_OTHER_BUTTON4_HTML_ID = '';      
     299        var $FG_OTHER_BUTTON5_HTML_ID = ''; 
    293300         
    294301        var $FG_OTHER_BUTTON1_CONDITION = ''; 
     
    296303        var $FG_OTHER_BUTTON3_CONDITION = ''; 
    297304        var $FG_OTHER_BUTTON4_CONDITION = ''; 
     305        var $FG_OTHER_BUTTON5_CONDITION = ''; 
     306 
    298307        var $FG_EDITION_CONDITION = ''; 
    299308        var $FG_DELETION_CONDITION = ''; 
     
    624633                 
    625634                $this -> FG_TOTAL_TABLE_COL = $this -> FG_NB_TABLE_COL; 
    626                 if ($this -> FG_DELETION || $this -> FG_INFO || $this -> FG_EDITION || $this -> FG_OTHER_BUTTON1 || $this -> FG_OTHER_BUTTON2 || $this -> FG_OTHER_BUTTON3 || $this -> FG_OTHER_BUTTON4) { 
     635                if ($this -> FG_DELETION || $this -> FG_INFO || $this -> FG_EDITION || $this -> FG_OTHER_BUTTON1 || $this -> FG_OTHER_BUTTON2 || $this -> FG_OTHER_BUTTON3 || $this -> FG_OTHER_BUTTON4 || $this -> FG_OTHER_BUTTON5) { 
    627636                        $this -> FG_TOTAL_TABLE_COL++; 
    628637                } 
  • trunk/common/lib/Form/Class.ViewHandler.inc.php

    r2679 r2769  
    658658                                                                ?></a> 
    659659                                                <?php } 
    660                                                         } ?> 
     660                                                }  
     661  
     662                                                if($this->FG_OTHER_BUTTON5){ 
     663                                                        $check = true; 
     664                                                        $condition_eval=$this->FG_OTHER_BUTTON5_CONDITION; 
     665                                                        $check_eval=false;       
     666                                                        if (!empty($this->FG_OTHER_BUTTON5_CONDITION) && (eregi ('col[0-9]', $this->FG_OTHER_BUTTON5_CONDITION))) { 
     667                                                                $check =false; 
     668                                                                        for ($h=count($list[$ligne_number]);$h>=0;$h--){ 
     669                                                                                $findme = "|col$h|"; 
     670                                                                                $pos = stripos($condition_eval, $findme); 
     671                                                                                if ($pos !== false) { 
     672                                                                                        $condition_eval = str_replace($findme,$list[$ligne_number][$h],$condition_eval); 
     673                                                                                } 
     674                                                                        } 
     675                                                        eval('$check_eval = '.$condition_eval.';');      
     676                                                                } 
     677                                                        if($check || $check_eval){ 
     678                                                        ?> 
     679                                                        <a href="<?php 
     680                                                                $new_FG_OTHER_BUTTON5_LINK = $this -> FG_OTHER_BUTTON5_LINK; 
     681                                                                if (strpos($this -> FG_OTHER_BUTTON5_LINK,"|param|")){ 
     682                                                                        $new_FG_OTHER_BUTTON5_LINK = str_replace("|param|",$list[$ligne_number][$this->FG_NB_TABLE_COL],$this -> FG_OTHER_BUTTON5_LINK); 
     683                                                                        // SHOULD DO SMTH BETTER WITH paramx and get the x number to find the value to use 
     684                                                                } 
     685                                                                if (strpos($this -> FG_OTHER_BUTTON5_LINK,"|param1|")){ 
     686                                                                        $new_FG_OTHER_BUTTON5_LINK = str_replace("|param1|",$list[$ligne_number][$this->FG_NB_TABLE_COL-1],$this -> FG_OTHER_BUTTON5_LINK); 
     687                                                                } 
     688 
     689                                                                // REPLACE |colX|  where is a numero of the column by the column value 
     690                                                                if (eregi ('col[0-9]', $new_FG_OTHER_BUTTON5_LINK)) { 
     691                                                                        for ($h=0;$h<=$this->FG_NB_TABLE_COL;$h++){ 
     692                                                                                $findme = "|col$h|"; 
     693                                                                                $pos = stripos($new_FG_OTHER_BUTTON5_LINK, $findme); 
     694                                                                                if ($pos !== false) { 
     695                                                                                        $new_FG_OTHER_BUTTON5_LINK = str_replace($findme,$list[$ligne_number][$h],$new_FG_OTHER_BUTTON5_LINK); 
     696                                                                                } 
     697                                                                        } 
     698                                                                } 
     699 
     700                                                                // REPLACE |col_origX|  where is a numero of the column by the column value 
     701                                                                if (eregi ('col_orig[0-9]', $new_FG_OTHER_BUTTON5_LINK)) { 
     702                                                                                for ($h=count($list[$ligne_number]);$h>=0;$h--){ 
     703                                                                                $findme = "|col_orig$h|"; 
     704                                                                                $pos = stripos($new_FG_OTHER_BUTTON5_LINK, $findme); 
     705                                                                                if ($pos !== false) { 
     706                                                                                        $new_FG_OTHER_BUTTON5_LINK = str_replace($findme,$origlist[$ligne_number][$h],$new_FG_OTHER_BUTTON5_LINK); 
     707                                                                                } 
     708                                                                        } 
     709                                                                } 
     710                                                                echo $new_FG_OTHER_BUTTON5_LINK; 
     711                                                                 
     712                                                                $extra_html=""; 
     713                                                                 
     714                                                                if(!empty($this->FG_OTHER_BUTTON5_HTML_ID) && (eregi ('col[0-9]',$this->FG_OTHER_BUTTON5_HTML_ID))){ 
     715                                                                        $temp_id =$this->FG_OTHER_BUTTON5_HTML_ID; 
     716                                                                        for ($h=count($list[$ligne_number]);$h>=0;$h--){ 
     717                                                                                $findme = "|col$h|"; 
     718                                                                                $pos = stripos($temp_id, $findme); 
     719                                                                                if ($pos !== false) { 
     720                                                                                        $temp_id = str_replace($findme,$origlist[$ligne_number][$h],$temp_id); 
     721                                                                                } 
     722                                                                        } 
     723                                                                        $extra_html.=' id="'.$temp_id.'"'; 
     724                                 
     725                                                                } 
     726                                                                 
     727                                                                if(!empty($this->FG_OTHER_BUTTON5_HTML_CLASS) ){ 
     728                                                                        $extra_html.= ' class="'.$this->FG_OTHER_BUTTON5_HTML_CLASS.'" '; 
     729                                                                } 
     730                                                                 
     731                                                                 
     732                                                                 
     733                                                                if (substr($new_FG_OTHER_BUTTON5_LINK,-1)=='=') echo $list[$ligne_number][$this->FG_NB_TABLE_COL]; 
     734                                                                if (strlen($this -> FG_OTHER_BUTTON5_IMG)==0){ 
     735                                                                        echo '"'.$extra_html.'> '.'<span class="cssbutton">'.$this->FG_OTHER_BUTTON5_ALT.'</span>'; 
     736                                                                }else{ 
     737                                                                        ?>" <?php echo $extra_html ?> ><img src="<?php echo $this -> FG_OTHER_BUTTON5_IMG?>" border="0" title="<?php echo $this->FG_OTHER_BUTTON5_ALT?>" alt="<?php echo $this->FG_OTHER_BUTTON5_ALT?>"><?php 
     738 
     739                                                                } 
     740                                                                ?></a> 
     741                                                <?php 
     742                                                         } 
     743                                                }  
     744                                                ?> 
    661745                                                 
    662746