Changeset 5192


Ignore:
Timestamp:
11/21/11 14:59:25 (12 years ago)
Author:
gustavo
Message:

Ticket #2329 - Compatibilizar filtro fora do escritório

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.ScriptS.inc.php

    r5134 r5192  
    2525    var $EmailVoip; 
    2626    var $EmailExpresso; 
    27  
     27        var $AlternateEmailExpresso = array(); 
     28         
    2829    function ScriptS() { 
    2930 
     
    4849        $this->EmailVoip = trim($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['voip_email_redirect']); 
    4950        $this->EmailExpresso = trim($_SESSION['phpgw_info']['expressomail']['user']['email']); 
     51                 
     52                include_once $_SESSION['rootPath'] . '/header.inc.php';  
     53                require_once $_SESSION['rootPath'] . '/API/class.servicelocator.php'; 
     54                $alternativeMailService = ServiceLocator::getService('ldap'); 
     55                $this->AlternateEmailExpresso = $alternativeMailService->getMailAlternateByUidNumber($_SESSION['phpgw_info']['expressomail']['user']['account_id']); 
    5056    } 
    5157 
     
    159165        unset($key); 
    160166        $tmp = explode("&&", $this->newout); 
     167                                 
     168                foreach($this->AlternateEmailExpresso as $alternative) 
     169                { 
     170                        if(!stristr($tmp3, ", \"$alternative\"")) 
     171                                $tmp3_aux .=  ", \"$alternative\""; 
     172                } 
     173                 
     174                $tmp3 .= $tmp3_aux; 
     175 
    161176        foreach ($tmp as $key => $tmp1) { 
    162177            if ($key == 2) { 
     
    166181            } 
    167182        } 
     183 
    168184        unset($this->newout); 
    169185        $this->newout = substr($tmp2, 0, (strlen($tmp2) - 2)); 
     
    462478        if ($vacation['status'] == 'on') { 
    463479            $newscriptbody .= "vacation :days " . $vacation['days'] . " :addresses ["; 
    464             $newscriptbody .= $vacation['addresses']; 
     480                        $newscriptbody .= $vacation['addresses']; 
    465481            $newscriptbody .= "] text:\n" . utf8_encode($vacation['text']) . "\n.\n;\n\n"; 
    466482        } 
     
    509525            $newscriptfoot .= preg_replace("/[\\n\\r]/", " ", $this->newout) . "\n"; 
    510526        } 
     527                 
    511528        $newscriptfoot .= "#mode&&basic\n"; 
    512529 
     
    527544 
    528545        // Retorna o script construido; 
     546 
    529547        return $newscript; 
    530548    } 
Note: See TracChangeset for help on using the changeset viewer.