From 0d0fc4e50a38725a7c7a17f081759c61dc655cbf Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sun, 28 Apr 2024 19:38:10 +0200 Subject: [PATCH] check for documents with a link to themselves --- out/out.ObjectCheck.php | 5 +++++ views/bootstrap/class.ObjectCheck.php | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/out/out.ObjectCheck.php b/out/out.ObjectCheck.php index 6011492a5..e133cb017 100644 --- a/out/out.ObjectCheck.php +++ b/out/out.ObjectCheck.php @@ -102,6 +102,10 @@ if(!isset($_GET['action']) || $_GET['action'] == 'listDuplicateSequence') $duplicatesequences = $dms->getDuplicateSequenceNo(); else $duplicatesequences = null; +if(!isset($_GET['action']) || $_GET['action'] == 'listLinkToItself') + $docslinktoitself = $dms->getLinksToItself(); +else + $docslinktoitself = null; $processwithoutusergroup = array(); foreach(array('review', 'approval', 'receipt', 'revision') as $process) { foreach(array('user', 'group') as $ug) { @@ -256,6 +260,7 @@ if($view) { $view->setParam('wrongfiletypeversions', $wrongfiletypeversions); $view->setParam('duplicateversions', $duplicateversions); $view->setParam('duplicatesequences', $duplicatesequences); + $view->setParam('docslinktoitself', $docslinktoitself); $view->setParam('docsinrevisionnoaccess', $docsinrevisionnoaccess); $view->setParam('docsinrevisiondisabled', $docsinrevisiondisabled); $view->setParam('docsmissingrevsiondate', $docsmissingrevsiondate); diff --git a/views/bootstrap/class.ObjectCheck.php b/views/bootstrap/class.ObjectCheck.php index d43496816..4491c45bd 100644 --- a/views/bootstrap/class.ObjectCheck.php +++ b/views/bootstrap/class.ObjectCheck.php @@ -470,6 +470,30 @@ class SeedDMS_View_ObjectCheck extends SeedDMS_Theme_Style { } } /* }}} */ + function listLinkToItself() { /* {{{ */ + $dms = $this->params['dms']; + $user = $this->params['user']; + $folder = $this->params['folder']; + $docslinktoitself = $this->params['docslinktoitself']; + $conversionmgr = $this->params['conversionmgr']; + $cachedir = $this->params['cachedir']; + $previewwidth = $this->params['previewWidthList']; + $previewconverters = $this->params['previewConverters']; + $timeout = $this->params['timeout']; + + $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); + + $this->contentHeading(getMLText("docs_with_link_to_itself")); + + if($docslinktoitself) { + $this->printList($docslinktoitself, $previewer); + } + } /* }}} */ + function listDocsInRevisionNoAccess() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; @@ -722,6 +746,7 @@ $(document).ready( function() { $nochecksumversions = $this->params['nochecksumversions']; $duplicateversions = $this->params['duplicateversions']; $duplicatesequences = $this->params['duplicatesequences']; + $docslinktoitself = $this->params['docslinktoitself']; $docsinrevisionnoaccess = $this->params['docsinrevisionnoaccess']; $docsinrevisiondisabled = $this->params['docsinrevisiondisabled']; $docsinreceptionnoaccess = $this->params['docsinreceptionnoaccess']; @@ -759,6 +784,7 @@ $(document).ready( function() { $menuitems = []; $menuitems[] = array('label'=>getMLText('duplicate_content'), 'badge'=>count($duplicateversions), 'attributes'=>array(array('data-href', "#duplicate_content"), array('data-action', "listDuplicateContent"))); $menuitems[] = array('label'=>getMLText('duplicate_sequences'), 'badge'=>count($duplicatesequences), 'attributes'=>array(array('data-href', "#duplicate_sequences"), array('data-action', "listDuplicateSequence"))); + $menuitems[] = array('label'=>getMLText('link_to_itself'), 'badge'=>count($docslinktoitself), 'attributes'=>array(array('data-href', "#link_to_itself"), array('data-action', "listLinkToItself"))); $menuitems[] = array('label'=>getMLText('docs_in_revision_no_access'), 'badge'=>count($docsinrevisionnoaccess), 'attributes'=>array(array('data-href', "#inrevision_no_access"), array('data-action', "listDocsInRevisionNoAccess"))); $menuitems[] = array('label'=>getMLText('docs_in_revision_disabled'), 'badge'=>count($docsinrevisiondisabled), 'attributes'=>array(array('data-href', "#inrevision_disabled"), array('data-action', "listDocsInRevisionDisabled"))); $menuitems[] = array('label'=>getMLText('docs_in_reception_no_access'), 'badge'=>count($docsinreceptionnoaccess), 'attributes'=>array(array('data-href', "#inreception_no_access"), array('data-action', "listDocsInReceptionNoAccess")));