Beispiel #1
0
 /**
  * action index
  *
  * @return void
  */
 public function indexAction()
 {
     $allConfigs = \Sng\Recordsmanager\Utility\Config::getAllConfigs(0);
     if (empty($allConfigs)) {
         return null;
     }
     $this->currentConfig = $allConfigs[0];
     $this->setCurrentConfig();
     $query = $this->buildQuery();
     $query->execQuery();
     $this->view->assign('headers', $query->getHeaders());
     $this->view->assign('rows', $query->getRows());
     $this->view->assign('currentconfig', $this->currentConfig);
     $this->view->assign('arguments', $this->request->getArguments());
     $this->view->assign('menuitems', $allConfigs);
     $this->view->assign('returnurl', rawurlencode($this->getReturnUrl()));
     $this->view->assign('deleteurl', $this->getDeleteUrl());
     $this->view->assign('baseediturl', $this->getBaseEditUrl());
     $this->view->assign('disableFields', implode(',', \tx_recordsmanager_flexfill::getDiffFieldsFromTable($this->currentConfig['sqltable'], $this->currentConfig['sqlfieldsinsert'])));
 }
 /**
  * Redirect to the insert form with correct params
  *
  * @param int $id
  */
 public function redirectToForm($id)
 {
     $arguments = $this->request->getArguments();
     $returnUrl = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('txrecordsmanagerM1_RecordsmanagerInsert');
     if (!empty($arguments['menuitem'])) {
         $returnUrl .= '&tx_recordsmanager_txrecordsmanagerm1_recordsmanagerinsert[menuitem]=' . $arguments['menuitem'];
     }
     if (version_compare(TYPO3_version, '7.0.0', '>=')) {
         $editLink = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('record_edit') . '&returnUrl=' . rawurlencode($returnUrl) . '&edit[' . $this->currentConfig['sqltable'] . '][' . $id . ']=new';
     } else {
         $editLink = 'alt_doc.php?returnUrl=' . rawurlencode($returnUrl) . '&edit[' . $this->currentConfig['sqltable'] . '][' . $id . ']=new';
     }
     // disabledFields
     $this->disableFields = implode(',', \tx_recordsmanager_flexfill::getDiffFieldsFromTable($this->currentConfig['sqltable'], $this->currentConfig['sqlfieldsinsert']));
     if ($this->currentConfig['sqlfieldsinsert'] !== '') {
         $editLink .= '&recordsHide=' . $this->disableFields;
     }
     \TYPO3\CMS\Core\Utility\HttpUtility::redirect($editLink);
 }