mirror of
https://codeberg.org/SeedDMS/paperless
synced 2025-05-13 05:01:41 +00:00
return only released documents
This commit is contained in:
parent
19b5a670d7
commit
63539d9e07
|
@ -237,7 +237,7 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
|
||||||
$index = $fulltextservice->Indexer();
|
$index = $fulltextservice->Indexer();
|
||||||
if($index) {
|
if($index) {
|
||||||
$lucenesearch = $fulltextservice->Search();
|
$lucenesearch = $fulltextservice->Search();
|
||||||
$searchresult = $lucenesearch->search('', array('record_type'=>['document'], 'user'=>[$userobj->getLogin()], 'startFolder'=>$startfolder, 'rootFolder'=>$startfolder), array('limit'=>20), array());
|
$searchresult = $lucenesearch->search('', array('record_type'=>['document'], 'status'=>[2], 'user'=>[$userobj->getLogin()], 'startFolder'=>$startfolder, 'rootFolder'=>$startfolder), array('limit'=>20), array());
|
||||||
if($searchresult === false) {
|
if($searchresult === false) {
|
||||||
return $response->withStatus(500);
|
return $response->withStatus(500);
|
||||||
} else {
|
} else {
|
||||||
|
@ -311,6 +311,10 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
|
||||||
return $response->withStatus(204);
|
return $response->withStatus(204);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/* FIXME: This method does not take the document status into account
|
||||||
|
* It might be better to create a facet from the correspondant field
|
||||||
|
* instead of calling getStatistics()
|
||||||
|
*/
|
||||||
function correspondents($request, $response) { /* {{{ */
|
function correspondents($request, $response) { /* {{{ */
|
||||||
$dms = $this->container->dms;
|
$dms = $this->container->dms;
|
||||||
$userobj = $this->container->userobj;
|
$userobj = $this->container->userobj;
|
||||||
|
@ -610,7 +614,7 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
|
||||||
$offset = ($page-1)*$limit;
|
$offset = ($page-1)*$limit;
|
||||||
$logger->log('Query is '.$query, PEAR_LOG_DEBUG);
|
$logger->log('Query is '.$query, PEAR_LOG_DEBUG);
|
||||||
$lucenesearch = $fulltextservice->Search();
|
$lucenesearch = $fulltextservice->Search();
|
||||||
$searchresult = $lucenesearch->search($query, array('record_type'=>['document'], 'user'=>[$userobj->getLogin()], 'category'=>$categorynames, 'created_start'=>$astart, 'created_end'=>$aend, 'startFolder'=>$startfolder, 'rootFolder'=>$rootfolder, 'attributes'=>$cattrs), array('limit'=>$limit, 'offset'=>$offset), $order);
|
$searchresult = $lucenesearch->search($query, array('record_type'=>['document'], 'status'=>[2], 'user'=>[$userobj->getLogin()], 'category'=>$categorynames, 'created_start'=>$astart, 'created_end'=>$aend, 'startFolder'=>$startfolder, 'rootFolder'=>$rootfolder, 'attributes'=>$cattrs), array('limit'=>$limit, 'offset'=>$offset), $order);
|
||||||
if($searchresult) {
|
if($searchresult) {
|
||||||
$recs = array();
|
$recs = array();
|
||||||
$facets = $searchresult['facets'];
|
$facets = $searchresult['facets'];
|
||||||
|
@ -720,7 +724,7 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
|
||||||
$index = $fulltextservice->Indexer();
|
$index = $fulltextservice->Indexer();
|
||||||
if($index) {
|
if($index) {
|
||||||
$lucenesearch = $fulltextservice->Search();
|
$lucenesearch = $fulltextservice->Search();
|
||||||
$searchresult = $lucenesearch->search('', array('record_type'=>['document'], 'user'=>[$userobj->getLogin()], 'startFolder'=>$startfolder, 'rootFolder'=>$startfolder), array('limit'=>20), array());
|
$searchresult = $lucenesearch->search('', array('record_type'=>['document'], 'status'=>[2], 'user'=>[$userobj->getLogin()], 'startFolder'=>$startfolder, 'rootFolder'=>$startfolder), array('limit'=>20), array());
|
||||||
if($searchresult === false) {
|
if($searchresult === false) {
|
||||||
return $response->withStatus(500);
|
return $response->withStatus(500);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user