Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
  1: <?php
  2: /**
  3:  * This file contains various to-do classes.
  4:  *
  5:  * @package Core
  6:  * @subpackage Backend
  7:  * @version SVN Revision $Rev:$
  8:  *
  9:  * @author Unknown
 10:  * @copyright four for business AG <www.4fb.de>
 11:  * @license http://www.contenido.org/license/LIZENZ.txt
 12:  * @link http://www.4fb.de
 13:  * @link http://www.contenido.org
 14:  */
 15: 
 16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 17: 
 18: /**
 19:  * This class uses the communication collection to serve a special collection
 20:  * for to-do entries.
 21:  *
 22:  * @package Core
 23:  * @subpackage GenericDB_Model
 24:  */
 25: class TODOCollection extends cApiCommunicationCollection {
 26: 
 27:     /**
 28:      */
 29:     public function __construct() {
 30:         parent::__construct();
 31:         $this->_setItemClass('TODOItem');
 32:     }
 33: 
 34:     /**
 35:      * (non-PHPdoc)
 36:      *
 37:      * @see ItemCollection::select()
 38:      */
 39:     public function select($where = '', $group_by = '', $order_by = '', $limit = '') {
 40:         if ($where == '') {
 41:             $where = "comtype='todo'";
 42:         } else {
 43:             $where .= " AND comtype='todo'";
 44:         }
 45: 
 46:         return parent::select($where, $group_by, $order_by, $limit);
 47:     }
 48: 
 49:     /**
 50:      * Creates a new communication item
 51:      *
 52:      * @param unknown_type $itemtype
 53:      * @param unknown_type $itemid
 54:      * @param unknown_type $reminderdate
 55:      * @param string $subject
 56:      * @param string $content
 57:      * @param unknown_type $notimail
 58:      * @param unknown_type $notibackend
 59:      * @param string $recipient
 60:      * @return Ambigous <cApiCommunication, Item, object>
 61:      */
 62:     public function createItem($itemtype, $itemid, $reminderdate, $subject, $content, $notimail, $notibackend, $recipient) {
 63:         $item = parent::create();
 64: 
 65:         $item->set('comtype', 'todo');
 66:         $item->set('subject', $subject);
 67:         $item->set('message', $content);
 68:         $item->set('recipient', $recipient);
 69:         $item->store();
 70: 
 71:         if ($notimail === true) {
 72:             $notimail = 1;
 73:         }
 74: 
 75:         // Is the date passed as string?
 76:         if (!is_numeric($reminderdate)) {
 77:             // Convert to timestamp
 78:             $reminderdate = strtotime($reminderdate);
 79:         }
 80: 
 81:         $item->setProperty('todo', 'reminderdate', $reminderdate);
 82:         $item->setProperty('todo', 'itemtype', $itemtype);
 83:         $item->setProperty('todo', 'itemid', $itemid);
 84:         $item->setProperty('todo', 'emailnoti', $notimail);
 85:         $item->setProperty('todo', 'backendnoti', $notibackend);
 86:         $item->setProperty('todo', 'status', 'new');
 87:         $item->setProperty('todo', 'priority', 'medium');
 88:         $item->setProperty('todo', 'progress', '0');
 89: 
 90:         return $item;
 91:     }
 92: 
 93:     /**
 94:      *
 95:      * @return array
 96:      */
 97:     public function getStatusTypes() {
 98:         return array(
 99:             'new' => i18n('New'),
100:             'progress' => i18n('In progress'),
101:             'done' => i18n('Done'),
102:             'waiting' => i18n('Waiting for action'),
103:             'deferred' => i18n('Deferred')
104:         );
105:     }
106: 
107:     /**
108:      *
109:      * @return array
110:      */
111:     public function getPriorityTypes() {
112:         return array(
113:             'low' => i18n('Low'),
114:             'medium' => i18n('Medium'),
115:             'high' => i18n('High'),
116:             'immediately' => i18n('Immediately')
117:         );
118:     }
119: }
120: 
121: /**
122:  * This class uses the communication collection to serve a special collection
123:  * for to-do entries.
124:  *
125:  * @package Core
126:  * @subpackage GenericDB_Model
127:  */
128: class TODOItem extends cApiCommunication {
129: 
130:     /**
131:      * (non-PHPdoc)
132:      *
133:      * @see Item::setProperty()
134:      * @todo should return return value of overloaded method
135:      */
136:     public function setProperty($type, $name, $value, $client = 0) {
137:         if ($type == 'todo' && $name == 'emailnoti') {
138:             if ($value) {
139:                 parent::setProperty('todo', 'emailnoti-sent', false);
140:                 $value = true;
141:             } else {
142:                 $value = false;
143:             }
144:         }
145: 
146:         parent::setProperty($type, $name, $value);
147:     }
148: }
149: 
150: /**
151:  * This class uses the link GUI class to serve a special link for to-do entries.
152:  *
153:  * @package Core
154:  * @subpackage GUI
155:  */
156: class TODOLink extends cHTMLLink {
157: 
158:     /**
159:      *
160:      * @param unknown_type $itemtype
161:      * @param unknown_type $itemid
162:      * @param unknown_type $subject
163:      * @param unknown_type $message
164:      */
165:     public function __construct($itemtype, $itemid, $subject, $message) {
166:         global $sess;
167:         parent::__construct();
168: 
169:         $subject = urlencode($subject);
170:         $message = urlencode($message);
171: 
172:         $this->setEvent('click', 'javascript:window.open(' . "'" . $sess->url("main.php?subject=$subject&message=$message&area=todo&frame=1&itemtype=$itemtype&itemid=$itemid") . "', 'todo', 'scrollbars=yes,resizable=yes,height=350,width=625');");
173:         $this->setEvent('mouseover', "this.style.cursor='pointer'");
174: 
175:         $img = new cHTMLImage('images/but_setreminder.gif');
176:         $img->setClass("vAlignMiddle tableElement");
177: 
178:         $img->setAlt(i18n('Set reminder / add to todo list'));
179:         $this->setLink('#');
180:         $this->setContent($img->render());
181:         $this->setAlt(i18n('Set reminder / add to todo list'));
182:     }
183: }
184: 
185: ?>
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen