[TASK] Sys_note: Bring headline & delete action icon 80/32980/5
authorFelix Kopp <felix-source@phorax.com>
Thu, 25 Sep 2014 22:15:31 +0000 (00:15 +0200)
committerMarkus Klein <klein.t3@reelworx.at>
Sun, 26 Oct 2014 18:48:09 +0000 (19:48 +0100)
To finalze the rebrush of sys notes a section headline is added:
The delete action can be accessed right from the note.

Resolves: #26796
Releases: master
Change-Id: I80923ee523d21880d877a0e1cc9cc2f355f59b3a
Reviewed-on: http://review.typo3.org/32980
Reviewed-by: Felix Kopp <felix-source@phorax.com>
Tested-by: Felix Kopp <felix-source@phorax.com>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/sys_note/Classes/ViewHelpers/DeleteLinkViewHelper.php [new file with mode: 0644]
typo3/sysext/sys_note/Resources/Private/Language/locallang.xlf
typo3/sysext/sys_note/Resources/Private/Templates/Note/List.html
typo3/sysext/t3skin/Resources/Private/Styles/TYPO3/_module_web_list_sysnote.less
typo3/sysext/t3skin/Resources/Public/Css/visual/t3kin.css

diff --git a/typo3/sysext/sys_note/Classes/ViewHelpers/DeleteLinkViewHelper.php b/typo3/sysext/sys_note/Classes/ViewHelpers/DeleteLinkViewHelper.php
new file mode 100644 (file)
index 0000000..575567c
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+namespace TYPO3\CMS\SysNote\ViewHelpers;
+
+/**
+ * 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!
+ */
+
+/**
+ * ViewHelper to create a link to delete a note
+ */
+class DeleteLinkViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
+
+       /**
+        * Create link to delete a note
+        *
+        * @param integer $id uid of the note
+        * @return string link
+        */
+       public function render($id) {
+               $redirectUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI');
+               $parameters = 'cmd[sys_note][' . $id . '][delete]=1';
+               $url = $GLOBALS['BACK_PATH'] . 'tce_db.php?&' . $parameters . '&redirect=' . ($redirectUrl == '' ? '\' + T3_THIS_LOCATION + \'' : rawurlencode($redirectUrl)) . \TYPO3\CMS\Backend\Utility\BackendUtility::getUrlToken('tceAction');
+               return $url;
+       }
+
+}
\ No newline at end of file
index 1d96f7a..2f0bc16 100644 (file)
@@ -3,6 +3,9 @@
        <file source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:37Z" product-name="sys_note">
                <header/>
                <body>
+                       <trans-unit id="internal_note" xml:space="preserve">
+                               <source>Internal notes</source>
+                       </trans-unit>
                        <trans-unit id="author" xml:space="preserve">
                                <source>Author:</source>
                        </trans-unit>
index 6d26409..9a36e06 100644 (file)
@@ -4,6 +4,7 @@
 
 <f:section name="Content">
        <f:if condition="{notes}">
+               <h2><f:translate key="internal_note" /></h2>
 
                <div id="typo3-dblist-sysnotes">
                        <f:for each="{notes}" as="note">
@@ -27,6 +28,7 @@
                                                </f:if>
 
                                                <div class="right icons">
+                                                       <f:be.buttons.icon uri="{notes:deleteLink(id:note.uid)}" icon="actions-edit-delete" additionalAttributes="{onClick: 'return confirm(\'{f:translate(key: \'LLL:EXT:lang/locallang_alt_doc.xlf:deleteWarning\')}\');'}" />
                                                        <f:be.buttons.icon uri="{notes:editLink(id:note.uid)}" icon="actions-document-open" />
                                                </div>
                                        </div>
index 17315f4..2738bac 100644 (file)
@@ -43,7 +43,6 @@ Sys notes
                        }
                        .right {
                                float: right;
-                               margin-top: -3px;
                                margin-right: 5px;
                        }
                        span {
index c5b3989..27339bd 100644 (file)
@@ -11005,7 +11005,6 @@ Sys notes
 }
 #typo3-dblist-sysnotes .single-note .header .right {
   float: right;
-  margin-top: -3px;
   margin-right: 5px;
 }
 #typo3-dblist-sysnotes .single-note .header span {