Index: typo3/sysext/taskcenter/ext_tables.php =================================================================== --- typo3/sysext/taskcenter/ext_tables.php (Revision 7975) +++ typo3/sysext/taskcenter/ext_tables.php (Arbeitskopie) @@ -7,13 +7,6 @@ t3lib_extMgm::addModulePath('tools_txtaskcenterM1', t3lib_extMgm::extPath($_EXTKEY) . 'task/'); t3lib_extMgm::addModule('user','task', 'top', t3lib_extMgm::extPath($_EXTKEY) . 'task/'); -// $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter']['taskcenter']['about'] = array( -// 'title' => 'LLL:EXT:taskcenter/locallang.xml:task_help_title', -// 'description' => 'LLL:EXT:taskcenter/locallang.xml:task_help_description', -// 'icon' => 'EXT:taskcenter/task/icon.gif', -// 'task' => 'tx_taskcenter_about' -// ); - $GLOBALS['TYPO3_CONF_VARS']['BE']['AJAX']['Taskcenter::saveCollapseState'] = 'EXT:taskcenter/classes/class.tx_taskcenter_status.php:tx_taskcenter_status->saveCollapseState'; $GLOBALS['TYPO3_CONF_VARS']['BE']['AJAX']['Taskcenter::saveSortingState'] = 'EXT:taskcenter/classes/class.tx_taskcenter_status.php:tx_taskcenter_status->saveSortingState'; } Index: typo3/sysext/taskcenter/task/class.mod_user_task.php =================================================================== --- typo3/sysext/taskcenter/task/class.mod_user_task.php (Revision 7975) +++ typo3/sysext/taskcenter/task/class.mod_user_task.php (Arbeitskopie) @@ -1,211 +0,0 @@ - -* @author Christian Jul Jensen -* -* Revision for TYPO3 3.8.0 / Native Workflow System -*/ - -class mod_user_task extends t3lib_extobjbase { - var $getUserNamesFields = 'username,usergroup,usergroup_cached_list,uid,realName,email'; - var $userGroupArray = array(); - var $perms_clause = ''; - - var $backPath; - - /** - * BE user - * - * @var t3lib_beUserAuth - */ - var $BE_USER; - - function JScode() { - - } - - /** - * Send an email... - * - * @param string $email: the email address to send to - * @param string $subject: the subject of the emil - * @param string $message: the message body of the email - * @return void - */ - function sendEmail($recipient, $subject, $message) { - $message .= ' - - -------- - '.sprintf($GLOBALS['LANG']->getLL('messages_emailFooter'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'], t3lib_div::getIndpEnv('HTTP_HOST')); - - $email = t3lib_div::makeInstance('t3lib_htmlmail'); - $email->start(); - $email->useBase64(); - $email->subject = $GLOBALS['TYPO3_CONF_VARS']['BE']['notificationPrefix'].' '.$subject; - $email->from_email = $this->BE_USER->user['email']; - $email->from_name = $this->BE_USER->user['realName']; - $email->addPlain($message); - $email->setHTML($email->encodeMsg($message)); - $email->setHeaders(); - $email->setContent(); - $email->recipient = $recipient; - $email->sendTheMail(); - } - - /** - * Initialise the object - * - * @param object $BE_USER: instance of t3lib_beuserauth representing the current be user. - * @return void - */ - function mod_user_task_init($BE_USER) { - $this->BE_USER = $BE_USER; - $this->perms_clause = $this->BE_USER->getPagePermsClause(1); - } - - /** - * Return helpbubble image - * - * @return string image tag (HTML) - */ - function helpBubble() { - return 'doc->helpStyle().'>'; - } - - - /** - * Create a link to the module with the name of the module as link text. - * - * @param string $key: the classname of the module - * @param bool $dontLink: Just return the name of the module without a link. - * @param stting $params: HTTP GET parameter string to add to the link (not used if dontLink true) - * @return string link (HTML) / name of module (regular string) - */ - function headLink($key, $dontLink = false, $params = '') { - $str = $GLOBALS['SOBE']->MOD_MENU['function'][$key]; - if (!$dontLink) $str = ''.htmlspecialchars($str).''; - return $str; - } - - /** - * Return a string cropped to a fixed length according to system setting or parameter - * - * @param string $str: string to be cropped. - * @param int $len: length of the cropped string, system settings is used if none is given - * @return string cropped string - */ - function fixed_lgd($str, $len = 0) { - return t3lib_div::fixed_lgd_cs($str, $len?$len:$this->BE_USER->uc['titleLen']); - } - - /** - * Return an error icon - * - * @return string Image tag (HTML) - */ - function errorIcon() { - return ''; - } - - /** - * [Describe function...] - * - * @return array ... - */ - function getUserAndGroupArrays() { - // Get groupnames for todo-tasks - $be_group_Array = t3lib_BEfunc::getListGroupNames('title,uid'); - $groupArray = array_keys($be_group_Array); - // Usernames - $be_user_Array = $be_user_Array_o = t3lib_BEfunc::getUserNames($this->getUserNamesFields); - if (!$GLOBALS['BE_USER']->isAdmin()) $be_user_Array = t3lib_BEfunc::blindUserNames($be_user_Array, $groupArray, 1); - - $this->userGroupArray = array($be_user_Array, $be_group_Array, $be_user_Array_o); - return $this->userGroupArray; - } - - /** - * [Describe function...] - * - * @param [type] $tstamp: ... - * @param [type] $prefix: ... - * @return [type] ... - */ - function dateTimeAge($tstamp, $prefix = 1) { - return t3lib_BEfunc::dateTimeAge($tstamp, $prefix); - } - - /** - * [Describe function...] - * - * @param [type] $mod: ... - * @return [type] ... - */ - function accessMod($mod) { - return $this->BE_USER->modAccess(array('name' => $mod, 'access' => 'user,group'), 0); - } - - /** - * Create configuration for entry in the left tab menu. - * - * @param string $htmlContent: Content that does not get escaped, use this for icons links etc. (HTML) - * @param string $label: bTitle of the tab, escaped for HTML, dispalyed after html content. - * @param string $content: html content that gets displayed when the tab is activated. (HTML) - * @param string $popUpDescription: alt-text for the tab text - * @return array proper configuration for the tab menu. - */ - function mkMenuConfig($htmlContent, $label = "", $content = "", $popUpDescription = '') { - $configArr = Array(); - if ((string) $htmlContent) $configArr['icon'] = $htmlContent; - if ((string) $label) $configArr['label'] = $label; - if ((string) $content) $configArr['content'] = $content; - if ((string) $linkTitle) $configArr['linkTitle'] = $linkTitle; - return $configArr; - } - - /** - * Returns HTML code to dislay an url in an iframe with the right side of the taskcenter - * - * @param string $url: url to display - * @param [type] $max: ... - * @return string code that inserts the iframe (HTML) - */ - function urlInIframe($url,$max=0) { - return ''; - } - - -} - -if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/taskcenter/task/class.mod_user_task.php']) { - include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/taskcenter/task/class.mod_user_task.php']); -} - -?> Index: typo3/sysext/taskcenter/task/index.php =================================================================== --- typo3/sysext/taskcenter/task/index.php (Revision 7975) +++ typo3/sysext/taskcenter/task/index.php (Arbeitskopie) @@ -73,7 +73,7 @@ * @return void */ public function menuConfig() { - $this->MOD_MENU = array('mode' => array()); + $this->MOD_MENU = array('mode' => array()); $this->MOD_MENU['mode']['information'] = $GLOBALS['LANG']->sL('LLL:EXT:taskcenter/locallang.xml:task_overview'); $this->MOD_MENU['mode']['tasks'] = 'Tasks'; @@ -91,88 +91,74 @@ $docHeaderButtons = $this->getButtons(); $markers = array(); - // Access check! @todo: need access check? - if ($GLOBALS['BE_USER']->user['admin'] || 1==1) { + $this->doc->JScodeArray[] = ' + script_ended = 0; + function jumpToUrl(URL) { + document.location = URL; + } - $this->doc->JScodeArray[] = ' - script_ended = 0; - function jumpToUrl(URL) { - document.location = URL; - } + Event.observe(document, "dom:loaded", function(){ + var changeEffect; + Sortable.create("task-list", { handles:$$("#task-list .drag"), tag: "li", ghosting:false, overlap:"vertical", constraint:false, + onChange: function(item) { + var list = Sortable.options(item).element; + // deactivate link + $$("#task-list a").each(function(link) { + link.writeAttribute("onclick","return false;"); + }); - Event.observe(document, "dom:loaded", function(){ - var changeEffect; - Sortable.create("task-list", { handles:$$("#task-list .drag"), tag: "li", ghosting:false, overlap:"vertical", constraint:false, - onChange: function(item) { - var list = Sortable.options(item).element; - // deactivate link + }, + + onUpdate: function(list) { + new Ajax.Request("ajax.php", { + method: "post", + parameters: { ajaxID :"Taskcenter::saveSortingState", data: Sortable.serialize(list)} + }); + // activate link + Event.observe(window,"mouseup",function(){ $$("#task-list a").each(function(link) { - link.writeAttribute("onclick","return false;"); + link.writeAttribute("onclick",""); }); + }); - }, + } + }); - onUpdate: function(list) { - new Ajax.Request("ajax.php", { - method: "post", - parameters: { ajaxID :"Taskcenter::saveSortingState", data: Sortable.serialize(list)} - }); - // activate link - Event.observe(window,"mouseup",function(){ - $$("#task-list a").each(function(link) { - link.writeAttribute("onclick",""); - }); - }); + $$("#taskcenter-menu .down").invoke("observe", "click", function(event){ + var item = Event.element(event); + var itemParent = item.up(); + item = item.next("div").next("div").next("div").next("div"); - } + if (itemParent.hasClassName("expanded")) { + itemParent.removeClassName("expanded").addClassName("collapsed"); + Effect.BlindUp(item, {duration : 0.5}); + state = 1; + } else { + itemParent.removeClassName("collapsed").addClassName("expanded"); + Effect.BlindDown(item, {duration : 0.5}); + state = 0; + } + new Ajax.Request("ajax.php", { + parameters : "ajaxID=Taskcenter::saveCollapseState&item=" + itemParent.id + "&state=" + state }); - - $$("#taskcenter-menu .down").invoke("observe", "click", function(event){ - var item = Event.element(event); - var itemParent = item.up(); - item = item.next("div").next("div").next("div").next("div"); - - if (itemParent.hasClassName("expanded")) { - itemParent.removeClassName("expanded").addClassName("collapsed"); - Effect.BlindUp(item, {duration : 0.5}); - state = 1; - } else { - itemParent.removeClassName("collapsed").addClassName("expanded"); - Effect.BlindDown(item, {duration : 0.5}); - state = 0; - } - new Ajax.Request("ajax.php", { - parameters : "ajaxID=Taskcenter::saveCollapseState&item=" + itemParent.id + "&state=" + state - }); - }); }); - '; - $this->doc->postCode=' - - '; + }); + '; + $this->doc->postCode=' + + '; - // Render content depending on the mode - $mode = (string)$this->MOD_SETTINGS['mode']; - if ($mode == 'information') { - $this->renderInformationContent(); - } else { - $this->renderModuleContent(); - } - - + // Render content depending on the mode + $mode = (string)$this->MOD_SETTINGS['mode']; + if ($mode == 'information') { + $this->renderInformationContent(); } else { - $flashMessage = t3lib_div::makeInstance( - 't3lib_FlashMessage', - $GLOBALS['LANG']->getLL('error-access', true), - $GLOBALS['LANG']->getLL('error_header'), - t3lib_FlashMessage::ERROR - ); - $this->content.= $flashMessage->render(); + $this->renderModuleContent(); } // compile document @@ -215,17 +201,15 @@ } // remder the task - list($extKey, $taskName) = explode('.', $chosenTask, 2); + list($extKey, $taskClass) = explode('.', $chosenTask, 2); + $title = $GLOBALS['LANG']->sL($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter'][$extKey][$taskClass]['title']); - $taskClass = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter'][$extKey][$taskName]['task']; - $title = $GLOBALS['LANG']->sL($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter'][$extKey][$taskName]['title']); - if (class_exists($taskClass)) { $taskInstance = t3lib_div::makeInstance($taskClass, $this); if ($taskInstance instanceof tx_taskcenter_Task) { // check if the task is restricted to admins only - if ($this->checkAccess($extKey, $taskName)) { + if ($this->checkAccess($extKey, $taskClass)) { $actionContent .= $taskInstance->getTask(); } else { $flashMessage = t3lib_div::makeInstance( @@ -246,11 +230,19 @@ ); $actionContent .= $flashMessage->render(); } + } else { + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + $GLOBALS['LANG']->sL('LLL:EXT:taskcenter/task/locallang_mod.xml:mlang_labels_tabdescr'), + $GLOBALS['LANG']->sL('LLL:EXT:taskcenter/task/locallang_mod.xml:mlang_tabs_tab'), + t3lib_FlashMessage::INFO + ); + $actionContent .= $flashMessage->render(); } $content = '
' . $this->indexAction() . '
-
' . +
' . $actionContent . '
'; @@ -309,11 +301,11 @@ * description * * @param array $items: List of items to be displayed in the definition list. - * @param boolean $mainMenu: Set it to true to render the main menu + * @param boolean $mainMenu: Set it to TRUE to render the main menu * @return string definition list */ - public function renderListMenu($items, $mainMenu=FALSE) { - $content = ''; + public function renderListMenu($items, $mainMenu = FALSE) { + $content = $section = ''; $count = 0; // change the sorting of items to the user's one @@ -376,27 +368,26 @@ // active menu item $active = ((string) $this->MOD_SETTINGS['function'] == $item['uid']) ? ' active-task' : ''; + // Main menu: Render additional syntax to sort tasks if ($mainMenu) { + $dragIcon = ''; $section = '
 
-
' . $icon . '
-
- -
'; +
' . $dragIcon . '
'; } $content .= '
  • ' . $section . ' +
    ' . $icon . '
    -
    ' . $description . '
  • '; $count++; } - $navId = ($mainMenu) ? 'id="task-list"' : ''; + $navigationId = ($mainMenu) ? 'id="task-list"' : ''; - $content = '
      ' . $content . '
    '; + $content = '
      ' . $content . '
    '; } @@ -409,17 +400,18 @@ * @return string list of available reports */ protected function indexAction() { - $icon = t3lib_extMgm::extRelPath('taskcenter') . 'task/task.gif'; + $content = ''; $tasks = array(); - + $icon = t3lib_extMgm::extRelPath('taskcenter') . 'task/task.gif'; + // render the tasks only if there are any available if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter']) && count($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter']) > 0) { foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter'] as $extKey => $extensionReports) { - foreach ($extensionReports as $taskName => $task) { - if (!$this->checkAccess($extKey, $taskName)) { + foreach ($extensionReports as $taskClass => $task) { + if (!$this->checkAccess($extKey, $taskClass)) { continue; } - $link = 'mod.php?M=user_task&SET[function]=' . $extKey . '.' . $taskName; + $link = 'mod.php?M=user_task&SET[function]=' . $extKey . '.' . $taskClass; $taskTitle = $GLOBALS['LANG']->sL($task['title']); $taskDescriptionHtml = ''; @@ -428,20 +420,20 @@ $icon = t3lib_div::getFileAbsFilename($task['icon']); } - $taskInstance = t3lib_div::makeInstance($task['task'], $this); + $taskInstance = t3lib_div::makeInstance($taskClass, $this); if ($taskInstance instanceof tx_taskcenter_Task) { $taskDescriptionHtml = $taskInstance->getOverview(); } - - $uniqueKey = $this->getUniqueKey($extKey . '.' . $taskName); + // generate an array of all tasks + $uniqueKey = $this->getUniqueKey($extKey . '.' . $taskClass); $tasks[$uniqueKey] = array( 'title' => $taskTitle, 'descriptionHtml' => $taskDescriptionHtml, 'description' => $GLOBALS['LANG']->sL($task['description']), 'icon' => $icon, 'link' => $link, - 'uid' => $extKey . '.' . $taskName + 'uid' => $extKey . '.' . $taskClass ); } } @@ -454,8 +446,7 @@ '', t3lib_FlashMessage::INFO ); - $this->content.= $flashMessage->render(); - + $this->content .= $flashMessage->render(); } return $content; @@ -489,12 +480,12 @@ * - Tasks can be blinded for Users with TsConfig taskcenter.. = 0 * * @param string $extKey: Extension key - * @param string $taskName: Name of the task + * @param string $taskClass: Name of the task * @return boolean Access to the task allowed or not */ - protected function checkAccess($extKey, $taskName) { + protected function checkAccess($extKey, $taskClass) { // check if task is blinded with TsConfig (taskcenter.. - $tsConfig = $GLOBALS['BE_USER']->getTSConfig('taskcenter.' . $extKey . '.' . $taskName); + $tsConfig = $GLOBALS['BE_USER']->getTSConfig('taskcenter.' . $extKey . '.' . $taskClass); if (isset($tsConfig['value']) && intval($tsConfig['value']) == 0) { return FALSE; } @@ -505,10 +496,11 @@ } // check if task is restricted to admins - if (intval($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter'][$extKey][$taskName]['admin']) == 1) { + if (intval($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter'][$extKey][$taskClass]['admin']) == 1) { return FALSE; } + return FALSE; } /** @@ -574,9 +566,9 @@ -// Make instance: + // Make instance: $SOBE = t3lib_div::makeInstance('SC_mod_user_task_index'); -// Include files? + // Include files? foreach($SOBE->include_once as $INC_FILE) { include_once($INC_FILE); } Index: typo3/sysext/taskcenter/interfaces/interface.tx_taskcenter_task.php =================================================================== --- typo3/sysext/taskcenter/interfaces/interface.tx_taskcenter_task.php (Revision 7975) +++ typo3/sysext/taskcenter/interfaces/interface.tx_taskcenter_task.php (Arbeitskopie) @@ -2,7 +2,7 @@ /*************************************************************** * Copyright notice * -* (c) 2010 Georg Ringer * All rights reserved * * This script is part of the TYPO3 project. The TYPO3 project is @@ -27,7 +27,7 @@ /** - * Interface for classes which provide a report. + * Interface for classes which provide a task. * * @author Georg Ringer 'Curby Soft Multimedia', 'CGLcompliance' => '', 'CGLcompliance_note' => '', - 'version' => '1.0.0', + 'version' => '2.0.0', '_md5_values_when_last_written' => 'a:22:{s:16:"ext_autoload.php";s:4:"db4e";s:12:"ext_icon.gif";s:4:"fc53";s:14:"ext_tables.php";s:4:"697a";s:13:"locallang.xml";s:4:"5e6d";s:38:"classes/class.tx_taskcenter_status.php";s:4:"bdbe";s:43:"interfaces/interface.tx_taskcenter_task.php";s:4:"a913";s:13:"res/Thumbs.db";s:4:"2468";s:23:"res/item-background.jpg";s:4:"c87c";s:21:"res/list-item-act.gif";s:4:"6fa4";s:17:"res/list-item.gif";s:4:"e82d";s:18:"res/mod_styles.css";s:4:"a29c";s:19:"res/mod_styles2.css";s:4:"a66b";s:21:"res/mod_template.html";s:4:"eb07";s:28:"task/class.mod_user_task.php";s:4:"5869";s:34:"task/class.tx_taskcenter_about.php";s:4:"3ca7";s:14:"task/clear.gif";s:4:"cc11";s:13:"task/conf.php";s:4:"e419";s:13:"task/icon.gif";s:4:"7941";s:14:"task/index.php";s:4:"2baa";s:18:"task/locallang.xml";s:4:"c202";s:22:"task/locallang_mod.xml";s:4:"c0f2";s:13:"task/task.gif";s:4:"fc53";}', 'constraints' => array( 'depends' => array( - 'php' => '5.1.0-0.0.0', - 'typo3' => '4.3.0-0.0.0', + 'typo3' => '4.4.0-0.0.0' ), 'conflicts' => array( ), 'suggests' => array( + 'sys_action' => '1.2.0-0.0.0' ), ), 'suggests' => array( Index: typo3/sysext/taskcenter/classes/class.tx_taskcenter_status.php =================================================================== --- typo3/sysext/taskcenter/classes/class.tx_taskcenter_status.php (Revision 7975) +++ typo3/sysext/taskcenter/classes/class.tx_taskcenter_status.php (Arbeitskopie) @@ -26,7 +26,7 @@ /** * Status of tasks * - * @author Georg Ringer * @package TYPO3 * @subpackage taskcenter * @@ -41,7 +41,7 @@ * @return void */ public function saveCollapseState(array $params, TYPO3AJAX $ajaxObj) { - // remove 'el_' in the beginning which is needed for the saveSortingState + // remove 'el_' in the beginning which is needed for the saveSortingState() $item = substr(htmlspecialchars(t3lib_div::_POST('item')), 3); $state = (bool)t3lib_div::_POST('state'); Index: typo3/sysext/taskcenter/ext_autoload.php =================================================================== --- typo3/sysext/taskcenter/ext_autoload.php (Revision 7975) +++ typo3/sysext/taskcenter/ext_autoload.php (Arbeitskopie) @@ -5,7 +5,6 @@ */ $extensionPath = t3lib_extMgm::extPath('taskcenter'); return array ( - 'tx_taskcenter_task' => $extensionPath . 'interfaces/interface.tx_taskcenter_task.php', - 'tx_taskcenter_about' => $extensionPath . 'task/class.tx_taskcenter_about.php', + 'tx_taskcenter_task' => $extensionPath . 'interfaces/interface.tx_taskcenter_task.php' ); -?> +?> \ No newline at end of file