add method documentListRowExtraContent() for showing correspondent

This commit is contained in:
Uwe Steinmann 2024-11-27 17:17:48 +01:00
parent 7bc95887cb
commit c8c5a789ae

View File

@ -79,6 +79,34 @@ class SeedDMS_ExtPaperless_Bootstrap { /* {{{ */
return $menuitems; 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'] .= '<br><span class="badge" style="border: 1px solid black;">'.$docid.'</span>';
else
$extracontent['bottom_title'] = '<br><span class="badge" style="border: 1px solid black;">'.$docid.'</span>';
return $extracontent;
} /* }}} */
} /* }}} */ } /* }}} */
use Psr\Container\ContainerInterface; use Psr\Container\ContainerInterface;