[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/felamimail/inc/ -> class.uifilter.inc.php (source)

   1  <?php
   2      /***************************************************************************\
   3      * eGroupWare - FeLaMiMail                                                   *
   4      * http://www.linux-at-work.de                                               *
   5      * http://www.phpgw.de                                                       *
   6      * http://www.egroupware.org                                                 *
   7      * Written by : Lars Kneschke [lkneschke@linux-at-work.de]                   *
   8      * -------------------------------------------------                         *
   9      * This program is free software; you can redistribute it and/or modify it   *
  10      * under the terms of the GNU General Public License as published by the     *
  11      * Free Software Foundation; either version 2 of the License, or (at your    *
  12      * option) any later version.                                                *
  13      \***************************************************************************/
  14      /* $Id: class.uifilter.inc.php 18876 2005-07-23 15:52:49Z ralfbecker $ */
  15  
  16      class uifilter
  17      {
  18  
  19          var $public_functions = array
  20          (
  21              'mainScreen'    => 'True',
  22              'saveFilter'    => 'True'
  23          );
  24  
  25  		function uifilter()
  26          {
  27              
  28              // get posted variables
  29              $this->urlMailbox    = urldecode($_GET['mailbox']);
  30              $this->startMessage    = $_GET['startMessage'];
  31              $this->sort        = $_GET['sort'];
  32              
  33              $this->bofelamimail    =& CreateObject('felamimail.bofelamimail',$this->urlMailbox);
  34              $this->bofilter        =& CreateObject('felamimail.bofilter');
  35              $this->sessionData    = $this->bofelamimail->sessionData;
  36  
  37              $this->t =& CreateObject('phpgwapi.Template',EGW_APP_TPL);
  38              $this->t->set_unknowns('remove');
  39              
  40              $this->rowColor[0] = $GLOBALS['egw_info']["theme"]["bg01"];
  41              $this->rowColor[1] = $GLOBALS['egw_info']["theme"]["bg02"];
  42  
  43          }
  44          
  45  		function display_app_header()
  46          {
  47              $GLOBALS['egw_info']['flags']['include_xajax'] = True;
  48              $GLOBALS['egw']->common->egw_header();
  49              echo parse_navbar();
  50          }
  51  
  52  		function mainScreen()
  53          {
  54              // display the header
  55              $this->display_app_header();
  56              
  57              // initialize the template
  58              $this->t->set_file(array("filterForm" => "filterForm.tpl"));
  59              $this->t->set_block('filterForm','header');
  60              $this->t->set_block('filterForm','filterrow');
  61              
  62              // translate most of the parts
  63              $this->translate();
  64              
  65              switch($_GET['action'])
  66              {
  67                  case "deleteFilter":
  68                      $filterID = $_GET['filterID'];
  69                      $this->bofilter->deleteFilter($filterID);
  70                      $filterList = $this->bofilter->getFilterList();
  71                                                          $linkData = array
  72                                                          (
  73                                                                          'menuaction'    => 'felamimail.uifilter.mainScreen',
  74                                                                          'action'    => 'updateFilter'
  75                                                          );
  76                      $this->t->set_var('link_action',$GLOBALS['egw']->link('/index.php',$linkData));
  77  
  78                      $this->t->set_var("filterName",'');
  79                      $this->t->set_var("from",'');
  80                      $this->t->set_var("to",'');
  81                      $this->t->set_var("subject",'');
  82                      $this->t->set_var("filter_checked",'');
  83                      break;
  84                      
  85                  case "editFilter":
  86                      $filterID = $_GET['filterID'];
  87                      $filterList = $this->bofilter->getFilterList();
  88                      
  89                                                          // set the default values for the sort links (sort by url)
  90                                                          $linkData = array
  91                                                          (
  92                                                                          'menuaction'    => 'felamimail.uifilter.mainScreen',
  93                                                                          'action'    => 'updateFilter',
  94                                                                          'filterID'    => $filterID
  95                                                          );
  96                      $this->t->set_var('link_action',$GLOBALS['egw']->link('/index.php',$linkData));
  97  
  98                      $this->t->set_var("filterName",$filterList[$filterID]['filterName']);
  99                      $this->t->set_var("from",$filterList[$filterID]['from']);
 100                      $this->t->set_var("to",$filterList[$filterID]['to']);
 101                      $this->t->set_var("subject",$filterList[$filterID]['subject']);
 102                      if($filterList[$filterID]['filterActive'] == "true")
 103                      {
 104                          $this->t->set_var("filter_checked","checked");
 105                      }
 106                      break;
 107                  case "updateFilter":
 108                      $filterID = $_GET['filterID'];
 109                      $formData['from']        = $_POST['from'];
 110                      $formData['to']            = $_POST['to'];
 111                      $formData['subject']        = $_POST['subject'];
 112                      $formData['filterName']        = $_POST['filterName'];
 113                      if($_POST['filter_active'] == "on")
 114                      {
 115                          $formData['filterActive']    = "true";
 116                      }
 117                      $this->bofilter->saveFilter($formData, $filterID);
 118                      $filterList = $this->bofilter->getFilterList();
 119                                                          // set the default values for the sort links (sort by url)
 120                                                          $linkData = array
 121                                                          (
 122                                                                          'menuaction'    => 'felamimail.uifilter.mainScreen',
 123                                                                          'action'    => 'updateFilter',
 124                                                                          'filterID'    => $filterID
 125                                                          );
 126                      $this->t->set_var('link_action',$GLOBALS['egw']->link('/index.php',$linkData));
 127  
 128                      $this->t->set_var("filterName",$filterList[$filterID]['filterName']);
 129                      $this->t->set_var("from",$filterList[$filterID]['from']);
 130                      $this->t->set_var("to",$filterList[$filterID]['to']);
 131                      $this->t->set_var("subject",$filterList[$filterID]['subject']);
 132                      if($filterList[$filterID]['filterActive'] == "true")
 133                      {
 134                          $this->t->set_var("filter_checked","checked");
 135                      }
 136                      break;
 137                  default:
 138                                                          $linkData = array
 139                                                          (
 140                                                                          'menuaction'    => 'felamimail.uifilter.mainScreen',
 141                                                                          'action'    => 'updateFilter'
 142                                                          );
 143                      $this->t->set_var('link_action',$GLOBALS['egw']->link('/index.php',$linkData));
 144  
 145                      $this->t->set_var("filterName",'');
 146                      $this->t->set_var("from",'');
 147                      $this->t->set_var("to",'');
 148                      $this->t->set_var("subject",'');
 149                      $this->t->set_var("filter_checked",'');
 150                      break;
 151                      
 152              }
 153                                      $linkData = array
 154                                      (
 155                                                      'menuaction'    => 'felamimail.uifilter.mainScreen'
 156                                      );
 157              $this->t->set_var('link_newFilter',$GLOBALS['egw']->link('/index.php',$linkData));
 158              $this->t->set_var("filterrows",'');
 159              $linkData = array
 160              (
 161                  'menuaction'    => 'felamimail.uifelamimail.viewMainScreen',
 162                  'filter'    => -1
 163              );
 164              $link = $GLOBALS['egw']->link('/index.php',$linkData);
 165              $this->t->set_var("link_noFilter",$link);
 166              
 167              $filterList = $this->bofilter->getFilterList();
 168              
 169              while(list($key,$value)=@each($filterList))
 170              {
 171                  $this->t->set_var("id",$key);
 172                  $this->t->set_var("filtername",$value['filterName']);
 173  
 174                  $linkData = array
 175                  (
 176                      'menuaction'    => 'felamimail.uifilter.mainScreen',
 177                      'action'    => 'editFilter',
 178                      'filterID'    => $key
 179                  );
 180                  $link = $GLOBALS['egw']->link('/index.php',$linkData);
 181                  $this->t->set_var("link_editFilter",$link);
 182  
 183                  $linkData = array
 184                  (
 185                      'menuaction'    => 'felamimail.uifilter.mainScreen',
 186                      'action'    => 'deleteFilter',
 187                      'filterID'    => $key
 188                  );
 189                  $link = $GLOBALS['egw']->link('/index.php',$linkData);
 190                  $this->t->set_var("link_deleteFilter",$link);
 191  
 192                  $linkData = array
 193                  (
 194                      'menuaction'    => 'felamimail.uifelamimail.changeFilter',
 195                      'filter'    => $key
 196                  );
 197                  $link = $GLOBALS['egw']->link('/index.php',$linkData);
 198                  $this->t->set_var("link_activateFilter",$link);
 199  
 200                  $this->t->parse("filterrows","filterrow",true);
 201              }
 202              $this->t->pparse("out","header");
 203          }
 204  
 205  		function saveFilter()
 206          {
 207              
 208          }
 209          
 210  		function translate()
 211          {
 212              $this->t->set_var("lang_message_list",lang('Message List'));
 213              $this->t->set_var("lang_from",lang('from'));
 214              $this->t->set_var("lang_to",lang('to'));
 215              $this->t->set_var("lang_edit",lang('edit'));
 216              $this->t->set_var("lang_delete",lang('delete'));
 217              $this->t->set_var("lang_subject",lang('subject'));
 218              $this->t->set_var("lang_filter_active",lang('filter active'));
 219              $this->t->set_var("lang_filter_name",lang('filter name'));
 220              $this->t->set_var("lang_new_filter",lang('new filter'));
 221              $this->t->set_var("lang_no_filter",lang('no filter'));
 222              $this->t->set_var("lang_activate",lang('activate'));
 223              $this->t->set_var("lang_save",lang('save'));
 224  
 225              $this->t->set_var("bg01",$GLOBALS['egw_info']["theme"]["bg01"]);
 226              $this->t->set_var("bg02",$GLOBALS['egw_info']["theme"]["bg02"]);
 227              $this->t->set_var("bg03",$GLOBALS['egw_info']["theme"]["bg03"]);
 228          }
 229  }


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7