From c8c5a789aeaf13e5c424e7d032cbb4ccf60fef4d Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 27 Nov 2024 17:17:48 +0100 Subject: [PATCH] add method documentListRowExtraContent() for showing correspondent --- class.paperless.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/class.paperless.php b/class.paperless.php index 5fb860a..c5410f8 100644 --- a/class.paperless.php +++ b/class.paperless.php @@ -79,6 +79,34 @@ class SeedDMS_ExtPaperless_Bootstrap { /* {{{ */ return $menuitems; } /* }}} */ + /** + * Show the document in a list of documents + */ + public function documentListRowExtraContent($view, $document, $content) { /* {{{ */ + $dms = $view->getParam('dms'); + $user = $view->getParam('user'); + $settings = $view->getParam('settings'); + + $conf = $settings->_extensions['paperless']; + + /* Check if target attribute is configured */ + if(empty($conf['correspondentsattr'])) + return null; + + /* Check if target attribute defintion exists */ + $docidattrid = (int) $conf['correspondentsattr']; + if(!($docidattrdef = $dms->getAttributeDefinition($docidattrid))) + return null; + + $docid = $document->getAttributeValue($docidattrdef); + if(isset($extracontent['bottom_title'])) + $extracontent['bottom_title'] .= '
'.$docid.''; + else + $extracontent['bottom_title'] = '
'.$docid.''; + + return $extracontent; + } /* }}} */ + } /* }}} */ use Psr\Container\ContainerInterface;