mirror of
https://codeberg.org/SeedDMS/paperless
synced 2024-11-26 07:22:08 +00:00
get correspondents from ->getStatistics()
This commit is contained in:
parent
1121532204
commit
32aed7f3eb
|
@ -300,8 +300,11 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
|
|||
|
||||
$correspondents = array();
|
||||
if(!empty($settings->_extensions['paperless']['correspondentsattr']) && $attrdef = $dms->getAttributeDefinition($settings->_extensions['paperless']['correspondentsattr'])) {
|
||||
$res = $attrdef->getStatistics(30);
|
||||
// print_r($res['frequencies']);
|
||||
$valueset = $attrdef->getValueSetAsArray();
|
||||
foreach($valueset as $id=>$val) {
|
||||
$c = isset($res['frequencies']['document'][md5($val)]) ? $res['frequencies']['document'][md5($val)]['c'] : 0;
|
||||
$correspondents[] = array(
|
||||
'id'=>$id+1,
|
||||
'slug'=>strtolower($val),
|
||||
|
@ -309,7 +312,7 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
|
|||
'match'=>'',
|
||||
'matching_algorithm'=>1,
|
||||
'is_insensitive'=>true,
|
||||
'document_count'=>0,
|
||||
'document_count'=>$c,
|
||||
'last_correspondence'=>null
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user