[TASK] Remove alerts of locked records 87/51387/2
authorGeorg Ringer <georg.ringer@gmail.com>
Sun, 22 Jan 2017 20:36:30 +0000 (21:36 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Sat, 28 Jan 2017 18:30:01 +0000 (19:30 +0100)
Use tooltips instead of ancient JavaScript alerts for locked
records.

Resolves: #79422
Releases: master
Change-Id: Ia9911f8eaad1c55c2af14e366af13e0e9b7b21df
Reviewed-on: https://review.typo3.org/51387
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index 3981ba4..bb36e26 100644 (file)
@@ -550,7 +550,7 @@ class InlineRecordContainer extends AbstractContainer
         // If the record is edit-locked by another user, we will show a little warning sign:
         if ($lockInfo = BackendUtility::isRecordLocked($foreignTable, $rec['uid'])) {
             $cells['locked'] = '
-                               <a class="btn btn-default" href="#" onclick="alert(' . GeneralUtility::quoteJSvalue($lockInfo['msg']) . ');return false;">
+                               <a class="btn btn-default" href="#" data-toggle="tooltip" data-title="' . htmlspecialchars($lockInfo['msg']) . '">
                                        ' . '<span title="' . htmlspecialchars($lockInfo['msg']) . '">' . $this->iconFactory->getIcon('status-warning-in-use', Icon::SIZE_SMALL)->render() . '</span>' . '
                                </a>';
         }
index fbd001c..0afc3cc 100644 (file)
@@ -1600,8 +1600,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         $additionalIcons[] = $langMode ? $this->languageFlag($row['sys_language_uid'], false) : '';
         // Get record locking status:
         if ($lockInfo = BackendUtility::isRecordLocked('tt_content', $row['uid'])) {
-            $additionalIcons[] = '<a href="#" onclick="alert(' . GeneralUtility::quoteJSvalue($lockInfo['msg'])
-                . ');return false;" title="' . htmlspecialchars($lockInfo['msg']) . '">'
+            $additionalIcons[] = '<a href="#" data-toggle="tooltip" data-title="' . htmlspecialchars($lockInfo['msg']) . '">'
                 . $this->iconFactory->getIcon('status-warning-in-use', Icon::SIZE_SMALL)->render() . '</a>';
         }
         // Call stats information hook
index c06a071..0d18ece 100644 (file)
@@ -921,10 +921,8 @@ class DatabaseRecordList extends AbstractDatabaseRecordList
                 // If the record is edit-locked        by another user, we will show a little warning sign:
                 $lockInfo = BackendUtility::isRecordLocked($table, $row['uid']);
                 if ($lockInfo) {
-                    $warning = '<a href="#" onclick="alert('
-                        . GeneralUtility::quoteJSvalue($lockInfo['msg']) . '); return false;" title="'
-                        . htmlspecialchars($lockInfo['msg']) . '">'
-                        . $this->iconFactory->getIcon('status-warning-in-use', Icon::SIZE_SMALL)->render() . '</a>';
+                    $warning = '<span data-toggle="tooltip" data-placement="right" data-title="' . htmlspecialchars($lockInfo['msg']) . '">'
+                        . $this->iconFactory->getIcon('status-warning-in-use', Icon::SIZE_SMALL)->render() . '</span>';
                 }
                 $theData[$fCol] = $theData['__label'] = $warning . $this->linkWrapItems($table, $row['uid'], $recTitle, $row);
                 // Render thumbnails, if: