Skip to content
Snippets Groups Projects
Commit 6a3d14fd authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[TASK] SgJobs backend module bugfixing and remove unnecessary scripts

parent 7c42d996
No related branches found
No related tags found
1 merge request!12Feature upgrade to9 lts
......@@ -91,7 +91,11 @@ class BackendService {
// Refresh
$refreshButton = $buttonBar->makeLinkButton()
->setHref(GeneralUtility::getIndpEnv('REQUEST_URI'))
->setTitle(LocalizationUtility::translate('LLL:EXT:lang/locallang_core.xlf:labels.reload', ''))
->setTitle(
LocalizationUtility::translate(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.reload', ''
)
)
->setIcon($iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL));
$buttonBar->addButton($refreshButton, ButtonBar::BUTTON_POSITION_RIGHT);
......
......@@ -27,6 +27,8 @@ namespace SGalinski\SgJobs\ViewHelpers\Backend;
***************************************************************/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList;
......@@ -42,7 +44,7 @@ class ControlViewHelper extends AbstractViewHelper {
public function initializeArguments() {
parent::initializeArguments();
$this->registerArgument('table', 'string', 'The table to control', TRUE);
$this->registerArgument('row', 'array', 'The row of the record', TRUE);
$this->registerArgument('row', 'mixed', 'The row of the record', TRUE);
}
/**
......@@ -63,6 +65,11 @@ class ControlViewHelper extends AbstractViewHelper {
}
$pageInfo = BackendUtility::readPageAccess($row['pid'], $GLOBALS['BE_USER']->getPagePermsClause(1));
$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/AjaxDataHandler');
$pageRenderer->addInlineLanguageLabelFile('EXT:backend/Resources/Private/Language/locallang_alt_doc.xlf');
$languageService = GeneralUtility::makeInstance(LanguageService::class);
$languageService->includeLLFile('EXT:backend/Resources/Private/Language/locallang_alt_doc.xlf');
$databaseRecordList->calcPerms = $GLOBALS['BE_USER']->calcPerms($pageInfo);
return $databaseRecordList->makeControl($table, $row);
}
......
......@@ -188,12 +188,6 @@ return call_user_func(
'minitems' => 1,
'maxitems' => 1,
'size' => 1,
'items' => [
[
'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:' . $table . '.department.none',
0
]
],
'fieldControl' => [
'editPopup' => [
'disabled' => FALSE,
......
{namespace core = TYPO3\CMS\Core\ViewHelpers}
{namespace sg=SGalinski\SgJobs\ViewHelpers}
<f:be.container includeRequireJsModules="{
0: 'TYPO3/CMS/Backend/AjaxDataHandler',
1: 'TYPO3/CMS/Backend/ContextMenu',
2: 'TYPO3/CMS/Backend/Tooltip'
3: 'TYPO3/CMS/SgJobs/Backend'}">
<f:be.container>
<div class="module" data-module-id="" data-module-name="">
<div class="module-docheader t3js-module-docheader">
<div class="module-docheader-bar module-docheader-bar-navigation t3js-module-docheader-bar t3js-module-docheader-bar-navigation">
......
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
define([
'jquery',
'TYPO3/CMS/Backend/ModuleMenu',
'TYPO3/CMS/Backend/Viewport'
], function($, ModuleMenu, Viewport) {
'use strict';
var SgJobs = {
goTo: function(module, id) {
var pageTreeNodes = Viewport.NavigationContainer.PageTree.instance.nodes;
for (var nodeIndex in pageTreeNodes) {
if (pageTreeNodes.hasOwnProperty(nodeIndex) && pageTreeNodes[nodeIndex].identifier === id) {
Viewport.NavigationContainer.PageTree.selectNode(pageTreeNodes[nodeIndex]);
break;
}
}
ModuleMenu.App.showModule(module, 'id=' + id);
},
/**
* Switches to the spefied page in the BE
*
* @param {number} uid
*/
sgJobsGoToPage: function(uid) {
SgJobs.goTo('web_SgJobs', uid);
}
};
/**
* opens the selected category edit form
*
* @return {boolean}
*/
function editSelectedLocation() {
var selected = TYPO3.jQuery('#filter-locations').val();
if (selected && LocationEditLinks[selected[0]]) {
jumpToUrl(LocationEditLinks[selected[0]] + '&returnUrl=' + T3_THIS_LOCATION);
}
return false;
}
function deleteAllListener(_event) {
_event.preventDefault();
var confirm = SG.lang.SgRoutes['backend.delete_all'];
if (window.confirm(confirm)) {
window.location = $(_event.currentTarget).attr('href');
}
}
$(document).ready(function() {
$('.btn-delete-all').on('click', deleteAllListener);
});
});
// functions for backend docheader functionality
function jumpExt(URL, anchor) { //
var anc = anchor ? anchor : "";
window.location.href = URL + (T3_THIS_LOCATION ? "&returnUrl=" + T3_THIS_LOCATION : "") + anc;
return false;
}
function jumpSelf(URL) { //
window.location.href = URL + (T3_RETURN_URL ? "&returnUrl=" + T3_RETURN_URL : "");
return false;
}
function jumpToUrl(URL) {
window.location.href = URL;
return false;
}
function setHighlight(id) { //
top.fsMod.recentIds["web"] = id;
top.fsMod.navFrameHighlightedID["web"] = "pages" + id + "_" + top.fsMod.currentBank; // For highlighting
if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
top.content.nav_frame.refresh_nav();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment