This commit is contained in:
Marco Antonio Nina Mena
2017-12-04 13:25:35 +00:00
committed by Julio Cesar Laura Avendaño
parent abe71a6ffe
commit 0d533e19d9
363 changed files with 23948 additions and 44623 deletions

View File

@@ -27,9 +27,9 @@ $APP_UID = $_SESSION['APPLICATION'];
$c = new Criteria('workflow');
$c->clearSelectColumns();
$c->addSelectColumn( AppThreadPeer::APP_THREAD_PARENT );
$c->add(AppThreadPeer::APP_UID, $APP_UID );
$c->add(AppThreadPeer::APP_THREAD_STATUS , 'OPEN' );
$c->addSelectColumn(AppThreadPeer::APP_THREAD_PARENT);
$c->add(AppThreadPeer::APP_UID, $APP_UID);
$c->add(AppThreadPeer::APP_THREAD_STATUS, 'OPEN');
$cant = AppThreadPeer::doCount($c);
$oTree = new PmTree();
@@ -38,7 +38,7 @@ $oTree->name = 'Actions';
$oTree->showSign = false;
$oCase = new Cases();
$aFields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
$aFields = $oCase->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX']);
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDelayPeer::APP_UID, $_SESSION['APPLICATION']);
@@ -50,45 +50,42 @@ $oDataset = AppDelayPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
GLOBAL $RBAC;
switch($aFields['APP_STATUS'])
{
case 'DRAFT':
if(!$aRow) {
$oNode = &$oTree->addChild('1', '<a id="spause" class="linkInBlue" href="#" onclick="pauseCase();return false;">' . G::LoadTranslation('ID_PAUSED_CASE') . '</a></span><a id="scpause" class="linkInBlue" href="#" onclick="cancelPauseCase();return false;" style="display:none">' . G::LoadTranslation('ID_CANCEL') . ' ' . strtolower(G::LoadTranslation('ID_PAUSED_CASE')) . '</a><div id="pausediv" style="display:none"></div>', array('nodeType' => 'parentBlue'));
}
else {
$oNode = &$oTree->addChild('1', '<a class="linkInBlue" href="#" onclick="unpauseCase();return false;">' . G::LoadTranslation('ID_UNPAUSE') . '</a>', array('nodeType' => 'parentBlue'));
}
$oNode = &$oTree->addChild('2', '<a class="linkInBlue" href="#" onclick="deleteCase(\''.$APP_UID.'\');return false;">' . G::LoadTranslation('ID_DELETE') . '</a>', array('nodeType' => 'parentBlue'));
if($RBAC->userCanAccess('PM_REASSIGNCASE')==1) {
$oNode = &$oTree->addChild('3', '<a class="linkInBlue" href="#" onclick="view_reassignCase(\''.$APP_UID.'\');return false;">' . G::LoadTranslation('ID_REASSIGN') . '</a>', array('nodeType' => 'parentBlue'));
}
break;
case 'TO_DO':
if(!$aRow) {
$oNode = &$oTree->addChild('1', '<a id="spause" class="linkInBlue" href="#" onclick="pauseCase();return false;">' . G::LoadTranslation('ID_PAUSED_CASE') . '</a></span><a id="scpause" class="linkInBlue" href="#" onclick="cancelPauseCase();return false;" style="display:none">' . G::LoadTranslation('ID_CANCEL') . ' ' . strtolower(G::LoadTranslation('ID_PAUSED_CASE')) . '</a><div id="pausediv" style="display:none"></div>', array('nodeType' => 'parentBlue'));
if ($cant == 1) {
$oNode = & $oTree->addChild('2', '<a class="linkInBlue" href="#" onclick="cancelCase();return false;">' . G::LoadTranslation('ID_CANCEL') . '</a>', array('nodeType'=>'parentBlue'));
}
}
else {
$oNode = &$oTree->addChild('1', '<a class="linkInBlue" href="#" onclick="unpauseCase();return false;">' . G::LoadTranslation('ID_UNPAUSE') . '</a>', array('nodeType' => 'parentBlue'));
}
if($RBAC->userCanAccess('PM_REASSIGNCASE')==1) {
$oNode = &$oTree->addChild('3', '<a class="linkInBlue" href="#" onclick="view_reassignCase(\''.$APP_UID.'\');return false;">' . G::LoadTranslation('ID_REASSIGN') . '</a>', array('nodeType' => 'parentBlue'));
}
break;
global $RBAC;
switch ($aFields['APP_STATUS']) {
case 'DRAFT':
if (!$aRow) {
$oNode = $oTree->addChild('1', '<a id="spause" class="linkInBlue" href="#" onclick="pauseCase();return false;">' . G::LoadTranslation('ID_PAUSED_CASE') . '</a></span><a id="scpause" class="linkInBlue" href="#" onclick="cancelPauseCase();return false;" style="display:none">' . G::LoadTranslation('ID_CANCEL') . ' ' . strtolower(G::LoadTranslation('ID_PAUSED_CASE')) . '</a><div id="pausediv" style="display:none"></div>', array('nodeType' => 'parentBlue'));
} else {
$oNode = $oTree->addChild('1', '<a class="linkInBlue" href="#" onclick="unpauseCase();return false;">' . G::LoadTranslation('ID_UNPAUSE') . '</a>', array('nodeType' => 'parentBlue'));
}
$oNode = $oTree->addChild('2', '<a class="linkInBlue" href="#" onclick="deleteCase(\'' . $APP_UID . '\');return false;">' . G::LoadTranslation('ID_DELETE') . '</a>', array('nodeType' => 'parentBlue'));
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) {
$oNode = $oTree->addChild('3', '<a class="linkInBlue" href="#" onclick="view_reassignCase(\'' . $APP_UID . '\');return false;">' . G::LoadTranslation('ID_REASSIGN') . '</a>', array('nodeType' => 'parentBlue'));
}
break;
case 'TO_DO':
if (!$aRow) {
$oNode = $oTree->addChild('1', '<a id="spause" class="linkInBlue" href="#" onclick="pauseCase();return false;">' . G::LoadTranslation('ID_PAUSED_CASE') . '</a></span><a id="scpause" class="linkInBlue" href="#" onclick="cancelPauseCase();return false;" style="display:none">' . G::LoadTranslation('ID_CANCEL') . ' ' . strtolower(G::LoadTranslation('ID_PAUSED_CASE')) . '</a><div id="pausediv" style="display:none"></div>', array('nodeType' => 'parentBlue'));
if ($cant == 1) {
$oNode = $oTree->addChild('2', '<a class="linkInBlue" href="#" onclick="cancelCase();return false;">' . G::LoadTranslation('ID_CANCEL') . '</a>', array('nodeType' => 'parentBlue'));
}
} else {
$oNode = $oTree->addChild('1', '<a class="linkInBlue" href="#" onclick="unpauseCase();return false;">' . G::LoadTranslation('ID_UNPAUSE') . '</a>', array('nodeType' => 'parentBlue'));
}
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) {
$oNode = $oTree->addChild('3', '<a class="linkInBlue" href="#" onclick="view_reassignCase(\'' . $APP_UID . '\');return false;">' . G::LoadTranslation('ID_REASSIGN') . '</a>', array('nodeType' => 'parentBlue'));
}
break;
case 'CANCELLED':
$oNode = &$oTree->addChild('1', '<a class="linkInBlue" href="#" onclick="reactivateCase();return false;">' . G::LoadTranslation('ID_REACTIVATE') . '</a>', array('nodeType' => 'parentBlue'));
break;
case 'CANCELLED':
$oNode = $oTree->addChild('1', '<a class="linkInBlue" href="#" onclick="reactivateCase();return false;">' . G::LoadTranslation('ID_REACTIVATE') . '</a>', array('nodeType' => 'parentBlue'));
break;
}
$oTask = new Task();
$aTask = $oTask->load($_SESSION['TASK']);
if ($aTask['TAS_TYPE'] == 'ADHOC') {
$oNode = &$oTree->addChild('4', '<a class="linkInBlue" href="#" onclick="adhocAssignmentUsers();return false;">' . G::LoadTranslation('ID_ADHOC_ASSIGNMENT') . '</a>', array('nodeType' => 'parentBlue'));
$oNode = $oTree->addChild('4', '<a class="linkInBlue" href="#" onclick="adhocAssignmentUsers();return false;">' . G::LoadTranslation('ID_ADHOC_ASSIGNMENT') . '</a>', array('nodeType' => 'parentBlue'));
}
$oNode->plus = '';
@@ -96,4 +93,3 @@ $oNode->minus = '';
$oNode->point = '';
echo $oTree->render();
?>

View File

@@ -28,49 +28,49 @@ $oTree->nodeType ="blank";
$oTree->name = 'Information';
$oTree->showSign = false;
$oNode =& $oTree->addChild('1', '<a class="linkInBlue" href="#" onclick="showProcessMap();return false;">' . G::LoadTranslation('ID_PROCESS_MAP') . '</a>', array('nodeType'=>'parentBlue'));
$oNode = $oTree->addChild('1', '<a class="linkInBlue" href="#" onclick="showProcessMap();return false;">' . G::LoadTranslation('ID_PROCESS_MAP') . '</a>', array('nodeType'=>'parentBlue'));
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';
$oNode =& $oTree->addChild('2', '<a class="linkInBlue" href="#" onclick="showProcessInformation();return false;">' . G::LoadTranslation('ID_PROCESS_INFORMATION') . '</a>', array('nodeType'=>'parentBlue'));
$oNode = $oTree->addChild('2', '<a class="linkInBlue" href="#" onclick="showProcessInformation();return false;">' . G::LoadTranslation('ID_PROCESS_INFORMATION') . '</a>', array('nodeType'=>'parentBlue'));
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';
if ($_SESSION['TASK'] != -1) {
$oNode =& $oTree->addChild('3', '<a class="linkInBlue" href="#" onclick="showTaskInformation();return false;">' . G::LoadTranslation('ID_TASK_INFORMATION') . '</a>', array('nodeType'=>'parentBlue'));
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';
$oNode = $oTree->addChild('3', '<a class="linkInBlue" href="#" onclick="showTaskInformation();return false;">' . G::LoadTranslation('ID_TASK_INFORMATION') . '</a>', array('nodeType'=>'parentBlue'));
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';
}
$oNode =& $oTree->addChild('4', '<a class="linkInBlue" href="#" onclick="showTransferHistory();return false;">' . G::LoadTranslation('ID_CASE_HISTORY') . '</a>', array('nodeType'=>'parentBlue'));
$oNode = $oTree->addChild('4', '<a class="linkInBlue" href="#" onclick="showTransferHistory();return false;">' . G::LoadTranslation('ID_CASE_HISTORY') . '</a>', array('nodeType'=>'parentBlue'));
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';
$oNode =& $oTree->addChild('6', '<a class="linkInBlue" href="#" onclick="showHistoryMessages();return false;">' . G::LoadTranslation('ID_HISTORY_MESSAGE_CASE') . '</a>', array('nodeType'=>'parentBlue'));
$oNode = $oTree->addChild('6', '<a class="linkInBlue" href="#" onclick="showHistoryMessages();return false;">' . G::LoadTranslation('ID_HISTORY_MESSAGE_CASE') . '</a>', array('nodeType'=>'parentBlue'));
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';
$oNode =& $oTree->addChild('6', '<a class="linkInBlue" href="#" onclick="showDynaforms();return false;">' . G::LoadTranslation('ID_DYNAFORMS') . '</a>', array('nodeType'=>'parentBlue'));
$oNode = $oTree->addChild('6', '<a class="linkInBlue" href="#" onclick="showDynaforms();return false;">' . G::LoadTranslation('ID_DYNAFORMS') . '</a>', array('nodeType'=>'parentBlue'));
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';
$oNode =& $oTree->addChild('5', '<a class="linkInBlue" href="#" onclick="showUploadedDocuments();return false;">' . G::LoadTranslation('ID_UPLOADED_DOCUMENTS') . '</a>', array('nodeType'=>'parentBlue'));
$oNode = $oTree->addChild('5', '<a class="linkInBlue" href="#" onclick="showUploadedDocuments();return false;">' . G::LoadTranslation('ID_UPLOADED_DOCUMENTS') . '</a>', array('nodeType'=>'parentBlue'));
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';
$oNode =& $oTree->addChild('6', '<a class="linkInBlue" href="#" onclick="showGeneratedDocuments();return false;">' . G::LoadTranslation('ID_GENERATED_DOCUMENTS') . '</a>', array('nodeType'=>'parentBlue'));
$oNode = $oTree->addChild('6', '<a class="linkInBlue" href="#" onclick="showGeneratedDocuments();return false;">' . G::LoadTranslation('ID_GENERATED_DOCUMENTS') . '</a>', array('nodeType'=>'parentBlue'));
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';
/*
$oNode =& $oTree->addChild('6', '<a class="linkInBlue" href="#" onclick="stages();return false;">' . G::LoadTranslation('ID_STAGES') . '</a>', array('nodeType'=>'parentBlue'));
$oNode = $oTree->addChild('6', '<a class="linkInBlue" href="#" onclick="stages();return false;">' . G::LoadTranslation('ID_STAGES') . '</a>', array('nodeType'=>'parentBlue'));
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';
@@ -81,11 +81,10 @@ $oProcess = new Process();
$Fields = $oProcess->Load( $_SESSION['PROCESS'] );
if($Fields['PRO_DEBUG']==1)
{
$oNode =& $oTree->addChild('7', '<a class="linkInBlue" href="../cases/casesDemo">' . G::LoadTranslation('ID_CASEDEMO') . '</a>', array('nodeType'=>'parentBlue'));
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';
}
$oNode = $oTree->addChild('7', '<a class="linkInBlue" href="../cases/casesDemo">' . G::LoadTranslation('ID_CASEDEMO') . '</a>', array('nodeType'=>'parentBlue'));
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';
}
*/
echo $oTree->render();
?>

View File

@@ -1,10 +1,10 @@
<?php
/**
* cases_KTTree.php
*
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
*
* 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
@@ -14,23 +14,17 @@
* 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.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
$oTree = new PmTree();
$oTree->name = 'KT';
$oTree->showSign = false;
/*$oNode =& $oTree->addChild('1', '<a href="#" onclick="showProcessInformation();return false;">' . G::LoadTranslation('ID_PROCESS_INFORMATION') . '</a>');
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';*/
echo $oTree->render();
?>

View File

@@ -25,210 +25,196 @@
use ProcessMaker\Plugins\PluginRegistry;
$c = new Criteria();
$c->add ( StepPeer::PRO_UID, $_SESSION['PROCESS'] );
$c->add ( StepPeer::TAS_UID, $_SESSION['TASK'] );
$c->addAscendingOrderByColumn ( StepPeer::STEP_POSITION );
$c = new Criteria();
$c->add(StepPeer::PRO_UID, $_SESSION['PROCESS']);
$c->add(StepPeer::TAS_UID, $_SESSION['TASK']);
$c->addAscendingOrderByColumn(StepPeer::STEP_POSITION);
$oPluginRegistry = PluginRegistry::loadSingleton();
$externalSteps = $oPluginRegistry->getSteps();
$oPluginRegistry = PluginRegistry::loadSingleton();
$externalSteps = $oPluginRegistry->getSteps();
$oTree = new PmTree();
$oTree->nodeType = "blank";
$oTree->name = 'Steps';
$oTree->showSign = false;
$oTree = new PmTree();
$oTree->nodeType = "blank";
$oTree->name = 'Steps';
$oTree->showSign = false;
$tasUid = $_SESSION['TASK'];
$rs = StepPeer::doSelect( $c );
$tasUid = $_SESSION['TASK'];
$rs = StepPeer::doSelect($c);
$oCase = new Cases();
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$oPMScript = new PMScript();
$oPMScript->setFields($Fields['APP_DATA'] );
foreach ( $rs as $key => $aRow )
{
$oCase = new Cases();
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
$oPMScript = new PMScript();
$oPMScript->setFields($Fields['APP_DATA']);
foreach ($rs as $key => $aRow) {
$bAccessStep = false;
if (trim($aRow->getStepCondition()) != '') {
$oPMScript->setScript( $aRow->getStepCondition() );
$bAccessStep = $oPMScript->evaluate();
}
else {
$bAccessStep = true;
$oPMScript->setScript($aRow->getStepCondition());
$bAccessStep = $oPMScript->evaluate();
} else {
$bAccessStep = true;
}
if ($bAccessStep)
{
switch( $aRow->getStepTypeObj() )
{
case 'DYNAFORM':
$oDocument = DynaformPeer::retrieveByPK($aRow->getStepUidObj());
$stepTitle = $oDocument->getDynTitle(); break;
case 'OUTPUT_DOCUMENT':
$oDocument = OutputDocumentPeer::retrieveByPK($aRow->getStepUidObj());
$stepTitle = $oDocument->getOutDocTitle(); break;
case 'INPUT_DOCUMENT':
$oDocument = InputDocumentPeer::retrieveByPK($aRow->getStepUidObj());
$stepTitle = $oDocument->getInpDocTitle();
$sType = $oDocument->getInpDocFormNeeded(); break;
case 'EXTERNAL':
$stepTitle = 'unknown ' . $aRow->getStepUidObj();
$oPluginRegistry = PluginRegistry::loadSingleton();
/** @var \ProcessMaker\Plugins\Interfaces\StepDetail $val */
foreach ( $externalSteps as $val ) {
if ($val->equalStepIdTo($aRow->getStepUidObj())) {
$stepTitle = $val->getStepTitle(); //default title
$sNamespace = $val->getNamespace();
$oPlugin =& $oPluginRegistry->getPlugin($sNamespace);
$classFile = PATH_PLUGINS . $oPlugin->sNamespace . PATH_SEP . 'class.' . $oPlugin->sNamespace .'.php';
if ( file_exists ( $classFile ) ) {
require_once ( $classFile );
$sClassName = $sNamespace . 'class';
$obj = new $sClassName( );
if (method_exists($obj, 'getExternalStepTitle')) {
$stepTitle = $obj->getExternalStepTitle( $aRow->getStepUidObj(), $tasUid, $aRow->getStepPosition());
}
}
}
}
break;
if ($bAccessStep) {
switch ($aRow->getStepTypeObj()) {
case 'DYNAFORM':
$oDocument = DynaformPeer::retrieveByPK($aRow->getStepUidObj());
$stepTitle = $oDocument->getDynTitle();
break;
case 'OUTPUT_DOCUMENT':
$oDocument = OutputDocumentPeer::retrieveByPK($aRow->getStepUidObj());
$stepTitle = $oDocument->getOutDocTitle();
break;
case 'INPUT_DOCUMENT':
$oDocument = InputDocumentPeer::retrieveByPK($aRow->getStepUidObj());
$stepTitle = $oDocument->getInpDocTitle();
$sType = $oDocument->getInpDocFormNeeded();
break;
case 'EXTERNAL':
$stepTitle = 'unknown ' . $aRow->getStepUidObj();
$oPluginRegistry = PluginRegistry::loadSingleton();
/** @var \ProcessMaker\Plugins\Interfaces\StepDetail $val */
foreach ($externalSteps as $val) {
if ($val->equalStepIdTo($aRow->getStepUidObj())) {
$stepTitle = $val->getStepTitle(); //default title
$sNamespace = $val->getNamespace();
$oPlugin = $oPluginRegistry->getPlugin($sNamespace);
$classFile = PATH_PLUGINS . $oPlugin->sNamespace . PATH_SEP . 'class.' . $oPlugin->sNamespace . '.php';
if (file_exists($classFile)) {
require_once($classFile);
$sClassName = $sNamespace . 'class';
$obj = new $sClassName();
if (method_exists($obj, 'getExternalStepTitle')) {
$stepTitle = $obj->getExternalStepTitle($aRow->getStepUidObj(), $tasUid, $aRow->getStepPosition());
}
}
}
}
break;
default:
$stepTitle = $aRow->getStepUid();
}
//$oNode =& $oTree->addChild($aRow->getStepUid(), '&nbsp;' . $aRow->getStepNameObj(), array('nodeType'=>'parent') );
$oNode =& $oTree->addChild($aRow->getStepUid(), '&nbsp;' . $stepTitle, array('nodeType'=>'parent') );
$oNode->plus = '';
$oNode->minus = '';
switch( $aRow->getStepTypeObj() )
{
case 'DYNAFORM':
$sOptions = '<table width="70%" cellpadding="0" cellspacing="0" border="0"><tr>';
$sOptions .= '<td width="100%" class="treeNode"><a style="' . (($_GET['TYPE'] == 'DYNAFORM') && ($_GET['UID'] == $aRow->getStepUidObj() && ($_GET['ACTION'] == 'EDIT')) ?'background-color:orange;color:white;padding-left:5px;padding-right:5px; ' : '') . '" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=EDIT">' . G::LoadTranslation('ID_EDIT') . '</a></td>';
$sOptions .= '</tr></table>';
$oAux =& $oNode->addChild($aRow->getStepUid() . '_node', $sOptions, array('nodeType'=>'child'));
break;
case 'OUTPUT_DOCUMENT':
$sOptions = '<table width="70%" cellpadding="0" cellspacing="0" border="0"><tr>';
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDocumentPeer::APP_UID, $_SESSION['APPLICATION']);
$oCriteria->add(AppDocumentPeer::DEL_INDEX, $_SESSION['INDEX']);
$oCriteria->add(AppDocumentPeer::DOC_UID, $aRow->getStepUidObj());
$oCriteria->add(AppDocumentPeer::APP_DOC_TYPE, 'OUTPUT');
$oDataset = AppDocumentPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
if ($aRow2 = $oDataset->getRow()) {
$sOptions .= '<td width="30%" class="treeNode"><a style="' . (($_GET['TYPE'] == 'OUTPUT_DOCUMENT') && ($_GET['UID'] == $aRow->getStepUidObj() && ($_GET['ACTION'] == 'VIEW')) ? 'background-color:orange;color:white;padding-left:5px;padding-right:5px;' : '') . '" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=VIEW&DOC=' . $aRow2['APP_DOC_UID'] . '">' . G::LoadTranslation('ID_VIEW') . '</a></td>';
$sOptions .= '<td width="40%" class="treeNode"><a style="' . (($_GET['TYPE'] == 'OUTPUT_DOCUMENT') && ($_GET['UID'] == $aRow->getStepUidObj() && ($_GET['ACTION'] == 'GENERATE')) ? 'background-color:orange;color:white;padding-left:5px;padding-right:5px;' : '') . '" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=GENERATE">' . G::LoadTranslation('ID_GENERATE') . '</a></td>';
$sOptions .= '<td width="30%" class="treeNode"><a style="' . (($_GET['TYPE'] == 'OUTPUT_DOCUMENT') && ($_GET['UID'] == $aRow->getStepUidObj() && ($_GET['ACTION'] == 'DELETE')) ? 'background-color:orange;color:white;padding-left:5px;padding-right:5px;' : '') . '" href="../cases/cases_DeleteDocument?TYPE=OUTPUT&DOC=' . $aRow2['APP_DOC_UID'] . '" onclick="return confirm(\'' . G::LoadTranslation('ID_CONFIRM_DELETE_ELEMENT') . '\');">' . G::LoadTranslation('ID_DELETE') . '</a></td>';
}
else {
$sOptions .= '<td width="100%" class="treeNode"><a style="' . (($_GET['TYPE'] == 'OUTPUT_DOCUMENT') && ($_GET['UID'] == $aRow->getStepUidObj() && ($_GET['ACTION'] == 'GENERATE')) ? 'background-color:orange;color:white;padding-left:5px;padding-right:5px;' : '') . '" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=GENERATE">' . G::LoadTranslation('ID_GENERATE') . '</a></td>';
}
$sOptions .= '</tr></table>';
$oAux =& $oNode->addChild($aRow->getStepUid() . '_node', $sOptions, array('nodeType'=>'child'));
break;
case 'INPUT_DOCUMENT':
$sOptions = '<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>';
$sOptions .= '<td width="100%" class="treeNode"><a style="' . (($_GET['TYPE'] == 'INPUT_DOCUMENT') && ($_GET['UID'] == $aRow->getStepUidObj() && ($_GET['ACTION'] == 'ATTACH')) ? 'background-color:orange;color:white;padding-left:5px;padding-right:5px;' : '') . '" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=ATTACH">' . ($sType == 'REAL' ? G::LoadTranslation('ID_NEW') : G::LoadTranslation('ID_ATTACH')) . '</a></td>';
$sOptions .= '</tr></table>';
$oCri = new Criteria;
$oCri->add( AppDocumentPeer::APP_UID , $_SESSION['APPLICATION'] );
$oCri->add( AppDocumentPeer::DEL_INDEX , $_SESSION['INDEX'] );
$oCri->add( AppDocumentPeer::DOC_UID , $aRow->getStepUidObj() );
$oCri->add( AppDocumentPeer::APP_DOC_TYPE , 'INPUT' );
$oCri->addAscendingOrderByColumn(AppDocumentPeer::APP_DOC_INDEX);
$aDocuments = AppDocumentPeer::doSelect($oCri);
if (sizeof($aDocuments) !== 0)
{
$i = 1;
$sOptions .= '<table width="90%" align="center" cellpadding="0" cellspacing="0" border="0">';
reset($aDocuments);
while ($oDocument = current($aDocuments))
{
$aRow2 = $oDocument->toArray(BasePeer::TYPE_FIELDNAME);
$oAux1 = new AppDocument();
$aAux = $oAux1->load($aRow2['APP_DOC_UID']);
$sOptions .= '<tr>';
if ($aAux['APP_DOC_FILENAME'] != '') {
$sAux = $aAux['APP_DOC_FILENAME'];
}
else {
$sAux = $aAux['APP_DOC_COMMENT'];
}
$sOptions .= '<td width="5%">' . $i . '.</td><td width="55%" class="treeNodeAlternate"><input type="text" readonly="readonly" style="font:inherit;border:none;width:100%;" value="' . htmlentities( $sAux, ENT_QUOTES, "utf-8" ) . '" title="' . $sAux . '" /></td>';
global $oPluginRegistry;
if (!$oPluginRegistry->existsTrigger ( PM_CASE_DOCUMENT_LIST )) {
if (isset($_GET['DOC']))
{
$sOptions .= '<td width="20%" class="treeNode" align="center"><a style="' . (($_GET['TYPE'] == 'INPUT_DOCUMENT') && ($_GET['UID'] == $aRow->getStepUidObj() && ($_GET['ACTION'] == 'VIEW') && ($_GET['DOC'] == $aRow2['APP_DOC_UID'])) ? 'background-color:orange;color:shite;padding-left:5px;padding-right:5px;' : '') . '" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=VIEW&DOC=' . $aRow2['APP_DOC_UID'] .'&VERSION=' . $aRow2['DOC_VERSION'] . '">' . G::LoadTranslation('ID_VIEW') . '</a></td>';
}
else
{
$sOptions .= '<td width="20%" class="treeNode" align="center"><a style="" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=VIEW&DOC=' . $aRow2['APP_DOC_UID'] . '&VERSION=' . $aRow2['DOC_VERSION']. '">' . G::LoadTranslation('ID_VIEW') . '</a></td>';
}
$sOptions .= '<td width="20%" class="treeNode" align="center"><a href="../cases/cases_DeleteDocument?TYPE=INPUT&DOC=' . $aRow2['APP_DOC_UID'] . '" onclick="return confirm(\'' . G::LoadTranslation('ID_CONFIRM_DELETE_ELEMENT') . '\');">' . G::LoadTranslation('ID_DELETE') . '</a></td>';
}
$sOptions .= '</tr>';
$i++;
next($aDocuments);
}
$sOptions .= '</table>';
}
$oAux =& $oNode->addChild($aRow->getStepUid() . '_node', $sOptions, array('nodeType'=>'child'));
break;
case 'MESSAGE':
$sOptions = '<table width="70%" cellpadding="0" cellspacing="0" border="0"><tr>';
$sOptions .= '<td width="100%" class="treeNode"></td>';
$sOptions .= '</tr></table>';
$oAux =& $oNode->addChild($aRow['STEP_UID'] . '_node', $sOptions, array('nodeType'=>'child'));
break;
case 'EXTERNAL':
$aActions = array ('action' => 'label' );
$oPluginRegistry = PluginRegistry::loadSingleton();
/** @var \ProcessMaker\Plugins\Interfaces\StepDetail $val */
foreach ( $externalSteps as $key=>$val ) {
if ($val->equalStepIdTo($aRow->getStepUidObj())) {
$stepTitle = $val->getStepTitle(); //default title
$sNamespace = $val->getNamespace();
$oPlugin =& $oPluginRegistry->getPlugin($sNamespace);
$classFile = PATH_PLUGINS . $oPlugin->sNamespace . PATH_SEP . 'class.' . $oPlugin->sNamespace .'.php';
if ( file_exists ( $classFile ) ) {
require_once ( $classFile );
$sClassName = $sNamespace . 'class';
$obj = new $sClassName( );
if (method_exists($obj, 'getExternalStepAction')) {
$aActions = $obj->getExternalStepAction( $aRow->getStepUidObj(), $aRow->getStepPosition());
}
}
}
default:
$stepTitle = $aRow->getStepUid();
}
$sOptions = "<table width='70%' cellpadding='0' cellspacing='0' border='0'><tr>";
$sOptions .= "<td width='100%' class='treeNode'>";
foreach ( $aActions as $action => $label ) {
$styleAction = $_GET['UID'] == $aRow->getStepUidObj() &&
$_GET['POSITION'] == $aRow->getStepPosition() &&
$_GET['ACTION'] == $action ? 'background-color:orange;color:white;padding-left:5px;padding-right:5px; ' : '';
$sOptions .= " <a style='$styleAction' href='../cases/cases_Step?TYPE=" .
$aRow->getStepTypeObj() . "&UID=" . $aRow->getStepUidObj() . "&POSITION=" . $aRow->getStepPosition() . "&ACTION=$action'>" . $label . "</a>";
}
$sOptions .= '</td></tr></table>';
$oAux =& $oNode->addChild($aRow->getStepUid() . '_node', $sOptions, array('nodeType'=>'child'));
}
$oAux->point = '';
$oNode = $oTree->addChild($aRow->getStepUid(), '&nbsp;' . $stepTitle, array('nodeType' => 'parent'));
$oNode->plus = '';
$oNode->minus = '';
switch ($aRow->getStepTypeObj()) {
case 'DYNAFORM':
$sOptions = '<table width="70%" cellpadding="0" cellspacing="0" border="0"><tr>';
$sOptions .= '<td width="100%" class="treeNode"><a style="' . (($_GET['TYPE'] == 'DYNAFORM') && ($_GET['UID'] == $aRow->getStepUidObj() && ($_GET['ACTION'] == 'EDIT')) ? 'background-color:orange;color:white;padding-left:5px;padding-right:5px; ' : '') . '" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=EDIT">' . G::LoadTranslation('ID_EDIT') . '</a></td>';
$sOptions .= '</tr></table>';
$oAux = $oNode->addChild($aRow->getStepUid() . '_node', $sOptions, array('nodeType' => 'child'));
break;
case 'OUTPUT_DOCUMENT':
$sOptions = '<table width="70%" cellpadding="0" cellspacing="0" border="0"><tr>';
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDocumentPeer::APP_UID, $_SESSION['APPLICATION']);
$oCriteria->add(AppDocumentPeer::DEL_INDEX, $_SESSION['INDEX']);
$oCriteria->add(AppDocumentPeer::DOC_UID, $aRow->getStepUidObj());
$oCriteria->add(AppDocumentPeer::APP_DOC_TYPE, 'OUTPUT');
$oDataset = AppDocumentPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
if ($aRow2 = $oDataset->getRow()) {
$sOptions .= '<td width="30%" class="treeNode"><a style="' . (($_GET['TYPE'] == 'OUTPUT_DOCUMENT') && ($_GET['UID'] == $aRow->getStepUidObj() && ($_GET['ACTION'] == 'VIEW')) ? 'background-color:orange;color:white;padding-left:5px;padding-right:5px;' : '') . '" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=VIEW&DOC=' . $aRow2['APP_DOC_UID'] . '">' . G::LoadTranslation('ID_VIEW') . '</a></td>';
$sOptions .= '<td width="40%" class="treeNode"><a style="' . (($_GET['TYPE'] == 'OUTPUT_DOCUMENT') && ($_GET['UID'] == $aRow->getStepUidObj() && ($_GET['ACTION'] == 'GENERATE')) ? 'background-color:orange;color:white;padding-left:5px;padding-right:5px;' : '') . '" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=GENERATE">' . G::LoadTranslation('ID_GENERATE') . '</a></td>';
$sOptions .= '<td width="30%" class="treeNode"><a style="' . (($_GET['TYPE'] == 'OUTPUT_DOCUMENT') && ($_GET['UID'] == $aRow->getStepUidObj() && ($_GET['ACTION'] == 'DELETE')) ? 'background-color:orange;color:white;padding-left:5px;padding-right:5px;' : '') . '" href="../cases/cases_DeleteDocument?TYPE=OUTPUT&DOC=' . $aRow2['APP_DOC_UID'] . '" onclick="return confirm(\'' . G::LoadTranslation('ID_CONFIRM_DELETE_ELEMENT') . '\');">' . G::LoadTranslation('ID_DELETE') . '</a></td>';
} else {
$sOptions .= '<td width="100%" class="treeNode"><a style="' . (($_GET['TYPE'] == 'OUTPUT_DOCUMENT') && ($_GET['UID'] == $aRow->getStepUidObj() && ($_GET['ACTION'] == 'GENERATE')) ? 'background-color:orange;color:white;padding-left:5px;padding-right:5px;' : '') . '" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=GENERATE">' . G::LoadTranslation('ID_GENERATE') . '</a></td>';
}
$sOptions .= '</tr></table>';
$oAux = $oNode->addChild($aRow->getStepUid() . '_node', $sOptions, array('nodeType' => 'child'));
break;
case 'INPUT_DOCUMENT':
$sOptions = '<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>';
$sOptions .= '<td width="100%" class="treeNode"><a style="' . (($_GET['TYPE'] == 'INPUT_DOCUMENT') && ($_GET['UID'] == $aRow->getStepUidObj() && ($_GET['ACTION'] == 'ATTACH')) ? 'background-color:orange;color:white;padding-left:5px;padding-right:5px;' : '') . '" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=ATTACH">' . ($sType == 'REAL' ? G::LoadTranslation('ID_NEW') : G::LoadTranslation('ID_ATTACH')) . '</a></td>';
$sOptions .= '</tr></table>';
$oCri = new Criteria;
$oCri->add(AppDocumentPeer::APP_UID, $_SESSION['APPLICATION']);
$oCri->add(AppDocumentPeer::DEL_INDEX, $_SESSION['INDEX']);
$oCri->add(AppDocumentPeer::DOC_UID, $aRow->getStepUidObj());
$oCri->add(AppDocumentPeer::APP_DOC_TYPE, 'INPUT');
$oCri->addAscendingOrderByColumn(AppDocumentPeer::APP_DOC_INDEX);
$aDocuments = AppDocumentPeer::doSelect($oCri);
if (sizeof($aDocuments) !== 0) {
$i = 1;
$sOptions .= '<table width="90%" align="center" cellpadding="0" cellspacing="0" border="0">';
reset($aDocuments);
while ($oDocument = current($aDocuments)) {
$aRow2 = $oDocument->toArray(BasePeer::TYPE_FIELDNAME);
$oAux1 = new AppDocument();
$aAux = $oAux1->load($aRow2['APP_DOC_UID']);
$sOptions .= '<tr>';
if ($aAux['APP_DOC_FILENAME'] != '') {
$sAux = $aAux['APP_DOC_FILENAME'];
} else {
$sAux = $aAux['APP_DOC_COMMENT'];
}
$sOptions .= '<td width="5%">' . $i . '.</td><td width="55%" class="treeNodeAlternate"><input type="text" readonly="readonly" style="font:inherit;border:none;width:100%;" value="' . htmlentities($sAux, ENT_QUOTES, "utf-8") . '" title="' . $sAux . '" /></td>';
global $oPluginRegistry;
if (!$oPluginRegistry->existsTrigger(PM_CASE_DOCUMENT_LIST)) {
if (isset($_GET['DOC'])) {
$sOptions .= '<td width="20%" class="treeNode" align="center"><a style="' . (($_GET['TYPE'] == 'INPUT_DOCUMENT') && ($_GET['UID'] == $aRow->getStepUidObj() && ($_GET['ACTION'] == 'VIEW') && ($_GET['DOC'] == $aRow2['APP_DOC_UID'])) ? 'background-color:orange;color:shite;padding-left:5px;padding-right:5px;' : '') . '" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=VIEW&DOC=' . $aRow2['APP_DOC_UID'] . '&VERSION=' . $aRow2['DOC_VERSION'] . '">' . G::LoadTranslation('ID_VIEW') . '</a></td>';
} else {
$sOptions .= '<td width="20%" class="treeNode" align="center"><a style="" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=VIEW&DOC=' . $aRow2['APP_DOC_UID'] . '&VERSION=' . $aRow2['DOC_VERSION'] . '">' . G::LoadTranslation('ID_VIEW') . '</a></td>';
}
$sOptions .= '<td width="20%" class="treeNode" align="center"><a href="../cases/cases_DeleteDocument?TYPE=INPUT&DOC=' . $aRow2['APP_DOC_UID'] . '" onclick="return confirm(\'' . G::LoadTranslation('ID_CONFIRM_DELETE_ELEMENT') . '\');">' . G::LoadTranslation('ID_DELETE') . '</a></td>';
}
$sOptions .= '</tr>';
$i++;
next($aDocuments);
}
$sOptions .= '</table>';
}
$oAux = $oNode->addChild($aRow->getStepUid() . '_node', $sOptions, array('nodeType' => 'child'));
break;
case 'MESSAGE':
$sOptions = '<table width="70%" cellpadding="0" cellspacing="0" border="0"><tr>';
$sOptions .= '<td width="100%" class="treeNode"></td>';
$sOptions .= '</tr></table>';
$oAux = $oNode->addChild($aRow['STEP_UID'] . '_node', $sOptions, array('nodeType' => 'child'));
break;
case 'EXTERNAL':
$aActions = array('action' => 'label');
$oPluginRegistry = PluginRegistry::loadSingleton();
/** @var \ProcessMaker\Plugins\Interfaces\StepDetail $val */
foreach ($externalSteps as $keyStep => $val) {
if ($val->equalStepIdTo($aRow->getStepUidObj())) {
$stepTitle = $val->getStepTitle(); //default title
$sNamespace = $val->getNamespace();
$oPlugin = $oPluginRegistry->getPlugin($sNamespace);
$classFile = PATH_PLUGINS . $oPlugin->sNamespace . PATH_SEP . 'class.' . $oPlugin->sNamespace . '.php';
if (file_exists($classFile)) {
require_once($classFile);
$sClassName = $sNamespace . 'class';
$obj = new $sClassName();
if (method_exists($obj, 'getExternalStepAction')) {
$aActions = $obj->getExternalStepAction($aRow->getStepUidObj(), $aRow->getStepPosition());
}
}
}
}
$sOptions = "<table width='70%' cellpadding='0' cellspacing='0' border='0'><tr>";
$sOptions .= "<td width='100%' class='treeNode'>";
foreach ($aActions as $action => $label) {
$styleAction = $_GET['UID'] == $aRow->getStepUidObj() &&
$_GET['POSITION'] == $aRow->getStepPosition() &&
$_GET['ACTION'] == $action ? 'background-color:orange;color:white;padding-left:5px;padding-right:5px; ' : '';
$sOptions .= " <a style='$styleAction' href='../cases/cases_Step?TYPE=" .
$aRow->getStepTypeObj() . "&UID=" . $aRow->getStepUidObj() . "&POSITION=" . $aRow->getStepPosition() . "&ACTION=$action'>" . $label . "</a>";
}
$sOptions .= '</td></tr></table>';
$oAux = $oNode->addChild($aRow->getStepUid() . '_node', $sOptions, array('nodeType' => 'child'));
}
$oAux->point = '';
}
}
}
$oNode = $oTree->addChild('-1', '<span class="treeNode"><a style="' . (($_GET['TYPE'] == 'ASSIGN_TASK') && ($_GET['UID'] == '-1' && ($_GET['ACTION'] == 'ASSIGN')) ? 'background-color:orange;padding-left:5px;padding-right:5px;color:white;' : '') . '" href="../cases/cases_Step?TYPE=ASSIGN_TASK&UID=-1&POSITION=10000&ACTION=ASSIGN">[ ' . G::LoadTranslation('ID_ASSIGN_TASK') . ' ]</a></span>', array('nodeType' => 'parent'));
$oNode->plus = '';
$oNode->minus = '';
$oNode =& $oTree->addChild('-1', '<span class="treeNode"><a style="' . (($_GET['TYPE'] == 'ASSIGN_TASK') && ($_GET['UID'] == '-1' && ($_GET['ACTION'] == 'ASSIGN')) ? 'background-color:orange;padding-left:5px;padding-right:5px;color:white;' : '') . '" href="../cases/cases_Step?TYPE=ASSIGN_TASK&UID=-1&POSITION=10000&ACTION=ASSIGN">[ ' . G::LoadTranslation('ID_ASSIGN_TASK') . ' ]</a></span>', array('nodeType'=>'parent'));
$oNode->plus = '';
$oNode->minus = '';
/*$sOptions = '<table width="70%" cellpadding="0" cellspacing="0" border="0"><tr>';
$sOptions .= '<td width="100%" class="treeNode"><a style="' . (($_GET['TYPE'] == 'ASSIGN_TASK') && ($_GET['UID'] == '-1' && ($_GET['ACTION'] == 'ASSIGN')) ? 'background-color:#006699;padding-left:5px;padding-right:5px;color:white;' : '') . '" href="../cases/cases_Step?TYPE=ASSIGN_TASK&UID=-1&POSITION=10000&ACTION=ASSIGN">' . G::LoadTranslation('ID_ASSIGN_SCREEN') . '</a></td>';
$sOptions .= '</tr></table>';
$oAux =& $oNode->addChild('-1_node', $sOptions, array('nodeType'=>'child'));
$oAux->point = '';*/
echo $oTree->render();

View File

@@ -55,22 +55,22 @@ $html = "
</tr>
</table>";
$ch = &$tree->addChild("", $html, array('nodeType' => 'child'));
$ch = $tree->addChild("", $html, array('nodeType' => 'child'));
$ch->point = '</span><img src="/images/plus.gif" />';
$i=1;
$PRO_UID='';
$DYN_UID='';
foreach ($steps as $step) {
require_once 'classes/model/Dynaform.php';
$od = new Dynaform();
$dynaformF = $od->Load($step['STEP_UID_OBJ']);
require_once 'classes/model/Dynaform.php';
$od = new Dynaform();
$dynaformF = $od->Load($step['STEP_UID_OBJ']);
$n = $step['STEP_POSITION'];
$TITLE = " - ".$dynaformF['DYN_TITLE'];
$DYN_UID = $dynaformF['DYN_UID'];
$PRO_UID = $step['PRO_UID'];
$n = $step['STEP_POSITION'];
$TITLE = " - ".$dynaformF['DYN_TITLE'];
$DYN_UID = $dynaformF['DYN_UID'];
$PRO_UID = $step['PRO_UID'];
$html = "
$html = "
<table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>
<tr>
<td class='treeNode' style='border:0px;background-color:transparent;'><span id='focus$i'></td>
@@ -81,9 +81,9 @@ foreach ($steps as $step) {
</tr>
</table>";
$ch = &$tree->addChild("", $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/ftv2mnode.gif" />';
$i++;
$ch = $tree->addChild("", $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/ftv2mnode.gif" />';
$i++;
}
$html = "
@@ -95,23 +95,23 @@ $html = "
</td>
</tr>
</table>";
$ch = &$tree->addChild("", $html, array('nodeType' => 'child'));
$ch = $tree->addChild("", $html, array('nodeType' => 'child'));
$ch->point = '</span><img src="/images/plus.gif" />';
$steps = $o->getAllInputsStepsToRevise($_GET['APP_UID']);
//$i=1;
foreach ($steps as $step) {
require_once 'classes/model/InputDocument.php';
$od = new InputDocument();
$IDF = $od->Load($step['STEP_UID_OBJ']);
require_once 'classes/model/InputDocument.php';
$od = new InputDocument();
$IDF = $od->Load($step['STEP_UID_OBJ']);
$n = $step['STEP_POSITION'];
$TITLE = " - ".$IDF['INP_DOC_TITLE'];
$INP_DOC_UID = $IDF['INP_DOC_UID'];
$PRO_UID = $step['PRO_UID'];
$n = $step['STEP_POSITION'];
$TITLE = " - ".$IDF['INP_DOC_TITLE'];
$INP_DOC_UID = $IDF['INP_DOC_UID'];
$PRO_UID = $step['PRO_UID'];
$html = "
$html = "
<table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>
<tr>
<td class='treeNode' style='border:0px;background-color:transparent;'><span id='focus$i'></td>
@@ -122,9 +122,9 @@ foreach ($steps as $step) {
</tr>
</table>";
$ch = &$tree->addChild("", $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/ftv2mnode.gif" />';
$i++;
$ch = $tree->addChild("", $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/ftv2mnode.gif" />';
$i++;
}
$i++;
@@ -138,8 +138,8 @@ $html = "
</tr>
</table>";
$ch = &$tree->addChild("", $html, array('nodeType' => 'child'));
$ch = $tree->addChild("", $html, array('nodeType' => 'child'));
$ch->point = '</span><img src="/images/ftv2doc.gif" />';
print ($tree->render());
print($tree->render());
//

View File

@@ -1,39 +1,39 @@
<?php
/**
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* 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.
*
* 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.
*
*/
/*
* @Author Erik Amaru Ortiz <erik@colosa.com>
* @Date Aug 26th, 2009
*/
if(!((isset( $_SESSION['USER_LOGGED'] ))&&(!(isset($_GET['sid']))))||!isset($_SESSION['Current_Dynafom'])) {
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptCode("
<?php
/**
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* 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.
*
* 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.
*
*/
/*
* @Author Erik Amaru Ortiz <erik@colosa.com>
* @Date Aug 26th, 2009
*/
if (!((isset($_SESSION['USER_LOGGED']))&&(!(isset($_GET['sid']))))||!isset($_SESSION['Current_Dynafom'])) {
$oHeadPublisher = headPublisher::getSingleton();
$oHeadPublisher->addScriptCode("
window.parent.location.href = '../processes/mainInit';
");
G::RenderPage('publish');
exit();
}
");
G::RenderPage('publish');
exit();
}
?>
<html>
<head>
@@ -44,12 +44,12 @@
<script type="text/javascript" src="/js/jquery/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="/jscore/dynaforms/dynaforms_fieldsHandler.js"></script>
</head>
<?php
$content = file_get_contents(PATH_DYNAFORM.$_SESSION['Current_Dynafom']['Parameters']['FILE'].".xml");
$oXxml = G::xmlParser($content);
if( !isset($oXxml->result['dynaForm']['__CONTENT__']) ){
?>
<?php
$content = file_get_contents(PATH_DYNAFORM.$_SESSION['Current_Dynafom']['Parameters']['FILE'].".xml");
$oXxml = G::xmlParser($content);
if (!isset($oXxml->result['dynaForm']['__CONTENT__'])) {
?>
<br/>
<div class="ui-widget-header ui-corner-all" style="height:17px" align="center">
<?php echo G::loadTranslation('ID_NO_FIELD_FOUND')?>
@@ -58,30 +58,28 @@
parent.document.getElementById('light').style.display='none';
parent.document.getElementById('fade').style.display='none';
</script>
<?php
die();
}
$elements = $oXxml->result['dynaForm']['__CONTENT__'];
$dynaformAttributes = $oXxml->result['dynaForm']['__ATTRIBUTES__'];
$dynaformType = $dynaformAttributes['type'];
foreach($elements as $node_name=>$node){
if( $node_name == "___pm_boot_strap___"){
$boot_strap = $elements[$node_name];
$hidden_fields = G::decrypt($boot_strap['__ATTRIBUTES__']['meta'], 'dynafieldsHandler');
//echo $hidden_fields;
$hidden_fields_list = explode(',', $hidden_fields);
unset($elements[$node_name]);
?>
<?php
die();
}
$elements = $oXxml->result['dynaForm']['__CONTENT__'];
$dynaformAttributes = $oXxml->result['dynaForm']['__ATTRIBUTES__'];
$dynaformType = $dynaformAttributes['type'];
foreach ($elements as $node_name=>$node) {
if ($node_name == "___pm_boot_strap___") {
$boot_strap = $elements[$node_name];
$hidden_fields = G::decrypt($boot_strap['__ATTRIBUTES__']['meta'], 'dynafieldsHandler');
//echo $hidden_fields;
$hidden_fields_list = explode(',', $hidden_fields);
unset($elements[$node_name]); ?>
<script>
parent.jsMeta = "<?php echo $boot_strap['__ATTRIBUTES__']['meta'] ?>";
</script>
<?php
}
}
<?php
}
}
?>
<body>
<table border="0" width="100%" cellpadding="0" cellspacing="0" class="fieldshandler_item">
@@ -106,74 +104,85 @@
<div id="dynafields">
<ul id="sortable" style="margin:0; padding:0;">
<?php foreach($elements as $node_name=>$node){
if( isset($hidden_fields_list) ){
$checked = !(in_array($node_name, $hidden_fields_list))? 'checked="checked"': '';
} else {
$checked = 'checked="checked"';
}
?>
<?php foreach ($elements as $node_name=>$node) {
if (isset($hidden_fields_list)) {
$checked = !(in_array($node_name, $hidden_fields_list))? 'checked="checked"': '';
} else {
$checked = 'checked="checked"';
} ?>
<li style="list-style:none;" id="<?php echo $node_name?>" class="ui-state-default" onmouseover="setClass(this, 'ui-state-hover')" onmouseout="setClass(this, 'ui-state-default')">
<table class="dynalist" border="0" width="100%" cellpadding="0" cellspacing="0" id="fieldshandler_items_table">
<tr>
<td width="7%">
<?php if($node['__ATTRIBUTES__']['type'] != 'javascript' && $dynaformType != 'grid') {?>
<?php if ($node['__ATTRIBUTES__']['type'] != 'javascript' && $dynaformType != 'grid') {
?>
<input id="chk@<?php echo $node_name?>" type="checkbox" onclick="parent.jsMeta = fieldsHandlerSaveHidden();" <?php echo $checked?> />
<?php } else {?>
<?php
} else {
?>
&nbsp;
<?php }?>
<?php
} ?>
</td>
<td width="15%" >
<?php $type = $node['__ATTRIBUTES__']['type'];
switch($type){
case 'yesno': $type = 'yes_no'; break;
case 'listbox': $type = 'list_box'; break;
case 'checkgroup': $type = 'check_group'; break;
case 'radiogroup': $type = 'radio_group'; break;
case 'file': $type = 'upload_files'; break;
}?>
<?php if ( is_file(PATH_HTML.'images'.PATH_SEP.'dynamicForm'.PATH_SEP."$type.gif") ){?>
<?php $type = $node['__ATTRIBUTES__']['type'];
switch ($type) {
case 'yesno': $type = 'yes_no'; break;
case 'listbox': $type = 'list_box'; break;
case 'checkgroup': $type = 'check_group'; break;
case 'radiogroup': $type = 'radio_group'; break;
case 'file': $type = 'upload_files'; break;
} ?>
<?php if (is_file(PATH_HTML.'images'.PATH_SEP.'dynamicForm'.PATH_SEP."$type.gif")) {
?>
<img src="/images/dynamicForm/<?php echo $type?>.gif"/>
<?php } else {?>
<?php
} else {
?>
<img src="/images/unknown_icon.gif" border="0" width="20" height="16"/>
<?php }?>
<span style="font-size:10px;">&nbsp;<?php echo "({$node['__ATTRIBUTES__']['type']})";?></span>
<?php
} ?>
<span style="font-size:10px;">&nbsp;<?php echo "({$node['__ATTRIBUTES__']['type']})"; ?></span>
</td>
<td width="28%" style="font-size:12px;">
&nbsp;<?php echo "$node_name";?>
&nbsp;<?php echo "$node_name"; ?>
</td>
<td><p style="font-size:12px; color:#1C3166; font-weight:bold">
<?php if (isset($node["__CONTENT__"][SYS_LANG]["__VALUE__"]) && $node["__CONTENT__"][SYS_LANG]["__VALUE__"] != "") {
if( strlen($node['__CONTENT__'][SYS_LANG]['__VALUE__']) > 30 ){
$label = substr(trim(strip_tags(G::stripCDATA($node['__CONTENT__'][SYS_LANG]['__VALUE__']))), 0, 30 ) . '...';
} else {
$label = $node['__CONTENT__'][SYS_LANG]['__VALUE__'];
}
print($label);
} else {
print("&nbsp;");
}
?></p>
<?php if (isset($node["__CONTENT__"][SYS_LANG]["__VALUE__"]) && $node["__CONTENT__"][SYS_LANG]["__VALUE__"] != "") {
if (strlen($node['__CONTENT__'][SYS_LANG]['__VALUE__']) > 30) {
$label = substr(trim(strip_tags(G::stripCDATA($node['__CONTENT__'][SYS_LANG]['__VALUE__']))), 0, 30) . '...';
} else {
$label = $node['__CONTENT__'][SYS_LANG]['__VALUE__'];
}
print($label);
} else {
print("&nbsp;");
} ?></p>
</td>
<td width="40px" class="options" align="right">
<?php if( in_array($node['__ATTRIBUTES__']['type'], $_POST['fieldsList']) ){ ?>
<?php if (in_array($node['__ATTRIBUTES__']['type'], $_POST['fieldsList'])) {
?>
<!-- <div class="tool"><img src="/images/options.png" width="12" height="12" border="0"/> </div>-->
<div class="jq-checkpointSubhead" style="display:block">
<a title="<?php echo G::loadTranslation('ID_EDIT_FIELD')?>" href="#" onclick="__ActionEdit('<?php echo $node_name?>'); return false;"><img src="/images/e_Edit.png" width="15" height="15" border="0" onmouseout="backImage(this,'')" onmouseover="backImage(this,'url(/images/dynamicForm/hover.gif) no-repeat')"/></a>
<a title="<?php echo G::loadTranslation('ID_REMOVE_FIELD')?>" href="#" onclick="__ActionDelete('<?php echo $node_name?>', '<?php echo $node['__ATTRIBUTES__']['type'];?>');return false;"><img src="/images/e_Delete.png" width="15" height="15" border="0" onmouseout="backImage(this,'')" onmouseover="backImage(this,'url(/images/dynamicForm/hover.gif) no-repeat')"/></a>
<a title="<?php echo G::loadTranslation('ID_REMOVE_FIELD')?>" href="#" onclick="__ActionDelete('<?php echo $node_name?>', '<?php echo $node['__ATTRIBUTES__']['type']; ?>');return false;"><img src="/images/e_Delete.png" width="15" height="15" border="0" onmouseout="backImage(this,'')" onmouseover="backImage(this,'url(/images/dynamicForm/hover.gif) no-repeat')"/></a>
</div>
<?php } else {?>
<?php
} else {
?>
<div class="tool"><img src="/images/options.png" width="12" height="12" border="0"/> </div>
<div class="jq-checkpointSubhead" style="display:none">
<a title="<?php echo G::loadTranslation('ID_REMOVE_FIELD')?>" href="#" onclick="__ActionDelete('<?php echo $node_name?>', '<?php echo $node['__ATTRIBUTES__']['type'];?>');return false;"><img src="/images/e_Delete.png" width="15" height="15" border="0" onmouseout="backImage(this,'')" onmouseover="backImage(this,'url(/images/dynamicForm/hover.gif) no-repeat')"/></a>
<a title="<?php echo G::loadTranslation('ID_REMOVE_FIELD')?>" href="#" onclick="__ActionDelete('<?php echo $node_name?>', '<?php echo $node['__ATTRIBUTES__']['type']; ?>');return false;"><img src="/images/e_Delete.png" width="15" height="15" border="0" onmouseout="backImage(this,'')" onmouseover="backImage(this,'url(/images/dynamicForm/hover.gif) no-repeat')"/></a>
</div>
<?php }?>
<?php
} ?>
</td>
</tr>
</table>
</li>
<?php }?>
<?php
}?>
</ul>
</div>
</center>

File diff suppressed because it is too large Load Diff

View File

@@ -1,47 +1,47 @@
<?php
$ROL_UID = $_GET['ROL_UID'];
global $RBAC;
$oDataset = $RBAC->getAllPermissions($ROL_UID, $RBAC->sSystem);
$roleCode = $RBAC->getRoleCode($ROL_UID);
$tree = new PmTree();
$tree->name = 'Users';
$tree->nodeType = "base";
$tree->width = "350px";
$tree->value = '
<div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="boxContentBlue">
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
<tr>
<td class="userGroupTitle">' . G::LoadTranslation('ID_ASSIGN_THE_ROLE') . ': '.$roleCode.'</td>
</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());
<?php
$ROL_UID = $_GET['ROL_UID'];
global $RBAC;
$oDataset = $RBAC->getAllPermissions($ROL_UID, $RBAC->sSystem);
$roleCode = $RBAC->getRoleCode($ROL_UID);
$tree = new PmTree();
$tree->name = 'Users';
$tree->nodeType = "base";
$tree->width = "350px";
$tree->value = '
<div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="boxContentBlue">
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
<tr>
<td class="userGroupTitle">' . G::LoadTranslation('ID_ASSIGN_THE_ROLE') . ': '.$roleCode.'</td>
</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

@@ -38,7 +38,7 @@ while ($aRow = $oDataset->getRow()) {
</tr>
</table>";
$ch = &$tree->addChild('', $html, array('nodeType' => 'child'));
$ch = $tree->addChild('', $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/users.png" />';
$oDataset->next();

View File

@@ -44,7 +44,7 @@ while ($aRow = $oDataset->getRow()) {
</tr>
</table>";
$ch = &$tree->addChild('', $html, array('nodeType' => 'child'));
$ch = $tree->addChild('', $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/users.png" />';
$oDataset->next();

View File

@@ -1,84 +1,84 @@
<?php
/**
* groups_Tree.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* 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.
*
* 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.
*
*/
/**
* @Description This is the View of all groups from a determinated user
* @author Erik Amaru Ortiz <erik@colosa.com>
* @Date 24/04/2008
* @LastModification none
*/
$ROL_UID = $_GET['ROL_UID'];
global $RBAC;
$oDataset = $RBAC->getRolePermissions($ROL_UID);
$roleCode = $RBAC->getRoleCode($ROL_UID);
$tree = new PmTree();
$tree->name = 'Users';
$tree->nodeType = "base";
$tree->width = "350px";
$tree->value = '
<div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="boxContentBlue">
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
<tr>
<td class="userGroupTitle">' . G::LoadTranslation('ID_PERMISSIONS_FOR_THE_ROL') . ': '.$roleCode.'</td>
</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="showPermissions(\''.$_GET['ROL_UID'].'\');return false;">'.G::LoadTranslation('ID_ASSIGN').'</a></div>';
$tree->showSign = false;
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$ID_REMOVE = G::LoadTranslation('ID_REMOVE');
$CODE = $aRow['PER_CODE'];
$UID = $aRow['PER_UID'];
if($ROL_UID != "00000000000000000000000000000002") { #because the admin remove permitions it doesn't posible
$refer = "<a href=\"javascript:deletePermissionRole('{$ROL_UID}','{$UID}');\">{$ID_REMOVE}</a>";
} else {
$refer = "<font color='#CFCFCF'>{$ID_REMOVE}</font>";
}
$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;'>[$refer]</td>
</tr>
</table>";
$ch = &$tree->addChild('', $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/users.png" />';
$oDataset->next();
}
print ($tree->render());
<?php
/**
* groups_Tree.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* 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.
*
* 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.
*
*/
/**
* @Description This is the View of all groups from a determinated user
* @author Erik Amaru Ortiz <erik@colosa.com>
* @Date 24/04/2008
* @LastModification none
*/
$ROL_UID = $_GET['ROL_UID'];
global $RBAC;
$oDataset = $RBAC->getRolePermissions($ROL_UID);
$roleCode = $RBAC->getRoleCode($ROL_UID);
$tree = new PmTree();
$tree->name = 'Users';
$tree->nodeType = "base";
$tree->width = "350px";
$tree->value = '
<div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="boxContentBlue">
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
<tr>
<td class="userGroupTitle">' . G::LoadTranslation('ID_PERMISSIONS_FOR_THE_ROL') . ': '.$roleCode.'</td>
</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="showPermissions(\''.$_GET['ROL_UID'].'\');return false;">'.G::LoadTranslation('ID_ASSIGN').'</a></div>';
$tree->showSign = false;
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$ID_REMOVE = G::LoadTranslation('ID_REMOVE');
$CODE = $aRow['PER_CODE'];
$UID = $aRow['PER_UID'];
if ($ROL_UID != "00000000000000000000000000000002") { #because the admin remove permitions it doesn't posible
$refer = "<a href=\"javascript:deletePermissionRole('{$ROL_UID}','{$UID}');\">{$ID_REMOVE}</a>";
} else {
$refer = "<font color='#CFCFCF'>{$ID_REMOVE}</font>";
}
$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;'>[$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

@@ -1,134 +1,133 @@
<?php
/**
* groups_Tree.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* 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.
*
* 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.
*
*/
$wsSessionId = '';
if (isset ( $_SESSION ['WS_SESSION_ID'] )) {
$wsSessionId = $_SESSION ['WS_SESSION_ID'];
}
if (isset ( $_GET ['x'] )) {
if ($_GET ['x'] == 1) {
$wsdl = $_SESSION ['END_POINT'];
$workspace = $_SESSION ['WS_WORKSPACE'];
} else {
$wsdl = '<font color="red">' . G::LoadTranslation ( 'ID_WSDL' ) . '</font>';
$workspace = '';
}
} else {
if (! isset ( $_SESSION ['END_POINT'] )) {
$wsdl = 'http://' . $_SERVER ['HTTP_HOST'];
$workspace = config("system.workspace");
} else {
$wsdl = $_SESSION ['END_POINT'];
$workspace = $_SESSION ['WS_WORKSPACE'];
}
}
$defaultEndpoint = 'http://' . $_SERVER ['SERVER_NAME'] . ':' . $_SERVER ['SERVER_PORT'] . '/sys' . config("system.workspace") . '/en/classic/services/wsdl2';
$wsdl = isset ( $_SESSION ['END_POINT'] ) ? $_SESSION ['END_POINT'] : $defaultEndpoint;
$tree = new PmTree ( );
$tree->name = 'WebServices';
$tree->nodeType = "base";
$tree->contentWidth = "310";
$tree->width = "280px";
$tree->value = '
<div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="boxContentBlue">
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
<tr>
<td class="userGroupTitle">' . G::loadTranslation ( "ID_WEB_SERVICES" ) . '</td>
</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="showDetails();return false;">' . G::LoadTranslation ( 'ID_DETAILS_WEBSERVICES' ) .
'</a> &nbsp;
<a href="#" onclick="webServicesSetup();return false;">' . G::LoadTranslation ( 'ID_SETUP_WEBSERVICES' ) .
'</a>
</div>
';
$tree->showSign = false;
$allWebservices = array ();
$allWebservices [] = 'Login';
$allWebservices [] = 'CreateUser';
$allWebservices [] = 'AssignUserToGroup';
$allWebservices [] = 'NewCase';
$allWebservices [] = 'NewCaseImpersonate';
$allWebservices [] = 'RouteCase';
$allWebservices [] = 'SendVariables';
$allWebservices [] = 'SendMessage';
$allWebservices [] = 'ProcessList';
$allWebservices [] = 'CaseList';
$allWebservices [] = 'UnassignedCaseList';
$allWebservices [] = 'RoleList';
$allWebservices [] = 'GroupList';
$allWebservices [] = 'UserList';
$allWebservices [] = 'TaskList';
$allWebservices [] = 'TriggerList';
$allWebservices [] = 'InputDocumentList';
$allWebservices [] = 'InputDocumentProcessList';
$allWebservices [] = 'OutputDocumentList';
$allWebservices [] = 'RemoveDocument';
$allWebservices [] = 'TaskCase';
$allWebservices [] = 'ReassignCase';
$allWebservices [] = 'removeUserFromGroup';
foreach ($allWebservices as $ws) {
$ID_TEST = G::LoadTranslation ( 'ID_TEST' );
$UID = htmlentities ( $ws );
$WS_TITLE = strip_tags ( $ws );
$htmlGroup = '';
$htmlGroup .= "<table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>";
$htmlGroup .= "<tr>";
$htmlGroup .= "<td width='250px' class='treeNode' style='border:0px;background-color:transparent;'>";
$htmlGroup .= "{$WS_TITLE}</td>";
$htmlGroup .= "<td class='treeNode' style='border:0px;background-color:transparent;'>";
if ($WS_TITLE !='SendFiles') {
if ($WS_TITLE == 'Login' || $wsSessionId != '') {
$htmlGroup .= "[<a href='#' onclick=\"showFormWS('{$UID}');return false;\">{$ID_TEST}</a>]";
}
} else {
if (isset($_SESSION ['WS_SESSION_ID'])&&$_SESSION ['WS_SESSION_ID']!='') {
$htmlGroup .= "[<a href='#' onclick=\"showUploadFilesForm();return false;\">{$ID_TEST}</a>]";
}
}
$htmlGroup .= "</td></tr></table>";
$ch = & $tree->addChild ( $ws, $htmlGroup, array ('nodeType' => 'child' ) );
$ch->point = '<img src="/images/trigger.gif" />';
}
print ($tree->render ()) ;
<?php
/**
* groups_Tree.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* 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.
*
* 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.
*
*/
$wsSessionId = '';
if (isset ($_SESSION ['WS_SESSION_ID'])) {
$wsSessionId = $_SESSION ['WS_SESSION_ID'];
}
if (isset ($_GET ['x'])) {
if ($_GET ['x'] == 1) {
$wsdl = $_SESSION ['END_POINT'];
$workspace = $_SESSION ['WS_WORKSPACE'];
} else {
$wsdl = '<font color="red">' . G::LoadTranslation('ID_WSDL') . '</font>';
$workspace = '';
}
} else {
if (!isset ($_SESSION ['END_POINT'])) {
$wsdl = 'http://' . $_SERVER ['HTTP_HOST'];
$workspace = config("system.workspace");
} else {
$wsdl = $_SESSION ['END_POINT'];
$workspace = $_SESSION ['WS_WORKSPACE'];
}
}
$defaultEndpoint = 'http://' . $_SERVER ['SERVER_NAME'] . ':' . $_SERVER ['SERVER_PORT'] . '/sys' . config("system.workspace") . '/en/classic/services/wsdl2';
$wsdl = isset ($_SESSION ['END_POINT']) ? $_SESSION ['END_POINT'] : $defaultEndpoint;
$tree = new PmTree ();
$tree->name = 'WebServices';
$tree->nodeType = "base";
$tree->contentWidth = "310";
$tree->width = "280px";
$tree->value = '
<div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="boxContentBlue">
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
<tr>
<td class="userGroupTitle">' . G::loadTranslation("ID_WEB_SERVICES") . '</td>
</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="showDetails();return false;">' . G::LoadTranslation('ID_DETAILS_WEBSERVICES') .
'</a> &nbsp;
<a href="#" onclick="webServicesSetup();return false;">' . G::LoadTranslation('ID_SETUP_WEBSERVICES') .
'</a>
</div>
';
$tree->showSign = false;
$allWebservices = array();
$allWebservices [] = 'Login';
$allWebservices [] = 'CreateUser';
$allWebservices [] = 'AssignUserToGroup';
$allWebservices [] = 'NewCase';
$allWebservices [] = 'NewCaseImpersonate';
$allWebservices [] = 'RouteCase';
$allWebservices [] = 'SendVariables';
$allWebservices [] = 'SendMessage';
$allWebservices [] = 'ProcessList';
$allWebservices [] = 'CaseList';
$allWebservices [] = 'UnassignedCaseList';
$allWebservices [] = 'RoleList';
$allWebservices [] = 'GroupList';
$allWebservices [] = 'UserList';
$allWebservices [] = 'TaskList';
$allWebservices [] = 'TriggerList';
$allWebservices [] = 'InputDocumentList';
$allWebservices [] = 'InputDocumentProcessList';
$allWebservices [] = 'OutputDocumentList';
$allWebservices [] = 'RemoveDocument';
$allWebservices [] = 'TaskCase';
$allWebservices [] = 'ReassignCase';
$allWebservices [] = 'removeUserFromGroup';
foreach ($allWebservices as $ws) {
$ID_TEST = G::LoadTranslation('ID_TEST');
$UID = htmlentities($ws);
$WS_TITLE = strip_tags($ws);
$htmlGroup = '';
$htmlGroup .= "<table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>";
$htmlGroup .= "<tr>";
$htmlGroup .= "<td width='250px' class='treeNode' style='border:0px;background-color:transparent;'>";
$htmlGroup .= "{$WS_TITLE}</td>";
$htmlGroup .= "<td class='treeNode' style='border:0px;background-color:transparent;'>";
if ($WS_TITLE != 'SendFiles') {
if ($WS_TITLE == 'Login' || $wsSessionId != '') {
$htmlGroup .= "[<a href='#' onclick=\"showFormWS('{$UID}');return false;\">{$ID_TEST}</a>]";
}
} else {
if (isset($_SESSION ['WS_SESSION_ID']) && $_SESSION ['WS_SESSION_ID'] != '') {
$htmlGroup .= "[<a href='#' onclick=\"showUploadFilesForm();return false;\">{$ID_TEST}</a>]";
}
}
$htmlGroup .= "</td></tr></table>";
$ch = $tree->addChild($ws, $htmlGroup, array('nodeType' => 'child'));
$ch->point = '<img src="/images/trigger.gif" />';
}
print($tree->render());

View File

@@ -28,90 +28,91 @@ use ProcessMaker\Plugins\PluginRegistry;
try {
//call plugin
$oPluginRegistry = PluginRegistry::loadSingleton();
$externalSteps = $oPluginRegistry->getSteps();
$oPluginRegistry = PluginRegistry::loadSingleton();
$externalSteps = $oPluginRegistry->getSteps();
$oProcessMap = new ProcessMap();
$oTree = new PmTree();
$oTree->nodeType = 'blank';
$oTree->name = 'Triggers';
$oTree->showSign = false;
$oCriteria = new Criteria('workflow');
$oCriteria->add(StepPeer::PRO_UID, $_SESSION['PROCESS']);
$oCriteria->add(StepPeer::TAS_UID, $_SESSION['TASK']);
$oCriteria->addAscendingOrderByColumn(StepPeer::STEP_POSITION);
$oDataset = StepPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$i = 0;
while ($aRow = $oDataset->getRow()) {
switch ($aRow['STEP_TYPE_OBJ']) {
case 'DYNAFORM':
require_once 'classes/model/Dynaform.php';
$oObject = new Dynaform();
$aFields = $oObject->load($aRow['STEP_UID_OBJ']);
$aRow['STEP_NAME'] = $aFields['DYN_TITLE'];
break;
case 'INPUT_DOCUMENT':
require_once 'classes/model/InputDocument.php';
$oObject = new InputDocument();
$aFields = $oObject->load($aRow['STEP_UID_OBJ']);
$aRow['STEP_NAME'] = $aFields['INP_DOC_TITLE'];
break;
case 'OUTPUT_DOCUMENT':
require_once 'classes/model/OutputDocument.php';
$oObject = new OutputDocument();
$aFields = $oObject->load($aRow['STEP_UID_OBJ']);
$aRow['STEP_NAME'] = $aFields['OUT_DOC_TITLE'];
break;
case 'EXTERNAL':
$oProcessMap = new ProcessMap();
$oTree = new PmTree();
$oTree->nodeType = 'blank';
$oTree->name = 'Triggers';
$oTree->showSign = false;
$oCriteria = new Criteria('workflow');
$oCriteria->add(StepPeer::PRO_UID, $_SESSION['PROCESS']);
$oCriteria->add(StepPeer::TAS_UID, $_SESSION['TASK']);
$oCriteria->addAscendingOrderByColumn(StepPeer::STEP_POSITION);
$oDataset = StepPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$i = 0;
while ($aRow = $oDataset->getRow()) {
switch ($aRow['STEP_TYPE_OBJ']) {
case 'DYNAFORM':
require_once 'classes/model/Dynaform.php';
$oObject = new Dynaform();
$aFields = $oObject->load($aRow['STEP_UID_OBJ']);
$aRow['STEP_NAME'] = $aFields['DYN_TITLE'];
break;
case 'INPUT_DOCUMENT':
require_once 'classes/model/InputDocument.php';
$oObject = new InputDocument();
$aFields = $oObject->load($aRow['STEP_UID_OBJ']);
$aRow['STEP_NAME'] = $aFields['INP_DOC_TITLE'];
break;
case 'OUTPUT_DOCUMENT':
require_once 'classes/model/OutputDocument.php';
$oObject = new OutputDocument();
$aFields = $oObject->load($aRow['STEP_UID_OBJ']);
$aRow['STEP_NAME'] = $aFields['OUT_DOC_TITLE'];
break;
case 'EXTERNAL':
$aRow['STEP_NAME'] = 'unknown ' . $aRow['STEP_UID'];
/** @var \ProcessMaker\Plugins\Interfaces\StepDetail $val */
foreach ( $externalSteps as $val ) {
if ( $val->equalStepIdTo($aRow['STEP_UID_OBJ']))
$aRow['STEP_NAME'] = $val->getStepTitle();
}
break;
}
$oCriteria = $oProcessMap->getStepTriggersCriteria($aRow['STEP_UID'], $_SESSION['TASK'], 'BEFORE');
foreach ($externalSteps as $val) {
if ($val->equalStepIdTo($aRow['STEP_UID_OBJ'])) {
$aRow['STEP_NAME'] = $val->getStepTitle();
}
}
break;
}
$oCriteria = $oProcessMap->getStepTriggersCriteria($aRow['STEP_UID'], $_SESSION['TASK'], 'BEFORE');
$iCantidad1 = StepTriggerPeer::doCount($oCriteria);
$oCriteria = $oProcessMap->getStepTriggersCriteria($aRow['STEP_UID'], $_SESSION['TASK'], 'AFTER');
$iCantidad2 = StepTriggerPeer::doCount($oCriteria);
$oNode = $oTree->addChild($aRow['STEP_UID'], '&nbsp;&nbsp;<span onclick="tree.expand(this.parentNode);" style="cursor: pointer;">' . $aRow['STEP_NAME'] . ' - ' . G::LoadTranslation('ID_TRIGGERS'). ' (<span id="TRIG_'.$aRow['STEP_UID'] . '">' . ($iCantidad1 + $iCantidad2) . '</span>)' . '</span>', array('nodeType'=>'parent'));
$oNode->contracted = true;
$oAux1 = $oNode->addChild('before_node', '<span onclick="tree.expand(this.parentNode);showTriggers(\'' . $aRow['STEP_UID'] . '\', \'BEFORE\');" style="cursor: pointer;">' . G::LoadTranslation('ID_BEFORE') . ' - ' . G::LoadTranslation('ID_TRIGGERS'). ' (<span id="TRIG_'.$aRow['STEP_UID'].'_BEFORE">'. $iCantidad1 .'</span>) </span>', array('nodeType'=>'parent'));
$oAux1->plus = "<span style='cursor:pointer;display:block;width:15;height:10px;' onclick='tree.expand(this.parentNode);showTriggers(\"" . $aRow['STEP_UID'] . "\", \"BEFORE\");'></span>";
$oAux1->contracted = true;
$oAux2 = $oAux1->addChild($aRow['STEP_UID'] . '_before_node', '<span id="triggersSpan_' . $aRow['STEP_UID'] . '_BEFORE"></span>', array('nodeType'=>'parentBlue'));
$oAux1 = $oNode->addChild('after_node', '<span onclick="tree.expand(this.parentNode);showTriggers(\'' . $aRow['STEP_UID'] . '\', \'AFTER\');" style="cursor: pointer;">' . G::LoadTranslation('ID_AFTER') . ' - ' . G::LoadTranslation('ID_TRIGGERS'). ' (<span id="TRIG_'.$aRow['STEP_UID'].'_AFTER">'. $iCantidad2 .'</span>) </span>', array('nodeType'=>'parent'));
$oAux1->plus = "<span style='cursor:pointer;display:block;width:15;height:10px;' onclick='tree.expand(this.parentNode);showTriggers(\"" . $aRow['STEP_UID'] . "\", \"AFTER\");'></span>";
$oAux1->contracted = true;
$oAux2 = $oAux1->addChild($aRow['STEP_UID'] . '_after_node', '<span id="triggersSpan_' . $aRow['STEP_UID'] . '_AFTER"></span>', array('nodeType'=>'parentBlue'));
$oDataset->next();
}
$oCriteria = $oProcessMap->getStepTriggersCriteria(-1, $_SESSION['TASK'], 'BEFORE');
$iCantidad1 = StepTriggerPeer::doCount($oCriteria);
$oCriteria = $oProcessMap->getStepTriggersCriteria($aRow['STEP_UID'], $_SESSION['TASK'], 'AFTER');
$oCriteria = $oProcessMap->getStepTriggersCriteria(-2, $_SESSION['TASK'], 'BEFORE');
$iCantidad2 = StepTriggerPeer::doCount($oCriteria);
$oNode =& $oTree->addChild($aRow['STEP_UID'], '&nbsp;&nbsp;<span onclick="tree.expand(this.parentNode);" style="cursor: pointer;">' . $aRow['STEP_NAME'] . ' - ' . G::LoadTranslation('ID_TRIGGERS'). ' (<span id="TRIG_'.$aRow['STEP_UID'] . '">' . ($iCantidad1 + $iCantidad2) . '</span>)' . '</span>', array('nodeType'=>'parent'));
$oCriteria = $oProcessMap->getStepTriggersCriteria(-2, $_SESSION['TASK'], 'AFTER');
$iCantidad3 = StepTriggerPeer::doCount($oCriteria);
$oNode = $oTree->addChild('-1', '&nbsp;&nbsp;<span onclick="tree.expand(this.parentNode);" style="cursor: pointer;">[<b> ' . G::LoadTranslation('ID_ASSIGN_TASK') . ' </b>] ' . ' - ' . G::LoadTranslation('ID_TRIGGERS'). ' (<span id="TRIG_'.$aRow['STEP_UID'] . '">' . ($iCantidad1 + $iCantidad2 + $iCantidad3) . '</span>)' . '</span>', array('nodeType'=>'parent'));
$oNode->contracted = true;
$oAux1 =& $oNode->addChild('before_node', '<span onclick="tree.expand(this.parentNode);showTriggers(\'' . $aRow['STEP_UID'] . '\', \'BEFORE\');" style="cursor: pointer;">' . G::LoadTranslation('ID_BEFORE') . ' - ' . G::LoadTranslation('ID_TRIGGERS'). ' (<span id="TRIG_'.$aRow['STEP_UID'].'_BEFORE">'. $iCantidad1 .'</span>) </span>', array('nodeType'=>'parent'));
$oAux1->plus = "<span style='cursor:pointer;display:block;width:15;height:10px;' onclick='tree.expand(this.parentNode);showTriggers(\"" . $aRow['STEP_UID'] . "\", \"BEFORE\");'></span>";
$oAux1 = $oNode->addChild('before_node', '<span onclick="tree.expand(this.parentNode);showTriggers(\'-1\', \'BEFORE\');" style="cursor: pointer;">' . G::LoadTranslation('ID_BEFORE_ASSIGNMENT') . ' - ' . G::LoadTranslation('ID_TRIGGERS'). ' (<span id="TRIG_-1_BEFORE">'. $iCantidad1 .'</span>) </span>', array('nodeType'=>'parent'));
$oAux1->plus = "<span style='cursor:pointer;display:block;width:15;height:10px;' onclick='tree.expand(this.parentNode);showTriggers(\"-1\", \"BEFORE\");'></span>";
$oAux1->contracted = true;
$oAux2 =& $oAux1->addChild($aRow['STEP_UID'] . '_before_node', '<span id="triggersSpan_' . $aRow['STEP_UID'] . '_BEFORE"></span>', array('nodeType'=>'parentBlue'));
$oAux1 =& $oNode->addChild('after_node', '<span onclick="tree.expand(this.parentNode);showTriggers(\'' . $aRow['STEP_UID'] . '\', \'AFTER\');" style="cursor: pointer;">' . G::LoadTranslation('ID_AFTER') . ' - ' . G::LoadTranslation('ID_TRIGGERS'). ' (<span id="TRIG_'.$aRow['STEP_UID'].'_AFTER">'. $iCantidad2 .'</span>) </span>', array('nodeType'=>'parent'));
$oAux1->plus = "<span style='cursor:pointer;display:block;width:15;height:10px;' onclick='tree.expand(this.parentNode);showTriggers(\"" . $aRow['STEP_UID'] . "\", \"AFTER\");'></span>";
$oAux2 = $oAux1->addChild('-1_before_node', '<span id="triggersSpan_-1_BEFORE"></span>', array('nodeType'=>'parentBlue'));
$oAux1 = $oNode->addChild('before_node', '<span onclick="tree.expand(this.parentNode);showTriggers(\'-2\', \'BEFORE\');" style="cursor: pointer;">' . G::LoadTranslation('ID_BEFORE_DERIVATION') . ' - ' . G::LoadTranslation('ID_TRIGGERS'). ' (<span id="TRIG_-2_BEFORE">'. $iCantidad2 .'</span>) </span>', array('nodeType'=>'parent'));
$oAux1->plus = "<span style='cursor:pointer;display:block;width:15;height:10px;' onclick='tree.expand(this.parentNode);showTriggers(\"-2\", \"BEFORE\");'></span>";
$oAux1->contracted = true;
$oAux2 =& $oAux1->addChild($aRow['STEP_UID'] . '_after_node', '<span id="triggersSpan_' . $aRow['STEP_UID'] . '_AFTER"></span>', array('nodeType'=>'parentBlue'));
$oDataset->next();
}
$oCriteria = $oProcessMap->getStepTriggersCriteria(-1, $_SESSION['TASK'], 'BEFORE');
$iCantidad1 = StepTriggerPeer::doCount($oCriteria);
$oCriteria = $oProcessMap->getStepTriggersCriteria(-2, $_SESSION['TASK'], 'BEFORE');
$iCantidad2 = StepTriggerPeer::doCount($oCriteria);
$oCriteria = $oProcessMap->getStepTriggersCriteria(-2, $_SESSION['TASK'], 'AFTER');
$iCantidad3 = StepTriggerPeer::doCount($oCriteria);
$oAux2 = $oAux1->addChild('-2_before_node', '<span id="triggersSpan_-2_BEFORE"></span>', array('nodeType'=>'parentBlue'));
$oAux1 = $oNode->addChild('after_node', '<span onclick="tree.expand(this.parentNode);showTriggers(\'-2\', \'AFTER\');" style="cursor: pointer;">' . G::LoadTranslation('ID_AFTER_DERIVATION') . ' - ' . G::LoadTranslation('ID_TRIGGERS'). ' (<span id="TRIG_-2_AFTER">'. $iCantidad3 .'</span>) </span>', array('nodeType'=>'parent'));
$oAux1->plus = "<span style='cursor:pointer;display:block;width:15;height:10px;' onclick='tree.expand(this.parentNode);showTriggers(\"-2\", \"AFTER\");'></span>";
$oAux1->contracted = true;
$oAux2 = $oAux1->addChild('-2_after_node', '<span id="triggersSpan_-2_AFTER"></span>', array('nodeType'=>'parentBlue'));
$oNode =& $oTree->addChild('-1', '&nbsp;&nbsp;<span onclick="tree.expand(this.parentNode);" style="cursor: pointer;">[<b> ' . G::LoadTranslation('ID_ASSIGN_TASK') . ' </b>] ' . ' - ' . G::LoadTranslation('ID_TRIGGERS'). ' (<span id="TRIG_'.$aRow['STEP_UID'] . '">' . ($iCantidad1 + $iCantidad2 + $iCantidad3) . '</span>)' . '</span>', array('nodeType'=>'parent'));
$oNode->contracted = true;
$oAux1 =& $oNode->addChild('before_node', '<span onclick="tree.expand(this.parentNode);showTriggers(\'-1\', \'BEFORE\');" style="cursor: pointer;">' . G::LoadTranslation('ID_BEFORE_ASSIGNMENT') . ' - ' . G::LoadTranslation('ID_TRIGGERS'). ' (<span id="TRIG_-1_BEFORE">'. $iCantidad1 .'</span>) </span>', array('nodeType'=>'parent'));
$oAux1->plus = "<span style='cursor:pointer;display:block;width:15;height:10px;' onclick='tree.expand(this.parentNode);showTriggers(\"-1\", \"BEFORE\");'></span>";
$oAux1->contracted = true;
$oAux2 =& $oAux1->addChild('-1_before_node', '<span id="triggersSpan_-1_BEFORE"></span>', array('nodeType'=>'parentBlue'));
$oAux1 =& $oNode->addChild('before_node', '<span onclick="tree.expand(this.parentNode);showTriggers(\'-2\', \'BEFORE\');" style="cursor: pointer;">' . G::LoadTranslation('ID_BEFORE_DERIVATION') . ' - ' . G::LoadTranslation('ID_TRIGGERS'). ' (<span id="TRIG_-2_BEFORE">'. $iCantidad2 .'</span>) </span>', array('nodeType'=>'parent'));
$oAux1->plus = "<span style='cursor:pointer;display:block;width:15;height:10px;' onclick='tree.expand(this.parentNode);showTriggers(\"-2\", \"BEFORE\");'></span>";
$oAux1->contracted = true;
$oAux2 =& $oAux1->addChild('-2_before_node', '<span id="triggersSpan_-2_BEFORE"></span>', array('nodeType'=>'parentBlue'));
$oAux1 =& $oNode->addChild('after_node', '<span onclick="tree.expand(this.parentNode);showTriggers(\'-2\', \'AFTER\');" style="cursor: pointer;">' . G::LoadTranslation('ID_AFTER_DERIVATION') . ' - ' . G::LoadTranslation('ID_TRIGGERS'). ' (<span id="TRIG_-2_AFTER">'. $iCantidad3 .'</span>) </span>', array('nodeType'=>'parent'));
$oAux1->plus = "<span style='cursor:pointer;display:block;width:15;height:10px;' onclick='tree.expand(this.parentNode);showTriggers(\"-2\", \"AFTER\");'></span>";
$oAux1->contracted = true;
$oAux2 =& $oAux1->addChild('-2_after_node', '<span id="triggersSpan_-2_AFTER"></span>', array('nodeType'=>'parentBlue'));
$javascript = "
$javascript = "
<script type=\"text/javascript\">
//Add css Codemirror
var head = document.getElementsByTagName(\"head\")[0];
@@ -130,13 +131,11 @@ try {
</script>
";
echo $javascript . $oTree->render();
}
catch (Exception $oException) {
$token = strtotime("now");
echo $javascript . $oTree->render();
} catch (Exception $oException) {
$token = strtotime("now");
PMException::registerErrorLog($oException, $token);
G::outRes( G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)) );
G::outRes(G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)));
die;
}
unset($_SESSION['PROCESS']);
?>

View File

@@ -21,7 +21,7 @@
{php}
//This will add registered HTML toolbar options from plugins
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$oPluginRegistry = PMPluginRegistry::getSingleton();
$oPluginRegistry->getToolbarOptions("NORMAL");
{/php}
</tr>

View File

@@ -29,7 +29,7 @@
$tree = new PmTree();
reView(PATH_TRUNK, $tree);
print( $tree->render());
print($tree->render());
function reView($path, &$tree)
{
@@ -43,7 +43,9 @@ function reView($path, &$tree)
if (is_dir($file)) {
reView($file, $tree->addChild($file, $file));
} elseif (substr($file, -4, 4) === '.php') {
$nodeFile = &$tree->addChild($file, $file . '&nbsp;' .
$nodeFile = $tree->addChild(
$file,
$file . '&nbsp;' .
selectPermissions('Set Permission', 'setPermission("' . $file . '",this);') .
selectPermissions('Remove Permission', 'removePermission("' . $file . '",this);')
);

View File

@@ -24,7 +24,6 @@
*/
try {
$triggerLibrary = TriggerLibrary::getSingleton();
$triggerLibraryO = $triggerLibrary->getRegisteredClasses();
@@ -33,16 +32,16 @@ try {
$oTree->name = "Triggers";
$oTree->showSign = false;
$div1Style = (strpos($_SERVER["HTTP_USER_AGENT"], "MSIE") !== false)? " style=\"margin-top: 0.65em;\"" : null;
$div1Style = (strpos($_SERVER["HTTP_USER_AGENT"], "MSIE") !== false) ? " style=\"margin-top: 0.65em;\"" : null;
$oNode = &$oTree->addChild("TRI_CUSTOM", "<div" . $div1Style . "><span onclick=\"currentPopupWindow.remove(); triggerNewCustom();\" style=\"cursor: pointer;\"><img src=\"/images/50px-Edit.png\" width=\"15px\" heigth=\"15px\" valing=\"middle\" alt=\"\" />&nbsp;&nbsp;<strong>" . G::LoadTranslation("ID_CUSTOM_TRIGGER") . "</strong></span><br /><span onclick=\"currentPopupWindow.remove(); triggerNewCustom();\" style=\"cursor: pointer;\"><small><em>" . G::LoadTranslation("ID_CUSTOM_TRIGGER_DESCRIPTION") . "</em></small></span></div>", array("nodeType" => "parent"));
$oNode = &$oTree->addChild("TRI_COPY", "<div style=\"margin-top: 1.25em;\"><span onclick=\"currentPopupWindow.remove(); triggerCopy();\" style=\"cursor: pointer;\"><img src=\"/images/documents/_editcopy.png\" width=\"15px\" heigth=\"15px\" valing=\"middle\" alt=\"\" />&nbsp;&nbsp;<strong>" . G::LoadTranslation("ID_TRIGGER_COPY_OPTION") . "</strong></span><br /><span onclick=\"currentPopupWindow.remove(); triggerCopy();\" style=\"cursor: pointer;\"><small><em>" . G::LoadTranslation("ID_TRIGGER_COPY_OPTION_DESCRIPTION") . "</em></small></span></div>", array("nodeType" => "parent"));
$oNode = $oTree->addChild("TRI_CUSTOM", "<div" . $div1Style . "><span onclick=\"currentPopupWindow.remove(); triggerNewCustom();\" style=\"cursor: pointer;\"><img src=\"/images/50px-Edit.png\" width=\"15px\" heigth=\"15px\" valing=\"middle\" alt=\"\" />&nbsp;&nbsp;<strong>" . G::LoadTranslation("ID_CUSTOM_TRIGGER") . "</strong></span><br /><span onclick=\"currentPopupWindow.remove(); triggerNewCustom();\" style=\"cursor: pointer;\"><small><em>" . G::LoadTranslation("ID_CUSTOM_TRIGGER_DESCRIPTION") . "</em></small></span></div>", array("nodeType" => "parent"));
$oNode = $oTree->addChild("TRI_COPY", "<div style=\"margin-top: 1.25em;\"><span onclick=\"currentPopupWindow.remove(); triggerCopy();\" style=\"cursor: pointer;\"><img src=\"/images/documents/_editcopy.png\" width=\"15px\" heigth=\"15px\" valing=\"middle\" alt=\"\" />&nbsp;&nbsp;<strong>" . G::LoadTranslation("ID_TRIGGER_COPY_OPTION") . "</strong></span><br /><span onclick=\"currentPopupWindow.remove(); triggerCopy();\" style=\"cursor: pointer;\"><small><em>" . G::LoadTranslation("ID_TRIGGER_COPY_OPTION_DESCRIPTION") . "</em></small></span></div>", array("nodeType" => "parent"));
$triggerLibraryOCount = count($triggerLibraryO);
foreach ($triggerLibraryO as $keyLibrary => $libraryObj) {
$libraryName = $libraryObj->info["name"];
$libraryIcon = (isset($libraryObj->info["icon"]) && ($libraryObj->info["icon"]!= ""))? $libraryObj->info["icon"] : "/images/browse.gif";
$libraryIcon = (isset($libraryObj->info["icon"]) && ($libraryObj->info["icon"] != "")) ? $libraryObj->info["icon"] : "/images/browse.gif";
$libraryDescription = trim(str_replace("*", "", implode(" ", $libraryObj->info["description"])));
$triggerCount = count($libraryObj->methods);
@@ -52,8 +51,8 @@ try {
//Now the Triggers
//Library Father (Name + Description)
$oNode = &$oTree->addChild($keyLibrary, "&nbsp;&nbsp;<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td nowrap=\"nowrap\" valign=\"top\"><span onclick=\"tree.expand(this.parentNode);\" style=\"cursor: pointer;\"><img src=\"" . $libraryIcon . "\" width=\"15px\" heigth=\"15px\" valing=\"middle\" alt=\"\" />&nbsp;&nbsp;<b>" . $libraryName . "&nbsp;($triggerCount)</b></td></tr><tr><td class=\"\"><span onclick=\"tree.expand(this.parentNode);\" style=\"cursor: pointer;\"><small><i>$libraryDescription</i></small></span></td></tr></table>", array("nodeType" => "parent"));
$oNode->contracted = ($triggerLibraryOCount == 1)? false : true;
$oNode = $oTree->addChild($keyLibrary, "&nbsp;&nbsp;<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td nowrap=\"nowrap\" valign=\"top\"><span onclick=\"tree.expand(this.parentNode);\" style=\"cursor: pointer;\"><img src=\"" . $libraryIcon . "\" width=\"15px\" heigth=\"15px\" valing=\"middle\" alt=\"\" />&nbsp;&nbsp;<b>" . $libraryName . "&nbsp;($triggerCount)</b></td></tr><tr><td class=\"\"><span onclick=\"tree.expand(this.parentNode);\" style=\"cursor: pointer;\"><small><i>$libraryDescription</i></small></span></td></tr></table>", array("nodeType" => "parent"));
$oNode->contracted = ($triggerLibraryOCount == 1) ? false : true;
//Library Childs (available methods)
foreach ($libraryObj->methods as $methodName => $methodObject) {
@@ -61,9 +60,7 @@ try {
$methodLabel = $methodObject->info["label"];
$methodDescription = trim(str_replace("*", "", implode(" ", $methodObject->info["description"])));
$oAux1 = &$oNode->addChild($keyLibrary . "-" . $methodName, "<table><tr><td nowrap=\"nowrap\"><span style=\"cursor: pointer;\"><a class=\"linkInBlue\" href=\"javascript:;\" onclick=\"currentPopupWindow.remove(); triggerNewWizard('$methodName' , '$keyLibrary'); return false;\">" . $methodLabel . " (" . $methodName . ")</a></span></td></tr><tr><td><i>" . $methodDescription . "</i><br></span></td></tr></table>", array("nodeType" => "child"));
//$oAux1->plus = "<span style='cursor:pointer;display:block;width:15;height:10px;' onclick='tree.expand(this.parentNode);'></span>";
//$oAux2 =& $oAux1->addChild($keyLibrary."-".$methodName."-desc", "$methodParameters", array('nodeType'=>'parent'));
$oAux1 = $oNode->addChild($keyLibrary . "-" . $methodName, "<table><tr><td nowrap=\"nowrap\"><span style=\"cursor: pointer;\"><a class=\"linkInBlue\" href=\"javascript:;\" onclick=\"currentPopupWindow.remove(); triggerNewWizard('$methodName' , '$keyLibrary'); return false;\">" . $methodLabel . " (" . $methodName . ")</a></span></td></tr><tr><td><i>" . $methodDescription . "</i><br></span></td></tr></table>", array("nodeType" => "child"));
}
}
}
@@ -72,9 +69,8 @@ try {
} catch (Exception $e) {
$token = strtotime("now");
PMException::registerErrorLog($e, $token);
G::outRes( G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)) );
G::outRes(G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)));
die;
}
unset($_SESSION["PROCESS"]);

View File

@@ -1,83 +1,83 @@
<?php
/**
* groups_Tree.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* 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.
*
* 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.
*
*/
/**
* @Description This is the View of all groups from a determinated user
* @author Erik Amaru Ortiz <erik@colosa.com>
* @Date 24/04/2008
* @LastModification none
*/
require_once 'classes/model/Users.php';
$oCriteria = new Criteria();
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$oCriteria->add(UsersPeer::USR_UID, $_GET['sUserUID']);
$oDataset = UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$groups = new Groups();
$tree = new PmTree();
$tree->name = 'Users';
$tree->nodeType = "base";
$tree->width = "350px";
$tree->value = '
<div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="boxContentBlue">
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
<tr>
<td class="userGroupTitle">' . G::loadTranslation("ID_ASSIGN_GROUP_TO") . ' ' . $aRow['USR_FIRSTNAME'] . ' ' . $aRow['USR_LASTNAME'] . '</td>
</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="showUserGroups(\''.$_GET['sUserUID'].'\');return false;">'.G::LoadTranslation('ID_BACK_TO_GROUP_LIST').'</a></div>';
$tree->showSign = false;
$allGroups = $groups->getAllGroups();
foreach ($allGroups as $group) {
$ID_ASSIGN = G::LoadTranslation('ID_ASSIGN');
$groupUID = htmlentities($group->getGrpUid());
$userUID = $_GET['sUserUID'];
$GROUP_TITLE = strip_tags($group->getGrpTitle());
$html = <<< innerHTML
<table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>
<tr>
<td width='250px' class='treeNode' style='border:0px;background-color:transparent;'>{$GROUP_TITLE}</td>
<td class='treeNode' style='border:0px;background-color:transparent;'>[<a href="#" onclick="saveUserGroup('{$groupUID}','{$userUID}');return false;">{$ID_ASSIGN}</a>]</td>
</tr>
</table>
innerHTML;
$ch = &$tree->addChild($group->getGrpUid(), $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/users.png" />';
}
print ($tree->render());
<?php
/**
* groups_Tree.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* 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.
*
* 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.
*
*/
/**
* @Description This is the View of all groups from a determinated user
* @author Erik Amaru Ortiz <erik@colosa.com>
* @Date 24/04/2008
* @LastModification none
*/
require_once 'classes/model/Users.php';
$oCriteria = new Criteria();
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$oCriteria->add(UsersPeer::USR_UID, $_GET['sUserUID']);
$oDataset = UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$groups = new Groups();
$tree = new PmTree();
$tree->name = 'Users';
$tree->nodeType = "base";
$tree->width = "350px";
$tree->value = '
<div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="boxContentBlue">
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
<tr>
<td class="userGroupTitle">' . G::loadTranslation("ID_ASSIGN_GROUP_TO") . ' ' . $aRow['USR_FIRSTNAME'] . ' ' . $aRow['USR_LASTNAME'] . '</td>
</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="showUserGroups(\''.$_GET['sUserUID'].'\');return false;">'.G::LoadTranslation('ID_BACK_TO_GROUP_LIST').'</a></div>';
$tree->showSign = false;
$allGroups = $groups->getAllGroups();
foreach ($allGroups as $group) {
$ID_ASSIGN = G::LoadTranslation('ID_ASSIGN');
$groupUID = htmlentities($group->getGrpUid());
$userUID = $_GET['sUserUID'];
$GROUP_TITLE = strip_tags($group->getGrpTitle());
$html = <<< innerHTML
<table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>
<tr>
<td width='250px' class='treeNode' style='border:0px;background-color:transparent;'>{$GROUP_TITLE}</td>
<td class='treeNode' style='border:0px;background-color:transparent;'>[<a href="#" onclick="saveUserGroup('{$groupUID}','{$userUID}');return false;">{$ID_ASSIGN}</a>]</td>
</tr>
</table>
innerHTML;
$ch = $tree->addChild($group->getGrpUid(), $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/users.png" />';
}
print($tree->render());

View File

@@ -1,85 +1,85 @@
<?php
/**
* groups_Tree.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* 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.
*
* 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.
*
*/
/**
* @Description This is the View of all groups from a determinated user
* @author Erik Amaru Ortiz <erik@colosa.com>
* @Date 24/04/2008
* @LastModification none
*/
require_once 'classes/model/Users.php';
$oCriteria = new Criteria();
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$oCriteria->add(UsersPeer::USR_UID, $_GET['sUserUID']);
$oDataset = UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$groups = new Groups();
$tree = new PmTree();
$tree->name = 'Users';
$tree->nodeType = "base";
$tree->width = "350px";
$tree->value = '
<div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="boxContentBlue">
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
<tr>
<td class="userGroupTitle">' . G::loadTranslation("ID_USER_GROUPS") . ' ' . $aRow['USR_FIRSTNAME'] . ' ' . $aRow['USR_LASTNAME'] . '</td>
</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="showUserGroupInterface(\''.$_GET['sUserUID'].'\');return false;">'.G::LoadTranslation('ID_ASSIGN_GROUP').'</a></div>';
$tree->showSign = false;
$allGroups = $groups->getUserGroups($_GET['sUserUID']);
foreach ($allGroups as $group) {
$ID_DELETE = G::LoadTranslation('ID_DELETE');
$groupUID = htmlentities($group->getGrpUid());
$userUID = $_GET['sUserUID'];
$GROUP_TITLE = strip_tags($group->getGrpTitle());
$html = <<< innerHTML
<table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>
<tr>
<td width='250px' class='treeNode' style='border:0px;background-color:transparent;'>{$GROUP_TITLE}</td>
<td class='treeNode' style='border:0px;background-color:transparent;'>[<a href="#" onclick="deleteGroup('{$groupUID}','{$userUID}');return false;">{$ID_DELETE}</a>]</td>
</tr>
</table>
innerHTML;
$ch = &$tree->addChild($group->getGrpUid(), $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/users.png" />';
}
if($groups->getNumberGroups($_GET['sUserUID']) == 0){
$ch = &$tree->addChild('', G::LoadTranslation('ID_MSG_NORESULTS_USERGROUP'), array('nodeType' => 'child'));
}
print ($tree->render());
<?php
/**
* groups_Tree.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* 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.
*
* 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.
*
*/
/**
* @Description This is the View of all groups from a determinated user
* @author Erik Amaru Ortiz <erik@colosa.com>
* @Date 24/04/2008
* @LastModification none
*/
require_once 'classes/model/Users.php';
$oCriteria = new Criteria();
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$oCriteria->add(UsersPeer::USR_UID, $_GET['sUserUID']);
$oDataset = UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$groups = new Groups();
$tree = new PmTree();
$tree->name = 'Users';
$tree->nodeType = "base";
$tree->width = "350px";
$tree->value = '
<div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="boxContentBlue">
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
<tr>
<td class="userGroupTitle">' . G::loadTranslation("ID_USER_GROUPS") . ' ' . $aRow['USR_FIRSTNAME'] . ' ' . $aRow['USR_LASTNAME'] . '</td>
</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="showUserGroupInterface(\''.$_GET['sUserUID'].'\');return false;">'.G::LoadTranslation('ID_ASSIGN_GROUP').'</a></div>';
$tree->showSign = false;
$allGroups = $groups->getUserGroups($_GET['sUserUID']);
foreach ($allGroups as $group) {
$ID_DELETE = G::LoadTranslation('ID_DELETE');
$groupUID = htmlentities($group->getGrpUid());
$userUID = $_GET['sUserUID'];
$GROUP_TITLE = strip_tags($group->getGrpTitle());
$html = <<< innerHTML
<table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>
<tr>
<td width='250px' class='treeNode' style='border:0px;background-color:transparent;'>{$GROUP_TITLE}</td>
<td class='treeNode' style='border:0px;background-color:transparent;'>[<a href="#" onclick="deleteGroup('{$groupUID}','{$userUID}');return false;">{$ID_DELETE}</a>]</td>
</tr>
</table>
innerHTML;
$ch = $tree->addChild($group->getGrpUid(), $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/users.png" />';
}
if ($groups->getNumberGroups($_GET['sUserUID']) == 0) {
$ch = $tree->addChild('', G::LoadTranslation('ID_MSG_NORESULTS_USERGROUP'), array('nodeType' => 'child'));
}
print($tree->render());