From 159aa0963679e6b50dd952c25afdff3c599ea6d8 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 22 Sep 2016 08:48:09 +0200 Subject: [PATCH] dump acos, aros --- utils/xmldump.php | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/utils/xmldump.php b/utils/xmldump.php index 324e430af..f35fe092f 100644 --- a/utils/xmldump.php +++ b/utils/xmldump.php @@ -1,5 +1,6 @@ getDBVersion(), 1, 3))." /* Dump roles {{{ */ if(!$sections || in_array('roles', $sections)) { + /** + * Show tree of acos + * + */ + function aco_tree($aro=null, $aco=null, $indent='') { /* {{{ */ + $tchildren = $aco->getChildren(); + $html = ''; + if($tchildren) { + foreach($tchildren as $child) { + if($child->getPermission($aro)) { + $html .= $indent."getID()."\" alias=\"".$child->getAlias()."\">\n"; + $html .= $indent." ".((int) $child->getPermission($aro))."\n"; + //$html .= $indent." ".$child->getAlias()."\n"; + //$html .= $indent." ".($aro ? $aro->getID() : 0)."\n"; + if($thtml = aco_tree($aro, $child, $indent.' ')) { + $html .= $thtml; + } + $html .= $indent."\n"; + } else { + if($thtml = aco_tree($aro, $child, $indent.' ')) { + $html .= $indent."getID()."\" alias=\"".$child->getAlias()."\">\n"; + //$html .= $indent." ".$child->getAlias()."\n"; + $html .= $thtml; + $html .= $indent."\n"; + } + } + } + } + return $html; + } /* }}} */ + $roles = $dms->getAllRoles(); if($roles) { echo "\n"; @@ -490,6 +522,22 @@ if($roles) { echo " ".wrapWithCData($role->getName())."\n"; echo " ".$role->getRole()."\n"; echo " ".implode(',', $role->getNoAccess())."\n"; + $aro = SeedDMS_Aro::getInstance($role, $dms); + if($acos = SeedDMS_Aco::getRoot($dms)) { + foreach($acos as $aco) { + echo " getID()."\" alias=\"".$aco->getAlias()."\">\n"; + if($aco->getPermission($aro)) { + echo " ".((int) $aco->getPermission($aro))."\n"; +// echo " ".$aco->getAlias()."\n"; +// echo " ".($aro ? $aro->getID() : 0)."\n"; + } else { +// echo " ".$aco->getAlias()."\n"; + } + if($html = aco_tree($aro, $aco, ' ')) + echo $html; + echo " \n"; + } + } echo " \n"; $statistic['roles']++; } @@ -746,6 +794,7 @@ if($folder) { /* }}} */ /* Dump transmittals {{{ */ +if(!$sections || in_array('transmittals', $sections)) { $transmittals = $dms->getAllTransmittals(); if($transmittals) { echo "\n"; @@ -771,6 +820,7 @@ if($transmittals) { } echo "\n"; } +} /* }}} */ /* Dump statistics {{{ */