CODE STYLE

FILES:
workflow/engine/methods/processes/processesList.php
workflow/engine/methods/processes/processes_SaveEditObjectPermission.php
workflow/engine/methods/processes/processes_SaveObjectPermission.php
workflow/engine/methods/processes/processes_UploadFiles.php
workflow/engine/methods/processes/processes_UploadFilesForm.php
workflow/engine/methods/processes/processes_User.php
workflow/engine/methods/processes/processes_subProcessSave.php
workflow/engine/methods/processes/processes_webEntryGenerate.php
workflow/engine/methods/processes/processes_webEntryValidate.php
workflow/engine/methods/processes/webEntry_Val_Assig.php
This commit is contained in:
jennylee
2012-10-17 12:20:58 -04:00
parent 06683e9a3d
commit 57c78b8342
10 changed files with 636 additions and 674 deletions

View File

@@ -1,74 +1,70 @@
<?php
/**
* processes_List.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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.
*
*/
require_once 'classes/model/Process.php';
$start = isset($_POST['start'])? $_POST['start']: 0;
$limit = isset($_POST['limit'])? $_POST['limit']: '';
$oProcess = new Process();
<?php
/**
* processes_List.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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.
*/
$memcache = & PMmemcached::getSingleton(SYS_SYS);
require_once 'classes/model/Process.php';
$memkey = 'no memcache';
$memcacheUsed = 'not used';
$totalCount = 0;
if( isset($_POST['category']) && $_POST['category'] !== '<reset>' ) {
if( isset($_POST['processName']) )
$proData = $oProcess->getAllProcesses($start, $limit, $_POST['category'], $_POST['processName']);
else
$proData = $oProcess->getAllProcesses($start, $limit, $_POST['category']);
}
else {
if( isset($_POST['processName']) ) {
$memkey = 'processList-' . $start . '-' . $limit . '-' . $_POST['processName'];
$memcacheUsed = 'yes';
if ( ($proData = $memcache->get( $memkey )) === false ) {
$proData = $oProcess->getAllProcesses($start, $limit, null, $_POST['processName']);
$memcache->set( $memkey , $proData, PMmemcached::ONE_HOUR );
$memcacheUsed = 'no';
}
}
else {
$memkey = 'processList-allProcesses-' . $start . '-' . $limit;
$memkeyTotal = $memkey . '-total';
$memcacheUsed = 'yes';
if ( ($proData = $memcache->get( $memkey )) === false || ($totalCount=$memcache->get( $memkeyTotal)) === false ) {
$proData = $oProcess->getAllProcesses($start, $limit);
$totalCount = $oProcess->getAllProcessesCount();
$memcache->set( $memkey , $proData, PMmemcached::ONE_HOUR );
$memcache->set( $memkeyTotal , $totalCount, PMmemcached::ONE_HOUR );
$memcacheUsed = 'no';
}
$start = isset( $_POST['start'] ) ? $_POST['start'] : 0;
$limit = isset( $_POST['limit'] ) ? $_POST['limit'] : '';
$oProcess = new Process();
$memcache = & PMmemcached::getSingleton( SYS_SYS );
$memkey = 'no memcache';
$memcacheUsed = 'not used';
$totalCount = 0;
if (isset( $_POST['category'] ) && $_POST['category'] !== '<reset>') {
if (isset( $_POST['processName'] ))
$proData = $oProcess->getAllProcesses( $start, $limit, $_POST['category'], $_POST['processName'] );
else
$proData = $oProcess->getAllProcesses( $start, $limit, $_POST['category'] );
} else {
if (isset( $_POST['processName'] )) {
$memkey = 'processList-' . $start . '-' . $limit . '-' . $_POST['processName'];
$memcacheUsed = 'yes';
if (($proData = $memcache->get( $memkey )) === false) {
$proData = $oProcess->getAllProcesses( $start, $limit, null, $_POST['processName'] );
$memcache->set( $memkey, $proData, PMmemcached::ONE_HOUR );
$memcacheUsed = 'no';
}
} else {
$memkey = 'processList-allProcesses-' . $start . '-' . $limit;
$memkeyTotal = $memkey . '-total';
$memcacheUsed = 'yes';
if (($proData = $memcache->get( $memkey )) === false || ($totalCount = $memcache->get( $memkeyTotal )) === false) {
$proData = $oProcess->getAllProcesses( $start, $limit );
$totalCount = $oProcess->getAllProcessesCount();
$memcache->set( $memkey, $proData, PMmemcached::ONE_HOUR );
$memcache->set( $memkeyTotal, $totalCount, PMmemcached::ONE_HOUR );
$memcacheUsed = 'no';
}
}
}
$r->memkey = $memkey;
$r->memcache = $memcacheUsed;
$r->data = $proData;
$r->totalCount = $totalCount;
echo G::json_encode($r);
}
$r->memkey = $memkey;
$r->memcache = $memcacheUsed;
$r->data = $proData;
$r->totalCount = $totalCount;
echo G::json_encode( $r );

View File

@@ -1,89 +1,78 @@
<?php
/**
* processes_SaveEditObjectPermission.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.
*
*/
global $RBAC;
$access = $RBAC->userCanAccess('PM_FACTORY');
if( $access != 1 ){
switch ($access)
{
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
default:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
}
if(isset($_POST['form']))
$sValue = $_POST['form']; //For old processmap
else
$sValue = $_POST; //For new processmap EXtjs
list($iRelation, $sUserGroup) = explode('|', $sValue['GROUP_USER']);
$sObjectUID = '';
switch ($sValue['OP_OBJ_TYPE']) {
case 'ANY':
$sObjectUID = '';
break;
case 'DYNAFORM':
$sObjectUID = $sValue['DYNAFORMS'];
break;
case 'INPUT':
$sObjectUID = $sValue['INPUTS'];
break;
case 'OUTPUT':
$sObjectUID = $sValue['OUTPUTS'];
break;
}
require_once 'classes/model/ObjectPermission.php';
$oOP = new ObjectPermission();
$aData = array('OP_UID' => $sValue['OP_UID'],
'PRO_UID' => $sValue['PRO_UID'],
'TAS_UID' => $sValue['TAS_UID']!='' ? $sValue['TAS_UID'] : '0' ,
'USR_UID' => (string)$sUserGroup,
'OP_USER_RELATION' => $iRelation,
'OP_TASK_SOURCE' => $sValue['OP_TASK_SOURCE']!='' ? $sValue['OP_TASK_SOURCE'] : '0',
'OP_PARTICIPATE' => $sValue['OP_PARTICIPATE']!='' ? $sValue['OP_PARTICIPATE'] : 0,
'OP_OBJ_TYPE' => $sValue['OP_OBJ_TYPE']!='' ? $sValue['OP_OBJ_TYPE'] : '0',
'OP_OBJ_UID' => $sObjectUID!='' ? $sObjectUID : '0',
'OP_ACTION' => $sValue['OP_ACTION']!='' ? $sValue['OP_ACTION'] : '0',
'OP_CASE_STATUS' => $sValue['OP_CASE_STATUS']!='' ? $sValue['OP_CASE_STATUS'] : '0'
);
$oObj = new ObjectPermission();
$oObj->update($aData);
G::LoadClass('processMap');
$oProcessMap = new ProcessMap();
$oProcessMap->getObjectsPermissionsCriteria($sValue['PRO_UID']);
<?php
/**
* processes_SaveEditObjectPermission.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.
*/
global $RBAC;
$access = $RBAC->userCanAccess( 'PM_FACTORY' );
if ($access != 1) {
switch ($access) {
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
}
if (isset( $_POST['form'] ))
$sValue = $_POST['form']; //For old processmap
else
$sValue = $_POST; //For new processmap EXtjs
list ($iRelation, $sUserGroup) = explode( '|', $sValue['GROUP_USER'] );
$sObjectUID = '';
switch ($sValue['OP_OBJ_TYPE']) {
case 'ANY':
$sObjectUID = '';
break;
case 'DYNAFORM':
$sObjectUID = $sValue['DYNAFORMS'];
break;
case 'INPUT':
$sObjectUID = $sValue['INPUTS'];
break;
case 'OUTPUT':
$sObjectUID = $sValue['OUTPUTS'];
break;
}
require_once 'classes/model/ObjectPermission.php';
$oOP = new ObjectPermission();
$aData = array ('OP_UID' => $sValue['OP_UID'],'PRO_UID' => $sValue['PRO_UID'],'TAS_UID' => $sValue['TAS_UID'] != '' ? $sValue['TAS_UID'] : '0','USR_UID' => (string) $sUserGroup,'OP_USER_RELATION' => $iRelation,'OP_TASK_SOURCE' => $sValue['OP_TASK_SOURCE'] != '' ? $sValue['OP_TASK_SOURCE'] : '0','OP_PARTICIPATE' => $sValue['OP_PARTICIPATE'] != '' ? $sValue['OP_PARTICIPATE'] : 0,'OP_OBJ_TYPE' => $sValue['OP_OBJ_TYPE'] != '' ? $sValue['OP_OBJ_TYPE'] : '0','OP_OBJ_UID' => $sObjectUID != '' ? $sObjectUID : '0','OP_ACTION' => $sValue['OP_ACTION'] != '' ? $sValue['OP_ACTION'] : '0','OP_CASE_STATUS' => $sValue['OP_CASE_STATUS'] != '' ? $sValue['OP_CASE_STATUS'] : '0'
);
$oObj = new ObjectPermission();
$oObj->update( $aData );
G::LoadClass( 'processMap' );
$oProcessMap = new ProcessMap();
$oProcessMap->getObjectsPermissionsCriteria( $sValue['PRO_UID'] );

View File

@@ -1,88 +1,78 @@
<?php
/**
* processes_Save.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.
*
*/
global $RBAC;
$access = $RBAC->userCanAccess('PM_FACTORY');
if( $access != 1 ){
switch ($access)
{
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
default:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
}
if(isset($_POST['form']))
$sValue = $_POST['form']; //For old processmap
else
$sValue = $_POST; //For new processmap EXtjs
list($iRelation, $sUserGroup) = explode('|', $sValue['GROUP_USER']);
$sObjectUID = '';
switch ($sValue['OP_OBJ_TYPE']) {
case 'ANY':
/*case 'ANY_DYNAFORM':
case 'ANY_INPUT':
case 'ANY_OUTPUT':*/
$sObjectUID = '';
break;
case 'DYNAFORM':
$sObjectUID = $sValue['DYNAFORMS'];
break;
case 'INPUT':
$sObjectUID = $sValue['INPUTS'];
break;
case 'OUTPUT':
$sObjectUID = $sValue['OUTPUTS'];
break;
}
require_once 'classes/model/ObjectPermission.php';
$oOP = new ObjectPermission();
$aData = array('OP_UID' => G::generateUniqueID(),
'PRO_UID' =>$sValue['PRO_UID'],
'TAS_UID' => $sValue['TAS_UID'],
'USR_UID' => (string)$sUserGroup,
'OP_USER_RELATION' => $iRelation,
'OP_TASK_SOURCE' => $sValue['OP_TASK_SOURCE'],
'OP_PARTICIPATE' => $sValue['OP_PARTICIPATE'],
'OP_OBJ_TYPE' => $sValue['OP_OBJ_TYPE'],
'OP_OBJ_UID' => $sObjectUID,
'OP_ACTION' => $sValue['OP_ACTION'],
'OP_CASE_STATUS' => $sValue['OP_CASE_STATUS']);
$oOP->fromArray($aData,BasePeer::TYPE_FIELDNAME);
$oOP->save();
G::LoadClass('processMap');
$oProcessMap = new ProcessMap();
$oProcessMap->getObjectsPermissionsCriteria($sValue['PRO_UID']);
<?php
/**
* processes_Save.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.
*/
global $RBAC;
$access = $RBAC->userCanAccess( 'PM_FACTORY' );
if ($access != 1) {
switch ($access) {
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
}
if (isset( $_POST['form'] ))
$sValue = $_POST['form']; //For old processmap
else
$sValue = $_POST; //For new processmap EXtjs
list ($iRelation, $sUserGroup) = explode( '|', $sValue['GROUP_USER'] );
$sObjectUID = '';
switch ($sValue['OP_OBJ_TYPE']) {
case 'ANY':
/*case 'ANY_DYNAFORM':
case 'ANY_INPUT':
case 'ANY_OUTPUT':*/
$sObjectUID = '';
break;
case 'DYNAFORM':
$sObjectUID = $sValue['DYNAFORMS'];
break;
case 'INPUT':
$sObjectUID = $sValue['INPUTS'];
break;
case 'OUTPUT':
$sObjectUID = $sValue['OUTPUTS'];
break;
}
require_once 'classes/model/ObjectPermission.php';
$oOP = new ObjectPermission();
$aData = array ('OP_UID' => G::generateUniqueID(),'PRO_UID' => $sValue['PRO_UID'],'TAS_UID' => $sValue['TAS_UID'],'USR_UID' => (string) $sUserGroup,'OP_USER_RELATION' => $iRelation,'OP_TASK_SOURCE' => $sValue['OP_TASK_SOURCE'],'OP_PARTICIPATE' => $sValue['OP_PARTICIPATE'],'OP_OBJ_TYPE' => $sValue['OP_OBJ_TYPE'],'OP_OBJ_UID' => $sObjectUID,'OP_ACTION' => $sValue['OP_ACTION'],'OP_CASE_STATUS' => $sValue['OP_CASE_STATUS']
);
$oOP->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
$oOP->save();
G::LoadClass( 'processMap' );
$oProcessMap = new ProcessMap();
$oProcessMap->getObjectsPermissionsCriteria( $sValue['PRO_UID'] );

View File

@@ -1,19 +1,19 @@
<?php
switch ($_POST['form']['MAIN_DIRECTORY']) {
case 'mailTemplates':
$sDirectory = PATH_DATA_MAILTEMPLATES . $_POST['form']['PRO_UID'] . PATH_SEP . ($_POST['form']['CURRENT_DIRECTORY'] != '' ? $_POST['form']['CURRENT_DIRECTORY'] . PATH_SEP : '');
break;
case 'public':
$sDirectory = PATH_DATA_PUBLIC . $_POST['form']['PRO_UID'] . PATH_SEP . ($_POST['form']['CURRENT_DIRECTORY'] != '' ? $_POST['form']['CURRENT_DIRECTORY'] . PATH_SEP : '');
break;
default:
die;
break;
}
for ($i = 1; $i <= 5; $i++) {
if ($_FILES['form']['tmp_name']['FILENAME' . (string)$i] != '') {
G::uploadFile($_FILES['form']['tmp_name']['FILENAME' . (string)$i], $sDirectory, $_FILES['form']['name']['FILENAME' . (string)$i]);
}
}
die('<script type="text/javascript">parent.goToDirectoryforie(\'' . $_POST['form']['PRO_UID'] . '\', \'' . $_POST['form']['MAIN_DIRECTORY'] . '\', \'' . $_POST['form']['CURRENT_DIRECTORY'] . '\');</script>');
<?php
switch ($_POST['form']['MAIN_DIRECTORY']) {
case 'mailTemplates':
$sDirectory = PATH_DATA_MAILTEMPLATES . $_POST['form']['PRO_UID'] . PATH_SEP . ($_POST['form']['CURRENT_DIRECTORY'] != '' ? $_POST['form']['CURRENT_DIRECTORY'] . PATH_SEP : '');
break;
case 'public':
$sDirectory = PATH_DATA_PUBLIC . $_POST['form']['PRO_UID'] . PATH_SEP . ($_POST['form']['CURRENT_DIRECTORY'] != '' ? $_POST['form']['CURRENT_DIRECTORY'] . PATH_SEP : '');
break;
default:
die();
break;
}
for ($i = 1; $i <= 5; $i ++) {
if ($_FILES['form']['tmp_name']['FILENAME' . (string) $i] != '') {
G::uploadFile( $_FILES['form']['tmp_name']['FILENAME' . (string) $i], $sDirectory, $_FILES['form']['name']['FILENAME' . (string) $i] );
}
}
die( '<script type="text/javascript">parent.goToDirectoryforie(\'' . $_POST['form']['PRO_UID'] . '\', \'' . $_POST['form']['MAIN_DIRECTORY'] . '\', \'' . $_POST['form']['CURRENT_DIRECTORY'] . '\');</script>' );

View File

@@ -12,37 +12,33 @@
*
* 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
* 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/>.
* 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.
*
*/
if($_GET['NAVIGATOR']=='ie'){
$oForm = new Form('processes/processes_UploadFilesForm', '', SYS_LANG);
if ($_GET['NAVIGATOR'] == 'ie') {
$oForm = new Form( 'processes/processes_UploadFilesForm', '', SYS_LANG );
$oForm->action = 'processes_UploadFiles';
$oForm->values = array('PRO_UID' => $_GET['PRO_UID'],
'MAIN_DIRECTORY' => $_GET['MAIN_DIRECTORY'],
'CURRENT_DIRECTORY' => $_GET['CURRENT_DIRECTORY']);
echo '<link rel="stylesheet" type="text/css" href="/skins/' . SYS_SKIN . '/style.css"/>' .
$oForm->render(PATH_CORE . 'templates/xmlform.html', $scriptCode = '');
$oForm->values = array ('PRO_UID' => $_GET['PRO_UID'],'MAIN_DIRECTORY' => $_GET['MAIN_DIRECTORY'],'CURRENT_DIRECTORY' => $_GET['CURRENT_DIRECTORY']
);
echo '<link rel="stylesheet" type="text/css" href="/skins/' . SYS_SKIN . '/style.css"/>' . $oForm->render( PATH_CORE . 'templates/xmlform.html', $scriptCode = '' );
} else {
$params = Array ('PRO_UID' => $_GET['PRO_UID'],'MAIN_DIRECTORY' => $_GET['MAIN_DIRECTORY'],'CURRENT_DIRECTORY' => $_GET['CURRENT_DIRECTORY']
);
} else {
$params = Array('PRO_UID' => $_GET['PRO_UID'],
'MAIN_DIRECTORY' => $_GET['MAIN_DIRECTORY'],
'CURRENT_DIRECTORY' => $_GET['CURRENT_DIRECTORY']);
$_SESSION['processes_upload'] = $params;
$G_PUBLISH = new Publisher();
$oHeadPublisher =& headPublisher::getSingleton();
$G_PUBLISH->AddContent('view', 'processes/processes_Upload');
G::RenderPage( "publish" , "raw" );
}
$oHeadPublisher = & headPublisher::getSingleton();
$G_PUBLISH->AddContent( 'view', 'processes/processes_Upload' );
G::RenderPage( "publish", "raw" );
}

View File

@@ -1,10 +1,10 @@
<?php
/**
* processes_User.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
@@ -12,48 +12,48 @@
*
* 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
* 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.,
* 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 a callback for the View of all groups from a determinated user
* @author Everth S. Berrios Morales <everth@colosa.com>
* @Date 16/05/2008
* @LastModification none
*/
G::LoadThirdParty('pear/json','class.json');
/**
* ription This is a callback for the View of all groups from a determinated user
*
* @author Everth S. Berrios Morales <everth@colosa.com>
* @Date 16/05/2008
* @LastModification none
*/
G::LoadThirdParty( 'pear/json', 'class.json' );
try {
$oJSON = new Services_JSON();
$stdObj = $oJSON->decode(stripslashes($_POST['data']));
if ( isset ($stdObj->pro_uid ) )
$sProUid = $stdObj->pro_uid;
else
throw ( new Exception ( 'the process uid is not defined!.' ) );
$oJSON = new Services_JSON();
$stdObj = $oJSON->decode( stripslashes( $_POST['data'] ) );
if (isset( $stdObj->pro_uid ))
$sProUid = $stdObj->pro_uid;
else
throw (new Exception( 'the process uid is not defined!.' ));
G::LoadClass('processMap');
$oProcessMap = new ProcessMap();
$c = $oProcessMap->listProcessesUser($sProUid);
G::LoadClass( 'processMap' );
$oProcessMap = new ProcessMap();
$c = $oProcessMap->listProcessesUser( $sProUid );
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptFile('/jscore/processmap/core/processUser.js');
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'processes/processes_User', $c, array('PRO_UID' => $sProUid));
G::RenderPage( 'publish', 'raw' );
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptFile( '/jscore/processmap/core/processUser.js' );
}
catch ( Exception $e ){
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
G::RenderPage('publish', 'raw' );
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'processes/processes_User', $c, array ('PRO_UID' => $sProUid
) );
G::RenderPage( 'publish', 'raw' );
} catch (Exception $e) {
$G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'raw' );
}
?>

View File

@@ -1,102 +1,90 @@
<?php
/**
* processes_subProcessSave.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.
*
*/
global $RBAC;
$access = $RBAC->userCanAccess('PM_FACTORY');
if( $access != 1 ){
switch ($access)
{
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
default:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
}
//print_r($_POST); die;
$out = array();
for($i=1; $i<=count($_POST['form']['grid1']); $i++)
{
$out[$_POST['form']['grid1'][$i]['VAR_OUT1']]= $_POST['form']['grid1'][$i]['VAR_OUT2'];
}
$in = array();
for($j=1; $j<=count($_POST['form']['grid2']); $j++)
{
$in[$_POST['form']['grid2'][$j]['VAR_IN1']] = $_POST['form']['grid2'][$j]['VAR_IN2'];
}
require_once 'classes/model/Task.php';
$oTask= new Task();
//$aTask=$oTask->load($_POST['form']['TASKS']);
//$aTask=$oTask->load($_POST['form']['PRO_UID']);
$aTask=($_POST['form']['TASKS']!=0)?$oTask->load($_POST['form']['TASKS']):0;
//$aTask['PRO_UID']=0;
if ( isset ( $_POST['form']['SP_SYNCHRONOUS']) && $_POST['form']['SP_SYNCHRONOUS'] == '' ) {
$_POST['form']['SP_SYNCHRONOUS'] = '0';
}
if ( !isset ( $_POST['form']['SP_SYNCHRONOUS']) ) {
$_POST['form']['SP_SYNCHRONOUS'] = '0';
}
require_once 'classes/model/SubProcess.php';
$oOP = new SubProcess();
$aData = array('SP_UID' => $_POST['form']['SP_UID'],//G::generateUniqueID(),
'PRO_UID' => (isset($aTask['PRO_UID']))?$aTask['PRO_UID']:'',
'TAS_UID' => $_POST['form']['TASKS'],
'PRO_PARENT' => $_POST['form']['PRO_PARENT'],
'TAS_PARENT' => $_POST['form']['TAS_PARENT'],
'SP_TYPE' => 'SIMPLE',
'SP_SYNCHRONOUS' => $_POST['form']['SP_SYNCHRONOUS'],
'SP_SYNCHRONOUS_TYPE' => 'ALL',
'SP_SYNCHRONOUS_WAIT' => 0,
'SP_VARIABLES_OUT' => serialize($out),
'SP_VARIABLES_IN' => serialize($in),
'SP_GRID_IN' => '');
$oOP->update($aData);
require_once 'classes/model/Content.php';
$lang = defined ( 'SYS_LANG') ? SYS_LANG : 'en';
//$cont = Content::addContent( 'SP_TITLE', '', $_POST['form']['SP_UID'], $lang, $_POST['form']['SPROCESS_NAME'] );
$cont = Content::addContent( 'TAS_TITLE', '', $_POST['form']['TAS_PARENT'], $lang, $_POST['form']['SPROCESS_NAME'] );
//$cont = Content::addContent( 'TAS_TITLE', '', $_POST['form']['SP_UID'], $lang, $_POST['form']['SPROCESS_NAME'] );
//G::header('location: processes_Map?PRO_UID='. $_POST['form']['PRO_UID']);
die;
<?php
/**
* processes_subProcessSave.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.
*/
global $RBAC;
$access = $RBAC->userCanAccess( 'PM_FACTORY' );
if ($access != 1) {
switch ($access) {
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
}
//print_r($_POST); die;
$out = array ();
for ($i = 1; $i <= count( $_POST['form']['grid1'] ); $i ++) {
$out[$_POST['form']['grid1'][$i]['VAR_OUT1']] = $_POST['form']['grid1'][$i]['VAR_OUT2'];
}
$in = array ();
for ($j = 1; $j <= count( $_POST['form']['grid2'] ); $j ++) {
$in[$_POST['form']['grid2'][$j]['VAR_IN1']] = $_POST['form']['grid2'][$j]['VAR_IN2'];
}
require_once 'classes/model/Task.php';
$oTask = new Task();
//$aTask=$oTask->load($_POST['form']['TASKS']);
//$aTask=$oTask->load($_POST['form']['PRO_UID']);
$aTask = ($_POST['form']['TASKS'] != 0) ? $oTask->load( $_POST['form']['TASKS'] ) : 0;
//$aTask['PRO_UID']=0;
if (isset( $_POST['form']['SP_SYNCHRONOUS'] ) && $_POST['form']['SP_SYNCHRONOUS'] == '') {
$_POST['form']['SP_SYNCHRONOUS'] = '0';
}
if (! isset( $_POST['form']['SP_SYNCHRONOUS'] )) {
$_POST['form']['SP_SYNCHRONOUS'] = '0';
}
require_once 'classes/model/SubProcess.php';
$oOP = new SubProcess();
$aData = array ('SP_UID' => $_POST['form']['SP_UID'],//G::generateUniqueID(),
'PRO_UID' => (isset( $aTask['PRO_UID'] )) ? $aTask['PRO_UID'] : '','TAS_UID' => $_POST['form']['TASKS'],'PRO_PARENT' => $_POST['form']['PRO_PARENT'],'TAS_PARENT' => $_POST['form']['TAS_PARENT'],'SP_TYPE' => 'SIMPLE','SP_SYNCHRONOUS' => $_POST['form']['SP_SYNCHRONOUS'],'SP_SYNCHRONOUS_TYPE' => 'ALL','SP_SYNCHRONOUS_WAIT' => 0,'SP_VARIABLES_OUT' => serialize( $out ),'SP_VARIABLES_IN' => serialize( $in ),'SP_GRID_IN' => ''
);
$oOP->update( $aData );
require_once 'classes/model/Content.php';
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
//$cont = Content::addContent( 'SP_TITLE', '', $_POST['form']['SP_UID'], $lang, $_POST['form']['SPROCESS_NAME'] );
$cont = Content::addContent( 'TAS_TITLE', '', $_POST['form']['TAS_PARENT'], $lang, $_POST['form']['SPROCESS_NAME'] );
//$cont = Content::addContent( 'TAS_TITLE', '', $_POST['form']['SP_UID'], $lang, $_POST['form']['SPROCESS_NAME'] );
//G::header('location: processes_Map?PRO_UID='. $_POST['form']['PRO_UID']);
die();

View File

@@ -11,8 +11,8 @@ $sTASKS_SEL = $oData->TASKS_NAME;
//echo $sTASKS."<br>";
$sDYNAFORM = $oData->DYNAFORM;
$sWE_TYPE = $oData->WE_TYPE;
$sWS_USER = trim($oData->WS_USER);
$sWS_PASS = trim($oData->WS_PASS);
$sWS_USER = trim( $oData->WS_USER );
$sWS_PASS = trim( $oData->WS_PASS );
$sWS_ROUNDROBIN = $oData->WS_ROUNDROBIN;
$sWE_USR = $oData->WE_USR;
@@ -20,37 +20,41 @@ $sWE_USR = $oData->WE_USR;
//echo ($sTASKS."<br>");
//echo ($sDYNAFORM."<br>");
if (G::is_https ())
if (G::is_https())
$http = 'https://';
else
else
$http = 'http://';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
@$client = new SoapClient ( $endpoint );
@$client = new SoapClient( $endpoint );
$user = $sWS_USER;
$pass = $sWS_PASS;
$params = array ('userid' => $user, 'password' => $pass );
$result = $client->__SoapCall ( 'login', array ($params ) );
$params = array ('userid' => $user,'password' => $pass
);
$result = $client->__SoapCall( 'login', array ($params
) );
//$_SESSION ['WS_SESSION_ID'] = '';
//if ($result->status_code == 0) {
// $_SESSION ['WS_SESSION_ID'] = $result->message;
//}
$fields ['status_code'] = $result->status_code;
$fields ['message'] = 'ProcessMaker WebService version: ' . $result->version . "\n" . $result->message;
$fields ['version'] = $result->version;
$fields ['time_stamp'] = $result->timestamp;
$fields['status_code'] = $result->status_code;
$fields['message'] = 'ProcessMaker WebService version: ' . $result->version . "\n" . $result->message;
$fields['version'] = $result->version;
$fields['time_stamp'] = $result->timestamp;
$messageCode = 1;
G::LoadClass ( 'Task' );
G::LoadClass ( 'User' );
G::LoadClass ( 'TaskUser' );
G::LoadClass ( 'Groupwf' );
G::LoadClass( 'Task' );
G::LoadClass( 'User' );
G::LoadClass( 'TaskUser' );
G::LoadClass( 'Groupwf' );
/**
* note added by gustavo cruz gustavo-at-colosa-dot-com
* This is a little check to see if the GroupUser class has been declared or not.
@@ -58,39 +62,39 @@ G::LoadClass ( 'Groupwf' );
* It's seems that could be replicated in a Linux server easily.
* I recomend that in some way check already if a imported class is declared
* somewhere else or maybe delegate the task to the G Class LoadClass method.
**/
if(!class_exists('GroupUser')) {
G::LoadClass ( 'GroupUser' );
*/
if (! class_exists( 'GroupUser' )) {
G::LoadClass( 'GroupUser' );
}
// if the user has been authenticated, then check if has the rights or
// permissions to create the webentry
if ($result->status_code == 0) {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria->addSelectColumn(TaskUserPeer::USR_UID);
$oCriteria->addSelectColumn(TaskUserPeer::TAS_UID);
$oCriteria->addJoin(TaskUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->add(TaskUserPeer::TAS_UID, $sTASKS);
$oCriteria->add(UsersPeer::USR_USERNAME, $sWS_USER);
//$oCriteria->add(TaskUserPeer::TU_RELATION,1);
$userIsAssigned = TaskUserPeer::doCount($oCriteria);
// if the user is not assigned directly, maybe a have the task a group with the user
if($userIsAssigned<1) {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria->addJoin(UsersPeer::USR_UID, GroupUserPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->addJoin(GroupUserPeer::GRP_UID, TaskUserPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->add(TaskUserPeer::TAS_UID, $sTASKS);
$oCriteria->add(UsersPeer::USR_USERNAME, $sWS_USER);
$userIsAssigned = GroupUserPeer::doCount($oCriteria);
if (!($userIsAssigned>=1)) {
$messageCode = "The User \"".$sWS_USER."\" doesn't have the task \"".$sTASKS_SEL."\" assigned";
}
}
} else {
$messageCode = $result->message;
// if the user has been authenticated, then check if has the rights or
// permissions to create the webentry
if ($result->status_code == 0) {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( UsersPeer::USR_UID );
$oCriteria->addSelectColumn( TaskUserPeer::USR_UID );
$oCriteria->addSelectColumn( TaskUserPeer::TAS_UID );
$oCriteria->addJoin( TaskUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN );
$oCriteria->add( TaskUserPeer::TAS_UID, $sTASKS );
$oCriteria->add( UsersPeer::USR_USERNAME, $sWS_USER );
//$oCriteria->add(TaskUserPeer::TU_RELATION,1);
$userIsAssigned = TaskUserPeer::doCount( $oCriteria );
// if the user is not assigned directly, maybe a have the task a group with the user
if ($userIsAssigned < 1) {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( UsersPeer::USR_UID );
$oCriteria->addJoin( UsersPeer::USR_UID, GroupUserPeer::USR_UID, Criteria::LEFT_JOIN );
$oCriteria->addJoin( GroupUserPeer::GRP_UID, TaskUserPeer::USR_UID, Criteria::LEFT_JOIN );
$oCriteria->add( TaskUserPeer::TAS_UID, $sTASKS );
$oCriteria->add( UsersPeer::USR_USERNAME, $sWS_USER );
$userIsAssigned = GroupUserPeer::doCount( $oCriteria );
if (! ($userIsAssigned >= 1)) {
$messageCode = "The User \"" . $sWS_USER . "\" doesn't have the task \"" . $sTASKS_SEL . "\" assigned";
}
}
} else {
$messageCode = $result->message;
}
echo ($messageCode);
?>

View File

@@ -1,32 +1,32 @@
<?php
/**
* webEntryValidate_Val_assig
* it gets the assign type for the task
* with pro_uid and tas_uid
*/
$sPRO_UID = $oData->PRO_UID;
$sTASKS = $oData->TASKS;
$sDYNAFORM = $oData->DYNAFORM;
if (G::is_https ())
$http = 'https://';
else
$http = 'http://';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
@$client = new SoapClient ( $endpoint );
G::LoadClass ( 'Task' );
G::LoadClass ( 'User' );
G::LoadClass ( 'TaskUser' );
$oTask = new Task ( );
$TaskFields = $oTask->kgetassigType ( $sPRO_UID, $sTASKS );
if ($TaskFields['TAS_ASSIGN_TYPE'] == 'BALANCED')echo 1;
else echo 0;
?>
<?php
/**
* webEntryValidate_Val_assig
* it gets the assign type for the task
* with pro_uid and tas_uid
*/
$sPRO_UID = $oData->PRO_UID;
$sTASKS = $oData->TASKS;
$sDYNAFORM = $oData->DYNAFORM;
if (G::is_https())
$http = 'https://';
else
$http = 'http://';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
@$client = new SoapClient( $endpoint );
G::LoadClass( 'Task' );
G::LoadClass( 'User' );
G::LoadClass( 'TaskUser' );
$oTask = new Task();
$TaskFields = $oTask->kgetassigType( $sPRO_UID, $sTASKS );
if ($TaskFields['TAS_ASSIGN_TYPE'] == 'BALANCED')
echo 1;
else
echo 0;
?>