pass latest content to hooks. Fix php warnings

This commit is contained in:
Uwe Steinmann 2024-03-25 15:17:27 +01:00
parent 37478ecd89
commit fc4d2edb57
2 changed files with 5 additions and 3 deletions

View File

@ -74,6 +74,7 @@ if($view) {
$view->setParam('enableadminrevapp', $settings->_enableAdminRevApp);
$view->setParam('enableownerrevapp', $settings->_enableOwnerRevApp);
$view->setParam('enableselfrevapp', $settings->_enableSelfRevApp);
$view->setParam('enablehiddenrevapp', $settings->_enableHiddenRevApp);
$view->setParam('enablereceiptworkflow', $settings->_enableReceiptWorkflow);
$view->setParam('enableselfreceipt', $settings->_enableSelfReceipt);
$view->setParam('dropfolderdir', $settings->_dropFolderDir);

View File

@ -69,6 +69,7 @@ $(document).ready(function() {
$enableadminrevapp = $this->params['enableadminrevapp'];
$enableownerrevapp = $this->params['enableownerrevapp'];
$enableselfrevapp = $this->params['enableselfrevapp'];
$enablehiddenrevapp = $this->params['enablehiddenrevapp'];
$enablereceiptworkflow = $this->params['enablereceiptworkflow'];
$enableselfreceipt = $this->params['enableselfreceipt'];
$workflowmode = $this->params['workflowmode'];
@ -203,18 +204,18 @@ $(document).ready(function() {
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_all));
if($attrdefs) {
foreach($attrdefs as $attrdef) {
$arr = $this->callHook('editDocumentContentAttribute', $document, $attrdef);
$arr = $this->callHook('editDocumentContentAttribute', $latestContent, $attrdef);
if(is_array($arr)) {
if($arr)
$this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null);
} elseif(is_string($arr)) {
echo $arr;
} else {
$this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, $document->getAttribute($attrdef), 'attributes_version'));
$this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, $latestContent->getAttribute($attrdef), 'attributes_version'));
}
}
}
$arrs = $this->callHook('addDocumentContentAttributes', $document);
$arrs = $this->callHook('addDocumentContentAttributes', $latestContent);
if(is_array($arrs)) {
foreach($arrs as $arr) {
$this->formField($arr[0], $arr[1], isset($arr[2]) ? $arr[2] : null);