[TASK] Streamline taskmanager 39/47639/6
authorBenjamin Kott <benjamin.kott@wfp2.com>
Wed, 13 Apr 2016 08:04:00 +0000 (10:04 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 14 Apr 2016 09:02:01 +0000 (11:02 +0200)
Releases: master
Resolves: #75583
Change-Id: Id82af2fed1a9a5174fe29629bceb7aaf00a9c047
Reviewed-on: https://review.typo3.org/47639
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Build/Resources/Public/Less/Component/panel.less [new file with mode: 0644]
Build/Resources/Public/Less/_minimal.less
typo3/sysext/impexp/Classes/Controller/ImportExportController.php
typo3/sysext/impexp/Classes/Task/ImportExportTask.php
typo3/sysext/install/Resources/Public/Css/InstallTool.css
typo3/sysext/sys_action/Classes/ActionTask.php
typo3/sysext/t3skin/Resources/Public/Css/backend.css
typo3/sysext/taskcenter/Classes/Controller/TaskModuleController.php
typo3/sysext/taskcenter/Classes/TaskStatus.php
typo3/sysext/taskcenter/Resources/Public/Css/styles.css [deleted file]
typo3/sysext/taskcenter/Resources/Public/JavaScript/Taskcenter.js

diff --git a/Build/Resources/Public/Less/Component/panel.less b/Build/Resources/Public/Less/Component/panel.less
new file mode 100644 (file)
index 0000000..9145c4a
--- /dev/null
@@ -0,0 +1,89 @@
+//
+// Panel
+// ======
+// Additions and enhancements of the bootstrap panel component. This file
+// needs to be included directly after the bootstrap panel definitions.
+//
+//
+// Normal Usage
+// ------------
+//
+// <div class="panel panel-default">
+//   <div class="panel-heading">
+//     <div class="panel-heading-right">
+//       <a href="#panelContentId" class="panel-heading-collapse" role="button" data-toggle="collapse" aria-expanded="true">
+//         <span class="t3js-icon icon icon-size-small icon-state-default icon-actions-view-list-collapse" data-identifier="actions-view-list-collapse">
+//           ... IconAPI ...
+//         </span>
+//       </a>
+//     </div>
+//     <div class="panel-heading-left">
+//       <a href="#" class="panel-title">
+//         ... Title ...
+//       </a>
+//     </div>
+//   </div>
+//   <div id="panelContentId" class="panel-collapse collapse in" aria-expanded="true">
+//     <div class="panel-body">
+//       ... Content ...
+//     </div>
+//   </div>
+// </div>
+//
+//
+
+
+//
+// Variables
+//
+@panel-active-text:          #fff;
+@panel-active-border:        #444;
+@panel-active-heading-bg:    #666;
+
+//
+// Heading
+//
+.panel-heading {
+       &:extend(.clearfix all);
+       a,
+       a:hover,
+       a:focus
+       a:active {
+               text-decoration: none;
+               color: inherit;
+       }
+}
+.panel-heading-left {
+       float: left;
+}
+.panel-heading-right {
+       float: right;
+}
+
+//
+// Title
+//
+.panel-title {
+       font-size: @font-size-base;
+}
+.panel-title-icon,
+.panel-title-name {
+       display: inline-block;
+       vertical-align: middle;
+}
+
+//
+// Body
+//
+.panel-body {
+       > *:last-child {
+               margin-bottom: 0;
+       }
+}
+
+//
+// Additional Variations
+//
+.panel-active {
+       .panel-variant(@panel-active-border; @panel-active-text; @panel-active-heading-bg; @panel-active-border);
+}
index 77e41b2..1b7681d 100644 (file)
 @import "Component/icon.less";
 @import "Component/diff.less";
 @import "Component/module.less";
+@import "Component/panel.less";
 
 //
 // Bootstrap Utility classes
index 72c7b21..526e2cb 100644 (file)
@@ -132,6 +132,13 @@ class ImportExportController extends BaseScriptClass
     protected $excludeDisabledRecords = false;
 
     /**
+     * Return URL
+     *
+     * @var string
+     */
+    protected $returnUrl;
+
+    /**
      * Constructor
      */
     public function __construct()
@@ -158,6 +165,7 @@ class ImportExportController extends BaseScriptClass
         $this->MCONF['name'] = $this->moduleName;
         parent::init();
         $this->vC = GeneralUtility::_GP('vC');
+        $this->returnUrl = GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GP('returnUrl'));
         $this->lang = $this->getLanguageService();
     }
 
@@ -289,6 +297,14 @@ class ImportExportController extends BaseScriptClass
                 ->setModuleName($this->moduleName);
             $buttonBar->addButton($shortcutButton);
         }
+        // back button
+        if ($this->returnUrl) {
+            $backButton = $buttonBar->makeLinkButton()
+                ->setHref($this->returnUrl)
+                ->setTitle($this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack'))
+                ->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-view-go-back', Icon::SIZE_SMALL));
+            $buttonBar->addButton($backButton);
+        }
         // Input data grabbed:
         $inData = GeneralUtility::_GP('tx_impexp');
         if ((string)$inData['action'] == 'import') {
index 93bae8a..249aca3 100644 (file)
@@ -35,12 +35,20 @@ class ImportExportTask implements TaskInterface
     protected $taskObject;
 
     /**
+     * URL to task module
+     *
+     * @var string
+     */
+    protected $moduleUrl;
+
+    /**
      * Constructor
      *
      * @param TaskModuleController $taskObject
      */
     public function __construct(TaskModuleController $taskObject)
     {
+        $this->moduleUrl = BackendUtility::getModuleUrl('user_task');
         $this->taskObject = $taskObject;
         $this->getLanguageService()->includeLLFile('EXT:impexp/Resources/Private/Language/locallang_csh.xlf');
     }
@@ -82,9 +90,11 @@ class ImportExportTask implements TaskInterface
                 array(
                     'tx_impexp[action]' => 'export',
                     'preset[load]' => 1,
-                    'preset[select]' => $id)
+                    'preset[select]' => $id,
+                    'returnUrl' => $this->moduleUrl
+                )
             );
-            return $this->taskObject->urlInIframe($url);
+            \TYPO3\CMS\Core\Utility\HttpUtility::redirect($url);
         } else {
             // Header
             $lang = $this->getLanguageService();
@@ -137,6 +147,7 @@ class ImportExportTask implements TaskInterface
                     }
                     // Collect all preset information
                     $lines[$key] = array(
+                        'uid' => 'impexp' . $key,
                         'icon' => $icon,
                         'title' => $title,
                         'descriptionHtml' => implode('<br />', $description),
index de28d85..8306db1 100644 (file)
@@ -7522,6 +7522,47 @@ button.close {
 .module-docheader + .module-body {
   padding-top: 89px;
 }
+.panel-heading a,
+.panel-heading a:hover,
+.panel-heading a:focus a:active {
+  text-decoration: none;
+  color: inherit;
+}
+.panel-heading-left {
+  float: left;
+}
+.panel-heading-right {
+  float: right;
+}
+.panel-title {
+  font-size: 12px;
+}
+.panel-title-icon,
+.panel-title-name {
+  display: inline-block;
+  vertical-align: middle;
+}
+.panel-body > *:last-child {
+  margin-bottom: 0;
+}
+.panel-active {
+  border-color: #444444;
+}
+.panel-active > .panel-heading {
+  color: #ffffff;
+  background-color: #666666;
+  border-color: #444444;
+}
+.panel-active > .panel-heading + .panel-collapse > .panel-body {
+  border-top-color: #444444;
+}
+.panel-active > .panel-heading .badge {
+  color: #666666;
+  background-color: #ffffff;
+}
+.panel-active > .panel-footer + .panel-collapse > .panel-body {
+  border-bottom-color: #444444;
+}
 .clearfix:after,
 .dl-horizontal dd:after,
 .container:after,
@@ -7535,7 +7576,8 @@ button.close {
 .modal-header:after,
 .modal-footer:after,
 .module-docheader:after,
-.module-docheader .module-docheader-bar:after {
+.module-docheader .module-docheader-bar:after,
+.panel-heading:after {
   content: "";
   display: table;
   clear: both;
index 609cb74..7c04e4d 100644 (file)
@@ -122,7 +122,7 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
                             $this->getLanguageService()->getLL('action_error'),
                             FlashMessage::ERROR
                         );
-                        $content .= '<br />' . $this->renderFlashMessages();
+                        $content .= $this->renderFlashMessages();
                 }
             }
         }
@@ -143,12 +143,10 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
             $items = '';
             // Render a single action menu item
             foreach ($actionList as $action) {
-                $active = GeneralUtility::_GP('show') === $action['uid'] ? ' class="active" ' : '';
-                $items .= '<li' . $active . '>
-                                                               <a href="' . $action['link'] . '" title="' . htmlspecialchars($action['description']) . '">' . htmlspecialchars($action['title']) . '</a>
-                                                       </li>';
+                $active = GeneralUtility::_GP('show') === $action['uid'] ? 'active' : '';
+                $items .= '<a class="list-group-item ' . $active . '" href="' . $action['link'] . '" title="' . htmlspecialchars($action['description']) . '">' . htmlspecialchars($action['title']) . '</a>';
             }
-            $content .= '<ul>' . $items . '</ul>';
+            $content .= '<div class="list-group">' . $items . '</div>';
         }
         return $content;
     }
@@ -184,15 +182,15 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
                     true
                 );
                 $title = 'title="' . $this->getLanguageService()->getLL('edit-sys_action') . '"';
-                $icon = $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL)->render();
-                $editActionLink = '<a class="edit" href="' . $link . '"' . $title . '>';
-                $editActionLink .= $icon . $this->getLanguageService()->getLL('edit-sys_action') . '</a>';
+                $icon = $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render();
+                $editActionLink = '<a class="btn btn-default btn-sm" href="' . $link . '"' . $title . '>';
+                $editActionLink .= $icon . ' ' . $this->getLanguageService()->getLL('edit-sys_action') . '</a>';
             }
             $actionList[] = array(
-                'uid' => $actionRow['uid'],
+                'uid' => 'actiontask' . $actionRow['uid'],
                 'title' => $actionRow['title'],
                 'description' => $actionRow['description'],
-                'descriptionHtml' => nl2br(htmlspecialchars($actionRow['description'])) . $editActionLink,
+                'descriptionHtml' => ($actionRow['description'] ? '<p>' . nl2br(htmlspecialchars($actionRow['description'])) . '</p>' : '' ) . $editActionLink,
                 'link' => $this->moduleUrl . '&SET[function]=sys_action.TYPO3\\CMS\\SysAction\\ActionTask&show=' . $actionRow['uid']
             );
         }
@@ -232,8 +230,8 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
                 true
             );
             $content .= '<p>' .
-                '<a href="' . $link . '" title="' . $this->getLanguageService()->getLL('new-sys_action') . '">' .
-                $this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL)->render() .
+                '<a class="btn btn-default" href="' . $link . '" title="' . $this->getLanguageService()->getLL('new-sys_action') . '">' .
+                $this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL)->render() . ' ' .
                 $this->getLanguageService()->getLL('new-sys_action') .
                 '</a></p>';
         }
@@ -301,7 +299,7 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
                     $this->getLanguageService()->getLL('success')
                 );
             }
-            $content .= $this->renderFlashMessages() . '<br />';
+            $content .= $this->renderFlashMessages();
         }
         // Load BE user to edit
         if ((int)GeneralUtility::_GP('be_users_uid') > 0) {
@@ -317,46 +315,45 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
                 $vars = $rawRecord;
             }
         }
-        $content .= '<form action="" method="post" enctype="multipart/form-data">
-                                               <fieldset class="fields">
-                                                       <legend>' . $this->getLanguageService()->getLL('action_t1_legend_generalFields') . '</legend>
-                                                       <div class="row">
-                                                               <label for="field_disable">' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_general.xlf:LGL.disable') . '</label>
-                                                               <input type="checkbox" id="field_disable" name="data[disable]" value="1" class="checkbox" ' . ($vars['disable'] == 1 ? ' checked="checked" ' : '') . ' />
-                                                       </div>
-                                                       <div class="row">
-                                                               <label for="field_realname">' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_general.xlf:LGL.name') . '</label>
-                                                               <input type="text" id="field_realname" name="data[realName]" value="' . htmlspecialchars($vars['realName']) . '" />
-                                                       </div>
-                                                       <div class="row">
-                                                               <label for="field_username">' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_tca.xlf:be_users.username') . '</label>
-                                                               <input type="text" id="field_username" name="data[username]" value="' . htmlspecialchars($vars['username']) . '" />
-                                                       </div>
-                                                       <div class="row">
-                                                               <label for="field_password">' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_tca.xlf:be_users.password') . '</label>
-                                                               <input type="password" id="field_password" name="data[password]" value="" />
-                                                       </div>
-                                                       <div class="row">
-                                                               <label for="field_email">' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_general.xlf:LGL.email') . '</label>
-                                                               <input type="text" id="field_email" name="data[email]" value="' . htmlspecialchars($vars['email']) . '" />
-                                                       </div>
-                                               </fieldset>
-                                               <fieldset class="fields">
-                                                       <legend>' . $this->getLanguageService()->getLL('action_t1_legend_configuration') . '</legend>
-
-                                                       <div class="row">
-                                                               <label for="field_usergroup">' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_tca.xlf:be_users.usergroup') . '</label>
-                                                               <select id="field_usergroup" name="data[usergroup][]" multiple="multiple">
-                                                                       ' . $this->getUsergroups($record, $vars) . '
-                                                               </select>
-                                                       </div>
-                                                       <div class="row">
-                                                               <input type="hidden" name="data[key]" value="' . $key . '" />
-                                                               <input type="hidden" name="data[sent]" value="1" />
-                                                               <input class="btn btn-default" type="submit" value="' . ($key === 'NEW' ? $this->getLanguageService()->getLL('action_Create') : $this->getLanguageService()->getLL('action_Update')) . '" />
-                                                       </div>
-                                               </fieldset>
-                                       </form>';
+        $content .= '<form action="" class="panel panel-default" method="post" enctype="multipart/form-data">
+                        <fieldset class="form-section">
+                            <h4 class="form-section-headline">' . $this->getLanguageService()->getLL('action_t1_legend_generalFields') . '</h4>
+                            <div class="form-group">
+                                <label for="field_disable">' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_general.xlf:LGL.disable') . '</label>
+                                <input type="checkbox" id="field_disable" name="data[disable]" value="1" class="checkbox" ' . ($vars['disable'] == 1 ? ' checked="checked" ' : '') . ' />
+                            </div>
+                            <div class="form-group">
+                                <label for="field_realname">' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_general.xlf:LGL.name') . '</label>
+                                <input type="text" id="field_realname" class="form-control" name="data[realName]" value="' . htmlspecialchars($vars['realName']) . '" />
+                            </div>
+                            <div class="form-group">
+                                <label for="field_username">' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_tca.xlf:be_users.username') . '</label>
+                                <input type="text" id="field_username" class="form-control" name="data[username]" value="' . htmlspecialchars($vars['username']) . '" />
+                            </div>
+                            <div class="form-group">
+                                <label for="field_password">' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_tca.xlf:be_users.password') . '</label>
+                                <input type="password" id="field_password" class="form-control" name="data[password]" value="" />
+                            </div>
+                            <div class="form-group">
+                                <label for="field_email">' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_general.xlf:LGL.email') . '</label>
+                                <input type="text" id="field_email" class="form-control" name="data[email]" value="' . htmlspecialchars($vars['email']) . '" />
+                            </div>
+                        </fieldset>
+                        <fieldset class="form-section">
+                            <h4 class="form-section-headline">' . $this->getLanguageService()->getLL('action_t1_legend_configuration') . '</h4>
+                            <div class="form-group">
+                                <label for="field_usergroup">' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_tca.xlf:be_users.usergroup') . '</label>
+                                <select id="field_usergroup" class="form-control" name="data[usergroup][]" multiple="multiple">
+                                    ' . $this->getUsergroups($record, $vars) . '
+                                </select>
+                            </div>
+                            <div class="form-group">
+                                <input type="hidden" name="data[key]" value="' . $key . '" />
+                                <input type="hidden" name="data[sent]" value="1" />
+                                <input class="btn btn-default" type="submit" value="' . ($key === 'NEW' ? $this->getLanguageService()->getLL('action_Create') : $this->getLanguageService()->getLL('action_Update')) . '" />
+                            </div>
+                        </fieldset>
+                    </form>';
         $content .= $this->getCreatedUsers($record, $key);
         return $content;
     }
@@ -417,12 +414,17 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
             if ($row['uid'] == $selectedUser) {
                 $line = '<strong>' . $line . '</strong>';
             }
-            $userList[] = $line;
+            $userList[] = '<li class="list-group-item">' . $line . '</li>';
         }
         $this->getDatabaseConnection()->sql_free_result($res);
         // If any records found
         if (!empty($userList)) {
-            $content .= '<br /><h3>' . $this->getLanguageService()->getLL('action_t1_listOfUsers', true) . '</h3><div>' . implode('<br />', $userList) . '</div>';
+            $content .= '<div class="panel panel-default">';
+            $content .= '<div class="panel-heading">';
+            $content .= '<h3 class="panel-title">' . $this->getLanguageService()->getLL('action_t1_listOfUsers', true) . '</h3>';
+            $content .= '</div>';
+            $content .= '<ul class="list-group">' . implode($userList) . '</ul>';
+            $content .= '</div>';
         }
         return $content;
     }
@@ -720,6 +722,7 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
                 true
             );
             $actionList[$el['id']] = array(
+                'uid' => 'record-' . $el['table'] . '-' . $el['id'],
                 'title' => $title,
                 'description' => BackendUtility::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]),
                 'descriptionHtml' => $description,
@@ -765,7 +768,7 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
                         $actionContent = $cP['content'];
                         // If the result is rendered as csv or xml, show a download link
                         if ($type === 'csv' || $type === 'xml') {
-                            $actionContent .= '<br /><br /><a href="' . GeneralUtility::getIndpEnv('REQUEST_URI') . '&download_file=1"><strong>' . $this->getLanguageService()->getLL('action_download_file') . '</strong></a>';
+                            $actionContent .= '<a href="' . GeneralUtility::getIndpEnv('REQUEST_URI') . '&download_file=1"><strong>' . $this->getLanguageService()->getLL('action_download_file') . '</strong></a>';
                         }
                     } else {
                         $actionContent .= $this->getDatabaseConnection()->sql_error();
@@ -778,23 +781,23 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
                         $this->getLanguageService()->getLL('action_error'),
                         FlashMessage::ERROR
                     );
-                    $content .= '<br />' . $this->renderFlashMessages();
+                    $content .= $this->renderFlashMessages();
                 }
                 // Admin users are allowed to see and edit the query
                 if ($this->getBackendUser()->isAdmin()) {
                     if (!$queryIsEmpty) {
-                        $actionContent .= '<hr /> ' . $fullsearch->tableWrap($sql_query['qSelect']);
+                        $actionContent .= '<div class="panel panel-default"><div class="panel-body">' . $fullsearch->tableWrap($sql_query['qSelect']) . '</div></div>';
                     }
-                    $actionContent .= '<br /><a title="' . $this->getLanguageService()->getLL('action_editQuery') . '" href="'
+                    $actionContent .= '<a title="' . $this->getLanguageService()->getLL('action_editQuery') . '" class="btn btn-default" href="'
                         . htmlspecialchars(BackendUtility::getModuleUrl('system_dbint')
                             . '&id=' . '&SET[function]=search' . '&SET[search]=query'
                             . '&storeControl[STORE]=-' . $record['uid'] . '&storeControl[LOAD]=1')
                         . '">'
-                        . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL)->render()
+                        . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL)->render() . ' '
                         . $this->getLanguageService()->getLL(($queryIsEmpty ? 'action_createQuery'
-                        : 'action_editQuery')) . '</a><br /><br />';
+                        : 'action_editQuery')) . '</a>';
                 }
-                $content .= '<h2>' . $this->getLanguageService()->getLL('action_t2_result', true) . '</h2><div>' . $actionContent . '</div>';
+                $content .= '<h2>' . $this->getLanguageService()->getLL('action_t2_result', true) . '</h2>' . $actionContent;
             } else {
                 // Query is not configured
                 $this->addMessage(
@@ -802,7 +805,7 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
                     $this->getLanguageService()->getLL('action_error'),
                     FlashMessage::ERROR
                 );
-                $content .= '<br />' . $this->renderFlashMessages();
+                $content .= $this->renderFlashMessages();
             }
         } else {
             // Required sysext lowlevel is not installed
@@ -811,7 +814,7 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
                 $this->getLanguageService()->getLL('action_error'),
                 FlashMessage::ERROR
             );
-            $content .= '<br />' . $this->renderFlashMessages();
+            $content .= $this->renderFlashMessages();
         }
         return $content;
     }
@@ -833,7 +836,7 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
                 $this->getLanguageService()->getLL('action_error'),
                 FlashMessage::ERROR
             );
-            $content .= '<br />' . $this->renderFlashMessages();
+            $content .= $this->renderFlashMessages();
             return $content;
         }
         // Loading current page record and checking access:
index 96b90b2..cd4445a 100644 (file)
@@ -7531,6 +7531,47 @@ button.close {
 .module-docheader + .module-body {
   padding-top: 89px;
 }
+.panel-heading a,
+.panel-heading a:hover,
+.panel-heading a:focus a:active {
+  text-decoration: none;
+  color: inherit;
+}
+.panel-heading-left {
+  float: left;
+}
+.panel-heading-right {
+  float: right;
+}
+.panel-title {
+  font-size: 12px;
+}
+.panel-title-icon,
+.panel-title-name {
+  display: inline-block;
+  vertical-align: middle;
+}
+.panel-body > *:last-child {
+  margin-bottom: 0;
+}
+.panel-active {
+  border-color: #444444;
+}
+.panel-active > .panel-heading {
+  color: #ffffff;
+  background-color: #666666;
+  border-color: #444444;
+}
+.panel-active > .panel-heading + .panel-collapse > .panel-body {
+  border-top-color: #444444;
+}
+.panel-active > .panel-heading .badge {
+  color: #666666;
+  background-color: #ffffff;
+}
+.panel-active > .panel-footer + .panel-collapse > .panel-body {
+  border-bottom-color: #444444;
+}
 .clearfix:after,
 .dl-horizontal dd:after,
 .container:after,
@@ -7545,6 +7586,7 @@ button.close {
 .modal-footer:after,
 .module-docheader:after,
 .module-docheader .module-docheader-bar:after,
+.panel-heading:after,
 .pagination-block:after,
 .typo3-login-copyright-link:after,
 .form-irre-header-body dl dd:after,
index 950ff8f..18b5890 100644 (file)
@@ -57,8 +57,6 @@ class TaskModuleController extends BaseScriptClass
     public function __construct()
     {
         $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
-        $cssFile = GeneralUtility::getFileAbsFileName('EXT:taskcenter/Resources/Public/Css/styles.css');
-        $this->moduleTemplate->getPageRenderer()->addCssFile(PathUtility::getAbsoluteWebPath($cssFile));
         $this->getLanguageService()->includeLLFile('EXT:taskcenter/Resources/Private/Language/locallang_task.xlf');
         $this->MCONF = array(
             'name' => $this->moduleName
@@ -230,11 +228,20 @@ class TaskModuleController extends BaseScriptClass
             $defaultFlashMessageQueue->enqueue($flashMessage);
         }
 
-        $content = '<div id="taskcenter-main">
-                                               <div id="taskcenter-menu">' . $this->indexAction() . '</div>
-                                               <div id="taskcenter-item" class="' . htmlspecialchars(($extKey . '-' . $taskClass)) . '">' . $actionContent . '
-                                               </div>
-                                       </div>';
+        $content = '<div class="taskcenter">
+                        <div class="row">
+                            <div class="col-sm-4 col-md-3">
+                                <div class="taskcenter-menu">
+                                    ' . $this->indexAction() . '
+                                </div>
+                            </div>
+                            <div class="col-sm-8 col-md-9">
+                                <div class="taskcenter-content taskcenter-content-' . strtolower(str_replace('\\', '-', htmlspecialchars(($extKey . '-' . $taskClass)))) . '">
+                                    ' . $actionContent . '
+                                </div>
+                            </div>
+                        </div>
+                    </div>';
         $this->content .= $content;
     }
 
@@ -264,7 +271,7 @@ class TaskModuleController extends BaseScriptClass
     {
         $content = '<h1>' . nl2br(htmlspecialchars($title)) . '</h1>';
         if (!empty($description)) {
-            $content .= '<p class="description">' . nl2br(htmlspecialchars($description)) . '</p>';
+            $content .= '<p>' . nl2br(htmlspecialchars($description)) . '</p>';
         }
         return $content;
     }
@@ -304,7 +311,7 @@ class TaskModuleController extends BaseScriptClass
             }
         }
         if (is_array($items) && !empty($items)) {
-            foreach ($items as $item) {
+            foreach ($items as $itemKey => $item) {
                 $title = htmlspecialchars($item['title']);
                 $icon = ($additionalClass = ($collapsedStyle = ''));
                 // Check for custom icon
@@ -325,39 +332,49 @@ class TaskModuleController extends BaseScriptClass
                 }
                 $description = $item['descriptionHtml'] ?: '<p>' . nl2br(htmlspecialchars($item['description'])) . '</p>';
                 $id = $this->getUniqueKey($item['uid']);
+                $contentId = strtolower(str_replace('\\','-',$id));
                 // Collapsed & expanded menu items
-                if ($mainMenu && isset($this->getBackendUser()->uc['taskcenter']['states'][$id]) && $this->getBackendUser()->uc['taskcenter']['states'][$id]) {
-                    $collapsedStyle = 'style="display:none"';
-                    $additionalClass = 'collapsed';
+                if (isset($this->getBackendUser()->uc['taskcenter']['states'][$id]) && $this->getBackendUser()->uc['taskcenter']['states'][$id]) {
+                    $collapsed = true;
+                    $collapseIcon = $this->moduleTemplate->getIconFactory()->getIcon('actions-view-list-expand', Icon::SIZE_SMALL)->render('inline');
                 } else {
-                    $additionalClass = 'expanded';
-                }
-                // First & last menu item
-                if ($count == 0) {
-                    $additionalClass .= ' first-item';
-                } elseif ($count + 1 === count($items)) {
-                    $additionalClass .= ' last-item';
+                    $collapsed = false;
+                    $collapseIcon = $this->moduleTemplate->getIconFactory()->getIcon('actions-view-list-collapse', Icon::SIZE_SMALL)->render('inline');
                 }
                 // Active menu item
-                $active = (string)$this->MOD_SETTINGS['function'] == $item['uid'] ? ' active-task' : '';
-                // Main menu: Render additional syntax to sort tasks
-                if ($mainMenu) {
-                    $section = '<div class="down"><i class="fa fa-caret-down fa-fw"></i></div>
-                                                               <div class="drag"><i class="fa fa-arrows"></i></div>';
-                    $backgroundClass = 't3-row-header ';
-                } else {
-                    $backgroundClass = '';
-                }
-                $content .= '<li class="' . $additionalClass . $active . '" id="el_' . $id . '">
-                                                               ' . $section . '
-                                                               <div class="image">' . $icon . '</div>
-                                                               <div class="' . $backgroundClass . 'link"><a href="' . $item['link'] . '">' . $title . '</a></div>
-                                                               <div class="content " ' . $collapsedStyle . '>' . $description . '</div>
+                $panelState = (string)$this->MOD_SETTINGS['function'] == $item['uid'] ? 'panel-active' : 'panel-default';
+                $content .= '<li id="el_' . $id . '">
+                                <div id="' . $contentId . '" data-taskcenter-id="' . $id . '" class="panel ' . $panelState . '">
+                                    <div class="panel-heading">
+                                        <div class="panel-heading-right">
+                                            <a href="#task_content_' . $contentId . '" class="panel-header-collapse t3js-taskcenter-header-collapse" role="button" data-toggle="collapse" data-uid="' . $contentId . '" aria-expanded="' . ($collapsed ? 'false' : 'true') .'">
+                                                ' . $collapseIcon . '
+                                            </a>
+                                        </div>
+                                        <div class="panel-heading-left">
+                                            <a href="' . $item['link'] . '" class="panel-title">
+                                                ' . ($icon ? '<span class="panel-title-icon">' . $icon . '</span>' : '') . '
+                                                <span class="panel-title-name">'
+                                                    . $title . ' '
+                                                    . $this->moduleTemplate->getIconFactory()->getIcon(
+                                                        'actions-view-table-expand',
+                                                        Icon::SIZE_SMALL
+                                                    )->render('inline')
+                                                . '</span>
+                                            </a>
+                                        </div>
+                                    </div>
+                                    <div id="task_content_' . $contentId . '" class="panel-collapse collapse t3js-taskcenter-collapse ' . ($collapsed ? '' : 'in') . '" aria-expanded="true">
+                                        <div class="panel-body">
+                                            ' . $description . '
+                                        </div>
+                                    </div>
+                                </div>
                                                        </li>';
                 $count++;
             }
             $navigationId = $mainMenu ? 'id="task-list"' : '';
-            $content = '<ul ' . $navigationId . ' class="task-list">' . $content . '</ul>';
+            $content = '<ul ' . $navigationId . ' class="list-unstyled">' . $content . '</ul>';
         }
         return $content;
     }
@@ -431,17 +448,6 @@ class TaskModuleController extends BaseScriptClass
     {
         $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
 
-        // Fullscreen Button
-        $url = GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL');
-        $onClick = 'devlogWin=window.open(' . GeneralUtility::quoteJSvalue($url) . ',\'taskcenter\',\'width=790,status=0,menubar=1,resizable=1,location=0,scrollbars=1,toolbar=0\');return false;';
-        $fullscreenButton = $buttonBar->makeLinkButton()
-            ->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.openInNewWindow'))
-            ->setOnClick($onClick)
-            ->setHref('#')
-            ->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-window-open', Icon::SIZE_SMALL))
-            ;
-        $buttonBar->addButton($fullscreenButton, ButtonBar::BUTTON_POSITION_RIGHT, 1);
-
         // Shortcut
         $shortcutButton = $buttonBar->makeShortcutButton()
             ->setModuleName($this->moduleName)
@@ -485,7 +491,7 @@ class TaskModuleController extends BaseScriptClass
      */
     public function urlInIframe($url)
     {
-        return '<iframe scrolling="auto"  width="100%" src="' . $url . '" name="list_frame" id="list_frame" frameborder="no"></iframe>';
+        return '<div class="panel panel-default"><iframe scrolling="auto"  width="100%" src="' . $url . '" name="list_frame" id="list_frame" frameborder="no" style="height: 500px"></iframe></div>';
     }
 
     /**
@@ -503,21 +509,6 @@ class TaskModuleController extends BaseScriptClass
     }
 
     /**
-     * This method prepares the link for opening the devlog in a new window
-     *
-     * @return string Hyperlink with icon and appropriate JavaScript
-     */
-    protected function openInNewWindow()
-    {
-        $url = GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL');
-        $onClick = 'devlogWin=window.open(' . GeneralUtility::quoteJSvalue($url) . ',\'taskcenter\',\'width=790,status=0,menubar=1,resizable=1,location=0,scrollbars=1,toolbar=0\');return false;';
-        $content = '<a href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.openInNewWindow', true) . '">'
-            . $this->moduleTemplate->getIconFactory()->getIcon('actions-window-open', Icon::SIZE_SMALL)->render()
-        . '</a>';
-        return $content;
-    }
-
-    /**
      * Returns the current BE user.
      *
      * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
index fb74c46..d590bb9 100644 (file)
@@ -33,7 +33,7 @@ class TaskStatus
     {
         // Remove 'el_' in the beginning which is needed for the saveSortingState()
         $item = isset($request->getParsedBody()['item']) ? $request->getParsedBody()['item'] : $request->getQueryParams()['item'];
-        $item = substr(htmlspecialchars($item), 3);
+        $item = htmlspecialchars($item);
         $state = (bool)(isset($request->getParsedBody()['state']) ? $request->getParsedBody()['state'] : $request->getQueryParams()['state']);
 
         $this->getBackendUserAuthentication()->uc['taskcenter']['states'][$item] = $state;
diff --git a/typo3/sysext/taskcenter/Resources/Public/Css/styles.css b/typo3/sysext/taskcenter/Resources/Public/Css/styles.css
deleted file mode 100644 (file)
index 062f37c..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-/* ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- */
-
-/* general */
-body#ext-taskcenter-task-index-php {
-       margin: 0;
-}
-
-body#ext-taskcenter-task-index-php div#typo3-docbody {
-       top: 50px;
-}
-
-body#ext-taskcenter-task-index-php div#typo3-inner-docbody {
-       padding: 24px;
-       height: 100%;
-}
-
-#typo3-inner-docbody p.help {
-       margin-bottom: 10px;
-}
-
-body#ext-taskcenter-task-index-php img.icon {
-       vertical-align: bottom;
-}
-
-body#ext-taskcenter-task-index-php h3 {
-       margin: 4px 0 8px;
-       padding: 0;
-}
-
-/* ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- */
-/* overview */
-
-#taskcenter-main {
-       width: 100%;
-}
-
-#taskcenter-main #taskcenter-menu {
-       width: 250px;
-       float: left;
-}
-
-#taskcenter-main #taskcenter-item {
-       position: absolute;
-       margin-left: 270px;
-       margin-right: 20px;
-       min-width: 300px;
-       float: right;
-}
-
-/* ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- */
-/* menu */
-#taskcenter-menu ul {
-       list-style: none;
-       padding: 0;
-       margin: 0;
-       border-bottom: 1px solid #b0b7c2;
-}
-
-#taskcenter-menu li {
-       margin-top: 1px;
-       border-top: 1px solid #EFEFF4;
-}
-
-#taskcenter-menu .image {
-       float: left;
-       height: 23px;
-       width: 23px;
-}
-
-#taskcenter-menu .image img {
-       margin: 3px 0 0 1px;
-}
-
-#taskcenter-menu .down {
-       color: #fff;
-       height: 23px;
-       float: left;
-       width: 25px;
-       cursor: pointer;
-}
-
-#taskcenter-menu .drag {
-       color: #fff;
-       float: right;
-       height: 23px;
-       width: 24px;
-       padding: 3px;
-}
-
-#taskcenter-menu .drag img {
-       margin-top: 6px;
-       cursor: move;
-}
-
-#taskcenter-menu .link {
-       border: 1px solid #adadad;
-       border-width: 1px 1px 0;
-       line-height: 18px;
-       display: block;
-}
-
-#taskcenter-menu .t3-row-header {
-       padding: 0;
-}
-#taskcenter-menu .t3-row-header a {
-       float: none;
-}
-
-#taskcenter-menu .link a {
-       padding: 2px 5px;
-       display: block;
-       color: #fff;
-}
-
-#taskcenter-menu .active-task .link a {
-       font-weight: bold;
-}
-
-#taskcenter-menu .content {
-       padding: 5px 0;
-       background: #fff;
-       border: 1px solid #b7bec9;
-}
-
-#taskcenter-menu .content p {
-       padding: 3px 5px 5px 5px;
-       margin: 0;
-}
-
-#taskcenter-menu .content ul, #taskcenter-menu .content ul li {
-       border: 0;
-}
-
-#taskcenter-menu .content ul li a {
-       display: block;
-       line-height: 16px;
-       margin: 0;
-       padding: 2px 24px;
-       background: url(../Images/list-item.gif) no-repeat 10px 6px;
-}
-
-#taskcenter-menu .content ul li.active {
-       background-color: #dadada;
-}
-
-#taskcenter-menu .content ul li.active a {
-       color: #000000;
-       font-weight: bold;
-       background-image: url(../Images/list-item-act.gif);
-}
-
-/* ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- */
-/* content section */
-#taskcenter-item {
-       margin-bottom: 20px;
-}
-
-#taskcenter-item ul {
-       padding: 5px 0 5px 5px;
-       margin: 0;
-       list-style: none;
-}
-
-#taskcenter-item ul li {
-       padding: 5px 0 0 12px;
-}
-
-#taskcenter-item ul.withicons li {
-       background: url(../Images/list-item.gif) no-repeat 0 7px;
-}
-
-#taskcenter-item ul .image {
-       float: left;
-       width: 20px;
-}
-
-#taskcenter-item ul .link {
-       font-weight: bold;
-       padding: 2px 5px;
-}
-
-#taskcenter-item ul .link a {
-       padding: 5px;
-}
-
-#taskcenter-item ul .link a:hover {
-       text-decoration: underline;
-}
-
-#taskcenter-item ul .content {
-       padding: 2px 0 0 25px;
-}
-
-#taskcenter-item ul .content .edit {
-       display: block;
-       margin-top: 2px;
-}
-
-/* ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- */
-/* forms */
-#taskcenter-item fieldset {
-       padding: 0;
-}
-
-#taskcenter-item fieldset.fields legend {
-       font-weight: bold;
-       border-bottom: 1px solid #ccc;
-       width: 100%;
-       padding: 0 0 2px 0;
-}
-
-#taskcenter-item form {
-       padding: 0;
-}
-
-#taskcenter-item fieldset.fields {
-       border: 0;
-}
-
-#taskcenter-item fieldset.fields .row {
-       width: 420px;
-       clear: both;
-       padding: 5px 0;
-}
-
-#taskcenter-item fieldset.fields label {
-       width: 150px;
-       display: block;
-       float: left;
-}
-
-#taskcenter-item fieldset.fields select {
-       width: 215px;
-       height: 120px;
-       margin-right: 5px;
-       resize: both;
-}
-
-#taskcenter-item fieldset.fields input {
-       width: 200px;
-}
-
-#taskcenter-item fieldset.fields input[type=checkbox] {
-       width: 16px;
-       text-align: left;
-}
-
-#taskcenter-item fieldset.fields input[type=submit] {
-       margin-left: 150px;
-       width: 215px;
-}
-
-#list_frame {
-       margin-top: -51px;
-       border: none;
-}
index 3cc6419..0f074f7 100644 (file)
 /**
  * Module: TYPO3/CMS/Taskcenter/Taskcenter
  */
-define(['jquery', 'jquery-ui/sortable'], function($) {
+define(['jquery',
+               'TYPO3/CMS/Backend/Icons',
+               'jquery-ui/sortable'
+               ], function($, Icons) {
        'use strict';
 
        /**
@@ -26,47 +29,32 @@ define(['jquery', 'jquery-ui/sortable'], function($) {
 
        /**
         *
-        */
-       Taskcenter.resizeIframe = function() {
-               var $listFrame = $('#list_frame');
-               if ($listFrame.length > 0) {
-                       $listFrame.ready(function() {
-                               var parent = $('#typo3-docbody');
-                               var parentHeight = parent.height();
-                               var parentWidth = parent.width() - $('#taskcenter-menu').width() - 61;
-                               $listFrame.css({height: parentHeight + 'px', width: parentWidth + 'px'});
-
-                               $(window).on('resize', function() {
-                                       Taskcenter.resizeIframe();
-                               });
-                       });
-               }
-       };
-
-       /**
-        *
         * @param {Object} element
+        * @param {Boolean} isCollapsed
         */
-       Taskcenter.doCollapseOrExpand = function(element) {
-               var itemParent = element.parent();
-               var item = element.next('div').next('div').next('div').next('div');
-               var state = itemParent.hasClass('expanded') ? 1 : 0;
-               itemParent.toggleClass('expanded', state);
-               itemParent.toggleClass('collapsed', !state);
-               item.toggle(state);
-               if (state) {
-                       element.find('i.fa').removeClass('fa-caret-down').addClass('fa-caret-up');
+       Taskcenter.collapse = function(element, isCollapsed) {
+               var $item = $(element);
+               var $parent = $item.parent();
+               var $icon = $parent.find('.t3js-taskcenter-header-collapse .t3js-icon');
+               var isCollapsed = isCollapsed;
+               var iconName;
+
+               if(isCollapsed) {
+                       iconName = 'actions-view-list-expand';
                } else {
-                       element.find('i.fa').removeClass('fa-caret-up').addClass('fa-caret-down');
+                       iconName = 'actions-view-list-collapse';
                }
+               Icons.getIcon(iconName, Icons.sizes.small, null, null, 'inline').done(function(icon) {
+                       $icon.replaceWith(icon);
+               });
 
                $.ajax({
                        url: TYPO3.settings.ajaxUrls['taskcenter_collapse'],
                        type: 'post',
                        cache: false,
                        data: {
-                               'item': itemParent.prop('id'),
-                               'state': state
+                               'item': $parent.data('taskcenterId'),
+                               'state': isCollapsed
                        }
                });
        };
@@ -96,11 +84,12 @@ define(['jquery', 'jquery-ui/sortable'], function($) {
         * Register listeners
         */
        Taskcenter.initializeEvents = function() {
-               $('#taskcenter-menu').find('.down').on('click', function() {
-                       Taskcenter.doCollapseOrExpand($(this));
+               $('.t3js-taskcenter-collapse').on('show.bs.collapse', function() {
+                       Taskcenter.collapse($(this), 0);
+               });
+               $('.t3js-taskcenter-collapse').on('hide.bs.collapse', function() {
+                       Taskcenter.collapse($(this), 1);
                });
-
-               Taskcenter.resizeIframe();
                Taskcenter.initializeSorting();
        };