[ Index ]
 

Code source de eGroupWare 1.2.106-2

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

title

Body

[fermer]

/calendar/inc/ -> class.calendernotify.inc.php (source)

   1  <?php
   2    /**************************************************************************\
   3    * eGroupWare - Calendar Notify Hook                                        *
   4    * http://www.egroupware.org                                                *
   5    * Based on Webcalendar by Craig Knudsen <cknudsen@radix.net>               *
   6    *          http://www.radix.net/~cknudsen                                  *
   7    * File created by Edo van Bruggen <edovanbruggen@raketnet.nl>              *
   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  
  15  
  16      class calendernotify
  17      {
  18  
  19  
  20  		function notify()
  21          {
  22              $db;
  23              $table = 'phpgw_cal';
  24              $owner;
  25              $this->db    = $GLOBALS['phpgw']->db;
  26              $this->owner = $GLOBALS['phpgw_info']['user']['account_id'];
  27              $config = CreateObject('phpgwapi.config');
  28              $config->read_repository();
  29              $GLOBALS['phpgw_info']['server']['calendar'] = $config->config_data;
  30              unset($config);
  31              $messages = array();
  32              $count = 0;
  33              $time = time();
  34              $date_new = time()+ 604800;
  35              $this->db->limit_query('SELECT * FROM `'. $table .'` WHERE  cal_owner =\''
  36                  . $this->owner.'\' ',"",__LINE__,__FILE__);
  37              
  38              while($this->db->next_record())
  39              {
  40                  if($this->db->f('cal_starttime') - $time < 604800 and $this->db->f('cal_starttime') - $time > 0)
  41                  {
  42                      $count++;
  43                  }
  44              }
  45              if($count > 0)
  46              {
  47                  if($count == 1)
  48                  {
  49                      return "You have ".$count." new appointment.";
  50                  }
  51                  else
  52                  {
  53                      return "You have ".$count." new appointments.";
  54                  }
  55                  
  56              }
  57              return  False;
  58  
  59          }
  60      }    
  61  ?>


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