mirror of
https://codeberg.org/SeedDMS/paperless
synced 2025-02-06 06:55:28 +00:00
add method documentListRowExtraContent() for showing correspondent
This commit is contained in:
parent
7bc95887cb
commit
c8c5a789ae
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user