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

Classes

  • cAjaxRequest
  • cAutoload
  • cBackend
  • cEffectiveSetting
  • cGuiScrollListAlltranslations
  • cHTMLValidator
  • cMailer
  • cModuleFileTranslation
  • cModuleHandler
  • cModuleSearch
  • cModuleSynchronizer
  • cModuleTemplateHandler
  • CodeMirror
  • cPasswordRequest
  • cPermission
  • cRegistry
  • cSystemPurge
  • cSystemtest
  • cTinymce4Configuration
  • cTinyMCE4Editor
  • cTinyMCEEditor
  • cWYSIWYGEditor
  • FrontendList
  • HtmlParser
  • TODOBackendList
  • TreeItem
  • UploadList
  • UploadSearchResultList

Functions

  • addArtspec
  • addSortImages
  • backToMainArea
  • buildArticleSelect
  • buildCategorySelect
  • buildCategorySelectRights
  • buildHeapTable
  • buildStackString
  • buildTree
  • buildUserOrGroupPermsFromRequest
  • callPluginStore
  • cApiCatGetLevelNode
  • cApiImageCheckCachedImageValidity
  • cApiImageCheckImageEditingPosibility
  • cApiImageGetCacheFileName
  • cApiImageGetTargetDimensions
  • cApiImageIsAnimGif
  • cApiImgScale
  • cApiImgScaleGetMD5CacheFile
  • cApiImgScaleHQ
  • cApiImgScaleImageMagick
  • cApiImgScaleLQ
  • cApiIsImageMagickAvailable
  • cApiStrCleanURLCharacters
  • cApiStrNormalizeLineEndings
  • cApiStrRecodeString
  • cApiStrReplaceDiacritics
  • cApiStrTrimAfterWord
  • cApiStrTrimHard
  • cApiStrTrimSentence
  • cDeprecated
  • cDie
  • cError
  • checkLangInClients
  • checkPathInformation
  • cInclude
  • compareUrlStrings
  • conChangeTemplateForCat
  • conCopyArticle
  • conCopyArtLang
  • conCopyContainerConf
  • conCopyContent
  • conCopyMetaTags
  • conCopyTemplateConfiguration
  • conCreateLocationString
  • conDeeperCategoriesArray
  • conDeleteart
  • conEditArt
  • conEditFirstTime
  • conFetchCategoryTree
  • conFlagOnOffline
  • conGenerateCode
  • conGenerateCodeForAllArts
  • conGenerateCodeForAllArtsInCategory
  • conGenerateCodeForAllartsUsingLayout
  • conGenerateCodeForAllartsUsingMod
  • conGenerateCodeForAllArtsUsingTemplate
  • conGenerateCodeForArtInAllCategories
  • conGenerateCodeForClient
  • conGenerateKeywords
  • conGetAvailableMetaTagTypes
  • conGetCategoryArticleId
  • conGetCategoryAssignments
  • conGetContainerConfiguration
  • conGetContentFromArticle
  • conGetHtmlTranslationTable
  • conGetMetaValue
  • conGetTemplateConfigurationIdForArticle
  • conGetTemplateConfigurationIdForCategory
  • conGetTopmostCat
  • conGetUsedModules
  • conHtmlentities
  • conHtmlEntityDecode
  • conHtmlSpecialChars
  • conIsLocked
  • conLock
  • conLockBulkEditing
  • conMakeArticleIndex
  • conMakeCatOnline
  • conMakeInlineScript
  • conMakeOnline
  • conMakeOnlineBulkEditing
  • conMakePublic
  • conMakeStart
  • conMoveArticles
  • conPhp54Check
  • conRemoveOldCategoryArticle
  • conSaveContentEntry
  • conSetCodeFlag
  • conSetCodeFlagBulkEditing
  • conSetMetaValue
  • conSyncArticle
  • copyRightsForElement
  • createBulkEditingFunction
  • createRandomName
  • createRightsForElement
  • cWarning
  • dbGetColumns
  • dbGetIndexes
  • dbGetPrimaryKeyName
  • dbTableExists
  • dbUpgradeTable
  • defineIfNotDefined
  • deleteArtspec
  • deleteRightsForElement
  • deleteSystemProperty
  • displayDatetime
  • emptyLogFile
  • endAndLogTiming
  • extractNumber
  • generateDisplayFilePath
  • generateJs
  • getAllClientsAndLanguages
  • getArtLang
  • getArtspec
  • getAvailableContentTypes
  • getCanonicalDay
  • getCanonicalMonth
  • getDirectorySize
  • getEffectiveSetting
  • getEffectiveSettingsByType
  • getEncodingByLanguage
  • getFileContents
  • getFileInformation
  • getFileType
  • getGroupOrUserName
  • getIDForArea
  • getJsHelpContext
  • getLanguageNamesByClient
  • getLanguagesByClient
  • getmicrotime
  • getNamedFrame
  • getParam
  • getParentAreaId
  • getSearchResults
  • getStrExpandCollapseButton
  • getSystemProperties
  • getSystemPropertiesByType
  • getSystemProperty
  • getTemplateSelect
  • getUplExpandCollapseButton
  • htmldecode
  • htmlentities_iso88592
  • humanReadableSize
  • includePlugins
  • insertEmptyStrRow
  • ipMatch
  • isAlphanumeric
  • isArchive
  • isArtInMultipleUse
  • isFunctionDisabled
  • isGroup
  • isIPv4
  • isRunningFromWeb
  • isStartArticle
  • isUtf8
  • isValidMail
  • langActivateDeactivateLanguage
  • langDeleteLanguage
  • langEditLanguage
  • langGetTextDirection
  • langNewLanguage
  • langRenameLanguage
  • layDeleteLayout
  • layEditLayout
  • machineReadableSize
  • mailLogBulkEditingFunctions
  • mailLogDecodeAddresses
  • markSubMenuItem
  • mask
  • modDeleteModule
  • modEditModule
  • phpInfoToHtml
  • plugin_include
  • prCreateURLNameLocationString
  • prDeleteCacheFileContent
  • prGetCacheFileContent
  • prResolvePathViaCategoryNames
  • prResolvePathViaURLNames
  • prWriteCacheFileContent
  • putFileContents
  • recursiveCopy
  • removeFileInformation
  • renderBackendBreadcrumb
  • renderLabel
  • renderSelectProperty
  • renderTextProperty
  • saveGroupRights
  • saveRights
  • scanDirectory
  • scanPlugins
  • sendEncodingHeader
  • set_magic_quotes_gpc
  • setArtspecDefault
  • setArtspecOnline
  • setSystemProperty
  • showTree
  • startTiming
  • statCreateLocationString
  • statDisplayTopChooser
  • statDisplayYearlyTopChooser
  • statGetAvailableMonths
  • statGetAvailableYears
  • statResetStatistic
  • statsArchive
  • statsDisplayInfo
  • statsOverviewAll
  • statsOverviewTop
  • statsOverviewTopYear
  • statsOverviewYear
  • strAssignTemplate
  • strBuildSqlValues
  • strCheckTreeForErrors
  • strCopyCategory
  • strCopyTree
  • strDeeperCategoriesArray
  • strDeleteCategory
  • strHasArticles
  • strHasStartArticle
  • strMakePublic
  • strMakeVisible
  • strMoveCatTargetallowed
  • strMoveDownCategory
  • strMoveSubtree
  • strMoveUpCategory
  • strNewCategory
  • strNewTree
  • strNextBackwards
  • strNextDeeper
  • strNextDeeperAll
  • strNextPost
  • strOrderedPostTreeList
  • strRemakeTreeTable
  • strRenameCategory
  • strRenameCategoryAlias
  • strSortPrePost
  • strSyncCategory
  • systemHavePerm
  • tplAutoFillModules
  • tplBrowseLayoutForContainers
  • tplcfgDuplicate
  • tplDeleteTemplate
  • tplDuplicateTemplate
  • tplEditTemplate
  • tplGetContainerDefault
  • tplGetContainerMode
  • tplGetContainerName
  • tplGetContainerNumbersInLayout
  • tplGetContainerTypes
  • tplGetInUsedData
  • tplIsTemplateInUse
  • tplPreparseLayout
  • tplProcessSendContainerConfiguration
  • updateClientCache
  • updateFileInformation
  • uplCreateFriendlyName
  • uplDirectoryListRecursive
  • uplGetDirectoriesToExclude
  • uplGetFileExtension
  • uplGetFileIcon
  • uplGetFileTypeDescription
  • uplGetThumbnail
  • uplHasFiles
  • uplHasSubdirs
  • uplmkdir
  • uplRecursiveDBDirectoryList
  • uplRecursiveDirectoryList
  • uplRenameDirectory
  • uplSearch
  • uplSyncDirectory
  • uplSyncDirectoryDBFS
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: 
  3: /**
  4:  * This file contains the backend page for managing tasks.
  5:  *
  6:  * @package          Core
  7:  * @subpackage       Backend
  8:  * @version          SVN Revision $Rev:$
  9:  *
 10:  * @author           Unknown
 11:  * @copyright        four for business AG <www.4fb.de>
 12:  * @license          http://www.contenido.org/license/LIZENZ.txt
 13:  * @link             http://www.4fb.de
 14:  * @link             http://www.contenido.org
 15:  */
 16: 
 17: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 18: 
 19: if (!isset($sortmode)) {
 20:     $sortmode = $currentuser->getUserProperty("system", "tasks_sortmode");
 21:     $sortby = $currentuser->getUserProperty("system", "tasks_sortby");
 22: }
 23: 
 24: $dateformat = getEffectiveSetting("dateformat", "full", "Y-m-d H:i:s");
 25: 
 26: if (isset($_REQUEST["listsubmit"])) {
 27:     if (isset($c_restrict)) {
 28:         $c_restrict = true;
 29:         $currentuser->setUserProperty("mycontenido", "hidedonetasks", "true");
 30:     } else {
 31:         $c_restrict = false;
 32:         $currentuser->setUserProperty("mycontenido", "hidedonetasks", "false");
 33:     }
 34: } else {
 35:     if ($currentuser->getUserProperty("mycontenido", "hidedonetasks") == "true") {
 36:         $c_restrict = true;
 37:     } else {
 38:         $c_restrict = false;
 39:     }
 40: }
 41: 
 42: /**
 43:  *
 44:  */
 45: class TODOBackendList extends cGuiScrollList {
 46: 
 47:     /**
 48:      *
 49:      * @var unknown_type
 50:      */
 51:     var $statustypes;
 52: 
 53:     /**
 54:      *
 55:      */
 56:     function TODOBackendList() {
 57:         global $todoitems;
 58: 
 59:         parent::__construct();
 60: 
 61:         $this->statustypes = $todoitems->getStatusTypes();
 62:         $this->prioritytypes = $todoitems->getPriorityTypes();
 63:     }
 64: 
 65:     /**
 66:      * Is called when a new column is rendered.
 67:      *
 68:      * @see cGuiScrollList::onRenderColumn()
 69:      * @param unknown_type $column
 70:      *         The current column which is being rendered
 71:      */
 72:     function onRenderColumn($column) {
 73:         if ($column == 6 || $column == 5) {
 74:             $this->objItem->updateAttributes(array("align" => "center"));
 75:         } else {
 76:             $this->objItem->updateAttributes(array("align" => "left"));
 77:         }
 78: 
 79:         if ($column == 7) {
 80:             $this->objItem->updateAttributes(array("style" => "width: 85px;"));
 81:         } else {
 82:             $this->objItem->updateAttributes(array("style" => ""));
 83:         }
 84:     }
 85: 
 86:     /**
 87:      * Field converting facility.
 88:      * Needs to be overridden in the child class to work properbly.
 89:      *
 90:      * @see cGuiScrollList::convert()
 91:      * @param unknown_type $field
 92:      *         Field index
 93:      * @param unknown_type $value
 94:      *         Field value
 95:      * @param unknown_type $hiddendata
 96:      * @return unknown
 97:      */
 98:     function convert($key, $value, $hidden) {
 99:         global $link, $dateformat, $cfg;
100: 
101:         $backendUrl = cRegistry::getBackendUrl();
102: 
103:         if ($key == 2) {
104:             $link->setCustom("idcommunication", $hidden[1]);
105:             $link->setContent($value);
106:             return $link->render();
107:         }
108: 
109:         if ($key == 3) {
110:             return date($dateformat, strtotime($value));
111:         }
112: 
113:         if ($key == 5) {
114:             switch ($value) {
115:                 case "new":
116:                     $img = "status_new.gif";
117:                     break;
118:                 case "progress":
119:                     $img = "status_inprogress.gif";
120:                     break;
121:                 case "done":
122:                     $img = "status_done.gif";
123:                     break;
124:                 case "deferred":
125:                     $img = "status_deferred.gif";
126:                     break;
127:                 case "waiting":
128:                     $img = "status_waiting.gif";
129:                     break;
130:                 default:
131:                     break;
132:             }
133: 
134:             if (!array_key_exists($value, $this->statustypes)) {
135:                 return i18n("No status type set");
136:             }
137: 
138:             $backendUrl = cRegistry::getBackendUrl();
139: 
140:             $image = new cHTMLImage($backendUrl . $cfg["path"]["images"] . "reminder/" . $img);
141:             $image->setAlt($this->statustypes[$value]);
142: 
143:             //Do not display statuicon, only show statustext
144:             //return $image->render();
145:             return $this->statustypes[$value];
146:         }
147: 
148:         if ($key == 7) {
149:             $amount = $value / 20;
150: 
151:             if ($amount < 0) {
152:                 $amount = 0;
153:             }
154: 
155:             if ($amount > 5) {
156:                 $amount = 5;
157:             }
158: 
159:             $amount = round($amount);
160: 
161:             if ($amount != 0) {
162:                 $image = new cHTMLImage($backendUrl . $cfg["path"]["images"] . "reminder/progress.gif");
163:                 $image->setAlt(sprintf(i18n("%d %% complete"), $value));
164:                 $ret = "";
165: 
166:                 for ($i = 0; $i < $amount; $i++) {
167:                     $ret .= $image->render();
168:                 }
169: 
170:                 return $ret;
171:             } else {
172:                 return '&nbsp;';
173:             }
174:         }
175: 
176:         if ($key == 6) {
177:             switch ($value) {
178:                 case 0:
179:                     $img = "prio_low.gif";
180:                     $p = "low";
181:                     break;
182:                 case 1:
183:                     $img = "prio_medium.gif";
184:                     $p = "medium";
185:                     break;
186:                 case 2:
187:                     $img = "prio_high.gif";
188:                     $p = "high";
189:                     break;
190:                 case 3:
191:                     $img = "prio_veryhigh.gif";
192:                     $p = "immediately";
193:                     break;
194:                 default:
195:                     break;
196:             }
197: 
198:             $image = new cHTMLImage($backendUrl . $cfg["path"]["images"] . "reminder/" . $img);
199:             $image->setAlt($this->prioritytypes[$p]);
200:             return $image->render();
201:         }
202: 
203:         if ($key == 8) {
204: 
205:             if ($value !== "") {
206:                 if (round($value, 2) == 0) {
207:                     return i18n("Today");
208:                 } else {
209:                     if ($value < 0) {
210:                         return number_format(0 - $value, 2, ',', '') . " " . i18n("Day(s)");
211:                     } else {
212:                         return '<font color="red">' . number_format(0 - $value, 2, ',', '') . " " . i18n("Day(s)") . '</font>';
213:                     }
214:                 }
215:             } else {
216:                 return '&nbsp;';
217:             }
218:         }
219: 
220:         return $value;
221:     }
222: 
223: }
224: 
225: if ($action == "todo_save_item") {
226:     $subject = stripslashes($subject);
227:     $message = stripslashes($message);
228: 
229:     $todoitem = new TODOItem();
230:     $todoitem->loadByPrimaryKey($idcommunication);
231: 
232:     $todoitem->set("subject", $subject);
233:     $todoitem->set("message", $message);
234:     $todoitem->set("recipient", $userassignment);
235: 
236:     if (isset($reminderdate)) {
237:         $todoitem->setProperty("todo", "reminderdate", strtotime($reminderdate));
238:     }
239: 
240:     if (isset($notibackend)) {
241:         $todoitem->setProperty("todo", "backendnoti", $notibackend);
242:     }
243: 
244:     $todoitem->setProperty("todo", "emailnoti", $notiemail);
245: 
246:     $todoitem->setProperty("todo", "status", $status);
247: 
248:     if ($progress < 0) {
249:         $progress = 0;
250:     }
251: 
252:     if ($progress > 100) {
253:         $progress = 100;
254:     }
255: 
256:     $todoitem->setProperty("todo", "priority", $priority);
257:     $todoitem->setProperty("todo", "progress", $progress);
258: 
259:     $todoitem->setProperty("todo", "enddate", $enddate);
260: 
261:     $todoitem->store();
262: }
263: 
264: $cpage = new cGuiPage("mycontenido.tasks", "", "1");
265: 
266: $todoitems = new TODOCollection();
267: 
268: if ($action == "mycontenido_tasks_delete") {
269:     $todoitems->delete($idcommunication);
270: }
271: 
272: $recipient = $auth->auth["uid"];
273: 
274: $todoitems->select("recipient = '" . $todoitems->escape($recipient) . "' AND idclient=" . (int) $client);
275: 
276: $list = new TODOBackendList();
277: 
278: $list->setHeader(
279:     '&nbsp;', i18n("Subject"), i18n("Created"), i18n("End Date"), i18n("Status"),
280:     i18n("Priority"), sprintf(i18n("%% complete")), i18n("Due in"), i18n("Actions")
281: );
282: 
283: $lcount = 0;
284: 
285: $link = new cHTMLLink();
286: $link->setCLink("mycontenido_tasks_edit", 4, "");
287: $link->setCustom("sortmode", $sortmode);
288: $link->setCustom("sortby", $sortby);
289: 
290: while ($todo = $todoitems->next()) {
291:     if ((($todo->getProperty("todo", "status") != "done") && ($c_restrict == true)) || ($c_restrict == '')) {
292: 
293:         $subject = $todo->get("subject");
294:         $created = $todo->get("created");
295: 
296:         $reminder = $todo->getProperty("todo", "enddate");
297:         $status = $todo->getProperty("todo", "status");
298:         $priority = $todo->getProperty("todo", "priority");
299:         $complete = $todo->getProperty("todo", "progress");
300: 
301:         if (trim($subject) == "") {
302:             $subject = i18n("Unnamed item");
303:         }
304: 
305:         if (trim($reminder) == "") {
306:             $reminder = i18n("No end date set");
307:         } else {
308:             $reminder = date($dateformat, strtotime($reminder));
309:         }
310: 
311:         if (trim($status) == "") {
312:             $status = i18n("No status set");
313:         }
314: 
315:         $link->setCustom("idcommunication", $todo->get("idcommunication"));
316:         $link->setContent('<img id="myContenidoTodoButton" src="images/but_todo.gif" alt="" border="0">');
317: 
318:         $mimg = $link->render();
319: 
320:         $link->setContent($subject);
321: 
322:         $msubject = $link->render();
323: 
324:         $idcommunication = $todo->get("idcommunication");
325: 
326:         $delete = new cHTMLLink();
327:         $delete->setCLink("mycontenido_tasks", 4, "mycontenido_tasks_delete");
328:         $delete->setCustom("idcommunication", $idcommunication);
329:         $delete->setCustom("sortby", $sortby);
330:         $delete->setCustom("sortmode", $sortmode);
331: 
332:         $img = new cHTMLImage("images/delete.gif");
333:         $img->setAlt(i18n("Delete item"));
334: 
335:         $delete->setContent($img->render());
336: 
337:         $properties = $link;
338: 
339:         $img = new cHTMLImage("images/but_art_conf2.gif");
340:         $img->setAlt(i18n("Edit item"));
341:         $img->setStyle("padding-right: 4px;");
342:         $properties->setContent($img);
343: 
344:         $actions = $properties->render() . $delete->render();
345: 
346:         if ($todo->getProperty("todo", "enddate") != "") {
347:             $duein = round((time() - strtotime($todo->getProperty("todo", "enddate"))) / 86400, 2);
348:         } else {
349:             $duein = "";
350:         }
351: 
352:         switch ($priority) {
353:             case "low":
354:                 $p = 0;
355:                 break;
356:             case "medium":
357:                 $p = 1;
358:                 break;
359:             case "high":
360:                 $p = 2;
361:                 break;
362:             case "immediately":
363:                 $p = 3;
364:                 break;
365:             default:
366:                 break;
367:         }
368: 
369:         $list->setData($lcount, $mimg, $subject, $created, $reminder, $status, $p, $complete, $duein, $actions);
370:         $list->setHiddenData($lcount, $idcommunication, $idcommunication);
371: 
372:         $lcount++;
373:     }
374: }
375: 
376: $form = new cGuiTableForm("restrict");
377: $form->setTableID("todoList");
378: $form->addHeader(i18n("Restrict display"));
379: $form->setVar("listsubmit", "true");
380: 
381: $form->unsetActionButton("submit");
382: $form->setActionButton("submit", "images/but_refresh.gif", i18n("Refresh"), "s");
383: 
384: $form->setVar("area", $area);
385: $form->setVar("frame", $frame);
386: 
387: $restrict = new cHTMLCheckbox("c_restrict", "true");
388: $restrict->setLabelText(i18n("Hide done tasks"));
389: 
390: if ($c_restrict == true) {
391:     $restrict->setChecked(true);
392: }
393: 
394: $submit = new cHTMLButton("submit");
395: $submit->setMode("image");
396: $submit->setImageSource("images/submit.gif");
397: 
398: $form->add(i18n("Options"), $restrict->render());
399: 
400: if ($lcount == 0) {
401:     $cpage->displayInfo(i18n("No tasks found"));
402:     $cpage->setContent(array($form));
403: } else {
404:     if (!isset($sortby)) {
405:         $sortby = 1;
406:     }
407: 
408:     if (!isset($sortmode)) {
409:         $sortmode = "ASC";
410:     }
411: 
412:     $list->setSortable(1, true);
413:     $list->setSortable(2, true);
414:     $list->setSortable(3, true);
415:     $list->setSortable(4, true);
416:     $list->setSortable(5, true);
417:     $list->setSortable(6, true);
418:     $list->setSortable(7, true);
419:     $list->sort($sortby, $sortmode);
420: 
421:     $cpage->setContent(array($form, $list));
422: }
423: $cpage->render();
424: 
425: $currentuser->setUserProperty("system", "tasks_sortby", $sortby);
426: $currentuser->setUserProperty("system", "tasks_sortmode", $sortmode);
427: 
428: ?>
CMS CONTENIDO 4.9.8 API documentation generated by ApiGen 2.8.0