remove old code, fix link to MyDocuments

This commit is contained in:
Uwe Steinmann 2021-04-19 19:49:24 +02:00
parent 6484094809
commit c559afd97c

View File

@ -159,10 +159,6 @@ class SeedDMS_View_Tasks extends SeedDMS_Theme_Style {
$menuitems = [];
$content = '';
$content .= " <ul id=\"main-menu-tasks\" class=\"nav pull-right\">\n";
$content .= " <li class=\"dropdown\">\n";
$content .= " <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">".getMLText('tasks')." (";
$ct = array();
if(isset($tasks['review']))
$ct[] = count($tasks['review']);
@ -172,82 +168,48 @@ class SeedDMS_View_Tasks extends SeedDMS_Theme_Style {
$ct[] = count($tasks['workflow']);
if(isset($tasks['rejected']))
$ct[] = count($tasks['rejected']);
$content .= implode('/', $ct);
$content .= ")";
$menuitems['tasks'] = array('label'=>getMLText('tasks')." (".implode('/', $ct).")");
$menuitems['tasks']['children'] = [];
if(!empty($tasks['review']) || !empty($tasks['approval']) || !empty($tasks['workflow'])) {
$content .= " <i class=\"fa fa-caret-down\"></i></a>\n";
$content .= " <ul class=\"dropdown-menu\" role=\"menu\">\n";
if(!empty($tasks['review'])) {
$content .= " <li class=\"dropdown-submenu\">\n";
$content .= " <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">".getMLText("documents_to_review")."</a>\n";
$content .= " <ul class=\"dropdown-menu\" role=\"menu\">\n";
$subitems = [];
foreach($tasks['review'] as $t) {
$doc = $dms->getDocument($t['id']);
$content .= " <li><a href=\"../out/out.ViewDocument.php?documentid=".$doc->getID()."&currenttab=revapp\" class=\"table-row-document\" rel=\"document_".$doc->getID()."\">".$doc->getName()."</a></li>";
$subitems[] = array('label'=>$doc->getName(), 'link'=>"../out/out.ViewDocument.php?documentid=".$doc->getID()."&currenttab=revapp", 'class'=>"table-row-document", 'rel'=>"document_".$doc->getID());
}
$menuitems['tasks']['children']['review'] = array('label'=>getMLText('documents_to_review'), 'children'=>$subitems);
$content .= " </ul>\n";
$content .= " </li>\n";
}
if(!empty($tasks['approval'])) {
$content .= " <li class=\"dropdown-submenu\">\n";
$content .= " <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">".getMLText("documents_to_approve")."</a>\n";
$content .= " <ul class=\"dropdown-menu\" role=\"menu\">\n";
$subitems = [];
foreach($tasks['approval'] as $t) {
$doc = $dms->getDocument($t['id']);
$content .= " <li><a href=\"../out/out.ViewDocument.php?documentid=".$doc->getID()."&currenttab=revapp\" class=\"table-row-document\" rel=\"document_".$doc->getID()."\">".$doc->getName()."</a></li>";
$subitems[] = array('label'=>$doc->getName(), 'link'=>"../out/out.ViewDocument.php?documentid=".$doc->getID()."&currenttab=revapp", 'class'=>"table-row-document", 'rel'=>"document_".$doc->getID());
}
$menuitems['tasks']['children']['approval'] = array('label'=>getMLText('documents_to_approve'), 'children'=>$subitems);
$content .= " </ul>\n";
$content .= " </li>\n";
}
if(!empty($tasks['workflow'])) {
$content .= " <li class=\"dropdown-submenu\">\n";
$content .= " <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">".getMLText("documents_to_trigger_workflow")."</a>\n";
$content .= " <ul class=\"dropdown-menu\" role=\"menu\">\n";
$subitems = [];
foreach($tasks['workflow'] as $t) {
$doc = $dms->getDocument($t['id']);
$content .= " <li><a href=\"../out/out.ViewDocument.php?documentid=".$doc->getID()."&currenttab=workflow\" class=\"table-row-document\" rel=\"document_".$doc->getID()."\">".$doc->getName()."</a></li>";
$subitems[] = array('label'=>$doc->getName(), 'link'=>"../out/out.ViewDocument.php?documentid=".$doc->getID()."&currenttab=workflow", 'class'=>"table-row-document", 'rel'=>"document_".$doc->getID());
}
$menuitems['tasks']['children']['workflow'] = array('label'=>getMLText('documents_to_trigger_workflow'), 'children'=>$subitems);
$content .= " </ul>\n";
$content .= " </li>\n";
}
if(!empty($tasks['rejected'])) {
$content .= " <li class=\"dropdown-submenu\">\n";
$content .= " <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">".getMLText("documents_rejected")."</a>\n";
$content .= " <ul class=\"dropdown-menu\" role=\"menu\">\n";
$subitems = [];
foreach($tasks['rejected'] as $t) {
$doc = $dms->getDocument($t['id']);
$content .= " <li><a href=\"../out/out.ViewDocument.php?documentid=".$doc->getID()."&currenttab=docinfo\" class=\"table-row-document\" rel=\"document_".$doc->getID()."\">".$doc->getName()."</a></li>";
$subitems[] = array('label'=>$doc->getName(), 'link'=>"../out/out.ViewDocument.php?documentid=".$doc->getID()."&currenttab=docinfo", 'class'=>"table-row-document", 'rel'=>"document_".$doc->getID());
}
$menuitems['tasks']['children']['rejected'] = array('label'=>getMLText('documents_rejected'), 'children'=>$subitems);
$content .= " </ul>\n";
$content .= " </li>\n";
}
$content .= " <li class=\"divider\"></li>\n";
$content .= " <li><a href=\"../out/out.MyDocuments.php\">".getMLText("my_documents")."</a></li>\n";
$content .= " </ul>\n";
$menuitems['tasks']['children']['divider'] = array('divider'=>true);
$menuitems['tasks']['children']['mydocuments'] = array('label'=>getMLText('my_documents'), 'href'=>'../out/out.MyDocuments.php');
$menuitems['tasks']['children']['mydocuments'] = array('label'=>getMLText('my_documents'), 'link'=>'../out/out.MyDocuments.php');
}
$content .= " </li>\n";
$content .= " </ul>\n";
self::showNavigationBar($menuitems, array('right'=>true));
//echo $content;
} /* }}} */
/**