diff --git a/Build/Sources/Sass/dashboard/_widget.scss b/Build/Sources/Sass/dashboard/_widget.scss index be52bbf7a73615d49f1ccb1b37b683ae3795ecef..fc5941ff81210158651333734ea17187333d22a6 100644 --- a/Build/Sources/Sass/dashboard/_widget.scss +++ b/Build/Sources/Sass/dashboard/_widget.scss @@ -40,6 +40,26 @@ h2 { margin-bottom: 0; } + + div[data-widget-key="sys_note_default"] & { + background-color: var(--note-default-header-bg); + } + + div[data-widget-key="sys_note_todos"] & { + background-color: var(--note-success-header-bg); + } + + div[data-widget-key="sys_note_instructions"] & { + background-color: var(--note-info-header-bg); + } + + div[data-widget-key="sys_note_notes"] & { + background-color: var(--note-notice-header-bg); + } + + div[data-widget-key="sys_note_template"] & { + background-color: var(--note-warning-header-bg); + } } .widget-content-main { diff --git a/typo3/sysext/core/Documentation/Changelog/13.3/Feature-104844-Dashboard-Sys_note-AddWidgetsForListingAllTheSys_notesInsideTheTYPO3System.rst b/typo3/sysext/core/Documentation/Changelog/13.3/Feature-104844-Dashboard-Sys_note-AddWidgetsForListingAllTheSys_notesInsideTheTYPO3System.rst new file mode 100644 index 0000000000000000000000000000000000000000..3a62a9ef4d67aac45a3fe51271dc79a424c440eb --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/13.3/Feature-104844-Dashboard-Sys_note-AddWidgetsForListingAllTheSys_notesInsideTheTYPO3System.rst @@ -0,0 +1,25 @@ +.. include:: /Includes.rst.txt + +.. _feature-104844-1725617507: + +==================================================================================== +Feature: #104844 - Add widgets for listing all the sys_notes inside the TYPO3 system +==================================================================================== + +See :issue:`104844` + +Description +=========== + +To make it easier for TYPO3 users to view all the internal notes (EXT:sys_note) in +their TYPO3 system, TYPO3 now offers dashboard widgets for each internal note type. +The backend user must have access to the sys_note table and view permission to the +page where the record is located. + +Impact +====== + +TYPO3 users who have access to the :guilabel:`Dashboard` module and are +granted access to the new widgets can now add and use these widgets. + +.. index:: Backend, ext:dashboard diff --git a/typo3/sysext/core/Tests/Acceptance/Application/Dashboard/DashboardModuleCest.php b/typo3/sysext/core/Tests/Acceptance/Application/Dashboard/DashboardModuleCest.php index bf4819374509f1cd89be2be4685a776b5f7cbc50..e9d22630a5174691efe1ef24438a5a69fc70a75a 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/Dashboard/DashboardModuleCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/Dashboard/DashboardModuleCest.php @@ -51,6 +51,7 @@ final class DashboardModuleCest $I->click('.dashboard-button-tab-add'); $modalDialog->canSeeDialog(); $I->fillField('#dashboardModalAdd-title', self::$customDashboardTitle); + $I->click('label[for="dashboardKey-empty"]'); $I->click('button[name="save"]', ModalDialog::$openedModalButtonContainerSelector); $I->switchToContentFrame(); $I->see(self::$customDashboardTitle, self::$dashboardActiveSelector); diff --git a/typo3/sysext/dashboard/Resources/Public/Css/dashboard.css b/typo3/sysext/dashboard/Resources/Public/Css/dashboard.css index 3cdb1358089c9b7ba658e819a87445ed011f52df..c6fa119c1950c8335f965c31906d10dd578d30a0 100644 --- a/typo3/sysext/dashboard/Resources/Public/Css/dashboard.css +++ b/typo3/sysext/dashboard/Resources/Public/Css/dashboard.css @@ -69,6 +69,11 @@ .widget-content-title{padding:10px 20px;padding-inline-end:76px;border-bottom:1px solid #d7d7d7;font-family:"Source Sans 3",sans-serif;font-size:16px;font-weight:700;line-height:1.25} .widget-content-title span{overflow:hidden;display:block;white-space:nowrap;text-overflow:ellipsis} .widget-content-title h2{margin-bottom:0} +div[data-widget-key=sys_note_default] .widget-content-title{background-color:var(--note-default-header-bg)} +div[data-widget-key=sys_note_todos] .widget-content-title{background-color:var(--note-success-header-bg)} +div[data-widget-key=sys_note_instructions] .widget-content-title{background-color:var(--note-info-header-bg)} +div[data-widget-key=sys_note_notes] .widget-content-title{background-color:var(--note-notice-header-bg)} +div[data-widget-key=sys_note_template] .widget-content-title{background-color:var(--note-warning-header-bg)} .widget-content-main{flex-grow:1;overflow-y:auto;padding:20px} .widget-content-footer{padding:20px;padding-top:0} .widget-actions{position:absolute;display:flex;top:calc(16px * 1.25 / 2 + 20px / 2);inset-inline-end:10px;transform:translate(0,-50%);opacity:0;transition:opacity .2s ease-in-out} diff --git a/typo3/sysext/sys_note/Classes/Domain/Repository/SysNoteRepository.php b/typo3/sysext/sys_note/Classes/Domain/Repository/SysNoteRepository.php index f372517e4c6b92ead5949d473b507a670b799dfe..0d2d6f9c9837d06aef030951b77915462000d905 100644 --- a/typo3/sysext/sys_note/Classes/Domain/Repository/SysNoteRepository.php +++ b/typo3/sysext/sys_note/Classes/Domain/Repository/SysNoteRepository.php @@ -17,8 +17,11 @@ declare(strict_types=1); namespace TYPO3\CMS\SysNote\Domain\Repository; +use TYPO3\CMS\Backend\Utility\BackendUtility; +use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; +use TYPO3\CMS\Core\Type\Bitmask\Permission; /** * Sys_note repository @@ -77,4 +80,68 @@ class SysNoteRepository return $res->executeQuery()->fetchAllAssociative(); } + + /** + * Find notes by given category but restricted to backend user permissions + * + * @param int $category Category id + * + * @return array + */ + public function findByCategoryRestricted(?int $category = null): array + { + $queryBuilder = $this->connectionPool->getQueryBuilderForTable('sys_note'); + $queryBuilder->getRestrictions()->removeAll(); + + $queryBuilder = $queryBuilder + ->select('sys_note.*') + ->from('sys_note') + ->where( + $queryBuilder->expr()->eq('sys_note.deleted', $queryBuilder->createNamedParameter(0, Connection::PARAM_INT)), + $queryBuilder->expr()->or( + $queryBuilder->expr()->eq('sys_note.personal', $queryBuilder->createNamedParameter(0, Connection::PARAM_INT)), + $queryBuilder->expr()->eq('sys_note.cruser', $queryBuilder->createNamedParameter($this->getBackendUser()->user['uid'], Connection::PARAM_INT)) + ) + ) + ->orderBy('sorting', 'asc') + ->addOrderBy('crdate', 'desc'); + + if ($category !== null) { + $queryBuilder = $queryBuilder->andWhere( + $queryBuilder->expr()->eq('sys_note.category', $queryBuilder->createNamedParameter($category, Connection::PARAM_INT)), + ); + } + + $results = []; + foreach ($queryBuilder->executeQuery()->fetchAllAssociative() as $result) { + if ($this->checkPermissions($result)) { + $results[] = $result; + } + } + + return $results; + } + + private function getBackendUser(): BackendUserAuthentication + { + return $GLOBALS['BE_USER']; + } + + private function checkPermissions(array $result): bool + { + $backendUser = $this->getBackendUser(); + $pageId = $result['pid']; + if ($pageId > 0 && !$backendUser->isAdmin()) { + // Check for WebMount access + if ($backendUser->isInWebMount($pageId) === null) { + return false; + } + // Check for record access + $pageRow = BackendUtility::getRecord('pages', $pageId); + if ($pageRow === null || !$backendUser->doesUserHaveAccess($pageRow, Permission::PAGE_SHOW)) { + return false; + } + } + return true; + } } diff --git a/typo3/sysext/sys_note/Classes/Widgets/PagesWithInternalNote.php b/typo3/sysext/sys_note/Classes/Widgets/PagesWithInternalNote.php new file mode 100644 index 0000000000000000000000000000000000000000..79b02a7bbf14f030500d6522c4ab8cd69c1a5c02 --- /dev/null +++ b/typo3/sysext/sys_note/Classes/Widgets/PagesWithInternalNote.php @@ -0,0 +1,74 @@ +<?php + +declare(strict_types=1); + +/* + * This file is part of the TYPO3 CMS project. + * + * It is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, either version 2 + * of the License, or any later version. + * + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + * + * The TYPO3 project - inspiring people to share! + */ + +namespace TYPO3\CMS\SysNote\Widgets; + +use Psr\Http\Message\ServerRequestInterface; +use TYPO3\CMS\Backend\View\BackendViewFactory; +use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; +use TYPO3\CMS\Dashboard\Widgets\AdditionalCssInterface; +use TYPO3\CMS\Dashboard\Widgets\RequestAwareWidgetInterface; +use TYPO3\CMS\Dashboard\Widgets\WidgetConfigurationInterface; +use TYPO3\CMS\Dashboard\Widgets\WidgetInterface; +use TYPO3\CMS\SysNote\Domain\Repository\SysNoteRepository; + +class PagesWithInternalNote implements WidgetInterface, AdditionalCssInterface, RequestAwareWidgetInterface +{ + private ServerRequestInterface $request; + + public function __construct( + private readonly WidgetConfigurationInterface $configuration, + private readonly SysNoteRepository $sysNoteRepository, + private readonly BackendViewFactory $backendViewFactory, + private readonly array $options = [] + ) {} + + public function setRequest(ServerRequestInterface $request): void + { + $this->request = $request; + } + + public function renderWidgetContent(): string + { + $view = $this->backendViewFactory->create($this->request, ['typo3/cms-dashboard', 'typo3/cms-sys-note']); + + $category = $this->options['category'] ?? null; + $view->assignMultiple([ + 'sysNotes' => $this->sysNoteRepository->findByCategoryRestricted($category), + 'category' => $category, + 'configuration' => $this->configuration, + 'dateFormat' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], + 'timeFormat' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'], + ]); + return $view->render('Widget/PagesWithInternalNote.html'); + } + + protected function getBackendUser(): BackendUserAuthentication + { + return $GLOBALS['BE_USER']; + } + + public function getCssFiles(): array + { + return []; + } + + public function getOptions(): array + { + return $this->options; + } +} diff --git a/typo3/sysext/sys_note/Configuration/Backend/DashboardPresets.php b/typo3/sysext/sys_note/Configuration/Backend/DashboardPresets.php new file mode 100644 index 0000000000000000000000000000000000000000..33caf70180de77579ca07d956f2cec97720fed4b --- /dev/null +++ b/typo3/sysext/sys_note/Configuration/Backend/DashboardPresets.php @@ -0,0 +1,11 @@ +<?php + +return [ + 'dashboardPreset-SysNotes' => [ + 'title' => 'LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:widget_group.sys_note_widget.title', + 'description' => 'Shows all widgets from EXT:sys_note', + 'iconIdentifier' => 'content-note', + 'defaultWidgets' => ['sys_note_all', 'sys_note_default', 'sys_note_instructions', 'sys_note_template', 'sys_note_notes', 'sys_note_todos'], + 'showInWizard' => true, + ], +]; diff --git a/typo3/sysext/sys_note/Configuration/Backend/DashboardWidgetGroups.php b/typo3/sysext/sys_note/Configuration/Backend/DashboardWidgetGroups.php new file mode 100644 index 0000000000000000000000000000000000000000..060bc76457b6fc83733b74b408b7025f1f2d3b35 --- /dev/null +++ b/typo3/sysext/sys_note/Configuration/Backend/DashboardWidgetGroups.php @@ -0,0 +1,7 @@ +<?php + +return [ + 'sys_note' => [ + 'title' => 'LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:widget_group.sys_note_widget.title', + ], +]; diff --git a/typo3/sysext/sys_note/Configuration/Services.yaml b/typo3/sysext/sys_note/Configuration/Services.yaml index ebca06aa5ac76a1557d99bae63160f467497760e..1fe3a864d10dbccf83c1c9ce4b249f535b96ab2b 100644 --- a/typo3/sysext/sys_note/Configuration/Services.yaml +++ b/typo3/sysext/sys_note/Configuration/Services.yaml @@ -6,3 +6,99 @@ services: TYPO3\CMS\SysNote\: resource: '../Classes/*' + + dashboard.widget.sys_notes.all: + class: 'TYPO3\CMS\SysNote\Widgets\PagesWithInternalNote' + arguments: + $options: + refreshAvailable: true + tags: + - name: dashboard.widget + identifier: 'sys_note_all' + groupNames: 'sys_note' + title: 'LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:widget.all.title' + description: 'LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:widget.all.description' + iconIdentifier: 'content-note' + height: 'medium' + width: 'medium' + + + dashboard.widget.sys_notes.default: + class: 'TYPO3\CMS\SysNote\Widgets\PagesWithInternalNote' + arguments: + $options: + refreshAvailable: true + category: 0 + tags: + - name: dashboard.widget + identifier: 'sys_note_default' + groupNames: 'sys_note' + title: 'LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:widget.pagesWithInternalNoteDefault.title' + description: 'LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:widget.pagesWithInternalNoteDefault.description' + iconIdentifier: 'content-note' + height: 'medium' + width: 'medium' + + dashboard.widget.sys_notes.sys_note_instructions: + class: 'TYPO3\CMS\SysNote\Widgets\PagesWithInternalNote' + arguments: + $options: + refreshAvailable: true + category: 1 + tags: + - name: dashboard.widget + identifier: 'sys_note_instructions' + groupNames: 'sys_note' + title: 'LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:widget.pagesWithInternalNoteInstructions.title' + description: 'LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:widget.pagesWithInternalNoteInstructions.description' + iconIdentifier: 'content-note' + height: 'medium' + width: 'medium' + + dashboard.widget.sys_notes.sys_note_template: + class: 'TYPO3\CMS\SysNote\Widgets\PagesWithInternalNote' + arguments: + $options: + refreshAvailable: true + category: 2 + tags: + - name: dashboard.widget + identifier: 'sys_note_template' + groupNames: 'sys_note' + title: 'LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:widget.pagesWithInternalNoteTemplate.title' + description: 'LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:widget.pagesWithInternalNoteTemplate.description' + iconIdentifier: 'content-note' + height: 'medium' + width: 'medium' + + dashboard.widget.sys_notes.sys_note_notes: + class: 'TYPO3\CMS\SysNote\Widgets\PagesWithInternalNote' + arguments: + $options: + refreshAvailable: true + category: 3 + tags: + - name: dashboard.widget + identifier: 'sys_note_notes' + groupNames: 'sys_note' + title: 'LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:widget.pagesWithInternalNoteNotes.title' + description: 'LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:widget.pagesWithInternalNoteNotes.description' + iconIdentifier: 'content-note' + height: 'medium' + width: 'medium' + + dashboard.widget.sys_notes.sys_note_todos: + class: 'TYPO3\CMS\SysNote\Widgets\PagesWithInternalNote' + arguments: + $options: + refreshAvailable: true + category: 4 + tags: + - name: dashboard.widget + identifier: 'sys_note_todos' + groupNames: 'sys_note' + title: 'LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:widget.pagesWithInternalNoteToDos.title' + description: 'LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:widget.pagesWithInternalNoteToDos.description' + iconIdentifier: 'content-note' + height: 'medium' + width: 'medium' diff --git a/typo3/sysext/sys_note/Resources/Private/Language/locallang.xlf b/typo3/sysext/sys_note/Resources/Private/Language/locallang.xlf index 287b3bd1e49d38f12d7f1679aabde544ebf82128..72e4c468393ea56d667b95e03d429a630503a264 100644 --- a/typo3/sysext/sys_note/Resources/Private/Language/locallang.xlf +++ b/typo3/sysext/sys_note/Resources/Private/Language/locallang.xlf @@ -39,6 +39,63 @@ <trans-unit id="author_deleted" resname="author_deleted"> <source>Unknown author</source> </trans-unit> + <trans-unit id="widget_group.sys_note_widget.title" resname="widget_group.sys_note_widget.title"> + <source>Sys Notes</source> + </trans-unit> + <!-- All --> + <trans-unit id="widget.all.title" resname="widget.all.title"> + <source>Alle Sys Notes</source> + </trans-unit> + <trans-unit id="widget.all.description" resname="widget.all.description"> + <source>Shows a list of all pages which have sys_notes</source> + </trans-unit> + <!-- Default --> + <trans-unit id="widget.pagesWithInternalNoteDefault.title" resname="widget.pagesWithInternalNoteDefault.title"> + <source>Notes with category Default</source> + </trans-unit> + <trans-unit id="widget.pagesWithInternalNoteDefault.description" resname="widget.pagesWithInternalNoteDefault.description"> + <source>Shows a list of all pages which have sys_notes with the category "Default"</source> + </trans-unit> + <!-- ToDos --> + <trans-unit id="widget.pagesWithInternalNoteToDos.title" resname="widget.pagesWithInternalNoteToDos.title"> + <source>Notes with category ToDo</source> + </trans-unit> + <trans-unit id="widget.pagesWithInternalNoteToDos.description" resname="widget.pagesWithInternalNoteToDos.description"> + <source>Shows a list of all pages which have sys_notes with the category "ToDo"</source> + </trans-unit> + <!-- Template --> + <trans-unit id="widget.pagesWithInternalNoteTemplate.title" resname="widget.pagesWithInternalNoteTemplate.title"> + <source>Notes with category Template</source> + </trans-unit> + <trans-unit id="widget.pagesWithInternalNoteTemplate.description" resname="widget.pagesWithInternalNoteTemplate.description"> + <source>Shows a list of all pages which have sys_notes with the category "Template"</source> + </trans-unit> + <!-- Notes --> + <trans-unit id="widget.pagesWithInternalNoteNotes.title" resname="widget.pagesWithInternalNoteNotes.title"> + <source>Notes with category Notes</source> + </trans-unit> + <trans-unit id="widget.pagesWithInternalNoteNotes.description" resname="widget.pagesWithInternalNoteNotes.description"> + <source>Shows a list of all pages which have sys_notes with the category "Notes"</source> + </trans-unit> + <!-- Instructions --> + <trans-unit id="widget.pagesWithInternalNoteInstructions.title" resname="widget.pagesWithInternalNoteInstructions.title"> + <source>Notes with category Instructions</source> + </trans-unit> + <trans-unit id="widget.pagesWithInternalNoteInstructions.description" resname="widget.pagesWithInternalNoteInstructions.description"> + <source>Shows a list of all pages which have sys_notes with the category "Instructions"</source> + </trans-unit> + <trans-unit id="created" resname="created"> + <source>Created</source> + </trans-unit> + <trans-unit id="subject" resname="subject"> + <source>Subject</source> + </trans-unit> + <trans-unit id="subjectmessage" resname="subjectmessage"> + <source>Subject and message</source> + </trans-unit> + <trans-unit id="goto_page" resname="goto_page"> + <source>Go to page</source> + </trans-unit> </body> </file> </xliff> diff --git a/typo3/sysext/sys_note/Resources/Private/Templates/List.html b/typo3/sysext/sys_note/Resources/Private/Templates/List.html index 944b7e5f9ad7cbe34f4cd203a08c37d3522cb4fb..679881a58ae2a0a05f1dd3d4b346901d30efbc21 100644 --- a/typo3/sysext/sys_note/Resources/Private/Templates/List.html +++ b/typo3/sysext/sys_note/Resources/Private/Templates/List.html @@ -1,6 +1,6 @@ <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" - xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers" - xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers" + xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers" + xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers" > <f:if condition="{notes}"> <h2><f:translate key="LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:internal_note" /></h2> @@ -10,13 +10,13 @@ <div class="note-header"> <div class="note-header-bar"> <button - type="button" - class="btn btn-link p-0 note-icon" - title="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.contextMenu.open')}" - data-contextmenu-trigger="click" - data-contextmenu-table="sys_note" - data-contextmenu-uid="{note.uid}" - aria-label="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.contextMenu.open')}" + type="button" + class="btn btn-link p-0 note-icon" + title="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.contextMenu.open')}" + data-contextmenu-trigger="click" + data-contextmenu-table="sys_note" + data-contextmenu-uid="{note.uid}" + aria-label="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.contextMenu.open')}" > <core:icon identifier="sysnote-type-{note.category}" /> </button> @@ -49,13 +49,13 @@ <input type="hidden" name="cmd[sys_note][{note.uid}][delete]" value="1" /> <input type="hidden" name="redirect" value="{returnUrl}" /> <button - type="submit" - class="btn btn-default btn-sm t3js-modal-trigger" - title="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:delete')}" - data-severity="warning" - data-title="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:delete')}" - data-bs-content="{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_alt_doc.xlf:deleteWarning')}" - data-button-close-text="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:cancel')}" + type="submit" + class="btn btn-default btn-sm t3js-modal-trigger" + title="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:delete')}" + data-severity="warning" + data-title="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:delete')}" + data-bs-content="{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_alt_doc.xlf:deleteWarning')}" + data-button-close-text="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:cancel')}" > <core:icon identifier="actions-edit-delete" /> </button> diff --git a/typo3/sysext/sys_note/Resources/Private/Templates/Widget/PagesWithInternalNote.html b/typo3/sysext/sys_note/Resources/Private/Templates/Widget/PagesWithInternalNote.html new file mode 100644 index 0000000000000000000000000000000000000000..e40442e1da451efc1d483dc88787f75ba2089c00 --- /dev/null +++ b/typo3/sysext/sys_note/Resources/Private/Templates/Widget/PagesWithInternalNote.html @@ -0,0 +1,46 @@ +<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" + xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers" +> +<f:layout name="Widget/Widget" /> + +<f:section name="main"> + <div class="widget-table-wrapper"> + <table class="table table-striped table-hover widget-table"> + <thead> + <tr> + <th> + <f:if condition="{category}"><core:icon identifier="sysnote-type-{category}" /> </f:if><f:translate key="subjectmessage" extensionName="sys_note" /> + </th> + <th colspan="2"><f:translate key="created" extensionName="sys_note" /></th> + </tr> + </thead> + <tbody> + <f:for each="{sysNotes}" as="sysNote"> + <f:switch expression="{sysNote.category}"> + <f:case value="1"><f:variable name="rowClass" value="info" /></f:case> + <f:case value="2"><f:variable name="rowClass" value="warning" /></f:case> + <f:case value="3"><f:variable name="rowClass" value="notice" /></f:case> + <f:case value="4"><f:variable name="rowClass" value="success" /></f:case> + <f:defaultCase><f:variable name="rowClass" value="" /></f:defaultCase> + </f:switch> + <tr class="{rowClass}"> + <td><strong><f:format.crop maxCharacters="30">{sysNote.subject}</f:format.crop> ({sysNote.pid})</strong><br /><f:format.crop maxCharacters="50">{sysNote.message}</f:format.crop></td> + <td><f:format.date format="{dateFormat} {timeFormat}">{sysNote.crdate}</f:format.date></td> + <td class="text-end"> + <f:be.link class="btn btn-default" route="web_layout" parameters="{id: sysNote.pid}"> + <core:icon identifier="actions-document-view" size="small" /> <f:translate key="goto_page" extensionName="sys_note"/> + </f:be.link> + </td> + </tr> + </f:for> + </tbody> + </table> + </div> + +</f:section> +<f:section name="footer"> + <f:if condition="{button}"> + <a href="{button.link}" target="{button.target}" class="widget-cta">{f:translate(id: button.title, default: button.title)}</a> + </f:if> +</f:section> +</html>