Skip to content
Snippets Groups Projects
Commit c47c4b87 authored by Markus Guenther's avatar Markus Guenther
Browse files

[BUGFIX] Fix the edit links to the TCA of the page records

parent db82bfca
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@ use SGalinski\DfTools\Domain\Service\UrlSynchronizeService;
use SGalinski\DfTools\UrlChecker\AbstractService;
use SGalinski\DfTools\Utility\LocalizationUtility;
use SGalinski\DfTools\Utility\PageUtility;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
/**
......@@ -260,6 +261,30 @@ class LinkCheckController extends AbstractController {
public function getViewLinkAction($tableName, $identifier) {
return PageUtility::getViewLinkFromTableNameAndIdPair($tableName, $identifier);
}
/**
* Returns the edit url to the TCA of a table/id pair
*
* @param string $tableName
* @param int $identifier
* @param string $returnUrl
* @return string
*/
public function getEditLinkAction($tableName, $identifier, $returnUrl = '') {
$urlParameters = [
'edit' => [
$tableName => [
$identifier => 'edit'
]
],
];
if ($returnUrl !== '') {
$urlParameters['$returnUrl'] = $returnUrl;
}
return BackendUtility::getModuleUrl('record_edit', $urlParameters);
}
}
?>
\ No newline at end of file
......@@ -37,9 +37,9 @@ class RecordSetDataProvider extends AbstractDataProvider {
* @return array
*/
public function read($data) {
$parameters = array(
$parameters = [
'identity' => intval($data->identity),
);
];
$this->extBaseConnector->setParameters($parameters);
return $this->extBaseConnector->runControllerAction('LinkCheck', 'readRecordSets');
......@@ -53,15 +53,34 @@ class RecordSetDataProvider extends AbstractDataProvider {
* @return string
*/
public function getViewLink($tableName, $identifier) {
$parameters = array(
$parameters = [
'tableName' => $tableName,
'identifier' => $identifier,
);
];
$this->extBaseConnector->setParameters($parameters);
return $this->extBaseConnector->runControllerAction('LinkCheck', 'getViewLink');
}
/**
* Returns the edit link to the TCA of a given table/id pair
*
* @param string $tableName
* @param int $identifier
* @param string $returnUrl
* @return string
*/
public function getEditLink($tableName, $identifier, $returnUrl = '') {
$parameters = [
'tableName' => $tableName,
'identifier' => $identifier,
'returnUrl' => $returnUrl
];
$this->extBaseConnector->setParameters($parameters);
return $this->extBaseConnector->runControllerAction('LinkCheck', 'getEditLink');
}
/**
* Not implemented!
*
......
......@@ -225,11 +225,17 @@ TYPO3.DfTools.LinkCheck.App = Ext.extend(TYPO3.DfTools.AbstractApp, {
* @return {void}
*/
onOpenRecordSet: function(grid, rowIndex) {
var dataSet = grid.getStore().getAt(rowIndex);
var url = 'alt_doc.php?edit[' + dataSet.get('tableName') +
'][' + dataSet.get('identifier') + ']=edit&returnUrl=' +
TYPO3.settings.DfTools.Settings.destroyWindowFile;
window.open(url, 'newTYPO3frontendWindow').focus();
var dataSet = grid.getStore().getAt(rowIndex),
frontendWindow = window.open('', 'newTYPO3frontendWindow');
TYPO3.DfTools.RecordSet.DataProvider.getEditLink(
dataSet.get('tableName'),
dataSet.get('identifier'),
TYPO3.settings.DfTools.Settings.destroyWindowFile,
function(result) {
frontendWindow.location = result;
frontendWindow.focus();
}
);
},
/**
......
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