Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationMain
    • NavigationTop
  • 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

Classes

  • cApiAction
  • cApiActionCollection
  • cApiActionlog
  • cApiActionlogCollection
  • cApiArea
  • cApiAreaCollection
  • cApiArticle
  • cApiArticleCollection
  • cApiArticleLanguage
  • cApiArticleLanguageCollection
  • cApiArticleSpecification
  • cApiArticleSpecificationCollection
  • cApiCategory
  • cApiCategoryArticle
  • cApiCategoryArticleCollection
  • cApiCategoryCollection
  • cApiCategoryLanguage
  • cApiCategoryLanguageCollection
  • cApiCategoryTree
  • cApiCategoryTreeCollection
  • cApiClient
  • cApiClientCollection
  • cApiClientLanguage
  • cApiClientLanguageCollection
  • cApiCommunication
  • cApiCommunicationCollection
  • cApiContainer
  • cApiContainerCollection
  • cApiContainerConfiguration
  • cApiContainerConfigurationCollection
  • cApiContent
  • cApiContentCollection
  • cApiDbfs
  • cApiDbfsCollection
  • cApiFile
  • cApiFileCollection
  • cApiFileInformation
  • cApiFileInformationCollection
  • cApiFrameFile
  • cApiFrameFileCollection
  • cApiFrontendGroup
  • cApiFrontendGroupCollection
  • cApiFrontendGroupMember
  • cApiFrontendGroupMemberCollection
  • cApiFrontendPermission
  • cApiFrontendPermissionCollection
  • cApiFrontendUser
  • cApiFrontendUserCollection
  • cApiGroup
  • cApiGroupCollection
  • cApiGroupMember
  • cApiGroupMemberCollection
  • cApiGroupProperty
  • cApiGroupPropertyCollection
  • cApiInUse
  • cApiInUseCollection
  • cApiIso3166
  • cApiIso3166Collection
  • cApiIso6392
  • cApiIso6392Collection
  • cApiKeyword
  • cApiKeywordCollection
  • cApiLanguage
  • cApiLanguageCollection
  • cApiLayout
  • cApiLayoutCollection
  • cApiMailLog
  • cApiMailLogCollection
  • cApiMailLogSuccess
  • cApiMailLogSuccessCollection
  • cApiMetaTag
  • cApiMetaTagCollection
  • cApiMetaType
  • cApiMetaTypeCollection
  • cApiModule
  • cApiModuleCollection
  • cApiNavMain
  • cApiNavMainCollection
  • cApiNavSub
  • cApiNavSubCollection
  • cApiOnlineUser
  • cApiOnlineUserCollection
  • cApiPathresolveCache
  • cApiPathresolveCacheCollection
  • cApiProperty
  • cApiPropertyCollection
  • cApiRight
  • cApiRightCollection
  • cApiStat
  • cApiStatCollection
  • cApiSystemProperty
  • cApiSystemPropertyCollection
  • cApiTemplate
  • cApiTemplateCollection
  • cApiTemplateConfiguration
  • cApiTemplateConfigurationCollection
  • cApiType
  • cApiTypeCollection
  • cApiUpload
  • cApiUploadCollection
  • cApiUploadMeta
  • cApiUploadMetaCollection
  • cApiUser
  • cApiUserCollection
  • cApiUserProperty
  • cApiUserPropertyCollection
  • NoteCollection
  • NoteItem
  • TODOCollection
  • TODOItem
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  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 for to-do entries.
 20:  *
 21:  * @package    Core
 22:  * @subpackage GenericDB_Model
 23:  */
 24: class TODOCollection extends cApiCommunicationCollection {
 25: 
 26:     public function __construct() {
 27:         parent::__construct();
 28:         $this->_setItemClass('TODOItem');
 29:     }
 30: 
 31:     public function select($where = '', $group_by = '', $order_by = '', $limit = '') {
 32:         if ($where == '') {
 33:             $where = "comtype='todo'";
 34:         } else {
 35:             $where .= " AND comtype='todo'";
 36:         }
 37: 
 38:         return parent::select($where, $group_by, $order_by, $limit);
 39:     }
 40: 
 41:     /**
 42:      * Creates a new communication item
 43:      */
 44:     public function createItem($itemtype, $itemid, $reminderdate, $subject, $content, $notimail, $notibackend, $recipient) {
 45:         $item = parent::create();
 46: 
 47:         $item->set('subject', $subject);
 48:         $item->set('message', $content);
 49:         $item->set('comtype', 'todo');
 50:         $item->set('recipient', $recipient);
 51:         $item->store();
 52: 
 53:         if ($notimail === true) {
 54:             $notimail = 1;
 55:         }
 56: 
 57:         // Is the date passed as string?
 58:         if (!is_numeric($reminderdate)) {
 59:             // Convert to timestamp
 60:             $reminderdate = strtotime($reminderdate);
 61:         }
 62: 
 63:         $item->setProperty('todo', 'reminderdate', $reminderdate);
 64:         $item->setProperty('todo', 'itemtype', $itemtype);
 65:         $item->setProperty('todo', 'itemid', $itemid);
 66:         $item->setProperty('todo', 'emailnoti', $notimail);
 67:         $item->setProperty('todo', 'backendnoti', $notibackend);
 68:         $item->setProperty('todo', 'status', 'new');
 69:         $item->setProperty('todo', 'priority', 'medium');
 70:         $item->setProperty('todo', 'progress', '0');
 71: 
 72:         return $item;
 73:     }
 74: 
 75:     public function getStatusTypes() {
 76:         $statusTypes = array(
 77:             'new' => i18n('New'),
 78:             'progress' => i18n('In progress'),
 79:             'done' => i18n('Done'),
 80:             'waiting' => i18n('Waiting for action'),
 81:             'deferred' => i18n('Deferred')
 82:         );
 83:         return ($statusTypes);
 84:     }
 85: 
 86:     public function getPriorityTypes() {
 87:         $priorityTypes = array(
 88:             'low' => i18n('Low'),
 89:             'medium' => i18n('Medium'),
 90:             'high' => i18n('High'),
 91:             'immediately' => i18n('Immediately')
 92:         );
 93:         return ($priorityTypes);
 94:     }
 95: 
 96: }
 97: 
 98: /**
 99:  * This class uses the communication collection to serve a special collection for to-do entries.
100:  *
101:  * @package    Core
102:  * @subpackage GenericDB_Model
103:  */
104: class TODOItem extends cApiCommunication {
105:     public function setProperty($type, $name, $value, $client = 0) {
106:         if ($type == 'todo' && $name == 'emailnoti') {
107:             if ($value) {
108:                 parent::setProperty('todo', 'emailnoti-sent', false);
109:                 $value = true;
110:             } else {
111:                 $value = false;
112:             }
113:         }
114: 
115:         parent::setProperty($type, $name, $value);
116:     }
117: 
118: }
119: 
120: /**
121:  * This class uses the link GUI class to serve a special link for to-do entries.
122:  *
123:  * @package    Core
124:  * @subpackage GUI
125:  */
126: class TODOLink extends cHTMLLink {
127: 
128:     public function __construct($itemtype, $itemid, $subject, $message) {
129:         global $sess;
130:         parent::__construct();
131: 
132:         $subject = urlencode($subject);
133:         $message = urlencode($message);
134: 
135:         $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');");
136:         $this->setEvent('mouseover', "this.style.cursor='pointer'");
137: 
138:         $img = new cHTMLImage('images/but_setreminder.gif');
139:         $img->setClass("vAlignMiddle tableElement");
140: 
141:         $img->setAlt(i18n('Set reminder / add to todo list'));
142:         $this->setLink('#');
143:         $this->setContent($img->render());
144:         $this->setAlt(i18n('Set reminder / add to todo list'));
145:     }
146: 
147: }
148: 
149: ?>
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0