PHPOpenChat PHP Cross Reference Customer Relationship Management

Source: /include/class.Mail.inc - 367 lines - 7063 bytes - Summary - Text - Print

   1  <?php //-*-php-*-
   2  /*   ********************************************************************   **
   3  **   Copyright notice                                                       **
   4  **                                                                          **
   5  **   (c) 1995-2004 PHPOpenChat Development Team                             **
   6  **   http://phpopenchat.sourceforge.net/                                    **
   7  **                                                                          **
   8  **   All rights reserved                                                    **
   9  **                                                                          **
  10  **   This script is part of the PHPOpenChat project. The PHPOpenChat        **
  11  **   project is free software; you can redistribute it and/or modify        **
  12  **   it under the terms of the GNU General Public License as published by   **
  13  **   the Free Software Foundation; either version 2 of the License, or      **
  14  **   (at your option) any later version.                                    **
  15  **                                                                          **
  16  **   The GNU General Public License can be found at                         **
  17  **   http://www.gnu.org/copyleft/gpl.html.                                  **
  18  **   A copy is found in the textfile GPL and important notices to the       **
  19  **   license from the team is found in the textfile LICENSE distributed     **
  20  **   with these scripts.                                                    **
  21  **                                                                          **
  22  **   This script is distributed in the hope that it will be useful,         **
  23  **   but WITHOUT ANY WARRANTY; without even the implied warranty of         **
  24  **   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          **
  25  **   GNU General Public License for more details.                           **
  26  **                                                                          **
  27  **   This copyright notice MUST APPEAR in all copies of the script!         **
  28  **   ********************************************************************   */
  29  
  30  //Get default values
  31  require_once (POC_BASE.'/config.inc.php');
  32  require_once (POC_INCLUDE_PATH.'/class.Logger.inc');
  33  
  34  /**
  35  * Mail implements a mail within the chat
  36  *
  37  * @author  Michael Oertel <michael@ortelius.de>
  38  * @access  public
  39  * @version $Id: class.Mail.inc,v 1.9.2.3 2004/02/24 17:05:17 letreo Exp $
  40  */
  41  class POC_Mail {
  42  
  43    /**
  44    * Sender of mail
  45    *
  46    * @var object
  47    */
  48    var $sender = null;
  49    
  50    /**
  51    * Recipients of mail
  52    *
  53    * @var array
  54    */
  55    var $recipients = array();
  56    
  57    /**
  58    * Recipient of mail
  59    *
  60    * @var string
  61    */
  62    var $recipient = '';
  63    
  64    /**
  65    * Body of mail
  66    *
  67    * @var string
  68    */
  69    var $body = '';
  70    
  71    /**
  72    * Subject of mail
  73    *
  74    * @var string
  75    */
  76    var $subject = '';
  77    
  78    /**
  79    * Send time of mail
  80    *
  81    * @var integer
  82    */
  83    var $send_time = 0;
  84    
  85    /**
  86    * Time of last touch by sender
  87    *
  88    * @var integer
  89    */
  90    var $last_touch_sender = 0;
  91    
  92    /**
  93    * Time of last touch by recipient
  94    *
  95    * @var integer
  96    */
  97    var $last_touch_recipient = 0;
  98    
  99    /**
 100    * Time of first touch by recipient
 101    *
 102    * @var integer
 103    */
 104    var $first_touch_recipient = 0;
 105  
 106    /**
 107    * Status flag of mail
 108    *
 109    * @var boolean
 110    */
 111    var $red_by_sender = false;
 112  
 113    /**
 114    * Status flag of mail
 115    *
 116    * @var boolean
 117    */
 118    var $red_by_recipient = false;
 119  
 120    
 121    
 122    function POC_Mail()
 123    {
 124      $this->sender = $_SESSION['chatter'];
 125    }
 126  
 127    /**
 128    * Adds a chatter to the list of recipients
 129    *
 130    * @access public
 131    * @param string
 132    */
 133    function add_recipient( $recipient )
 134    {
 135      if( !$this->is_in_recipients($recipient) )
 136        array_push ($this->recipients, $recipient);
 137    }
 138  
 139    /**
 140    * Sets the subject
 141    *
 142    * @access public
 143    * @param string
 144    */
 145    function set_subject( $subject )
 146    {
 147        $this->subject = $subject;
 148    }
 149  
 150    /**
 151    * Provides the subject of mail
 152    *
 153    * @access public
 154    * @return string
 155    */
 156    function get_subject()
 157    {
 158      return $this->subject;
 159    }
 160    
 161    /**
 162    * Sets the send time 
 163    *
 164    * @access public
 165    * @param integer
 166    */
 167    function set_send_time( $unix_timestamp )
 168    {
 169        $this->send_time = $unix_timestamp;
 170    }
 171    
 172    /**
 173    * Gets the send time 
 174    *
 175    * @access public
 176    * @return integer
 177    */
 178    function get_send_time()
 179    {
 180        return $this->send_time;
 181    }
 182  
 183    /**
 184    * Sets the subject
 185    *
 186    * @access public
 187    * @param string
 188    */
 189    function set_body( $body )
 190    {
 191      $this->body = $body;
 192    }
 193  
 194    /**
 195    * Gets the body of current mail
 196    *
 197    * @access public
 198    * @param string
 199    */
 200    function get_body()
 201    {
 202      return $this->body;
 203    }
 204    
 205    /**
 206    * Gets the sender
 207    *
 208    * @access public
 209    * @return string
 210    */
 211    function get_sender()
 212    {
 213      return $this->sender;
 214    }
 215    
 216    /**
 217    * Gets the sender
 218    *
 219    * @access public
 220    * @return array
 221    */
 222    function get_recipients()
 223    {
 224      return $this->recipients;
 225    }
 226    
 227    function set_recipient( $recipient )
 228    {
 229      $this->recipient = $recipient;
 230    }
 231    
 232    function get_recipient()
 233    {
 234      return $this->recipient;
 235    }
 236    
 237    function is_forwarded()
 238    {
 239      
 240    }
 241    
 242    function is_replied()
 243    {
 244      
 245    }
 246    
 247    /**
 248    * Sets red_by_recipient flag
 249  
 250    */
 251    function set_red_by_recipient()
 252    {
 253      $this->red_by_recipient = true;
 254    }
 255  
 256    
 257    /**
 258    * Sets red flag
 259    */
 260    function set_red_by_sender()
 261    {
 262      $this->red_by_sender = true;
 263    }
 264    
 265    /**
 266    * Returns true if mail is red by recipient, otherwise false
 267    *
 268    * @return boolean
 269    */
 270    function get_red_by_recipient()
 271    {
 272      return $this->red_by_recipient;
 273    }
 274    
 275    /**
 276    * @ignore
 277    */
 278    function is_red_by_recipient()
 279    {
 280      return $this->get_red_by_recipient();
 281    }
 282  
 283      
 284    /**
 285    * Returns true if mail is red, otherwise false
 286    *
 287    * @return boolean
 288    */
 289    function get_red_by_sender()
 290    {
 291      return $this->red_by_sender;
 292    }
 293    
 294    /**
 295    * @ignore
 296    */
 297    function is_red_by_sender()
 298    {
 299      return $this->get_red_by_sender();
 300    }
 301    
 302    /**
 303    * Returns true if given chatter already in recipient list, otherwise false
 304    *
 305    * @param string
 306    * @return boolean
 307    */
 308    function is_in_recipients( $chatter )
 309    {
 310      return in_array( $chatter, $this->recipients );
 311    }
 312    
 313    /**
 314    * Sets the time of last touch by sender
 315    *
 316    */  
 317    function set_last_touch_sender()
 318    {
 319      $this->last_touch_sender = time();
 320    }
 321    
 322    /**
 323    * Gets the time of last touch by sender
 324    *
 325    */  
 326    function get_last_touch_sender()
 327    {
 328      return $this->last_touch_sender;
 329    }
 330    
 331    /**
 332    * Sets the time of last touch by recipient
 333    *
 334    */  
 335    function set_last_touch_recipient()
 336    {
 337      $this->last_touch_recipient = time();
 338    }
 339    
 340    /**
 341    * Gets the time of last touch by recipient
 342    *
 343    */  
 344    function get_last_touch_recipient()
 345    {
 346      return $this->last_touch_recipient;
 347    }
 348    
 349    /**
 350    * Sets the time of first touch by recipient
 351    *
 352    */  
 353    function set_first_touch_recipient()
 354    {
 355      $this->first_touch_recipient = time();
 356    }
 357    
 358    /**
 359    * Gets the time of first touch by recipient
 360    *
 361    */  
 362    function get_first_touch_recipient()
 363    {
 364      return $this->first_touch_recipient;
 365    }
 366  }
 367  ?>

title

Description

title

Description

title

Description

title

title

Body