Merged in HOR-3700-DC (pull request #5994)

HOR-3700

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
David Callizaya
2017-08-21 15:18:38 +00:00
committed by Julio Cesar Laura Avendaño
17 changed files with 164 additions and 285 deletions

View File

@@ -1,38 +1,10 @@
<?php <?php
/**
* class.tree.php
*
* @package gulliver.system
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* <20>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/** /**
* *
* @package gulliver.system * @package gulliver.system
*/ */
class PmTree extends Xml_Node
class Tree extends Xml_Node
{ {
public $template = 'tree.html'; public $template = 'tree.html';
@@ -55,7 +27,7 @@ class Tree extends Xml_Node
* *
* @return none * @return none
*/ */
public function Tree($xmlnode = null) public function PmTree($xmlnode = null)
{ {
if (!isset($xmlnode)) { if (!isset($xmlnode)) {
return; return;
@@ -66,7 +38,7 @@ class Tree extends Xml_Node
foreach ($xmlnode as $key => $value) { foreach ($xmlnode as $key => $value) {
if ($key === 'children') { if ($key === 'children') {
foreach ($xmlnode->children as $key => $value) { foreach ($xmlnode->children as $key => $value) {
$this->children[$key] = new Tree($value->toTree()); $this->children[$key] = new PmTree($value->toTree());
} }
} elseif ($key === 'attributes') { } elseif ($key === 'attributes') {
foreach ($xmlnode->attributes as $key => $value) { foreach ($xmlnode->attributes as $key => $value) {
@@ -89,7 +61,7 @@ class Tree extends Xml_Node
*/ */
public function &addChild($name, $label, $attributes = array()) public function &addChild($name, $label, $attributes = array())
{ {
$newNode = new Tree(new Xml_Node($name, 'open', $label, $attributes)); $newNode = new PmTree(new Xml_Node($name, 'open', $label, $attributes));
$this->children[] = & $newNode; $this->children[] = & $newNode;
return $newNode; return $newNode;
} }
@@ -156,4 +128,3 @@ class Tree extends Xml_Node
return $obj->printObject(array('node' => &$this)); return $obj->printObject(array('node' => &$this));
} }
} }

View File

@@ -745,7 +745,7 @@ function openPMFolder()
exit (); exit ();
} }
$tree = new Tree (); $tree = new PmTree ();
$tree->name = 'DMS'; $tree->name = 'DMS';
$tree->nodeType = "blank"; $tree->nodeType = "blank";

View File

@@ -32,7 +32,7 @@ $c->add(AppThreadPeer::APP_UID, $APP_UID );
$c->add(AppThreadPeer::APP_THREAD_STATUS , 'OPEN' ); $c->add(AppThreadPeer::APP_THREAD_STATUS , 'OPEN' );
$cant = AppThreadPeer::doCount($c); $cant = AppThreadPeer::doCount($c);
$oTree = new Tree(); $oTree = new PmTree();
$oTree->nodeType = "blank"; $oTree->nodeType = "blank";
$oTree->name = 'Actions'; $oTree->name = 'Actions';
$oTree->showSign = false; $oTree->showSign = false;

View File

@@ -23,7 +23,7 @@
* *
*/ */
$oTree = new Tree(); $oTree = new PmTree();
$oTree->nodeType ="blank"; $oTree->nodeType ="blank";
$oTree->name = 'Information'; $oTree->name = 'Information';
$oTree->showSign = false; $oTree->showSign = false;

View File

@@ -23,7 +23,7 @@
* *
*/ */
$oTree = new Tree(); $oTree = new PmTree();
$oTree->name = 'KT'; $oTree->name = 'KT';
$oTree->showSign = false; $oTree->showSign = false;

View File

@@ -33,7 +33,7 @@ use ProcessMaker\Plugins\PluginRegistry;
$oPluginRegistry = PluginRegistry::loadSingleton(); $oPluginRegistry = PluginRegistry::loadSingleton();
$externalSteps = $oPluginRegistry->getSteps(); $externalSteps = $oPluginRegistry->getSteps();
$oTree = new Tree(); $oTree = new PmTree();
$oTree->nodeType = "blank"; $oTree->nodeType = "blank";
$oTree->name = 'Steps'; $oTree->name = 'Steps';
$oTree->showSign = false; $oTree->showSign = false;

View File

@@ -23,7 +23,7 @@
* *
*/ */
$tree = new Tree(); $tree = new PmTree();
$tree->name = 'Groups'; $tree->name = 'Groups';
$tree->nodeType = "base"; $tree->nodeType = "base";
$tree->width = "200px"; $tree->width = "200px";

View File

@@ -1,78 +1,47 @@
<?php <?php
/**
* groups_Tree.php $ROL_UID = $_GET['ROL_UID'];
* global $RBAC;
* ProcessMaker Open Source Edition $oDataset = $RBAC->getAllPermissions($ROL_UID, $RBAC->sSystem);
* Copyright (C) 2004 - 2008 Colosa Inc.23 $roleCode = $RBAC->getRoleCode($ROL_UID);
*
* This program is free software: you can redistribute it and/or modify $tree = new PmTree();
* it under the terms of the GNU Affero General Public License as $tree->name = 'Users';
* published by the Free Software Foundation, either version 3 of the $tree->nodeType = "base";
* License, or (at your option) any later version. $tree->width = "350px";
* $tree->value = '
* This program is distributed in the hope that it will be useful, <div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
* but WITHOUT ANY WARRANTY; without even the implied warranty of <div class="boxContentBlue">
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the <table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
* GNU Affero General Public License for more details. <tr>
* <td class="userGroupTitle">' . G::LoadTranslation('ID_ASSIGN_THE_ROLE') . ': '.$roleCode.'</td>
* You should have received a copy of the GNU Affero General Public License </tr>
* along with this program. If not, see <http://www.gnu.org/licenses/>. </table>
* </div>
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., <div class="boxBottomBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
* Coral Gables, FL, 33134, USA, or email info@colosa.com. <div class="userGroupLink"><a href="#" onclick="backPermissions(\''.$_GET['ROL_UID'].'\');return false;">' . G::LoadTranslation('ID_BACK_PERMISSIONS_LIST').'</a></div>';
*
*/ $tree->showSign = false;
/** $oDataset->next();
* @Description This is the View of all groups from a determinated user while ($aRow = $oDataset->getRow()) {
* @author Erik Amaru Ortiz <erik@colosa.com> $ID_ASSIGN = G::LoadTranslation('ID_ASSIGN');
* @Date 24/04/2008
* @LastModification none $CODE = $aRow['PER_CODE'];
*/ $UID = $aRow['PER_UID'];
$ROL_UID = $_GET['ROL_UID']; $html = "
global $RBAC; <table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>
$oDataset = $RBAC->getAllPermissions($ROL_UID,$RBAC->sSystem); <tr>
$roleCode = $RBAC->getRoleCode($ROL_UID); <td width='250px' class='treeNode' style='border:0px;background-color:transparent;'>{$CODE}</td>
<td class='treeNode' style='border:0px;background-color:transparent;'>[<a href=\"javascript:assignPermissionToRole('{$ROL_UID}','{$UID}');\">{$ID_ASSIGN}</a>]</td>
$tree = new Tree(); </tr>
$tree->name = 'Users'; </table>";
$tree->nodeType = "base";
$tree->width = "350px"; $ch = &$tree->addChild('', $html, array('nodeType' => 'child'));
$tree->value = ' $ch->point = '<img src="/images/users.png" />';
<div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="boxContentBlue"> $oDataset->next();
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0"> }
<tr>
<td class="userGroupTitle">' . G::LoadTranslation('ID_ASSIGN_THE_ROLE') . ': '.$roleCode.'</td> print($tree->render());
</tr>
</table>
</div>
<div class="boxBottomBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="userGroupLink"><a href="#" onclick="backPermissions(\''.$_GET['ROL_UID'].'\');return false;">' . G::LoadTranslation('ID_BACK_PERMISSIONS_LIST').'</a></div>';
$tree->showSign = false;
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$ID_ASSIGN = G::LoadTranslation('ID_ASSIGN');
$CODE = $aRow['PER_CODE'];
$UID = $aRow['PER_UID'];
$html = "
<table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>
<tr>
<td width='250px' class='treeNode' style='border:0px;background-color:transparent;'>{$CODE}</td>
<td class='treeNode' style='border:0px;background-color:transparent;'>[<a href=\"javascript:assignPermissionToRole('{$ROL_UID}','{$UID}');\">{$ID_ASSIGN}</a>]</td>
</tr>
</table>";
$ch = &$tree->addChild('', $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/users.png" />';
$oDataset->next();
}
print ($tree->render());

View File

@@ -1,78 +1,47 @@
<?php <?php
/**
* groups_Tree.php $ROL_UID = $_GET['ROL_UID'];
* global $RBAC;
* ProcessMaker Open Source Edition $oDataset = $RBAC->getAllUsers($ROL_UID);
* Copyright (C) 2004 - 2008 Colosa Inc.23 $roleCode = $RBAC->getRoleCode($ROL_UID);
*
* This program is free software: you can redistribute it and/or modify $tree = new PmTree();
* it under the terms of the GNU Affero General Public License as $tree->name = 'Users';
* published by the Free Software Foundation, either version 3 of the $tree->nodeType = "base";
* License, or (at your option) any later version. $tree->width = "350px";
* $tree->value = '
* This program is distributed in the hope that it will be useful, <div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
* but WITHOUT ANY WARRANTY; without even the implied warranty of <div class="boxContentBlue">
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the <table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
* GNU Affero General Public License for more details. <tr>
* <td class="userGroupTitle">' . G::LoadTranslation('ID_ASSIGN_THE_ROLE') . ': '.$roleCode.'</td>
* You should have received a copy of the GNU Affero General Public License </tr>
* along with this program. If not, see <http://www.gnu.org/licenses/>. </table>
* </div>
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., <div class="boxBottomBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
* Coral Gables, FL, 33134, USA, or email info@colosa.com. <div class="userGroupLink"><a href="#" onclick="backUsers(\''.$_GET['ROL_UID'].'\');return false;">' . G::LoadTranslation('ID_BACK_TO_USERS_LIST') . '</a></div>';
*
*/ $tree->showSign = false;
/** $oDataset->next();
* @Description This is the View of all groups from a determinated user while ($aRow = $oDataset->getRow()) {
* @author Erik Amaru Ortiz <erik@colosa.com> $ID_ASSIGN = G::LoadTranslation('ID_ASSIGN');
* @Date 24/04/2008
* @LastModification none $user = '['.$aRow['USR_USERNAME'].'] '.$aRow['USR_FIRSTNAME'].' '.$aRow['USR_LASTNAME'];
*/ $USR_UID = $aRow['USR_UID'];
$ROL_UID = $_GET['ROL_UID']; $html = "
global $RBAC; <table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>
$oDataset = $RBAC->getAllUsers($ROL_UID); <tr>
$roleCode = $RBAC->getRoleCode($ROL_UID); <td width='250px' class='treeNode' style='border:0px;background-color:transparent;'>{$user}</td>
<td class='treeNode' style='border:0px;background-color:transparent;'>[<a href=\"javascript:assignUserToRole('{$ROL_UID}','{$USR_UID}');\">{$ID_ASSIGN}</a>]</td>
$tree = new Tree(); </tr>
$tree->name = 'Users'; </table>";
$tree->nodeType = "base";
$tree->width = "350px"; $ch = &$tree->addChild('', $html, array('nodeType' => 'child'));
$tree->value = ' $ch->point = '<img src="/images/users.png" />';
<div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="boxContentBlue"> $oDataset->next();
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0"> }
<tr>
<td class="userGroupTitle">' . G::LoadTranslation('ID_ASSIGN_THE_ROLE') . ': '.$roleCode.'</td> print($tree->render());
</tr>
</table>
</div>
<div class="boxBottomBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="userGroupLink"><a href="#" onclick="backUsers(\''.$_GET['ROL_UID'].'\');return false;">' . G::LoadTranslation('ID_BACK_TO_USERS_LIST') . '</a></div>';
$tree->showSign = false;
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$ID_ASSIGN = G::LoadTranslation('ID_ASSIGN');
$user = '['.$aRow['USR_USERNAME'].'] '.$aRow['USR_FIRSTNAME'].' '.$aRow['USR_LASTNAME'];
$USR_UID = $aRow['USR_UID'];
$html = "
<table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>
<tr>
<td width='250px' class='treeNode' style='border:0px;background-color:transparent;'>{$user}</td>
<td class='treeNode' style='border:0px;background-color:transparent;'>[<a href=\"javascript:assignUserToRole('{$ROL_UID}','{$USR_UID}');\">{$ID_ASSIGN}</a>]</td>
</tr>
</table>";
$ch = &$tree->addChild('', $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/users.png" />';
$oDataset->next();
}
print ($tree->render());

View File

@@ -1,84 +1,54 @@
<?php <?php
/**
* groups_Tree.php $ROL_UID = $_GET['ROL_UID'];
* global $RBAC;
* ProcessMaker Open Source Edition $oDataset = $RBAC->getRoleUsers($ROL_UID);
* Copyright (C) 2004 - 2008 Colosa Inc.23 $roleCode = $RBAC->getRoleCode($ROL_UID);
*
* This program is free software: you can redistribute it and/or modify $tree = new PmTree();
* it under the terms of the GNU Affero General Public License as $tree->name = 'Users';
* published by the Free Software Foundation, either version 3 of the $tree->nodeType = "base";
* License, or (at your option) any later version. $tree->width = "350px";
* $tree->value = '
* This program is distributed in the hope that it will be useful, <div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
* but WITHOUT ANY WARRANTY; without even the implied warranty of <div class="boxContentBlue">
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the <table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
* GNU Affero General Public License for more details. <tr>
* <td class="userGroupTitle">' . G::LoadTranslation('ID_USER_WITH_ROLE') . ': '.$roleCode.'</td>
* You should have received a copy of the GNU Affero General Public License </tr>
* along with this program. If not, see <http://www.gnu.org/licenses/>. </table>
* </div>
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., <div class="boxBottomBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
* Coral Gables, FL, 33134, USA, or email info@colosa.com. <div class="userGroupLink"><a href="#" onclick="showUsersLoad(\''.$_GET['ROL_UID'].'\');return false;">'.G::LoadTranslation('ID_ASSIGN_ROLE').'</a></div>';
*
*/ $tree->showSign = false;
/** $oDataset->next();
* @Description This is the View of all groups from a determinated user while ($aRow = $oDataset->getRow()) {
* @author Erik Amaru Ortiz <erik@colosa.com> $ID_DELETE = G::LoadTranslation('ID_REMOVE');
* @Date 24/04/2008 $un = ($aRow['USR_USERNAME'] != '')?$aRow['USR_USERNAME']:'none';
* @LastModification none $user = '['.$un.'] '.$aRow['USR_FIRSTNAME'].' '.$aRow['USR_LASTNAME'];
*/ $USR_UID = $aRow['USR_UID'];
$ROL_UID = $_GET['ROL_UID']; if ($USR_UID != "00000000000000000000000000000001") { #because the admin remove rol it doesn't posible
global $RBAC; $refer = "<a href=\"javascript:deleteUserRole('{$ROL_UID}','{$USR_UID}');\">{$ID_DELETE}</a>";
$oDataset = $RBAC->getRoleUsers($ROL_UID); } else {
$roleCode = $RBAC->getRoleCode($ROL_UID); $refer = "<font color='#CFCFCF'>{$ID_DELETE}</font>";
}
$tree = new Tree();
$tree->name = 'Users'; $html = "
$tree->nodeType = "base"; <table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>
$tree->width = "350px"; <tr>
$tree->value = ' <td width='250px' class='treeNode' style='border:0px;background-color:transparent;'>{$user}</td>
<div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div> <td class='treeNode' style='border:0px;background-color:transparent;'>[$refer]</td>
<div class="boxContentBlue"> </tr>
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0"> </table>";
<tr>
<td class="userGroupTitle">' . G::LoadTranslation('ID_USER_WITH_ROLE') . ': '.$roleCode.'</td> $ch = &$tree->addChild('', $html, array('nodeType' => 'child'));
</tr> $ch->point = '<img src="/images/users.png" />';
</table>
</div> $oDataset->next();
<div class="boxBottomBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div> }
<div class="userGroupLink"><a href="#" onclick="showUsersLoad(\''.$_GET['ROL_UID'].'\');return false;">'.G::LoadTranslation('ID_ASSIGN_ROLE').'</a></div>';
$tree->showSign = false; print($tree->render());
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$ID_DELETE = G::LoadTranslation('ID_REMOVE');
$un = ($aRow['USR_USERNAME'] != '')?$aRow['USR_USERNAME']:'none';
$user = '['.$un.'] '.$aRow['USR_FIRSTNAME'].' '.$aRow['USR_LASTNAME'];
$USR_UID = $aRow['USR_UID'];
if($USR_UID != "00000000000000000000000000000001") { #because the admin remove rol it doesn't posible
$refer = "<a href=\"javascript:deleteUserRole('{$ROL_UID}','{$USR_UID}');\">{$ID_DELETE}</a>";
} else {
$refer = "<font color='#CFCFCF'>{$ID_DELETE}</font>";
}
$html = "
<table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>
<tr>
<td width='250px' class='treeNode' style='border:0px;background-color:transparent;'>{$user}</td>
<td class='treeNode' style='border:0px;background-color:transparent;'>[$refer]</td>
</tr>
</table>";
$ch = &$tree->addChild('', $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/users.png" />';
$oDataset->next();
}
print ($tree->render());

View File

@@ -36,7 +36,7 @@
$roleCode = $RBAC->getRoleCode($ROL_UID); $roleCode = $RBAC->getRoleCode($ROL_UID);
$tree = new Tree(); $tree = new PmTree();
$tree->name = 'Users'; $tree->name = 'Users';
$tree->nodeType = "base"; $tree->nodeType = "base";
$tree->width = "350px"; $tree->width = "350px";

View File

@@ -51,7 +51,7 @@ $defaultEndpoint = 'http://' . $_SERVER ['SERVER_NAME'] . ':' . $_SERVER ['SERVE
$wsdl = isset ( $_SESSION ['END_POINT'] ) ? $_SESSION ['END_POINT'] : $defaultEndpoint; $wsdl = isset ( $_SESSION ['END_POINT'] ) ? $_SESSION ['END_POINT'] : $defaultEndpoint;
$tree = new Tree ( ); $tree = new PmTree ( );
$tree->name = 'WebServices'; $tree->name = 'WebServices';
$tree->nodeType = "base"; $tree->nodeType = "base";
$tree->contentWidth = "310"; $tree->contentWidth = "310";

View File

@@ -32,7 +32,7 @@ try {
$externalSteps = $oPluginRegistry->getSteps(); $externalSteps = $oPluginRegistry->getSteps();
$oProcessMap = new ProcessMap(); $oProcessMap = new ProcessMap();
$oTree = new Tree(); $oTree = new PmTree();
$oTree->nodeType = 'blank'; $oTree->nodeType = 'blank';
$oTree->name = 'Triggers'; $oTree->name = 'Triggers';
$oTree->showSign = false; $oTree->showSign = false;

View File

@@ -26,7 +26,7 @@
/* /*
* Esto no deberias borrarlo * Esto no deberias borrarlo
*/ */
$tree = new Tree(); $tree = new PmTree();
reView(PATH_TRUNK, $tree); reView(PATH_TRUNK, $tree);
print( $tree->render()); print( $tree->render());

View File

@@ -28,7 +28,7 @@ try {
$triggerLibrary = TriggerLibrary::getSingleton(); $triggerLibrary = TriggerLibrary::getSingleton();
$triggerLibraryO = $triggerLibrary->getRegisteredClasses(); $triggerLibraryO = $triggerLibrary->getRegisteredClasses();
$oTree = new Tree(); $oTree = new PmTree();
$oTree->nodeType = "blank"; $oTree->nodeType = "blank";
$oTree->name = "Triggers"; $oTree->name = "Triggers";
$oTree->showSign = false; $oTree->showSign = false;

View File

@@ -43,7 +43,7 @@
$groups = new Groups(); $groups = new Groups();
$tree = new Tree(); $tree = new PmTree();
$tree->name = 'Users'; $tree->name = 'Users';
$tree->nodeType = "base"; $tree->nodeType = "base";
$tree->width = "350px"; $tree->width = "350px";

View File

@@ -43,7 +43,7 @@
$groups = new Groups(); $groups = new Groups();
$tree = new Tree(); $tree = new PmTree();
$tree->name = 'Users'; $tree->name = 'Users';
$tree->nodeType = "base"; $tree->nodeType = "base";
$tree->width = "350px"; $tree->width = "350px";