Merge pull request #818 from ralpheav/master

Code Style change  workflow/engine/methods/groups
This commit is contained in:
ferOnti
2012-10-18 10:29:28 -07:00
9 changed files with 742 additions and 768 deletions

View File

@@ -1,70 +1,69 @@
<?php
/**
* groups.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.
*
*/
$access = $RBAC->userCanAccess('PM_USERS');
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 (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'GROUPS';
$G_PUBLISH = new Publisher;
G::LoadClass('configuration');
$c = new Configurations();
$configPage = $c->getConfiguration('groupList', 'pageSize','',$_SESSION['USER_LOGGED']);
$configEnv = $c->getConfiguration('ENVIRONMENT_SETTINGS', '');
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('groups/groupsList', false); //adding a javascript file .js
$oHeadPublisher->addContent('groups/groupsList'); //adding a html file .html.
$oHeadPublisher->assign('CONFIG', $Config);
G::RenderPage('publish', 'extJs');
?>
<?php
/**
* groups.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.
*/
$access = $RBAC->userCanAccess( 'PM_USERS' );
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 (($RBAC_Response = $RBAC->userCanAccess( "PM_USERS" )) != 1) {
return $RBAC_Response;
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'GROUPS';
$G_PUBLISH = new Publisher();
G::LoadClass( 'configuration' );
$c = new Configurations();
$configPage = $c->getConfiguration( 'groupList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
$configEnv = $c->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript( 'groups/groupsList', false ); //adding a javascript file .js
$oHeadPublisher->addContent( 'groups/groupsList' ); //adding a html file .html.
$oHeadPublisher->assign( 'CONFIG', $Config );
G::RenderPage( 'publish', 'extJs' );

View File

@@ -12,65 +12,64 @@
*
* 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.
*
*/
$access = $RBAC->userCanAccess('PM_USERS');
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;
}
}
$access = $RBAC->userCanAccess( 'PM_USERS' );
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 (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_USERS" )) != 1) {
return $RBAC_Response;
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'GROUPS';
$G_PUBLISH = new Publisher;
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'GROUPS';
$oHeadPublisher =& headPublisher::getSingleton();
$G_PUBLISH = new Publisher();
$oHeadPublisher->addExtJsScript('groups/groupsMembers', false); //adding a javascript file .js
$oHeadPublisher->addContent('groups/groupsMembers'); //adding a html file .html.
$oHeadPublisher = & headPublisher::getSingleton();
$labels = G::getTranslations(Array('ID_GROUPS','ID_GROUP_NAME','ID_BACK','ID_ASSIGN_ALL_MEMBERS','ID_REMOVE_ALL_MEMBERS',
'ID_MSG_AJAX_FAILURE', 'ID_PROCESSING','ID_ENTER_SEARCH_TERM','ID_FIRST_NAME','ID_LAST_NAME','ID_USER_NAME','ID_AVAILABLE_MEMBERS','ID_ASSIGNED_MEMBERS'));
$oHeadPublisher->addExtJsScript( 'groups/groupsMembers', false ); //adding a javascript file .js
$oHeadPublisher->addContent( 'groups/groupsMembers' ); //adding a html file .html.
G::LoadClass('groups');
$labels = G::getTranslations( Array ('ID_GROUPS','ID_GROUP_NAME','ID_BACK','ID_ASSIGN_ALL_MEMBERS','ID_REMOVE_ALL_MEMBERS','ID_MSG_AJAX_FAILURE','ID_PROCESSING','ID_ENTER_SEARCH_TERM','ID_FIRST_NAME','ID_LAST_NAME','ID_USER_NAME','ID_AVAILABLE_MEMBERS','ID_ASSIGNED_MEMBERS') );
G::LoadClass( 'groups' );
$oGroup = new Groupwf();
$oGroup->load($_REQUEST['GRP_UID']);
$oGroup->load( $_REQUEST['GRP_UID'] );
$groups['GRP_UID'] = $_REQUEST['GRP_UID'];
$groups['GRP_TITLE'] = $oGroup->getGrpTitle();
//$oHeadPublisher->assign('TRANSLATIONS', $labels);
$oHeadPublisher->assign('GROUPS', $groups);
G::RenderPage('publish', 'extJs');
?>
$oHeadPublisher->assign( 'GROUPS', $groups );
G::RenderPage( 'publish', 'extJs' );

View File

@@ -1,57 +1,58 @@
<?php
/**
* groups_AddUser.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.
*
*/
require_once ( 'classes/class.xmlfield_InputPM.php' );
$access = $RBAC->userCanAccess('PM_USERS');
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 (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
G::LoadClass('groups');
$oGroups = new Groups();
$oGroup = new Groupwf();
$aFields = $oGroup->load($_GET['UID']);
$G_PUBLISH = new Publisher();
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'groups/groups_UsersListTitle', '', array('GRP_NAME' => $aFields['GRP_TITLE']));
$G_PUBLISH->AddContent('propeltable', 'groups/paged-table', 'groups/groups_AvailableUsers', $oGroups->getAvailableUsersCriteria($_GET['UID']));
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'groups/groups_SelectUsers','', '','save' );
G::RenderPage('publish', 'raw');
<?php
/**
* groups_AddUser.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.
*/
require_once ('classes/class.xmlfield_InputPM.php');
$access = $RBAC->userCanAccess( 'PM_USERS' );
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 (($RBAC_Response = $RBAC->userCanAccess( "PM_USERS" )) != 1) {
return $RBAC_Response;
}
G::LoadClass( 'groups' );
$oGroups = new Groups();
$oGroup = new Groupwf();
$aFields = $oGroup->load( $_GET['UID'] );
$G_PUBLISH = new Publisher();
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'groups/groups_UsersListTitle', '', array('GRP_NAME' => $aFields['GRP_TITLE']));
$G_PUBLISH->AddContent( 'propeltable', 'groups/paged-table', 'groups/groups_AvailableUsers', $oGroups->getAvailableUsersCriteria( $_GET['UID'] ) );
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'groups/groups_SelectUsers','', '','save' );
G::RenderPage( 'publish', 'raw' );

View File

@@ -12,339 +12,320 @@
*
* 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 (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
G::LoadInclude('ajax');
$_POST['action'] = get_ajax_value('action');
switch ($_POST['action'])
{
case 'showUsers':
G::LoadClass('groups');
$oGroups = new Groups();
$oGroup = new Groupwf();
$aFields = $oGroup->load($_POST['sGroupUID']);
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'groups/groups_UsersListTitle', '', array('GRP_NAME' => $aFields['GRP_TITLE']));
$G_PUBLISH->AddContent('propeltable', 'groups/paged-table2', 'groups/groups_UsersList', $oGroups->getUsersGroupCriteria($_POST['sGroupUID']), array('GRP_UID' => $_POST['sGroupUID'], 'GRP_NAME' => $aFields['GRP_TITLE']));
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptCode("groupname=\"{$aFields["GRP_TITLE"]}\";");
G::RenderPage('publish', 'raw');
break;
case 'assignUser':
G::LoadClass('groups');
$oGroup = new Groups();
$oGroup->addUserToGroup($_POST['GRP_UID'], $_POST['USR_UID']);
break;
case 'assignAllUsers':
G::LoadClass('groups');
$oGroup = new Groups();
$aUsers=explode(',', $_POST['aUsers']);
for($i=0; $i<count($aUsers); $i++)
{
$oGroup->addUserToGroup($_POST['GRP_UID'], $aUsers[$i]);
}
break;
case 'ofToAssignUser':
G::LoadClass('groups');
$oGroup = new Groups();
$oGroup->removeUserOfGroup($_POST['GRP_UID'], $_POST['USR_UID']);
break;
case 'verifyGroupname':
$_POST['sOriginalGroupname'] = get_ajax_value('sOriginalGroupname');
$_POST['sGroupname'] = get_ajax_value('sGroupname');
if ($_POST['sOriginalGroupname'] == $_POST['sGroupname'])
{
echo '0';
}
else
{
require_once 'classes/model/Groupwf.php';
G::LoadClass('Groupswf');
$oGroup = new Groupwf();
$oCriteria=$oGroup->loadByGroupname($_POST['sGroupname']);
$oDataset = GroupwfPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
if (!$aRow)
{
echo '0';
}
else
{
echo '1';
}
}
break;
case 'groupsList':
require_once 'classes/model/Groupwf.php';
require_once 'classes/model/TaskUser.php';
require_once 'classes/model/GroupUser.php';
G::LoadClass('configuration');
$co = new Configurations();
$config = $co->getConfiguration('groupList', 'pageSize','',$_SESSION['USER_LOGGED']);
$env = $co->getConfiguration('ENVIRONMENT_SETTINGS', '');
$limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size;
$filter = isset($_REQUEST['textFilter']) ? $_REQUEST['textFilter'] : '';
global $RBAC;
if ($limit == $start) $limit = $limit +$limit ;
$tasks = new TaskUser();
$aTask = $tasks->getCountAllTaksByGroups();
$members = new GroupUser();
$aMembers = $members->getCountAllUsersByGroup();
require_once PATH_CONTROLLERS . 'adminProxy.php';
$uxList = adminProxy::getUxTypesList();
$groups = new Groupwf();
$data = $groups->getAllGroup($start,$limit,$filter);
$result = $data['rows'];
$totalRows = 0;
$arrData = array();
foreach ($result as $results) {
$totalRows ++;
$results['CON_VALUE'] = str_replace(array("<", ">"), array("&lt;", "&gt;"), $results['GRP_TITLE']);
$results['GRP_TASKS'] = isset($aTask[$results['GRP_UID']]) ? $aTask[$results['GRP_UID']] : 0;
$results['GRP_USERS'] = isset($aMembers[$results['GRP_UID']]) ? $aMembers[$results['GRP_UID']] : 0;
$arrData[] = $results;
}
$result = new StdClass();
$result->success = true;
$result->groups = $arrData;
$result->total_groups = $data['totalCount'];
echo G::json_encode($result);
break;
case 'exitsGroupName':
require_once 'classes/model/Groupwf.php';
G::LoadClass('Groupswf');
$oGroup = new Groupwf();
$oCriteria=$oGroup->loadByGroupname($_POST['GRP_NAME']);
$oDataset = GroupwfPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$response = ($aRow) ? 'true' : 'false';
echo $response;
break;
case 'saveNewGroup':
G::LoadClass('groups');
$newGroup['GRP_UID'] = '';
$newGroup['GRP_STATUS'] = G::toUpper($_POST['status']);
$newGroup['GRP_TITLE'] = trim($_POST['name']);
unset($newGroup['GRP_UID']);
$group = new Groupwf();
$group->create($newGroup);
echo '{success: true}';
break;
case 'saveEditGroup':
G::LoadClass('groups');
$editGroup['GRP_UID'] = $_POST['grp_uid'];
$editGroup['GRP_STATUS'] = G::toUpper($_POST['status']);
$editGroup['GRP_TITLE'] = trim($_POST['name']);
$group = new Groupwf();
$group->update($editGroup);
echo '{success: true}';
break;
case 'deleteGroup':
G::LoadClass('groups');
$group = new Groupwf();
if (!isset($_POST['GRP_UID'])) return;
$group->remove(urldecode($_POST['GRP_UID']));
require_once 'classes/model/TaskUser.php';
$oProcess = new TaskUser();
$oCriteria = new Criteria('workflow');
$oCriteria->add(TaskUserPeer::USR_UID, $_POST['GRP_UID']);
TaskUserPeer::doDelete($oCriteria);
echo '{success: true}';
break;
case 'assignedMembers':
require_once 'classes/model/Users.php';
require_once 'classes/model/GroupUser.php';
G::LoadClass('configuration');
$co = new Configurations();
$config = $co->getConfiguration('groupList', 'pageSize','',$_SESSION['USER_LOGGED']);
$env = $co->getConfiguration('ENVIRONMENT_SETTINGS', '');
$limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size;
$filter = isset($_REQUEST['textFilter']) ? $_REQUEST['textFilter'] : '';
$sGroupUID = $_REQUEST['gUID'];
$aUsers = Array();
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn('COUNT(*) AS CNT');
$oCriteria->addJoin(GroupUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->add(GroupUserPeer::GRP_UID, $sGroupUID);
$oCriteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
$filter = (isset($_POST['textFilter']))? $_POST['textFilter'] : '';
if ($filter != ''){
$oCriteria->add(
$oCriteria->getNewCriterion(UsersPeer::USR_USERNAME, '%'.$filter.'%', Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%'.$filter.'%', Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME, '%'.$filter.'%', Criteria::LIKE))));
}
$oDataset = UsersPeer::DoSelectRs ($oCriteria);
$oDataset->setFetchmode (ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$row = $oDataset->getRow();
$totalRows = $row['CNT'];
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(GroupUserPeer::GRP_UID);
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL);
$oCriteria->addSelectColumn(UsersPeer::USR_STATUS);
$oCriteria->addJoin(GroupUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->add(GroupUserPeer::GRP_UID, $sGroupUID);
$oCriteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
$filter = (isset($_POST['textFilter']))? $_POST['textFilter'] : '';
if ($filter != ''){
$oCriteria->add(
$oCriteria->getNewCriterion(UsersPeer::USR_USERNAME, '%'.$filter.'%', Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%'.$filter.'%', Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME, '%'.$filter.'%', Criteria::LIKE))));
}
$oCriteria->setOffset($start);
$oCriteria->setLimit($limit);
$oDataset = UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$arrData = Array();
while ($oDataset->next()){
$arrData[] = $oDataset->getRow();
}
echo '{success: true, members: '.G::json_encode($arrData).', total_users: '.$totalRows.'}';
break;
case 'availableMembers':
require_once 'classes/model/Users.php';
require_once 'classes/model/GroupUser.php';
G::LoadClass('configuration');
$co = new Configurations();
$config = $co->getConfiguration('groupList', 'pageSize','',$_SESSION['USER_LOGGED']);
$env = $co->getConfiguration('ENVIRONMENT_SETTINGS', '');
$limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size;
$filter = isset($_REQUEST['textFilter']) ? $_REQUEST['textFilter'] : '';
$sGroupUID = $_REQUEST['gUID'];
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(GroupUserPeer::GRP_UID);
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria->addJoin(GroupUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->add(GroupUserPeer::GRP_UID, $sGroupUID);
$oCriteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
$oDataset = UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$uUIDs = array();
while ($aRow = $oDataset->getRow()) {
$uUIDs[] = $aRow['USR_UID'];
$oDataset->next();
}
$aUsers = Array();
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn('COUNT(*) AS CNT');
$oCriteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
$oCriteria->add(UsersPeer::USR_UID, $uUIDs, Criteria::NOT_IN);
$filter = (isset($_POST['textFilter']))? $_POST['textFilter'] : '';
if ($filter != ''){
$oCriteria->add(
$oCriteria->getNewCriterion(UsersPeer::USR_USERNAME, '%'.$filter.'%', Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%'.$filter.'%', Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME, '%'.$filter.'%', Criteria::LIKE))));
}
$oDataset = UsersPeer::DoSelectRs ($oCriteria);
$oDataset->setFetchmode (ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$row = $oDataset->getRow();
$totalRows = $row['CNT'];
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL);
$oCriteria->addSelectColumn(UsersPeer::USR_STATUS);
$oCriteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
$oCriteria->add(UsersPeer::USR_UID, $uUIDs, Criteria::NOT_IN);
$filter = (isset($_POST['textFilter']))? $_POST['textFilter'] : '';
if ($filter != ''){
$oCriteria->add(
$oCriteria->getNewCriterion(UsersPeer::USR_USERNAME, '%'.$filter.'%', Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%'.$filter.'%', Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME, '%'.$filter.'%', Criteria::LIKE))));
}
$oCriteria->setOffset($start);
$oCriteria->setLimit($limit);
$oDataset = UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$arrData = Array();
while ($oDataset->next()){
$arrData[] = $oDataset->getRow();
}
echo '{success: true, members: '.G::json_encode($arrData).', total_users: '.$totalRows.'}';
break;
case 'assignUsersToGroupsMultiple':
$GRP_UID = $_POST['GRP_UID'];
$uUIDs = explode(',',$_POST['USR_UID']);
G::LoadClass('groups');
$oGroup = new Groups();
foreach ($uUIDs as $USR_UID){
$oGroup->addUserToGroup($GRP_UID, $USR_UID);
}
break;
case 'deleteUsersToGroupsMultiple':
$GRP_UID = $_POST['GRP_UID'];
$uUIDs = explode(',',$_POST['USR_UID']);
G::LoadClass('groups');
$oGroup = new Groups();
foreach ($uUIDs as $USR_UID){
$oGroup->removeUserOfGroup($GRP_UID, $USR_UID);
}
break;
case 'updatePageSize':
G::LoadClass('configuration');
$c = new Configurations();
$arr['pageSize'] = $_REQUEST['size'];
$arr['dateSave'] = date('Y-m-d H:i:s');
$config = Array();
$config[] = $arr;
$c->aConfig = $config;
$c->saveConfig('groupList', 'pageSize','',$_SESSION['USER_LOGGED']);
echo '{success: true}';
break;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_USERS" )) != 1) {
return $RBAC_Response;
}
G::LoadInclude( 'ajax' );
$_POST['action'] = get_ajax_value( 'action' );
switch ($_POST['action']) {
case 'showUsers':
G::LoadClass( 'groups' );
$oGroups = new Groups();
$oGroup = new Groupwf();
$aFields = $oGroup->load( $_POST['sGroupUID'] );
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'groups/groups_UsersListTitle', '', array('GRP_NAME' => $aFields['GRP_TITLE']));
$G_PUBLISH->AddContent( 'propeltable', 'groups/paged-table2', 'groups/groups_UsersList', $oGroups->getUsersGroupCriteria( $_POST['sGroupUID'] ), array ('GRP_UID' => $_POST['sGroupUID'],'GRP_NAME' => $aFields['GRP_TITLE']) );
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptCode( "groupname=\"{$aFields["GRP_TITLE"]}\";" );
G::RenderPage( 'publish', 'raw' );
break;
case 'assignUser':
G::LoadClass( 'groups' );
$oGroup = new Groups();
$oGroup->addUserToGroup( $_POST['GRP_UID'], $_POST['USR_UID'] );
break;
case 'assignAllUsers':
G::LoadClass( 'groups' );
$oGroup = new Groups();
$aUsers = explode( ',', $_POST['aUsers'] );
for ($i = 0; $i < count( $aUsers ); $i ++) {
$oGroup->addUserToGroup( $_POST['GRP_UID'], $aUsers[$i] );
}
break;
case 'ofToAssignUser':
G::LoadClass( 'groups' );
$oGroup = new Groups();
$oGroup->removeUserOfGroup( $_POST['GRP_UID'], $_POST['USR_UID'] );
break;
case 'verifyGroupname':
$_POST['sOriginalGroupname'] = get_ajax_value( 'sOriginalGroupname' );
$_POST['sGroupname'] = get_ajax_value( 'sGroupname' );
if ($_POST['sOriginalGroupname'] == $_POST['sGroupname']) {
echo '0';
} else {
require_once 'classes/model/Groupwf.php';
G::LoadClass( 'Groupswf' );
$oGroup = new Groupwf();
$oCriteria = $oGroup->loadByGroupname( $_POST['sGroupname'] );
$oDataset = GroupwfPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aRow = $oDataset->getRow();
if (! $aRow) {
echo '0';
} else {
echo '1';
}
}
break;
case 'groupsList':
require_once 'classes/model/Groupwf.php';
require_once 'classes/model/TaskUser.php';
require_once 'classes/model/GroupUser.php';
G::LoadClass( 'configuration' );
$co = new Configurations();
$config = $co->getConfiguration( 'groupList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
$env = $co->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
$limit_size = isset( $config['pageSize'] ) ? $config['pageSize'] : 20;
$start = isset( $_REQUEST['start'] ) ? $_REQUEST['start'] : 0;
$limit = isset( $_REQUEST['limit'] ) ? $_REQUEST['limit'] : $limit_size;
$filter = isset( $_REQUEST['textFilter'] ) ? $_REQUEST['textFilter'] : '';
global $RBAC;
if ($limit == $start) {
$limit = $limit + $limit;
}
$tasks = new TaskUser();
$aTask = $tasks->getCountAllTaksByGroups();
$members = new GroupUser();
$aMembers = $members->getCountAllUsersByGroup();
require_once PATH_CONTROLLERS . 'adminProxy.php';
$uxList = adminProxy::getUxTypesList();
$groups = new Groupwf();
$data = $groups->getAllGroup( $start, $limit, $filter );
$result = $data['rows'];
$totalRows = 0;
$arrData = array ();
foreach ($result as $results) {
$totalRows ++;
$results['CON_VALUE'] = str_replace( array ("<",">"
), array ("&lt;","&gt;"
), $results['GRP_TITLE'] );
$results['GRP_TASKS'] = isset( $aTask[$results['GRP_UID']] ) ? $aTask[$results['GRP_UID']] : 0;
$results['GRP_USERS'] = isset( $aMembers[$results['GRP_UID']] ) ? $aMembers[$results['GRP_UID']] : 0;
$arrData[] = $results;
}
$result = new StdClass();
$result->success = true;
$result->groups = $arrData;
$result->total_groups = $data['totalCount'];
echo G::json_encode( $result );
break;
case 'exitsGroupName':
require_once 'classes/model/Groupwf.php';
G::LoadClass( 'Groupswf' );
$oGroup = new Groupwf();
$oCriteria = $oGroup->loadByGroupname( $_POST['GRP_NAME'] );
$oDataset = GroupwfPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aRow = $oDataset->getRow();
$response = ($aRow) ? 'true' : 'false';
echo $response;
break;
case 'saveNewGroup':
G::LoadClass( 'groups' );
$newGroup['GRP_UID'] = '';
$newGroup['GRP_STATUS'] = G::toUpper( $_POST['status'] );
$newGroup['GRP_TITLE'] = trim( $_POST['name'] );
unset( $newGroup['GRP_UID'] );
$group = new Groupwf();
$group->create( $newGroup );
echo '{success: true}';
break;
case 'saveEditGroup':
G::LoadClass( 'groups' );
$editGroup['GRP_UID'] = $_POST['grp_uid'];
$editGroup['GRP_STATUS'] = G::toUpper( $_POST['status'] );
$editGroup['GRP_TITLE'] = trim( $_POST['name'] );
$group = new Groupwf();
$group->update( $editGroup );
echo '{success: true}';
break;
case 'deleteGroup':
G::LoadClass( 'groups' );
$group = new Groupwf();
if (! isset( $_POST['GRP_UID'] )) {
return;
}
$group->remove( urldecode( $_POST['GRP_UID'] ) );
require_once 'classes/model/TaskUser.php';
$oProcess = new TaskUser();
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( TaskUserPeer::USR_UID, $_POST['GRP_UID'] );
TaskUserPeer::doDelete( $oCriteria );
echo '{success: true}';
break;
case 'assignedMembers':
require_once 'classes/model/Users.php';
require_once 'classes/model/GroupUser.php';
G::LoadClass( 'configuration' );
$co = new Configurations();
$config = $co->getConfiguration( 'groupList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
$env = $co->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
$limit_size = isset( $config['pageSize'] ) ? $config['pageSize'] : 20;
$start = isset( $_REQUEST['start'] ) ? $_REQUEST['start'] : 0;
$limit = isset( $_REQUEST['limit'] ) ? $_REQUEST['limit'] : $limit_size;
$filter = isset( $_REQUEST['textFilter'] ) ? $_REQUEST['textFilter'] : '';
$sGroupUID = $_REQUEST['gUID'];
$aUsers = Array ();
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( 'COUNT(*) AS CNT' );
$oCriteria->addJoin( GroupUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN );
$oCriteria->add( GroupUserPeer::GRP_UID, $sGroupUID );
$oCriteria->add( UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL );
$filter = (isset( $_POST['textFilter'] )) ? $_POST['textFilter'] : '';
if ($filter != '') {
$oCriteria->add( $oCriteria->getNewCriterion( UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_LASTNAME, '%' . $filter . '%', Criteria::LIKE ) ) ) );
}
$oDataset = UsersPeer::DoSelectRs( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$row = $oDataset->getRow();
$totalRows = $row['CNT'];
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( GroupUserPeer::GRP_UID );
$oCriteria->addSelectColumn( UsersPeer::USR_UID );
$oCriteria->addSelectColumn( UsersPeer::USR_USERNAME );
$oCriteria->addSelectColumn( UsersPeer::USR_FIRSTNAME );
$oCriteria->addSelectColumn( UsersPeer::USR_LASTNAME );
$oCriteria->addSelectColumn( UsersPeer::USR_EMAIL );
$oCriteria->addSelectColumn( UsersPeer::USR_STATUS );
$oCriteria->addJoin( GroupUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN );
$oCriteria->add( GroupUserPeer::GRP_UID, $sGroupUID );
$oCriteria->add( UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL );
$filter = (isset( $_POST['textFilter'] )) ? $_POST['textFilter'] : '';
if ($filter != '') {
$oCriteria->add( $oCriteria->getNewCriterion( UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_LASTNAME, '%' . $filter . '%', Criteria::LIKE ) ) ) );
}
$oCriteria->setOffset( $start );
$oCriteria->setLimit( $limit );
$oDataset = UsersPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$arrData = Array ();
while ($oDataset->next()) {
$arrData[] = $oDataset->getRow();
}
echo '{success: true, members: ' . G::json_encode( $arrData ) . ', total_users: ' . $totalRows . '}';
break;
case 'availableMembers':
require_once 'classes/model/Users.php';
require_once 'classes/model/GroupUser.php';
G::LoadClass( 'configuration' );
$co = new Configurations();
$config = $co->getConfiguration( 'groupList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
$env = $co->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
$limit_size = isset( $config['pageSize'] ) ? $config['pageSize'] : 20;
$start = isset( $_REQUEST['start'] ) ? $_REQUEST['start'] : 0;
$limit = isset( $_REQUEST['limit'] ) ? $_REQUEST['limit'] : $limit_size;
$filter = isset( $_REQUEST['textFilter'] ) ? $_REQUEST['textFilter'] : '';
$sGroupUID = $_REQUEST['gUID'];
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( GroupUserPeer::GRP_UID );
$oCriteria->addSelectColumn( UsersPeer::USR_UID );
$oCriteria->addJoin( GroupUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN );
$oCriteria->add( GroupUserPeer::GRP_UID, $sGroupUID );
$oCriteria->add( UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL );
$oDataset = UsersPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$uUIDs = array ();
while ($aRow = $oDataset->getRow()) {
$uUIDs[] = $aRow['USR_UID'];
$oDataset->next();
}
$aUsers = Array ();
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( 'COUNT(*) AS CNT' );
$oCriteria->add( UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL );
$oCriteria->add( UsersPeer::USR_UID, $uUIDs, Criteria::NOT_IN );
$filter = (isset( $_POST['textFilter'] )) ? $_POST['textFilter'] : '';
if ($filter != '') {
$oCriteria->add( $oCriteria->getNewCriterion( UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_LASTNAME, '%' . $filter . '%', Criteria::LIKE ) ) ) );
}
$oDataset = UsersPeer::DoSelectRs( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$row = $oDataset->getRow();
$totalRows = $row['CNT'];
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( UsersPeer::USR_UID );
$oCriteria->addSelectColumn( UsersPeer::USR_USERNAME );
$oCriteria->addSelectColumn( UsersPeer::USR_FIRSTNAME );
$oCriteria->addSelectColumn( UsersPeer::USR_LASTNAME );
$oCriteria->addSelectColumn( UsersPeer::USR_EMAIL );
$oCriteria->addSelectColumn( UsersPeer::USR_STATUS );
$oCriteria->add( UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL );
$oCriteria->add( UsersPeer::USR_UID, $uUIDs, Criteria::NOT_IN );
$filter = (isset( $_POST['textFilter'] )) ? $_POST['textFilter'] : '';
if ($filter != '') {
$oCriteria->add( $oCriteria->getNewCriterion( UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_LASTNAME, '%' . $filter . '%', Criteria::LIKE ) ) ) );
}
$oCriteria->setOffset( $start );
$oCriteria->setLimit( $limit );
$oDataset = UsersPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$arrData = Array ();
while ($oDataset->next()) {
$arrData[] = $oDataset->getRow();
}
echo '{success: true, members: ' . G::json_encode( $arrData ) . ', total_users: ' . $totalRows . '}';
break;
case 'assignUsersToGroupsMultiple':
$GRP_UID = $_POST['GRP_UID'];
$uUIDs = explode( ',', $_POST['USR_UID'] );
G::LoadClass( 'groups' );
$oGroup = new Groups();
foreach ($uUIDs as $USR_UID) {
$oGroup->addUserToGroup( $GRP_UID, $USR_UID );
}
break;
case 'deleteUsersToGroupsMultiple':
$GRP_UID = $_POST['GRP_UID'];
$uUIDs = explode( ',', $_POST['USR_UID'] );
G::LoadClass( 'groups' );
$oGroup = new Groups();
foreach ($uUIDs as $USR_UID) {
$oGroup->removeUserOfGroup( $GRP_UID, $USR_UID );
}
break;
case 'updatePageSize':
G::LoadClass( 'configuration' );
$c = new Configurations();
$arr['pageSize'] = $_REQUEST['size'];
$arr['dateSave'] = date( 'Y-m-d H:i:s' );
$config = Array ();
$config[] = $arr;
$c->aConfig = $config;
$c->saveConfig( 'groupList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
echo '{success: true}';
break;
}

View File

@@ -1,64 +1,65 @@
<?php
/**
* groups_Delete.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.
*
*/
$access = $RBAC->userCanAccess('PM_USERS');
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 (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
G::LoadClass('groups');
$group = new Groupwf();
if (!isset($_POST['GRP_UID'])) return;
$group->remove(urldecode($_POST['GRP_UID']));
require_once 'classes/model/TaskUser.php';
$oProcess = new TaskUser();
$oCriteria = new Criteria('workflow');
$oCriteria->add(TaskUserPeer::USR_UID, $_POST['GRP_UID']);
TaskUserPeer::doDelete($oCriteria);
?>
<?php
/**
* groups_Delete.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.
*/
$access = $RBAC->userCanAccess( 'PM_USERS' );
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 (($RBAC_Response = $RBAC->userCanAccess( "PM_USERS" )) != 1) {
return $RBAC_Response;
}
G::LoadClass( 'groups' );
$group = new Groupwf();
if (! isset( $_POST['GRP_UID'] )) {
return;
}
$group->remove( urldecode( $_POST['GRP_UID'] ) );
require_once 'classes/model/TaskUser.php';
$oProcess = new TaskUser();
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( TaskUserPeer::USR_UID, $_POST['GRP_UID'] );
TaskUserPeer::doDelete( $oCriteria );

View File

@@ -1,70 +1,65 @@
<?php
/**
* groups_Edit.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.
*
*/
$access = $RBAC->userCanAccess('PM_USERS');
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 (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
G::LoadClass('groups');
$dbc = new DBConnection();
$ses = new DBSession($dbc);
$group = new Groupwf();
$GrpUid = (isset($_GET['UID'])) ? urldecode($_GET['UID']):'';
if ($GrpUid)
{
$aFields=$group->Load( $GrpUid );
}
else
{
$aFields=array();
}
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'groups/groups_Edit', '', $aFields , 'groups_Save');
G::RenderPage( "publish" , "raw" );
?>
<?php
/**
* groups_Edit.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.
*/
$access = $RBAC->userCanAccess( 'PM_USERS' );
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 (($RBAC_Response = $RBAC->userCanAccess( "PM_USERS" )) != 1) {
return $RBAC_Response;
}
G::LoadClass( 'groups' );
$dbc = new DBConnection();
$ses = new DBSession( $dbc );
$group = new Groupwf();
$GrpUid = (isset( $_GET['UID'] )) ? urldecode( $_GET['UID'] ) : '';
if ($GrpUid) {
$aFields = $group->Load( $GrpUid );
} else {
$aFields = array ();
}
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'groups/groups_Edit', '', $aFields, 'groups_Save' );
G::RenderPage( "publish", "raw" );

View File

@@ -1,55 +1,55 @@
<?php
/**
* groups_List.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.
*
*/
$access = $RBAC->userCanAccess('PM_USERS');
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 (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent( 'view', 'groups/groups_Tree' );
G::RenderPage( "publish-raw" , "raw" );
?>
<?php
/**
* groups_List.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.
*/
$access = $RBAC->userCanAccess( 'PM_USERS' );
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 (($RBAC_Response = $RBAC->userCanAccess( "PM_USERS" )) != 1) {
return $RBAC_Response;
}
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'groups/groups_Tree' );
G::RenderPage( "publish-raw", "raw" );

View File

@@ -1,69 +1,65 @@
<?php
/**
* groups_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.
*
*/
$access = $RBAC->userCanAccess('PM_USERS');
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 (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
G::LoadClass('groups');
$G_MAIN_MENU = 'wf.login';
$G_MENU_SELECTED = '';
$group = new Groupwf();
if($_POST['form']['GRP_UID']==='')
{
$grpRow = $_POST['form'];
unset ( $grpRow['GRP_UID'] );
$group->create( $grpRow );
//$_POST['form']['GRP_UID']=$group->getGrpUid();
//$group->update($_POST['form']);
}
else
{
$group->update($_POST['form']);
}
?>
<?php
/**
* groups_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.
*/
$access = $RBAC->userCanAccess( 'PM_USERS' );
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 (($RBAC_Response = $RBAC->userCanAccess( "PM_USERS" )) != 1) {
return $RBAC_Response;
}
G::LoadClass( 'groups' );
$G_MAIN_MENU = 'wf.login';
$G_MENU_SELECTED = '';
$group = new Groupwf();
if ($_POST['form']['GRP_UID'] === '') {
$grpRow = $_POST['form'];
unset( $grpRow['GRP_UID'] );
$group->create( $grpRow );
//$_POST['form']['GRP_UID']=$group->getGrpUid();
//$group->update($_POST['form']);
} else {
$group->update( $_POST['form'] );
}

View File

@@ -1,10 +1,10 @@
<?php
/**
* groups_SaveAddUser.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,18 +12,20 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* 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.
*
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
G::LoadClass('groups');
$groups = new Groups;
$groups->addUserToGroup( $_GET['GRP_UID'], $_POST['form']['USR_UID'] );
if (($RBAC_Response = $RBAC->userCanAccess( "PM_USERS" )) != 1) {
return $RBAC_Response;
}
G::LoadClass( 'groups' );
$groups = new Groups();
$groups->addUserToGroup( $_GET['GRP_UID'], $_POST['form']['USR_UID'] );