Browse Source

Change FieldWizard to FieldInformation

pull/576/head
Sebastian Meyer 3 months ago
parent
commit
55592ee7cf
9 changed files with 19 additions and 18 deletions
  1. +1
    -1
      Classes/Hooks/Form/FieldInformation/EditInProductionWarning.php
  2. +9
    -8
      Classes/Hooks/Form/FieldInformation/SolrCoreStatus.php
  3. +1
    -1
      Configuration/TCA/tx_dlf_collections.php
  4. +1
    -1
      Configuration/TCA/tx_dlf_libraries.php
  5. +1
    -1
      Configuration/TCA/tx_dlf_metadata.php
  6. +1
    -1
      Configuration/TCA/tx_dlf_solrcores.php
  7. +1
    -1
      Configuration/TCA/tx_dlf_structures.php
  8. +2
    -2
      Resources/Private/Language/FlashMessages.xml
  9. +2
    -2
      ext_localconf.php

Classes/Hooks/Form/FieldWizard/EditInProductionWarning.php → Classes/Hooks/Form/FieldInformation/EditInProductionWarning.php View File

@@ -16,7 +16,7 @@ use Kitodo\Dlf\Common\Helper;
use TYPO3\CMS\Backend\Form\AbstractNode;

/**
* FieldWizard renderType for TYPO3 FormEngine
* FieldInformation renderType for TYPO3 FormEngine
*
* @author Sebastian Meyer <sebastian.meyer@slub-dresden.de>
* @package TYPO3

Classes/Hooks/Form/FieldWizard/SolrCoreStatus.php → Classes/Hooks/Form/FieldInformation/SolrCoreStatus.php View File

@@ -17,7 +17,7 @@ use Kitodo\Dlf\Common\Solr;
use TYPO3\CMS\Backend\Form\AbstractNode;

/**
* FieldWizard renderType for TYPO3 FormEngine
* FieldInformation renderType for TYPO3 FormEngine
*
* @author Sebastian Meyer <sebastian.meyer@slub-dresden.de>
* @package TYPO3
@@ -49,15 +49,16 @@ class SolrCoreStatus extends AbstractNode
$action = $coreAdminQuery->createStatus();
$action->setCore($core);
$coreAdminQuery->setAction($action);
$result = $solr->service->coreAdmin($coreAdminQuery)->getStatusResult();
$uptime = $result->getUptime();
$numDocuments = $result->getNumberOfDocuments();
$startTime = $result->getStartTime() ? date_format($result->getStartTime(), 'c') : 'N/A';
$lastModified = $result->getLastModified() ? date_format($result->getLastModified(), 'c') : 'N/A';
$response = $solr->service->coreAdmin($coreAdminQuery)->getStatusResult();
$uptimeInSeconds = floor($response->getUptime() / 1000);
$uptime = floor($uptimeInSeconds / 3600) . gmdate(":i:s.", $uptimeInSeconds % 3600) . $response->getUptime() % 1000;
$numDocuments = $response->getNumberOfDocuments();
$startTime = $response->getStartTime() ? date_format($response->getStartTime(), 'c') : 'N/A';
$lastModified = $response->getLastModified() ? date_format($response->getLastModified(), 'c') : 'N/A';
// Create flash message.
Helper::addMessage(
nl2br(htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.coreStatusDetails'), $startTime, $uptime, $lastModified, $numDocuments))),
htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.coreStatus'), $core)),
htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.coreStatusDetails'), $startTime, $uptime, $lastModified, $numDocuments)),
htmlspecialchars($GLOBALS['LANG']->getLL('flash.coreStatus')),
\TYPO3\CMS\Core\Messaging\FlashMessage::INFO
);
} else {

+ 1
- 1
Configuration/TCA/tx_dlf_collections.php View File

@@ -125,7 +125,7 @@ return [
'max' => 255,
'eval' => 'required,uniqueInPid',
'default' => '',
'fieldWizard' => [
'fieldInformation' => [
'editInProductionWarning' => [
'renderType' => 'editInProductionWarning',
],


+ 1
- 1
Configuration/TCA/tx_dlf_libraries.php View File

@@ -89,7 +89,7 @@ return [
'max' => 255,
'eval' => 'required,uniqueInPid',
'default' => '',
'fieldWizard' => [
'fieldInformation' => [
'editInProductionWarning' => [
'renderType' => 'editInProductionWarning',
],


+ 1
- 1
Configuration/TCA/tx_dlf_metadata.php View File

@@ -101,7 +101,7 @@ return [
'max' => 255,
'eval' => 'required,nospace,alphanum_x,uniqueInPid',
'default' => '',
'fieldWizard' => [
'fieldInformation' => [
'editInProductionWarning' => [
'renderType' => 'editInProductionWarning',
],


+ 1
- 1
Configuration/TCA/tx_dlf_solrcores.php View File

@@ -50,7 +50,7 @@ return [
'eval' => 'alphanum,nospace,required,unique',
'default' => '',
'readOnly' => true,
'fieldWizard' => [
'fieldInformation' => [
'solrCoreStatus' => [
'renderType' => 'solrCoreStatus',
],


+ 1
- 1
Configuration/TCA/tx_dlf_structures.php View File

@@ -111,7 +111,7 @@ return [
'max' => 255,
'eval' => 'required,nospace,alphanum_x,uniqueInPid',
'default' => '',
'fieldWizard' => [
'fieldInformation' => [
'editInProductionWarning' => [
'renderType' => 'editInProductionWarning',
],


+ 2
- 2
Resources/Private/Language/FlashMessages.xml View File

@@ -19,7 +19,7 @@
<label index="flash.done">Done!</label>
<label index="flash.warning">Warning!</label>
<label index="flash.error">Error!</label>
<label index="flash.coreStatus">Status of Solr Core "%s"</label>
<label index="flash.coreStatus">Status of Solr Core</label>
<label index="flash.coreStatusDetails">Start Time: %s\nUptime: %s\nLast Modified: %s\nNumber of Documents: %s</label>
<label index="flash.running">Please wait...</label>
<label index="flash.newCollection">New collection "%s" [%u] added to database.</label>
@@ -94,7 +94,7 @@
<label index="flash.done">Fertig!</label>
<label index="flash.warning">Warnung!</label>
<label index="flash.error">Fehler!</label>
<label index="flash.coreStatus">Status des Solr-Kerns "%s"</label>
<label index="flash.coreStatus">Status des Solr-Kerns</label>
<label index="flash.coreStatusDetails">Start Time: %s\nUptime: %s\nLast Modified: %s\nNumber of Documents: %s</label>
<label index="flash.running">Indexierung läuft...</label>
<label index="flash.newCollection">Neue Sammlung "%s" [%u] zur Datenbank hinzugefügt.</label>


+ 2
- 2
ext_localconf.php View File

@@ -254,10 +254,10 @@ if (\TYPO3_MODE === 'FE') {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][] = [
'nodeName' => 'editInProductionWarning',
'priority' => 30,
'class' => \Kitodo\Dlf\Hooks\Form\FieldWizard\EditInProductionWarning::class
'class' => \Kitodo\Dlf\Hooks\Form\FieldInformation\EditInProductionWarning::class
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][] = [
'nodeName' => 'solrCoreStatus',
'priority' => 30,
'class' => \Kitodo\Dlf\Hooks\Form\FieldWizard\SolrCoreStatus::class
'class' => \Kitodo\Dlf\Hooks\Form\FieldInformation\SolrCoreStatus::class
];

Loading…
Cancel
Save