Ignore:
Timestamp:
12/28/10 10:09:59 (13 years ago)
Author:
alexandrecorreia
Message:

Ticket #1468 - Notificacao por email de uploads de arquivos enviados pelo modulo Filemanager

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/filemanager/inc/class.uiconfig.inc.php

    r3632 r3636  
    99 
    1010require_once("load_lang.php"); 
     11require_once("class.notifications.inc.php"); 
    1112 
    1213class uiconfig 
     
    259260                $GLOBALS['phpgw']->common->phpgw_header(); 
    260261                 
    261                 if( $_POST['button_add'] ) 
     262                $notify                 = new notifications(); 
     263                $value_email_to = ""; 
     264 
     265                if( $_POST['button_add'] || $_GET['editUser'] ) 
    262266                { 
     267                        if( $_GET['editUser'] ) 
     268                        { 
     269                                $result = $notify->SearchId($_GET['editUser']); 
     270                                $emails_to = explode(",", $result[0]['email_to']); 
     271                                 
     272                                for( $i = 0 ; $i < count($emails_to); $i++ ) 
     273                                { 
     274                                        $value_email_to .= "<tr>"; 
     275                                        $value_email_to .= "<td>".$emails_to[$i]."</td>"; 
     276                                        $value_email_to .= "<td align='center'>"; 
     277                                        $value_email_to .= "<a href='javascript:void();' onclick='notify.deleteEmail(\"".$emails_to[$i]."\",this);'>Remover</a>"; 
     278                                        $value_email_to .= "</td>"; 
     279                                        $value_email_to .= "</tr>"; 
     280                                } 
     281                        } 
     282                         
    263283                        $vars = array( 
    264284                                                        'action_url_back'       => "./index.php?menuaction=filemanager.uiconfig.notifyUploads", 
     285                                                        'attr_readonly'         => ( $result[0]['email_from'] ) ? 'readonly="readonly"' : "", 
    265286                                                        'lang_Add'                      => lang("Add"), 
    266287                                                        'lang_Back'                     => lang("Back"), 
     
    272293                                                        'lang_from'                     => lang("From"), 
    273294                                                        'lang_to'                       => lang("To"), 
    274                                                         'value_conf_email'      => "", 
    275                                                  );      
     295                                                        'value_email_from'      => ( $result[0]['email_from'] ) ? $result[0]['email_from'] : "", 
     296                                                        'value_email_to'        => $value_email_to 
     297                        ); 
    276298                         
    277299                        $handle = "AddEmail"; 
     
    279301                else 
    280302                {        
    281                         $value_config = ""; 
    282                          
    283                         if( trim($_POST['search_email']) != "" ) 
     303                        if( trim( $_POST['search_email'] ) != "" ) 
    284304                        { 
    285                                 require_once("class.notifications.inc.php"); 
    286                                 $notify = new notifications(); 
    287                                 $result = $notify->SearchEmail( $_POST['search_email'] ); 
     305                                $limit  = 10; 
     306                                $offset = 1; 
     307                                 
     308                                if( $_POST['bt_next'] ) 
     309                                        $offset = $_POST['button_next'] + 1 ;                            
     310 
     311                                if( $_POST['bt_previous'] && $_POST['button_next'] > 1) 
     312                                { 
     313                                        $offset = $_POST['button_next'] - 1; 
     314                                } 
     315                                 
     316                                $result = $notify->SearchEmail( $_POST['search_email'], $limit, $offset ); 
    288317 
    289318                                foreach( $result as $tmp ) 
    290319                                { 
    291                                         $value_config .= '<tr>'; 
    292                                         $value_config .= '<td align="left" width="40%">'.$tmp['email_from'].'</td>'; 
    293                                         $value_config .= '<td align="left" width="40%">'.str_replace(",", "<br/>", $tmp['email_to']).'</td>'; 
    294                                         $value_config .= '<td align="center" width="10%">Editar</td>'; 
    295                                         $value_config .= '<td align="center" width="10%"><a href="javascript:void();" onclick="notify.deleteEmailUser(\''.$tmp['filemanager_id'].'\', this);">Excluir</a></td>'; 
    296                                         $value_config .= '</tr>'; 
     320                                        $value_email_to .= '<tr>'; 
     321                                        $value_email_to .= '<td align="left" width="40%">'.$tmp['email_from'].'</td>'; 
     322                                        $value_email_to .= '<td align="left" width="40%">'.str_replace(",", "<br/>", $tmp['email_to']).'</td>'; 
     323                                        $value_email_to .= '<td align="center" width="10%"><a href="./index.php?menuaction=filemanager.uiconfig.notifyUploads&editUser='.$tmp['filemanager_id'].'">'.lang("Edit").'</a></td>'; 
     324                                        $value_email_to .= '<td align="center" width="10%"><a href="javascript:void();" onclick="notify.deleteEmailUser(\''.$tmp['filemanager_id'].'\', this);">'.lang("Delete").'</a></td>'; 
     325                                        $value_email_to .= '</tr>'; 
    297326                                } 
    298327                        } 
    299328                         
    300329                        $vars = array( 
    301                                                         'action_url'            => "./index.php?menuaction=filemanager.uiconfig.notifyUploads", 
    302                                                         'action_url_back'       => "./admin", 
    303                                                         'bt_previous'           => "<input type='submit' name='bt_previous' value='Anterior' />", 
    304                                                         'bt_next'                       => "<input type='submit' name='bt_next' value='Proximo' />", 
    305                                                         'lang_search'           => lang("Search"), 
    306                                                         'value_config'          => $value_config                                                                                                         
     330                                                        'action_url'                    => "./index.php?menuaction=filemanager.uiconfig.notifyUploads", 
     331                                                        'action_url_back'               => "./admin", 
     332                                                        'display_bt_previous'   => ( $offset > 1 ) ? "line" : "none", 
     333                                                        'display_bt_next'               => ( count($result) < $limit ) ? "none" : "line", 
     334                                                        'lang_Add'                              => lang("Add"), 
     335                                                        'lang_Back'                             => lang("Back"), 
     336                                                        'lang_Delete'                   => lang("Delete"), 
     337                                                        'lang_Edit'                             => lang("Edit"), 
     338                                                        'lang_From'                             => lang("From"), 
     339                                                        'lang_To'                               => lang("To"), 
     340                                                        'lang_search'                   => lang("Search"), 
     341                                                        'lang_next'                             => lang("Next"), 
     342                                                        'lang_previous'                 => lang("Previous"), 
     343                                                        'value_search_email'    => $_POST['search_email'], 
     344                                                        'value_email_to'                => $value_email_to, 
     345                                                        'value_next'                    => $offset,                                                      
     346                                                        'value_previous'                => $limit 
    307347                                                 ); 
    308348                         
Note: See TracChangeset for help on using the changeset viewer.