CODE STYLE, workflow/engine/methods/users/

FILES:
data_usersList.php
index.php
myInfo.php
myInfo_Ajax.php
myInfo_Edit.php
myInfo_Save.php
usersAjax.php
usersEdit.php
usersGroups.php
usersInit.php
usersNew.php
users_Ajax.php
users_AuthSource.php
users_AuthSourceSave.php
users_Delete.php
users_DeleteAssign.php
users_DeleteReassign.php
users_DeleteReassignEnd.php
users_Edit.php
users_Groups.php
users_List.php
users_New.php
users_Reassign.php
users_ReassignCases.php
users_Save.php
users_View.php
users_ViewPhoto.php
users_ViewPhotoGrid.php
users_ViewResume.php
This commit is contained in:
jennylee
2012-10-17 18:13:05 -04:00
parent e16048052d
commit 5485060c3f
29 changed files with 2665 additions and 2749 deletions

View File

@@ -12,63 +12,60 @@
*
* 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.
*
*/
require_once (PATH_RBAC . "model/RolesPeer.php");
G::LoadClass('ArrayPeer');
G::LoadClass( 'ArrayPeer' );
isset($_POST['textFilter']) ? $filter = $_POST['textFilter'] : $filter = '';
isset( $_POST['textFilter'] ) ? $filter = $_POST['textFilter'] : $filter = '';
$sDelimiter = DBAdapter::getStringDelimiter();
require_once 'classes/model/Users.php';
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( UsersPeer::USR_UID );
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if(G::LoadSystemExist($sDataBase)){
G::LoadSystem($sDataBase);
$oDataBase = new database();
$oCriteria->addAsColumn('USR_COMPLETENAME', $oDataBase->concatString("USR_LASTNAME", "' '", "USR_FIRSTNAME"));
//$oCriteria->addAsColumn('USR_PHOTO', $oDataBase->concatString("'".PATH_IMAGES_ENVIRONMENT_USERS."'", "USR_UID","'.gif'"));
$sDataBase = 'database_' . strtolower( DB_ADAPTER );
if (G::LoadSystemExist( $sDataBase )) {
G::LoadSystem( $sDataBase );
$oDataBase = new database();
$oCriteria->addAsColumn( 'USR_COMPLETENAME', $oDataBase->concatString( "USR_LASTNAME", "' '", "USR_FIRSTNAME" ) );
//$oCriteria->addAsColumn('USR_PHOTO', $oDataBase->concatString("'".PATH_IMAGES_ENVIRONMENT_USERS."'", "USR_UID","'.gif'"));
}
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL);
$oCriteria->addSelectColumn(UsersPeer::USR_ROLE);
$oCriteria->addSelectColumn(UsersPeer::USR_DUE_DATE);
$oCriteria->addSelectColumn( UsersPeer::USR_USERNAME );
$oCriteria->addSelectColumn( UsersPeer::USR_EMAIL );
$oCriteria->addSelectColumn( UsersPeer::USR_ROLE );
$oCriteria->addSelectColumn( UsersPeer::USR_DUE_DATE );
//$oCriteria->addAsColumn('USR_VIEW', $sDelimiter . G::LoadTranslation('ID_DETAIL') . $sDelimiter);
//$oCriteria->addAsColumn('USR_EDIT', $sDelimiter . G::LoadTranslation('ID_EDIT') . $sDelimiter);
//$oCriteria->addAsColumn('USR_DELETE', $sDelimiter . G::LoadTranslation('ID_DELETE') . $sDelimiter);
//$oCriteria->addAsColumn('USR_AUTH', $sDelimiter . G::LoadTranslation('ID_AUTHENTICATION') . $sDelimiter);
//$oCriteria->addAsColumn('USR_REASSIGN', $sDelimiter . G::LoadTranslation('ID_REASSIGN_CASES') . $sDelimiter);
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
$oCriteria->add( UsersPeer::USR_STATUS, array ('CLOSED'
), Criteria::NOT_IN );
if ($filter != ''){
$cc = $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->add($cc);
if ($filter != '') {
$cc = $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->add( $cc );
//echo $oCriteria->toString();
}
$rs = UsersPeer::DoSelectRs( $oCriteria );
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs = UsersPeer::DoSelectRs ($oCriteria);
$rs->setFetchmode (ResultSet::FETCHMODE_ASSOC);
$rows = Array();
while($rs->next()){
$rows[] = $rs->getRow();
// if (!file_exists($aux['USR_PHOTO'])) $aux['USR_PHOTO'] = 'public_html/images/user.gif';
// $rows[] = $aux;
$rows = Array ();
while ($rs->next()) {
$rows[] = $rs->getRow();
// if (!file_exists($aux['USR_PHOTO'])) $aux['USR_PHOTO'] = 'public_html/images/user.gif';
// $rows[] = $aux;
}
echo '{users: '.G::json_encode($rows).'}';
echo '{users: ' . G::json_encode( $rows ) . '}';

View File

@@ -1,10 +1,10 @@
<?php
/**
* index.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,17 +12,15 @@
*
* 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.
*
*/
$newFile = str_replace ( 'index.php', 'users_List.php' , __FILE__ ) ;
return $newFile;
$newFile = str_replace( 'index.php', 'users_List.php', __FILE__ );
return $newFile;

View File

@@ -12,26 +12,25 @@
*
* 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.
*
*/
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'MY_ACCOUNT';
$G_PUBLISH = new Publisher ();
if ( isset($_GET['type']) ){
$G_PUBLISH->AddContent('view', 'users/usersReload');
G::RenderPage( "publishBlank", "blank");
}
else {
$G_PUBLISH->AddContent('view', 'users/usersLoad');
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'MY_ACCOUNT';
$G_PUBLISH = new Publisher();
if (isset( $_GET['type'] )) {
$G_PUBLISH->AddContent( 'view', 'users/usersReload' );
G::RenderPage( "publishBlank", "blank" );
} else {
$G_PUBLISH->AddContent( 'view', 'users/usersLoad' );
G::RenderPage( "publish" );
}
}

View File

@@ -1,10 +1,10 @@
<?php
/**
* myInfo_Ajax.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,21 +12,21 @@
*
* 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_LOGIN"))!=1) return $RBAC_Response;
G::LoadClass("xmlMenu");
$form = new Form ( 'myInfo/myInfoAEdit.xml' , PATH_XMLFORM );
$form->action = urlencode( G::encrypt( '' ,URL_KEY ) );
$form->ajaxServer = urlencode( G::encrypt( SYS_URI . '/gulliver/defaultAjax' ,URL_KEY ) );
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1)
return $RBAC_Response;
G::LoadClass( "xmlMenu" );
$form = new Form( 'myInfo/myInfoAEdit.xml', PATH_XMLFORM );
$form->action = urlencode( G::encrypt( '', URL_KEY ) );
$form->ajaxServer = urlencode( G::encrypt( SYS_URI . '/gulliver/defaultAjax', URL_KEY ) );
$template = PATH_CORE . 'templates/xmlform.html';
print $G_FORM->render( $template , $scriptCode );
?>
print $G_FORM->render( $template, $scriptCode );

View File

@@ -12,157 +12,157 @@
*
* 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.
*
*/
try {
global $RBAC;
$RBAC->requirePermissions('PM_LOGIN');
global $RBAC;
$RBAC->requirePermissions( 'PM_LOGIN' );
// deprecated the class XmlForm_Field_Image is currently part of the class.xmlform.php package
// the use of the external xmlfield_Image is highly discouraged
if (!class_exists('XmlForm_Field_Image')){
G::LoadClass('xmlfield_Image');
}
require_once 'classes/model/Users.php';
require_once 'classes/model/Department.php';
// deprecated the class XmlForm_Field_Image is currently part of the class.xmlform.php package
// the use of the external xmlfield_Image is highly discouraged
if (! class_exists( 'XmlForm_Field_Image' )) {
G::LoadClass( 'xmlfield_Image' );
}
require_once 'classes/model/Users.php';
require_once 'classes/model/Department.php';
unset($_SESSION['CURRENT_USER']);
$oUser = new Users();
$aFields = $oUser->load($_SESSION['USER_LOGGED']);
$aFields['USR_PASSWORD'] = '********';
$aFields['MESSAGE0'] = G::LoadTranslation('ID_USER_REGISTERED') . '!';
$aFields['MESSAGE1'] = G::LoadTranslation('ID_MSG_ERROR_USR_USERNAME');
$aFields['MESSAGE2'] = G::LoadTranslation('ID_MSG_ERROR_DUE_DATE');
$aFields['MESSAGE3'] = G::LoadTranslation('ID_NEW_PASS_SAME_OLD_PASS');
$aFields['MESSAGE4'] = G::LoadTranslation('ID_MSG_ERROR_USR_FIRSTNAME');
$aFields['MESSAGE5'] = G::LoadTranslation('ID_MSG_ERROR_USR_LASTNAME');
$aFields['NO_RESUME'] = G::LoadTranslation('ID_NO_RESUME');
$aFields['START_DATE'] = date('Y-m-d');
$aFields['END_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 5));
$aFields['RANDOM'] = rand();
unset( $_SESSION['CURRENT_USER'] );
$oUser = new Users();
$aFields = $oUser->load( $_SESSION['USER_LOGGED'] );
$aFields['USR_PASSWORD'] = '********';
$aFields['MESSAGE0'] = G::LoadTranslation( 'ID_USER_REGISTERED' ) . '!';
$aFields['MESSAGE1'] = G::LoadTranslation( 'ID_MSG_ERROR_USR_USERNAME' );
$aFields['MESSAGE2'] = G::LoadTranslation( 'ID_MSG_ERROR_DUE_DATE' );
$aFields['MESSAGE3'] = G::LoadTranslation( 'ID_NEW_PASS_SAME_OLD_PASS' );
$aFields['MESSAGE4'] = G::LoadTranslation( 'ID_MSG_ERROR_USR_FIRSTNAME' );
$aFields['MESSAGE5'] = G::LoadTranslation( 'ID_MSG_ERROR_USR_LASTNAME' );
$aFields['NO_RESUME'] = G::LoadTranslation( 'ID_NO_RESUME' );
$aFields['START_DATE'] = date( 'Y-m-d' );
$aFields['END_DATE'] = date( 'Y-m-d', mktime( 0, 0, 0, date( 'm' ), date( 'd' ), date( 'Y' ) + 5 ) );
$aFields['RANDOM'] = rand();
//getting the user and department
$oDepInfo = new Department();
$oUser = UsersPeer::retrieveByPk( $aFields['USR_REPORTS_TO'] );
if (is_object( $oUser ) && get_class( $oUser ) == 'Users') {
$userFields = $oUser->toArray( BasePeer::TYPE_FIELDNAME );
$aFields['USR_REPORTS_TO'] = $userFields['USR_FIRSTNAME'] . ' ' . $userFields['USR_LASTNAME'];
try {
$depFields = $oDepInfo->load( $userFields['DEP_UID'] . 'xy<' );
$aFields['USR_REPORTS_TO'] .= " (" . $depFields['DEPO_TITLE'] . ")";
} catch (Exception $e) {
}
} else {
$aFields['USR_REPORTS_TO'] = ' ';
}
//getting the user and department
$oDepInfo = new Department();
$oUser = UsersPeer::retrieveByPk( $aFields['USR_REPORTS_TO'] );
if (is_object($oUser) && get_class ($oUser) == 'Users' ) {
$userFields = $oUser->toArray(BasePeer::TYPE_FIELDNAME);
$aFields['USR_REPORTS_TO'] = $userFields['USR_FIRSTNAME'] . ' ' . $userFields['USR_LASTNAME'];
try {
$depFields = $oDepInfo->load($userFields['DEP_UID'] . 'xy<');
$aFields['USR_REPORTS_TO'] .= " (" . $depFields['DEPO_TITLE'] . ")";
$depFields = $oDepInfo->load( $aFields['DEP_UID'] );
$aFields['USR_DEPARTMENT'] = $depFields['DEPO_TITLE'];
} catch (Exception $e) {
$oUser = UsersPeer::retrieveByPk( $_SESSION['USER_LOGGED'] );
$oUser->setDepUid( '' );
$oUser->save();
$aFields['USR_DEPARTMENT'] = ' ';
}
catch( Exception $e ) {
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'MY_ACCOUNT';
$G_PUBLISH = new Publisher();
//$RBAC->systemObj->loadByCode('PROCESSMAKER');//('PROCESSMAKER', $_SESSION['USER_LOGGED']);
#verifying if it has any preferences on the configurations table
G::loadClass( 'configuration' );
$oConf = new Configurations();
$oConf->loadConfig( $x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '' );
//echo $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'];
//G::pr($RBAC->userObj->load($_SESSION['USER_LOGGED']));
if (sizeof( $oConf->Fields ) > 0) { #this user has a configuration record
$aFields['PREF_DEFAULT_LANG'] = $oConf->aConfig['DEFAULT_LANG'];
$aFields['PREF_DEFAULT_MENUSELECTED'] = isset( $oConf->aConfig['DEFAULT_MENU'] ) ? $oConf->aConfig['DEFAULT_MENU'] : '';
$aFields['PREF_DEFAULT_CASES_MENUSELECTED'] = isset( $oConf->aConfig['DEFAULT_CASES_MENU'] ) ? $oConf->aConfig['DEFAULT_CASES_MENU'] : '';
} else {
switch ($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE']) {
case 'PROCESSMAKER_ADMIN':
$aFields['PREF_DEFAULT_MENUSELECTED'] = 'PM_USERS';
break;
case 'PROCESSMAKER_OPERATOR':
$aFields['PREF_DEFAULT_MENUSELECTED'] = 'PM_CASES';
break;
}
$aFields['PREF_DEFAULT_LANG'] = SYS_LANG;
}
}
else{
$aFields['USR_REPORTS_TO'] = ' ';
}
//G::pr($RBAC->aUserInfo);
$rows[] = Array ('id' => 'char','name' => 'char'
);
try {
$depFields = $oDepInfo->load($aFields['DEP_UID']);
$aFields['USR_DEPARTMENT'] = $depFields['DEPO_TITLE'];
}
catch( Exception $e ) {
$oUser = UsersPeer::retrieveByPk( $_SESSION['USER_LOGGED'] );
$oUser->setDepUid( '' );
$oUser->save();
$aFields['USR_DEPARTMENT'] = ' ';
}
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'MY_ACCOUNT';
$G_PUBLISH = new Publisher;
foreach ($RBAC->aUserInfo['PROCESSMAKER']['PERMISSIONS'] as $permission) {
//$RBAC->systemObj->loadByCode('PROCESSMAKER');//('PROCESSMAKER', $_SESSION['USER_LOGGED']);
#verifying if it has any preferences on the configurations table
G::loadClass('configuration');
$oConf = new Configurations;
$oConf->loadConfig($x, 'USER_PREFERENCES','','',$_SESSION['USER_LOGGED'],'');
//echo $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'];
//G::pr($RBAC->userObj->load($_SESSION['USER_LOGGED']));
if( sizeof($oConf->Fields) > 0){ #this user has a configuration record
$aFields['PREF_DEFAULT_LANG'] = $oConf->aConfig['DEFAULT_LANG'];
$aFields['PREF_DEFAULT_MENUSELECTED'] = isset($oConf->aConfig['DEFAULT_MENU']) ? $oConf->aConfig['DEFAULT_MENU']: '';
$aFields['PREF_DEFAULT_CASES_MENUSELECTED'] = isset($oConf->aConfig['DEFAULT_CASES_MENU']) ? $oConf->aConfig['DEFAULT_CASES_MENU']: '';
} else {
switch($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE']){
case 'PROCESSMAKER_ADMIN':
$aFields['PREF_DEFAULT_MENUSELECTED'] = 'PM_USERS';
break;
case 'PROCESSMAKER_OPERATOR':
$aFields['PREF_DEFAULT_MENUSELECTED'] = 'PM_CASES';
break;
switch ($permission['PER_CODE']) {
case 'PM_USERS':
case 'PM_SETUP':
$rows[] = Array ('id' => 'PM_SETUP','name' => strtoupper( G::LoadTranslation( 'ID_SETUP' ) )
);
break;
case 'PM_CASES':
$rows[] = Array ('id' => 'PM_CASES','name' => strtoupper( G::LoadTranslation( 'ID_CASES' ) )
);
break;
case 'PM_FACTORY':
$rows[] = Array ('id' => 'PM_FACTORY','name' => strtoupper( G::LoadTranslation( 'ID_APPLICATIONS' ) )
);
break;
}
}
$aFields['PREF_DEFAULT_LANG'] = SYS_LANG;
}
//G::pr($RBAC->aUserInfo);
$rows[] = Array('id'=>'char', 'name'=>'char');
global $G_TMP_MENU;
$oMenu = new Menu();
$oMenu->load( 'cases' );
foreach($RBAC->aUserInfo['PROCESSMAKER']['PERMISSIONS'] as $permission){
switch($permission['PER_CODE']){
case 'PM_USERS':
case 'PM_SETUP':
$rows[] = Array('id'=>'PM_SETUP', 'name'=>strtoupper(G::LoadTranslation('ID_SETUP')));
break;
case 'PM_CASES':
$rows[] = Array('id'=>'PM_CASES', 'name'=>strtoupper(G::LoadTranslation('ID_CASES')));
break;
case 'PM_FACTORY':
$rows[] = Array('id'=>'PM_FACTORY', 'name'=>strtoupper(G::LoadTranslation('ID_APPLICATIONS')));
break;
$rowsCasesMenu[] = Array ('id' => 'char','name' => 'char'
);
foreach ($oMenu->Id as $i => $item) {
if ($oMenu->Types[$i] != 'blockHeader') {
$rowsCasesMenu[] = Array ('id' => $item,'name' => $oMenu->Labels[$i]
);
}
}
}
global $G_TMP_MENU;
$oMenu = new Menu();
$oMenu->load('cases');
$rowsCasesMenu[] = Array('id'=>'char', 'name'=>'char');
foreach($oMenu->Id as $i=>$item){
if( $oMenu->Types[$i] != 'blockHeader' ){
$rowsCasesMenu[] = Array('id'=>$item, 'name'=>$oMenu->Labels[$i]);
//G::pr($rows); die;
global $_DBArray;
$_DBArray['menutab'] = $rows;
$_SESSION['_DBArray'] = $_DBArray;
$_DBArray['CASES_MENU'] = $rowsCasesMenu;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass( 'ArrayPeer' );
$oCriteria = new Criteria( 'dbarray' );
$oCriteria->setDBArrayTable( 'menutab' );
$oCriteria2 = new Criteria( 'dbarray' );
$oCriteria2->setDBArrayTable( 'CASES_MENU' );
if ($RBAC->userCanAccess( 'PM_EDITPERSONALINFO' ) == 1) { //he has permitions for edit his profile
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/myInfo.xml', '', $aFields, 'myInfo_Save' );
} else { //he has not permitions for edit his profile, so just view mode will be displayed
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/myInfo2.xml', '', $aFields, '' );
}
}
//G::pr($rows); die;
global $_DBArray;
$_DBArray['menutab'] = $rows;
$_SESSION['_DBArray'] = $_DBArray;
$_DBArray['CASES_MENU'] = $rowsCasesMenu;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass('ArrayPeer');
$oCriteria = new Criteria('dbarray');
$oCriteria->setDBArrayTable('menutab');
$oCriteria2 = new Criteria('dbarray');
$oCriteria2->setDBArrayTable('CASES_MENU');
if ($RBAC->userCanAccess('PM_EDITPERSONALINFO') == 1) { //he has permitions for edit his profile
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/myInfo.xml', '', $aFields, 'myInfo_Save');
} else { //he has not permitions for edit his profile, so just view mode will be displayed
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/myInfo2.xml', '', $aFields, '');
}
G::RenderPage('publish');
G::RenderPage( 'publish' );
} catch (Exception $oException) {
die( $oException->getMessage() );
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,20 +1 @@
<?php
//calculating the max upload file size;
$POST_MAX_SIZE = ini_get('post_max_size');
$mul = substr($POST_MAX_SIZE, -1);
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$postMaxSize = (int)$POST_MAX_SIZE * $mul;
$UPLOAD_MAX_SIZE = ini_get('upload_max_filesize');
$mul = substr($UPLOAD_MAX_SIZE, -1);
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$uploadMaxSize = (int)$UPLOAD_MAX_SIZE * $mul;
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('users/users', true ); //adding a javascript file .js
$oHeadPublisher->assign('USR_UID', $_GET['USR_UID']);
$oHeadPublisher->assign('MODE', $_GET['MODE']);
$oHeadPublisher->assign('MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ');
G::RenderPage('publish', 'extJs');
<?php

View File

@@ -13,38 +13,37 @@
*
* 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_LOGIN")) != 1) {
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1) {
return $RBAC_Response;
}
global $RBAC;
$access = $RBAC->userCanAccess('PM_USERS');
$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;
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;
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;
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
}
@@ -53,21 +52,21 @@ $G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'USERS';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
G::LoadClass('configuration');
G::LoadClass( 'configuration' );
$c = new Configurations();
$configEnv = $c->getConfiguration('ENVIRONMENT_SETTINGS', '');
$Config['fullNameFormat'] = isset($configEnv['format']) ? $configEnv['format'] : '@firstName @lastName (@userName)';
$configEnv = $c->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
$Config['fullNameFormat'] = isset( $configEnv['format'] ) ? $configEnv['format'] : '@firstName @lastName (@userName)';
require_once 'classes/model/Users.php';
$oCriteria = new Criteria();
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oCriteria->add(UsersPeer::USR_UID, $_GET['uUID']);
$oDataset = UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oCriteria->addSelectColumn( UsersPeer::USR_FIRSTNAME );
$oCriteria->addSelectColumn( UsersPeer::USR_LASTNAME );
$oCriteria->addSelectColumn( UsersPeer::USR_USERNAME );
$oCriteria->add( UsersPeer::USR_UID, $_GET['uUID'] );
$oDataset = UsersPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aRow = $oDataset->getRow();
@@ -83,7 +82,7 @@ switch ($_REQUEST['type']) {
break;
}
$users = Array();
$users = Array ();
$users['USR_UID'] = $_GET['uUID'];
$users['USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME'];
$users['USR_LASTNAME'] = $aRow['USR_LASTNAME'];
@@ -92,11 +91,11 @@ $users['fullNameFormat'] = $Config['fullNameFormat'];
$users['CURRENT_TAB'] = $ctab;
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('users/usersGroups', false); //adding a javascript file .js
$oHeadPublisher->addExtJsScript( 'users/usersGroups', false ); //adding a javascript file .js
// $oHeadPublisher->addContent('users/usersGroups'); //adding a html file .html.
$oHeadPublisher->assign('USERS', $users);
$oHeadPublisher->assign( 'USERS', $users );
$oHeadPublisher->assign('hasAuthPerm', ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1));
$oHeadPublisher->assign( 'hasAuthPerm', ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) == 1) );
G::RenderPage( 'publish', 'extJs' );
G::RenderPage('publish', 'extJs');

View File

@@ -1,36 +1,38 @@
<?php
global $RBAC;
require_once 'classes/model/Users.php';
unset($_SESSION['CURRENT_USER']);
$oUser = new Users();
$aFields = $oUser->load($_SESSION['USER_LOGGED']);
if ($RBAC->userCanAccess('PM_EDITPERSONALINFO') == 1) { //he has permitions for edit his profile
$canEdit = false;
} else { //he has not permitions for edit his profile, so just view mode will be displayed
$canEdit = true;
}
//calculating the max upload file size;
$POST_MAX_SIZE = ini_get('post_max_size');
$mul = substr($POST_MAX_SIZE, -1);
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$postMaxSize = (int)$POST_MAX_SIZE * $mul;
$UPLOAD_MAX_SIZE = ini_get('upload_max_filesize');
$mul = substr($UPLOAD_MAX_SIZE, -1);
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$uploadMaxSize = (int)$UPLOAD_MAX_SIZE * $mul;
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('users/users', true ); //adding a javascript file .js
// $oHeadPublisher->addContent('users/users'); //adding a html file .html.
$oHeadPublisher->assign('USR_UID', $aFields['USR_UID']);
$oHeadPublisher->assign('infoMode', true);
$oHeadPublisher->assign('canEdit', $canEdit);
$oHeadPublisher->assign('MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ');
$oHeadPublisher->assign('MODE', '');
G::RenderPage('publish', 'extJs');
<?php
global $RBAC;
require_once 'classes/model/Users.php';
unset( $_SESSION['CURRENT_USER'] );
$oUser = new Users();
$aFields = $oUser->load( $_SESSION['USER_LOGGED'] );
if ($RBAC->userCanAccess( 'PM_EDITPERSONALINFO' ) == 1) { //he has permitions for edit his profile
$canEdit = false;
} else { //he has not permitions for edit his profile, so just view mode will be displayed
$canEdit = true;
}
//calculating the max upload file size;
$POST_MAX_SIZE = ini_get( 'post_max_size' );
$mul = substr( $POST_MAX_SIZE, - 1 );
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$postMaxSize = (int) $POST_MAX_SIZE * $mul;
$UPLOAD_MAX_SIZE = ini_get( 'upload_max_filesize' );
$mul = substr( $UPLOAD_MAX_SIZE, - 1 );
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
if ($postMaxSize < $uploadMaxSize)
$uploadMaxSize = $postMaxSize;
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript( 'users/users', true ); //adding a javascript file .js
// $oHeadPublisher->addContent('users/users'); //adding a html file .html.
$oHeadPublisher->assign( 'USR_UID', $aFields['USR_UID'] );
$oHeadPublisher->assign( 'infoMode', true );
$oHeadPublisher->assign( 'canEdit', $canEdit );
$oHeadPublisher->assign( 'MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ' );
$oHeadPublisher->assign( 'MODE', '' );
G::RenderPage( 'publish', 'extJs' );

View File

@@ -1,21 +1,23 @@
<?php
<?php
//calculating the max upload file size;
$POST_MAX_SIZE = ini_get('post_max_size');
$mul = substr($POST_MAX_SIZE, -1);
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$postMaxSize = (int)$POST_MAX_SIZE * $mul;
$POST_MAX_SIZE = ini_get( 'post_max_size' );
$mul = substr( $POST_MAX_SIZE, - 1 );
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$postMaxSize = (int) $POST_MAX_SIZE * $mul;
$UPLOAD_MAX_SIZE = ini_get( 'upload_max_filesize' );
$mul = substr( $UPLOAD_MAX_SIZE, - 1 );
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
if ($postMaxSize < $uploadMaxSize)
$uploadMaxSize = $postMaxSize;
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript( 'users/users', true ); //adding a javascript file .js
$oHeadPublisher->assign( 'USR_UID', '' );
$oHeadPublisher->assign( 'MODE', $_GET['MODE'] );
$oHeadPublisher->assign( 'MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ' );
G::RenderPage( 'publish', 'extJs' );
$UPLOAD_MAX_SIZE = ini_get('upload_max_filesize');
$mul = substr($UPLOAD_MAX_SIZE, -1);
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$uploadMaxSize = (int)$UPLOAD_MAX_SIZE * $mul;
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('users/users', true ); //adding a javascript file .js
$oHeadPublisher->assign('USR_UID', '');
$oHeadPublisher->assign('MODE', $_GET['MODE']);
$oHeadPublisher->assign('MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ');
G::RenderPage('publish', 'extJs');

File diff suppressed because it is too large Load Diff

View File

@@ -12,28 +12,29 @@
*
* 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.
*
*/
global $RBAC;
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
}
$G_MAIN_MENU = 'processmaker';
$G_MAIN_MENU = 'processmaker';
//$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_MENU_SELECTED = 'USERS';
//$G_ID_SUB_MENU_SELECTED = '-';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_AuthSource', '', $RBAC->load($_GET['USR_UID']), '../users/users_AuthSourceSave');
G::RenderPage('publish','blank');
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_AuthSource', '', $RBAC->load( $_GET['USR_UID'] ), '../users/users_AuthSourceSave' );
G::RenderPage( 'publish', 'blank' );

View File

@@ -12,35 +12,34 @@
*
* 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.
*
*/
global $RBAC;
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
}
$aData = $RBAC->load($_POST['form']['USR_UID']);
unset($aData['USR_ROLE']);
$aData = $RBAC->load( $_POST['form']['USR_UID'] );
unset( $aData['USR_ROLE'] );
if ($_POST['form']['UID_AUTH_SOURCE'] == 'MYSQL') {
$aData['USR_AUTH_TYPE'] = 'MYSQL';
$aData['UID_AUTH_SOURCE'] = '';
}
else {
$aFields = $RBAC->getAuthSource($_POST['form']['UID_AUTH_SOURCE']);
$aData['USR_AUTH_TYPE'] = $aFields['AUTH_SOURCE_PROVIDER'];
$aData['UID_AUTH_SOURCE'] = $_POST['form']['UID_AUTH_SOURCE'];
$aData['USR_AUTH_TYPE'] = 'MYSQL';
$aData['UID_AUTH_SOURCE'] = '';
} else {
$aFields = $RBAC->getAuthSource( $_POST['form']['UID_AUTH_SOURCE'] );
$aData['USR_AUTH_TYPE'] = $aFields['AUTH_SOURCE_PROVIDER'];
$aData['UID_AUTH_SOURCE'] = $_POST['form']['UID_AUTH_SOURCE'];
}
$aData['USR_AUTH_USER_DN'] = $_POST['form']['USR_AUTH_USER_DN'];
$RBAC->updateUser($aData);
$RBAC->updateUser( $aData );
G::header( 'location: users_List' );
G::header('location: users_List');

View File

@@ -1,5 +1,5 @@
<?php
/**
<?php
/**
* users_Delete.php
*
* ProcessMaker Open Source Edition
@@ -12,62 +12,59 @@
*
* 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.
*
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY'))
{
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
if ($_GET['USR_UID'] == '00000000000000000000000000000001') {
G::SendTemporalMessage('ID_CANNOT_CHANGE_STATUS_ADMIN_USER', 'error', 'usersLabels');
G::header('location: ' . $_SERVER['HTTP_REFERER']);
die;
}
/*$RBAC->removeUser($_GET['USR_UID']);
global $RBAC;
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
if ($_GET['USR_UID'] == '00000000000000000000000000000001') {
G::SendTemporalMessage( 'ID_CANNOT_CHANGE_STATUS_ADMIN_USER', 'error', 'usersLabels' );
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die();
}
/*$RBAC->removeUser($_GET['USR_UID']);
require_once 'classes/model/Users.php';
$oUser = new Users();
$oUser->remove($_GET['USR_UID']);*/
//print_r($_GET['USR_UID']); die
G::LoadClass('tasks');
$oTasks = new Tasks();
$oTasks->ofToAssignUserOfAllTasks($_GET['USR_UID']);
G::LoadClass('groups');
$oGroups = new Groups();
$oGroups->removeUserOfAllGroups($_GET['USR_UID']);
$RBAC->changeUserStatus($_GET['USR_UID'], 'CLOSED');
$_GET['USR_USERNAME']='';
$RBAC->updateUser(array('USR_UID' => $_GET['USR_UID'], 'USR_USERNAME' => $_GET['USR_USERNAME']),'');
//print_r($_GET['USR_UID']); die
G::LoadClass( 'tasks' );
$oTasks = new Tasks();
$oTasks->ofToAssignUserOfAllTasks( $_GET['USR_UID'] );
G::LoadClass( 'groups' );
$oGroups = new Groups();
$oGroups->removeUserOfAllGroups( $_GET['USR_UID'] );
$RBAC->changeUserStatus( $_GET['USR_UID'], 'CLOSED' );
$_GET['USR_USERNAME'] = '';
$RBAC->updateUser( array ('USR_UID' => $_GET['USR_UID'],'USR_USERNAME' => $_GET['USR_USERNAME']
), '' );
require_once 'classes/model/Users.php';
$oUser = new Users();
$aFields = $oUser->load($_GET['USR_UID']);
$aFields['USR_STATUS'] = 'CLOSED';
$aFields['USR_USERNAME'] = '';
$oUser->update($aFields);
G::header('location: users_List');
require_once 'classes/model/Users.php';
$oUser = new Users();
$aFields = $oUser->load( $_GET['USR_UID'] );
$aFields['USR_STATUS'] = 'CLOSED';
$aFields['USR_USERNAME'] = '';
$oUser->update( $aFields );
G::header( 'location: users_List' );
} catch (Exception $oException) {
die( $oException->getMessage() );
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -12,38 +12,36 @@
*
* 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.
*
*/
$USR_UID=$_GET['USR_UID'];
G::LoadClass('case');
$oProcessMap = new Cases();
$c = $oProcessMap->getCriteriaUsersCases('TO_DO', $USR_UID);
$array["TO_DO"] = ApplicationPeer::doCount($c);
$USR_UID = $_GET['USR_UID'];
$c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $USR_UID);
$array["COMPLETED"] = ApplicationPeer::doCount($c);
G::LoadClass( 'case' );
$oProcessMap = new Cases();
$c = $oProcessMap->getCriteriaUsersCases('DRAFT', $USR_UID);
$array["DRAFT"] = ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases( 'TO_DO', $USR_UID );
$array["TO_DO"] = ApplicationPeer::doCount( $c );
$c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID);
$array["CANCELLED"] = ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases( 'COMPLETED', $USR_UID );
$array["COMPLETED"] = ApplicationPeer::doCount( $c );
$array["USR_UID"]=$USR_UID;
$c = $oProcessMap->getCriteriaUsersCases( 'DRAFT', $USR_UID );
$array["DRAFT"] = ApplicationPeer::doCount( $c );
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_DeleteAssign', '', $array, '');
G::RenderPage('publish', 'raw');
$c = $oProcessMap->getCriteriaUsersCases( 'CANCELLED', $USR_UID );
$array["CANCELLED"] = ApplicationPeer::doCount( $c );
$array["USR_UID"] = $USR_UID;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_DeleteAssign', '', $array, '' );
G::RenderPage( 'publish', 'raw' );
?>

View File

@@ -12,153 +12,154 @@
*
* 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.
*
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_REASSIGNCASE')) {
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
if (!isset($_GET['USR_UID'])) {
$_GET['USR_UID'] = '';
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'USERS';
$G_PUBLISH = new Publisher;
if ($_GET['USR_UID'] != '') {
$c=0;
$oTemplatePower = new TemplatePower(PATH_TPL . 'users/users_DeleteReassign.html');
$oTemplatePower->prepare();
G::LoadClass('tasks');
G::LoadClass('groups');
$oTasks = new Tasks();
$oGroups = new Groups();
$oUser = new Users();
G::LoadClass('case');
$oCases = new Cases();
$USR_UID=$_GET['USR_UID'];
list($oCriteriaToDo,$sXMLFile) = $oCases->getConditionCasesList('to_do', $_GET['USR_UID']);
list($oCriteriaDraft,$sXMLFile) = $oCases->getConditionCasesList('draft', $_GET['USR_UID']);
if(ApplicationPeer::doCount($oCriteriaToDo)==0 && ApplicationPeer::doCount($oCriteriaDraft)==0);
G::header('location: users_Delete?USR_UID='.$USR_UID);
$oDataset = ApplicationPeer::doSelectRS($oCriteriaToDo);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$c++;
$oTemplatePower->newBlock('cases');
$aKeys = array_keys($aRow);
foreach ($aKeys as $sKey) {
$oTemplatePower->assign($sKey, $aRow[$sKey]);
}
$aUsers = array($_GET['USR_UID']);
$aAux1 = $oTasks->getGroupsOfTask($aRow['TAS_UID'], 1);
foreach ($aAux1 as $aGroup) {
$aAux2 = $oGroups->getUsersOfGroup($aGroup['GRP_UID']);
foreach ($aAux2 as $aUser) {
if (!in_array($aUser['USR_UID'], $aUsers)) {
$aUsers[] = $aUser['USR_UID'];
$aData = $oUser->load($aUser['USR_UID']);
$oTemplatePower->newBlock('users');
$oTemplatePower->assign('USR_UID', $aUser['USR_UID']);
$oTemplatePower->assign('USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')');
}
}
}
$aAux1 = $oTasks->getUsersOfTask($aRow['TAS_UID'], 1);
foreach ($aAux1 as $aUser) {
if (!in_array($aUser['USR_UID'], $aUsers)) {
$aUsers[] = $aUser['USR_UID'];
$aData = $oUser->load($aUser['USR_UID']);
$oTemplatePower->newBlock('users');
$oTemplatePower->assign('USR_UID', $aUser['USR_UID']);
$oTemplatePower->assign('USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')');
}
}
$oTemplatePower->gotoBlock('cases');
$oTemplatePower->assign('ID_STATUS', G::LoadTranslation('ID_TO_DO'));
$oTemplatePower->assign('ID_NO_REASSIGN', G::LoadTranslation('ID_NO_REASSIGN'));
$oDataset->next();
}
$oDataset = ApplicationPeer::doSelectRS($oCriteriaDraft);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$c++;
$oTemplatePower->newBlock('cases');
$aKeys = array_keys($aRow);
foreach ($aKeys as $sKey) {
$oTemplatePower->assign($sKey, $aRow[$sKey]);
}
$aUsers = array($_GET['USR_UID']);
$aAux1 = $oTasks->getGroupsOfTask($aRow['TAS_UID'], 1);
foreach ($aAux1 as $aGroup) {
$aAux2 = $oGroups->getUsersOfGroup($aGroup['GRP_UID']);
foreach ($aAux2 as $aUser) {
if (!in_array($aUser['USR_UID'], $aUsers)) {
$aUsers[] = $aUser['USR_UID'];
$aData = $oUser->load($aUser['USR_UID']);
$oTemplatePower->newBlock('users');
$oTemplatePower->assign('USR_UID', $aUser['USR_UID']);
$oTemplatePower->assign('USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')');
}
}
}
$aAux1 = $oTasks->getUsersOfTask($aRow['TAS_UID'], 1);
foreach ($aAux1 as $aUser) {
if (!in_array($aUser['USR_UID'], $aUsers)) {
$aUsers[] = $aUser['USR_UID'];
$aData = $oUser->load($aUser['USR_UID']);
$oTemplatePower->newBlock('users');
$oTemplatePower->assign('USR_UID', $aUser['USR_UID']);
$oTemplatePower->assign('USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')');
}
}
$oTemplatePower->gotoBlock('cases');
$oTemplatePower->assign('ID_STATUS', G::LoadTranslation('ID_DRAFT'));
$oTemplatePower->assign('ID_NO_REASSIGN', G::LoadTranslation('ID_NO_REASSIGN'));
$oDataset->next();
try {
global $RBAC;
switch ($RBAC->userCanAccess( 'PM_REASSIGNCASE' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
$oTemplatePower->gotoBlock('_ROOT');
$oTemplatePower->assign('ID_NUMBER', '#');
$oTemplatePower->assign('ID_CASE', G::LoadTranslation('ID_CASE'));
$oTemplatePower->assign('ID_TASK', G::LoadTranslation('ID_TASK'));
$oTemplatePower->assign('ID_PROCESS', G::LoadTranslation('ID_PROCESS'));
$oTemplatePower->assign('ID_STATUS', G::LoadTranslation('ID_STATUS'));
$oTemplatePower->assign('ID_REASSIGN_TO', G::LoadTranslation('ID_REASSIGN_TO'));
$oTemplatePower->assign('ID_REASSIGN', G::LoadTranslation('ID_REASSIGN'));
$oTemplatePower->assign('USR_UID', $_GET['USR_UID']);
$oTemplatePower->assign('CONT', $c);
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
}
G::RenderPage('publish');
if (! isset( $_GET['USR_UID'] )) {
$_GET['USR_UID'] = '';
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'USERS';
$G_PUBLISH = new Publisher();
if ($_GET['USR_UID'] != '') {
$c = 0;
$oTemplatePower = new TemplatePower( PATH_TPL . 'users/users_DeleteReassign.html' );
$oTemplatePower->prepare();
G::LoadClass( 'tasks' );
G::LoadClass( 'groups' );
$oTasks = new Tasks();
$oGroups = new Groups();
$oUser = new Users();
G::LoadClass( 'case' );
$oCases = new Cases();
$USR_UID = $_GET['USR_UID'];
list ($oCriteriaToDo, $sXMLFile) = $oCases->getConditionCasesList( 'to_do', $_GET['USR_UID'] );
list ($oCriteriaDraft, $sXMLFile) = $oCases->getConditionCasesList( 'draft', $_GET['USR_UID'] );
if (ApplicationPeer::doCount( $oCriteriaToDo ) == 0 && ApplicationPeer::doCount( $oCriteriaDraft ) == 0)
;
G::header( 'location: users_Delete?USR_UID=' . $USR_UID );
$oDataset = ApplicationPeer::doSelectRS( $oCriteriaToDo );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$c ++;
$oTemplatePower->newBlock( 'cases' );
$aKeys = array_keys( $aRow );
foreach ($aKeys as $sKey) {
$oTemplatePower->assign( $sKey, $aRow[$sKey] );
}
$aUsers = array ($_GET['USR_UID']
);
$aAux1 = $oTasks->getGroupsOfTask( $aRow['TAS_UID'], 1 );
foreach ($aAux1 as $aGroup) {
$aAux2 = $oGroups->getUsersOfGroup( $aGroup['GRP_UID'] );
foreach ($aAux2 as $aUser) {
if (! in_array( $aUser['USR_UID'], $aUsers )) {
$aUsers[] = $aUser['USR_UID'];
$aData = $oUser->load( $aUser['USR_UID'] );
$oTemplatePower->newBlock( 'users' );
$oTemplatePower->assign( 'USR_UID', $aUser['USR_UID'] );
$oTemplatePower->assign( 'USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')' );
}
}
}
$aAux1 = $oTasks->getUsersOfTask( $aRow['TAS_UID'], 1 );
foreach ($aAux1 as $aUser) {
if (! in_array( $aUser['USR_UID'], $aUsers )) {
$aUsers[] = $aUser['USR_UID'];
$aData = $oUser->load( $aUser['USR_UID'] );
$oTemplatePower->newBlock( 'users' );
$oTemplatePower->assign( 'USR_UID', $aUser['USR_UID'] );
$oTemplatePower->assign( 'USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')' );
}
}
$oTemplatePower->gotoBlock( 'cases' );
$oTemplatePower->assign( 'ID_STATUS', G::LoadTranslation( 'ID_TO_DO' ) );
$oTemplatePower->assign( 'ID_NO_REASSIGN', G::LoadTranslation( 'ID_NO_REASSIGN' ) );
$oDataset->next();
}
$oDataset = ApplicationPeer::doSelectRS( $oCriteriaDraft );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$c ++;
$oTemplatePower->newBlock( 'cases' );
$aKeys = array_keys( $aRow );
foreach ($aKeys as $sKey) {
$oTemplatePower->assign( $sKey, $aRow[$sKey] );
}
$aUsers = array ($_GET['USR_UID']
);
$aAux1 = $oTasks->getGroupsOfTask( $aRow['TAS_UID'], 1 );
foreach ($aAux1 as $aGroup) {
$aAux2 = $oGroups->getUsersOfGroup( $aGroup['GRP_UID'] );
foreach ($aAux2 as $aUser) {
if (! in_array( $aUser['USR_UID'], $aUsers )) {
$aUsers[] = $aUser['USR_UID'];
$aData = $oUser->load( $aUser['USR_UID'] );
$oTemplatePower->newBlock( 'users' );
$oTemplatePower->assign( 'USR_UID', $aUser['USR_UID'] );
$oTemplatePower->assign( 'USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')' );
}
}
}
$aAux1 = $oTasks->getUsersOfTask( $aRow['TAS_UID'], 1 );
foreach ($aAux1 as $aUser) {
if (! in_array( $aUser['USR_UID'], $aUsers )) {
$aUsers[] = $aUser['USR_UID'];
$aData = $oUser->load( $aUser['USR_UID'] );
$oTemplatePower->newBlock( 'users' );
$oTemplatePower->assign( 'USR_UID', $aUser['USR_UID'] );
$oTemplatePower->assign( 'USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')' );
}
}
$oTemplatePower->gotoBlock( 'cases' );
$oTemplatePower->assign( 'ID_STATUS', G::LoadTranslation( 'ID_DRAFT' ) );
$oTemplatePower->assign( 'ID_NO_REASSIGN', G::LoadTranslation( 'ID_NO_REASSIGN' ) );
$oDataset->next();
}
$oTemplatePower->gotoBlock( '_ROOT' );
$oTemplatePower->assign( 'ID_NUMBER', '#' );
$oTemplatePower->assign( 'ID_CASE', G::LoadTranslation( 'ID_CASE' ) );
$oTemplatePower->assign( 'ID_TASK', G::LoadTranslation( 'ID_TASK' ) );
$oTemplatePower->assign( 'ID_PROCESS', G::LoadTranslation( 'ID_PROCESS' ) );
$oTemplatePower->assign( 'ID_STATUS', G::LoadTranslation( 'ID_STATUS' ) );
$oTemplatePower->assign( 'ID_REASSIGN_TO', G::LoadTranslation( 'ID_REASSIGN_TO' ) );
$oTemplatePower->assign( 'ID_REASSIGN', G::LoadTranslation( 'ID_REASSIGN' ) );
$oTemplatePower->assign( 'USR_UID', $_GET['USR_UID'] );
$oTemplatePower->assign( 'CONT', $c );
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
}
G::RenderPage( 'publish' );
} catch (Exception $oException) {
die( $oException->getMessage() );
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -13,78 +13,75 @@
*
* 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.
*
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_REASSIGNCASE')) {
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
G::LoadClass('case');
$oCase = new Cases();
$aCases = array();
$aUsers = array();
$c=0;
if(isset($_POST['USERS']))
{ if (is_array($_POST['USERS'])) {
foreach ($_POST['USERS'] as $sKey => $sUser) {
if ($sUser != '') {
$c++;
$oCase->reassignCase($_POST['APPLICATIONS'][$sKey], $_POST['INDEXES'][$sKey], $_POST['USR_UID'], $sUser);
$aCases[] = $_POST['APPLICATIONS'][$sKey];
$aUsers[] = $sUser;
}
}
}
}
G::LoadClass('case');
$oCase = new Cases();
require_once 'classes/model/Users.php';
$oUser = new Users();
$sText = '';
foreach ($aCases as $sKey => $sCase) {
$aCase = $oCase->loadCase($sCase);
$aUser = $oUser->load($aUsers[$sKey]);
$sText .= $aCase['TITLE'] . ' => ' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' (' . $aUser['USR_USERNAME'] . ')' . '<br />';
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'USERS';
$G_PUBLISH = new Publisher;
$aMessage['USR_UID'] = $_POST['USR_UID'];
$aMessage['MESSAGE'] = $sText;
if($_POST['CONT']!=$c)
$aMessage['EVA']=G::LoadTranslation('ID_CASESREASSIGN');//
else
$aMessage['EVA']='';
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_ReassignShowInfo', '', $aMessage);
G::RenderPage('publish');
global $RBAC;
switch ($RBAC->userCanAccess( 'PM_REASSIGNCASE' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
G::LoadClass( 'case' );
$oCase = new Cases();
$aCases = array ();
$aUsers = array ();
$c = 0;
if (isset( $_POST['USERS'] )) {
if (is_array( $_POST['USERS'] )) {
foreach ($_POST['USERS'] as $sKey => $sUser) {
if ($sUser != '') {
$c ++;
$oCase->reassignCase( $_POST['APPLICATIONS'][$sKey], $_POST['INDEXES'][$sKey], $_POST['USR_UID'], $sUser );
$aCases[] = $_POST['APPLICATIONS'][$sKey];
$aUsers[] = $sUser;
}
}
}
}
G::LoadClass( 'case' );
$oCase = new Cases();
require_once 'classes/model/Users.php';
$oUser = new Users();
$sText = '';
foreach ($aCases as $sKey => $sCase) {
$aCase = $oCase->loadCase( $sCase );
$aUser = $oUser->load( $aUsers[$sKey] );
$sText .= $aCase['TITLE'] . ' => ' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' (' . $aUser['USR_USERNAME'] . ')' . '<br />';
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'USERS';
$G_PUBLISH = new Publisher();
$aMessage['USR_UID'] = $_POST['USR_UID'];
$aMessage['MESSAGE'] = $sText;
if ($_POST['CONT'] != $c)
$aMessage['EVA'] = G::LoadTranslation( 'ID_CASESREASSIGN' ); //
else
$aMessage['EVA'] = '';
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_ReassignShowInfo', '', $aMessage );
G::RenderPage( 'publish' );
} catch (Exception $oException) {
die( $oException->getMessage() );
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

File diff suppressed because it is too large Load Diff

View File

@@ -12,44 +12,42 @@
*
* 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.
*
*/
/**
* @Description This is a callback for the View of all groups from a determinated user
* @author Erik Amaru Ortiz <erik@colosa.com>
* @Date 24/04/2008
* @LastModification none
*/
/**
* ription This is a callback for the View of all groups from a determinated user
*
* @author Erik Amaru Ortiz <erik@colosa.com>
* @Date 24/04/2008
* @LastModification none
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY')) {
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case - 2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('view', 'users/users_Tree' );
G::RenderPage('publish', 'raw');
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'users/users_Tree' );
G::RenderPage( 'publish', 'raw' );
} catch (exception $oException) {
die( $oException->getMessage() );
}
catch (exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -1,68 +1,68 @@
<?php
/**
* users_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.
*
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_LOGIN"))!=1) return $RBAC_Response;
global $RBAC;
$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;
}
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'USERS';
$G_PUBLISH = new Publisher;
G::LoadClass('configuration');
$c = new Configurations();
$configPage = $c->getConfiguration('usersList', 'pageSize','',$_SESSION['USER_LOGGED']);
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('users/usersList', false); //adding a javascript file .js
$oHeadPublisher->addContent('users/usersList'); //adding a html file .html.
$oHeadPublisher->assign('CONFIG', $Config);
$oHeadPublisher->assign('FORMATS',$c->getFormats());
G::RenderPage('publish', 'extJs');
<?php
/**
* users_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.
*/
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1)
return $RBAC_Response;
global $RBAC;
$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;
}
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'USERS';
$G_PUBLISH = new Publisher();
G::LoadClass( 'configuration' );
$c = new Configurations();
$configPage = $c->getConfiguration( 'usersList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript( 'users/usersList', false ); //adding a javascript file .js
$oHeadPublisher->addContent( 'users/usersList' ); //adding a html file .html.
$oHeadPublisher->assign( 'CONFIG', $Config );
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
G::RenderPage( 'publish', 'extJs' );

View File

@@ -12,106 +12,106 @@
*
* 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.
*
*/
try {
global $RBAC;
$RBAC->requirePermissions('PM_USERS');
$aFields['MESSAGE0'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_USER_REGISTERED')) . '!';
$aFields['MESSAGE1'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_USR_USERNAME'));
$aFields['MESSAGE2'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_DUE_DATE'));
$aFields['MESSAGE3'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_NEW_PASS_SAME_OLD_PASS'));
$aFields['MESSAGE4'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_USR_FIRSTNAME'));
$aFields['MESSAGE5'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_USR_LASTNAME'));
$aFields['MESSAGE6'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_ERROR_UPLOADING_IMAGE_TYPE'));
global $RBAC;
$RBAC->requirePermissions( 'PM_USERS' );
$aFields['MESSAGE0'] = str_replace( "\r\n", "<br>", G::LoadTranslation( 'ID_USER_REGISTERED' ) ) . '!';
$aFields['MESSAGE1'] = str_replace( "\r\n", "<br>", G::LoadTranslation( 'ID_MSG_ERROR_USR_USERNAME' ) );
$aFields['MESSAGE2'] = str_replace( "\r\n", "<br>", G::LoadTranslation( 'ID_MSG_ERROR_DUE_DATE' ) );
$aFields['MESSAGE3'] = str_replace( "\r\n", "<br>", G::LoadTranslation( 'ID_NEW_PASS_SAME_OLD_PASS' ) );
$aFields['MESSAGE4'] = str_replace( "\r\n", "<br>", G::LoadTranslation( 'ID_MSG_ERROR_USR_FIRSTNAME' ) );
$aFields['MESSAGE5'] = str_replace( "\r\n", "<br>", G::LoadTranslation( 'ID_MSG_ERROR_USR_LASTNAME' ) );
$aFields['MESSAGE6'] = str_replace( "\r\n", "<br>", G::LoadTranslation( 'ID_ERROR_UPLOADING_IMAGE_TYPE' ) );
// the default role variable sets the value that will be showed as the default for the role field.
$aFields['DEFAULT_ROLE'] = 'PROCESSMAKER_OPERATOR';
$aFields['START_DATE'] = date('Y-m-d');
$aFields['END_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 5));
$aFields['USR_DUE_DATE']= date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 1));
//calculating the max upload file size;
$POST_MAX_SIZE = ini_get('post_max_size');
$mul = substr($POST_MAX_SIZE, -1);
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$postMaxSize = (int)$POST_MAX_SIZE * $mul;
$aFields['DEFAULT_ROLE'] = 'PROCESSMAKER_OPERATOR';
$aFields['START_DATE'] = date( 'Y-m-d' );
$aFields['END_DATE'] = date( 'Y-m-d', mktime( 0, 0, 0, date( 'm' ), date( 'd' ), date( 'Y' ) + 5 ) );
$aFields['USR_DUE_DATE'] = date( 'Y-m-d', mktime( 0, 0, 0, date( 'm' ), date( 'd' ), date( 'Y' ) + 1 ) );
$UPLOAD_MAX_SIZE = ini_get('upload_max_filesize');
$mul = substr($UPLOAD_MAX_SIZE, -1);
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$uploadMaxSize = (int)$UPLOAD_MAX_SIZE * $mul;
//calculating the max upload file size;
$POST_MAX_SIZE = ini_get( 'post_max_size' );
$mul = substr( $POST_MAX_SIZE, - 1 );
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$postMaxSize = (int) $POST_MAX_SIZE * $mul;
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
$aFields['MAX_FILES_SIZE'] = " (" . $UPLOAD_MAX_SIZE . ") ";
$UPLOAD_MAX_SIZE = ini_get( 'upload_max_filesize' );
$mul = substr( $UPLOAD_MAX_SIZE, - 1 );
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
//Load Calendar options and falue for this user
G::LoadClass ( 'calendar' );
$calendar = new Calendar ( );
$calendarObj = $calendar->getCalendarList ( true, true );
global $_DBArray;
$_DBArray ['availableCalendars'] = $calendarObj ['array'];
$_SESSION ['_DBArray'] = $_DBArray;
if ($postMaxSize < $uploadMaxSize)
$uploadMaxSize = $postMaxSize;
$aFields['MAX_FILES_SIZE'] = " (" . $UPLOAD_MAX_SIZE . ") ";
// $G_MAIN_MENU = 'processmaker';
// $G_ID_MENU_SELECTED = 'USERS';
//Load Calendar options and falue for this user
G::LoadClass( 'calendar' );
$calendar = new Calendar();
$calendarObj = $calendar->getCalendarList( true, true );
global $_DBArray;
$_DBArray['availableCalendars'] = $calendarObj['array'];
$_SESSION['_DBArray'] = $_DBArray;
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'USERS';
// $G_MAIN_MENU = 'processmaker';
// $G_ID_MENU_SELECTED = 'USERS';
/////////////////////////////
//SELECT USR_UID, CONCAT(USR_LASTNAME, " ", USR_FIRSTNAME) FROM USERS WHERE USR_STATUS = 1 ORDER BY USR_LASTNAME
require_once 'classes/model/Users.php';
$oCriteria=new Criteria();
$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->add(UsersPeer::USR_STATUS,'ACTIVE');
//$oCriteria->add(UsersPeer::USR_UID,$_GET['USR_UID'], Criteria::NOT_EQUAL);
$oDataset=UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
///////////////////////
G::loadClass('configuration');
$oConf = new Configurations;
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS','');
$defaultOption = isset($oConf->aConfig['format'])? $oConf->aConfig['format']: '';
$aUserInfo = array();
$aUserInfo[] = array('USR_UID' => 'char','USER_FULLNAME' => 'char');
while( $oDataset->next()){
$aRow1 = $oDataset->getRow();
$infoUser = G::getFormatUserList($defaultOption,$aRow1);
$aUserInfo[]=array(
'USR_UID' => $aRow1['USR_UID'],
'USER_FULLNAME' => $infoUser
);
}
//print_r($aUserInfo);
global $_DBArray;
$_DBArray['aUserInfo'] = $aUserInfo;
$_SESSION['_DBArray'] = $_DBArray;
/////////////////////////////
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'USERS';
//var_dump($aFields);
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_New.xml', '', $aFields, 'users_Save');
G::RenderPage('publish','blank');
/////////////////////////////
//SELECT USR_UID, CONCAT(USR_LASTNAME, " ", USR_FIRSTNAME) FROM USERS WHERE USR_STATUS = 1 ORDER BY USR_LASTNAME
require_once 'classes/model/Users.php';
$oCriteria = new Criteria();
$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->add( UsersPeer::USR_STATUS, 'ACTIVE' );
//$oCriteria->add(UsersPeer::USR_UID,$_GET['USR_UID'], Criteria::NOT_EQUAL);
$oDataset = UsersPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
///////////////////////
G::loadClass( 'configuration' );
$oConf = new Configurations();
$oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
$defaultOption = isset( $oConf->aConfig['format'] ) ? $oConf->aConfig['format'] : '';
$aUserInfo = array ();
$aUserInfo[] = array ('USR_UID' => 'char','USER_FULLNAME' => 'char'
);
while ($oDataset->next()) {
$aRow1 = $oDataset->getRow();
$infoUser = G::getFormatUserList( $defaultOption, $aRow1 );
$aUserInfo[] = array ('USR_UID' => $aRow1['USR_UID'],'USER_FULLNAME' => $infoUser
);
}
//print_r($aUserInfo);
global $_DBArray;
$_DBArray['aUserInfo'] = $aUserInfo;
$_SESSION['_DBArray'] = $_DBArray;
/////////////////////////////
//var_dump($aFields);
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_New.xml', '', $aFields, 'users_Save' );
G::RenderPage( 'publish', 'blank' );
} catch (Exception $oException) {
die( $oException->getMessage() );
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -12,38 +12,36 @@
*
* 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.
*
*/
try {
G::LoadClass('case');
$oCase = new Cases();
foreach($_POST['USER'] as $sProcessUID => $sUserUID) {
if ($sUserUID != '') {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(AppDelegationPeer::APP_UID);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
$oCriteria->add(AppDelegationPeer::PRO_UID, $sProcessUID);
$oCriteria->add(AppDelegationPeer::USR_UID, $_POST['USR_UID']);
$oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oCase->reassignCase($aRow['APP_UID'], $aRow['DEL_INDEX'], $_SESSION['USER_LOGGED'], $sUserUID);
$oDataset->next();
}
G::LoadClass( 'case' );
$oCase = new Cases();
foreach ($_POST['USER'] as $sProcessUID => $sUserUID) {
if ($sUserUID != '') {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( AppDelegationPeer::APP_UID );
$oCriteria->addSelectColumn( AppDelegationPeer::DEL_INDEX );
$oCriteria->add( AppDelegationPeer::PRO_UID, $sProcessUID );
$oCriteria->add( AppDelegationPeer::USR_UID, $_POST['USR_UID'] );
$oCriteria->add( AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL );
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oCase->reassignCase( $aRow['APP_UID'], $aRow['DEL_INDEX'], $_SESSION['USER_LOGGED'], $sUserUID );
$oDataset->next();
}
}
}
}
} catch (Exception $oException) {
die( $oException->getMessage() );
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -12,108 +12,107 @@
*
* 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.
*
*/
try {
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$_GET['iStep'] = (int)$_GET['iStep'];
switch ($_GET['iStep']) {
case 1:
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_ReassignSelectType', '', array('USR_UID' => $_GET['USR_UID']), '');
break;
case 2:
switch ($_POST['TYPE']) {
case 'ANY_USER':
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_ReassignSelectSubType', '', $_POST, '');
break;
}
break;
case 3:
switch ($_POST['SUB_TYPE']) {
case 'PROCESS':
require_once 'classes/model/Users.php';
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
/*
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$_GET['iStep'] = (int) $_GET['iStep'];
switch ($_GET['iStep']) {
case 1:
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_ReassignSelectType', '', array ('USR_UID' => $_GET['USR_UID']
), '' );
break;
case 2:
switch ($_POST['TYPE']) {
case 'ANY_USER':
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_ReassignSelectSubType', '', $_POST, '' );
break;
}
break;
case 3:
switch ($_POST['SUB_TYPE']) {
case 'PROCESS':
require_once 'classes/model/Users.php';
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( UsersPeer::USR_UID );
/*
$usr_completename_col = "CONCAT(USR_LASTNAME, ' ', USR_FIRSTNAME, ' (', USR_USERNAME, ')')";
*/
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if(G::LoadSystemExist($sDataBase)){
G::LoadSystem($sDataBase);
$oDataBase = new database();
$usr_completename_col = $oDataBase->concatString("USR_LASTNAME", "' '", "USR_FIRSTNAME", " '('", "USR_USERNAME", "')'");
}
$oCriteria->addAsColumn('USR_COMPLETENAME', $usr_completename_col);
$oCriteria->add(UsersPeer::USR_UID, $_POST['USR_UID'], Criteria::NOT_EQUAL);
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
$oDataset = UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$sUsers = '<option value=""> - ' . G::LoadTranslation('ID_NO_REASSIGN') . ' - </option>';
while ($aRow = $oDataset->getRow()) {
$sUsers .= '<option value="' . $aRow['USR_UID'] . '">' . $aRow['USR_COMPLETENAME'] . '</option>';
$oDataset->next();
}
$aProcesses = array();
$aProcesses[] = array('CHECKBOX' => 'char',
'PROCESS' => 'char',
'CANTITY' => 'char',
'USERS' => 'char');
$del = DBAdapter::getStringDelimiter();
require_once 'classes/model/AppDelegation.php';
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(AppDelegationPeer::PRO_UID);
$oCriteria->addSelectColumn('COUNT(' . AppDelegationPeer::PRO_UID . ') AS CANTITY');
$oCriteria->addAsColumn('PRO_TITLE', ContentPeer::CON_VALUE);
$aConditions = array();
$aConditions[] = array(AppDelegationPeer::PRO_UID, ContentPeer::CON_ID);
$aConditions[] = array(ContentPeer::CON_CATEGORY, $del . 'PRO_TITLE' . $del);
$aConditions[] = array(ContentPeer::CON_LANG, $del . SYS_LANG . $del);
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$oCriteria->add(AppDelegationPeer::USR_UID, $_POST['USR_UID']);
$oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
$oCriteria->addGroupByColumn(AppDelegationPeer::PRO_UID);
$sDataBase = 'database_' . strtolower( DB_ADAPTER );
if (G::LoadSystemExist( $sDataBase )) {
G::LoadSystem( $sDataBase );
$oDataBase = new database();
$usr_completename_col = $oDataBase->concatString( "USR_LASTNAME", "' '", "USR_FIRSTNAME", " '('", "USR_USERNAME", "')'" );
}
/*
$oCriteria->addAsColumn( 'USR_COMPLETENAME', $usr_completename_col );
$oCriteria->add( UsersPeer::USR_UID, $_POST['USR_UID'], Criteria::NOT_EQUAL );
$oCriteria->add( UsersPeer::USR_STATUS, array ('CLOSED'
), Criteria::NOT_IN );
$oDataset = UsersPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$sUsers = '<option value=""> - ' . G::LoadTranslation( 'ID_NO_REASSIGN' ) . ' - </option>';
while ($aRow = $oDataset->getRow()) {
$sUsers .= '<option value="' . $aRow['USR_UID'] . '">' . $aRow['USR_COMPLETENAME'] . '</option>';
$oDataset->next();
}
$aProcesses = array ();
$aProcesses[] = array ('CHECKBOX' => 'char','PROCESS' => 'char','CANTITY' => 'char','USERS' => 'char'
);
$del = DBAdapter::getStringDelimiter();
require_once 'classes/model/AppDelegation.php';
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( AppDelegationPeer::PRO_UID );
$oCriteria->addSelectColumn( 'COUNT(' . AppDelegationPeer::PRO_UID . ') AS CANTITY' );
$oCriteria->addAsColumn( 'PRO_TITLE', ContentPeer::CON_VALUE );
$aConditions = array ();
$aConditions[] = array (AppDelegationPeer::PRO_UID,ContentPeer::CON_ID
);
$aConditions[] = array (ContentPeer::CON_CATEGORY,$del . 'PRO_TITLE' . $del
);
$aConditions[] = array (ContentPeer::CON_LANG,$del . SYS_LANG . $del
);
$oCriteria->addJoinMC( $aConditions, Criteria::LEFT_JOIN );
$oCriteria->add( AppDelegationPeer::USR_UID, $_POST['USR_UID'] );
$oCriteria->add( AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL );
$oCriteria->addGroupByColumn( AppDelegationPeer::PRO_UID );
/*
* Adding grouped by standardization.
*/
$oCriteria->addGroupByColumn(ContentPeer::CON_VALUE);
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$aProcesses[] = array('CHECKBOX' => '<input type="checkbox" name="PROCESS[' . $aRow['PRO_UID'] . ']" id="PROCESS[' . $aRow['PRO_UID'] . ']" />',
'PROCESS' => $aRow['PRO_TITLE'],
'CANTITY' => $aRow['CANTITY'],
'USERS' => '<select name="USER[' . $aRow['PRO_UID'] . ']" id="USER[' . $aRow['PRO_UID'] . ']">' . $sUsers . '</select>');
$oDataset->next();
}
global $_DBArray;
$_DBArray['processesToReassign'] = $aProcesses;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass('ArrayPeer');
$oCriteria = new Criteria('dbarray');
$oCriteria->setDBArrayTable('processesToReassign');
$G_PUBLISH->AddContent('propeltable', 'cases/paged-table-reassign', 'users/users_ReassignCases', $oCriteria, $_POST);
break;
}
break;
}
G::RenderPage('publish', 'raw');
$oCriteria->addGroupByColumn( ContentPeer::CON_VALUE );
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$aProcesses[] = array ('CHECKBOX' => '<input type="checkbox" name="PROCESS[' . $aRow['PRO_UID'] . ']" id="PROCESS[' . $aRow['PRO_UID'] . ']" />','PROCESS' => $aRow['PRO_TITLE'],'CANTITY' => $aRow['CANTITY'],'USERS' => '<select name="USER[' . $aRow['PRO_UID'] . ']" id="USER[' . $aRow['PRO_UID'] . ']">' . $sUsers . '</select>'
);
$oDataset->next();
}
global $_DBArray;
$_DBArray['processesToReassign'] = $aProcesses;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass( 'ArrayPeer' );
$oCriteria = new Criteria( 'dbarray' );
$oCriteria->setDBArrayTable( 'processesToReassign' );
$G_PUBLISH->AddContent( 'propeltable', 'cases/paged-table-reassign', 'users/users_ReassignCases', $oCriteria, $_POST );
break;
}
break;
}
G::RenderPage( 'publish', 'raw' );
} catch (Exception $oException) {
die( $oException->getMessage() );
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

File diff suppressed because it is too large Load Diff

View File

@@ -12,70 +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.
*
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY'))
{
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
// deprecated the class XmlForm_Field_Image is currently part of the class.xmlform.php package
// the use of the external xmlfield_Image is highly discouraged
if (!class_exists('XmlForm_Field_Image')){
G::LoadClass('xmlfield_Image');
}
require_once 'classes/model/Users.php';
$_SESSION['CURRENT_USER'] = $_GET['USR_UID'];
$oUser = new Users();
$aFields = $oUser->load($_GET['USR_UID']);
$aFields['USR_PASSWORD'] = '********';
$aFields['MESSAGE0'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_USER_REGISTERED')) . '!';
$aFields['MESSAGE1'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_USR_USERNAME'));
$aFields['MESSAGE2'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_DUE_DATE'));
$aFields['MESSAGE3'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_NEW_PASS_SAME_OLD_PASS'));
$aFields['MESSAGE4'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_USR_FIRSTNAME'));
$aFields['MESSAGE5'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_USR_LASTNAME'));
$aFields['NO_RESUME'] = G::LoadTranslation('ID_NO_RESUME');
$aFields['START_DATE'] = date('Y-m-d');
$aFields['END_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 5));
$aFields['RANDOM'] = rand();
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'USERS';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_View.xml', '', $aFields);
krumo($_SESSION);
if($_GET['USR_UID']=='00000000000000000000000000000001')
{ //$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_ViewAdmin.xml', '', $aFields);
// administrator due date must have a longer range
$aFields['END_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 10));
krumo("asdasd");
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_EditAdmin.xml', 'display:none', $aFields, 'users_Save?USR_UID=' . $_SESSION['CURRENT_USER']);
}
else
{
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_Edit.xml', 'display:none', $aFields, 'users_Save?USR_UID=' . $_SESSION['CURRENT_USER']);
}
G::RenderPage('publish');
global $RBAC;
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
// deprecated the class XmlForm_Field_Image is currently part of the class.xmlform.php package
// the use of the external xmlfield_Image is highly discouraged
if (! class_exists( 'XmlForm_Field_Image' )) {
G::LoadClass( 'xmlfield_Image' );
}
require_once 'classes/model/Users.php';
$_SESSION['CURRENT_USER'] = $_GET['USR_UID'];
$oUser = new Users();
$aFields = $oUser->load( $_GET['USR_UID'] );
$aFields['USR_PASSWORD'] = '********';
$aFields['MESSAGE0'] = str_replace( "\r\n", "<br>", G::LoadTranslation( 'ID_USER_REGISTERED' ) ) . '!';
$aFields['MESSAGE1'] = str_replace( "\r\n", "<br>", G::LoadTranslation( 'ID_MSG_ERROR_USR_USERNAME' ) );
$aFields['MESSAGE2'] = str_replace( "\r\n", "<br>", G::LoadTranslation( 'ID_MSG_ERROR_DUE_DATE' ) );
$aFields['MESSAGE3'] = str_replace( "\r\n", "<br>", G::LoadTranslation( 'ID_NEW_PASS_SAME_OLD_PASS' ) );
$aFields['MESSAGE4'] = str_replace( "\r\n", "<br>", G::LoadTranslation( 'ID_MSG_ERROR_USR_FIRSTNAME' ) );
$aFields['MESSAGE5'] = str_replace( "\r\n", "<br>", G::LoadTranslation( 'ID_MSG_ERROR_USR_LASTNAME' ) );
$aFields['NO_RESUME'] = G::LoadTranslation( 'ID_NO_RESUME' );
$aFields['START_DATE'] = date( 'Y-m-d' );
$aFields['END_DATE'] = date( 'Y-m-d', mktime( 0, 0, 0, date( 'm' ), date( 'd' ), date( 'Y' ) + 5 ) );
$aFields['RANDOM'] = rand();
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'USERS';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_View.xml', '', $aFields );
krumo( $_SESSION );
if ($_GET['USR_UID'] == '00000000000000000000000000000001') { //$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_ViewAdmin.xml', '', $aFields);
// administrator due date must have a longer range
$aFields['END_DATE'] = date( 'Y-m-d', mktime( 0, 0, 0, date( 'm' ), date( 'd' ), date( 'Y' ) + 10 ) );
krumo( "asdasd" );
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_EditAdmin.xml', 'display:none', $aFields, 'users_Save?USR_UID=' . $_SESSION['CURRENT_USER'] );
} else {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_Edit.xml', 'display:none', $aFields, 'users_Save?USR_UID=' . $_SESSION['CURRENT_USER'] );
}
G::RenderPage( 'publish' );
} catch (Exception $oException) {
die( $oException->getMessage() );
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -1,10 +1,10 @@
<?php
/**
* users_ViewPhoto.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,89 +12,87 @@
*
* 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_LOGIN"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1)
return $RBAC_Response;
$direction = PATH_IMAGES_ENVIRONMENT_USERS . $uid = (isset($_SESSION['CURRENT_USER']) ? $_SESSION['CURRENT_USER'] : $_SESSION['USER_LOGGED']).".gif";
$direction = PATH_IMAGES_ENVIRONMENT_USERS . $uid = (isset( $_SESSION['CURRENT_USER'] ) ? $_SESSION['CURRENT_USER'] : $_SESSION['USER_LOGGED']) . ".gif";
// header('Pragma: ');
// header('Cache-Control: cache');
if (!file_exists($direction))
{
if (! file_exists( $direction )) {
$direction = PATH_HOME . 'public_html/images/user.gif';
}
G::sendHeaders( $direction );
DumpHeaders($direction);
}
G::sendHeaders( $direction );
DumpHeaders( $direction );
/*
* This function is verified to work with Netscape and the *very latest*
* version of IE. I don't know if it works with Opera, but it should now.
*/
function DumpHeaders($filename)
function DumpHeaders ($filename)
{
global $root_path;
if (!$filename) return;
if (! $filename)
return;
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
$isIE = 0;
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE ') !== false &&
strstr($HTTP_USER_AGENT, 'Opera') === false) {
if (strstr( $HTTP_USER_AGENT, 'compatible; MSIE ' ) !== false && strstr( $HTTP_USER_AGENT, 'Opera' ) === false) {
$isIE = 1;
}
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE 6') !== false &&
strstr($HTTP_USER_AGENT, 'Opera') === false) {
if (strstr( $HTTP_USER_AGENT, 'compatible; MSIE 6' ) !== false && strstr( $HTTP_USER_AGENT, 'Opera' ) === false) {
$isIE6 = 1;
}
$aux = preg_replace('[^-a-zA-Z0-9\.]', '_', $filename);
$aux = explode ('_', $aux);
$downloadName = $aux[ count($aux)-1 ];
// $downloadName = $filename;
$aux = preg_replace( '[^-a-zA-Z0-9\.]', '_', $filename );
$aux = explode( '_', $aux );
$downloadName = $aux[count( $aux ) - 1];
// $downloadName = $filename;
//$downloadName = ereg_replace('[^-a-zA-Z0-9\.]', '_', $filename);
if ($isIE && !isset($isIE6)) {
// http://support.microsoft.com/support/kb/articles/Q182/3/15.asp
// Do not have quotes around filename, but that applied to
// "attachment"... does it apply to inline too?
// This combination seems to work mostly. IE 5.5 SP 1 has
// known issues (see the Microsoft Knowledge Base)
header("Content-Disposition: inline; filename=$downloadName");
if ($isIE && ! isset( $isIE6 )) {
// http://support.microsoft.com/support/kb/articles/Q182/3/15.asp
// Do not have quotes around filename, but that applied to
// "attachment"... does it apply to inline too?
// This works for most types, but doesn't work with Word files
header("Content-Type: application/download; name=\"$downloadName\"");
//header("Content-Type: $type0/$type1; name=\"$downloadName\"");
//header("Content-Type: application/x-msdownload; name=\"$downloadName\"");
//header("Content-Type: application/octet-stream; name=\"$downloadName\"");
}
else {
header("Content-Disposition: attachment; filename=\"$downloadName\"");
header("Content-Type: application/octet-stream; name=\"$downloadName\"");
// This combination seems to work mostly. IE 5.5 SP 1 has
// known issues (see the Microsoft Knowledge Base)
header( "Content-Disposition: inline; filename=$downloadName" );
// This works for most types, but doesn't work with Word files
header( "Content-Type: application/download; name=\"$downloadName\"" );
//header("Content-Type: $type0/$type1; name=\"$downloadName\"");
//header("Content-Type: application/x-msdownload; name=\"$downloadName\"");
//header("Content-Type: application/octet-stream; name=\"$downloadName\"");
} else {
header( "Content-Disposition: attachment; filename=\"$downloadName\"" );
header( "Content-Type: application/octet-stream; name=\"$downloadName\"" );
}
//$filename = PATH_UPLOAD . "$filename";
readfile($filename);
readfile( $filename );
}
//G::header2( "location: /files/" .$_SESSION['ENVIRONMENT']. "/" .$appid, $filename);
?>

View File

@@ -1,10 +1,10 @@
<?php
/**
* users_ViewPhoto.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,87 +12,82 @@
*
* 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_LOGIN"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1)
return $RBAC_Response;
$direction = PATH_IMAGES_ENVIRONMENT_USERS . $_REQUEST['pUID'] . ".gif";
$direction = PATH_IMAGES_ENVIRONMENT_USERS . $_REQUEST['pUID'] . ".gif";
// header('Pragma: ');
// header('Cache-Control: cache');
if (!file_exists($direction))
{
if (! file_exists( $direction )) {
$direction = PATH_HOME . 'public_html/images/user.gif';
}
G::sendHeaders( $direction );
DumpHeaders($direction);
}
G::sendHeaders( $direction );
DumpHeaders( $direction );
/*
* This function is verified to work with Netscape and the *very latest*
* version of IE. I don't know if it works with Opera, but it should now.
*/
function DumpHeaders($filename)
function DumpHeaders ($filename)
{
global $root_path;
if (!$filename) return;
if (! $filename)
return;
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
$isIE = 0;
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE ') !== false &&
strstr($HTTP_USER_AGENT, 'Opera') === false) {
if (strstr( $HTTP_USER_AGENT, 'compatible; MSIE ' ) !== false && strstr( $HTTP_USER_AGENT, 'Opera' ) === false) {
$isIE = 1;
}
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE 6') !== false &&
strstr($HTTP_USER_AGENT, 'Opera') === false) {
if (strstr( $HTTP_USER_AGENT, 'compatible; MSIE 6' ) !== false && strstr( $HTTP_USER_AGENT, 'Opera' ) === false) {
$isIE6 = 1;
}
$aux = preg_replace('[^-a-zA-Z0-9\.]', '_', $filename);
$aux = explode ('_', $aux);
$downloadName = $aux[ count($aux)-1 ];
$aux = preg_replace( '[^-a-zA-Z0-9\.]', '_', $filename );
$aux = explode( '_', $aux );
$downloadName = $aux[count( $aux ) - 1];
if ($isIE && ! isset( $isIE6 )) {
// http://support.microsoft.com/support/kb/articles/Q182/3/15.asp
// Do not have quotes around filename, but that applied to
// "attachment"... does it apply to inline too?
if ($isIE && !isset($isIE6)) {
// http://support.microsoft.com/support/kb/articles/Q182/3/15.asp
// Do not have quotes around filename, but that applied to
// "attachment"... does it apply to inline too?
// This combination seems to work mostly. IE 5.5 SP 1 has
// known issues (see the Microsoft Knowledge Base)
header( "Content-Disposition: inline; filename=$downloadName" );
// This combination seems to work mostly. IE 5.5 SP 1 has
// known issues (see the Microsoft Knowledge Base)
header("Content-Disposition: inline; filename=$downloadName");
// This works for most types, but doesn't work with Word files
header( "Content-Type: application/download; name=\"$downloadName\"" );
// This works for most types, but doesn't work with Word files
header("Content-Type: application/download; name=\"$downloadName\"");
//header("Content-Type: $type0/$type1; name=\"$downloadName\"");
//header("Content-Type: application/x-msdownload; name=\"$downloadName\"");
//header("Content-Type: application/octet-stream; name=\"$downloadName\"");
}
else {
header("Content-Disposition: attachment; filename=\"$downloadName\"");
header("Content-Type: application/octet-stream; name=\"$downloadName\"");
//header("Content-Type: $type0/$type1; name=\"$downloadName\"");
//header("Content-Type: application/x-msdownload; name=\"$downloadName\"");
//header("Content-Type: application/octet-stream; name=\"$downloadName\"");
} else {
header( "Content-Disposition: attachment; filename=\"$downloadName\"" );
header( "Content-Type: application/octet-stream; name=\"$downloadName\"" );
}
//$filename = PATH_UPLOAD . "$filename";
readfile($filename);
readfile( $filename );
}
//G::header2( "location: /files/" .$_SESSION['ENVIRONMENT']. "/" .$appid, $filename);
?>

View File

@@ -1,10 +1,10 @@
<?php
/**
* users_ViewResume.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,97 +12,97 @@
*
* 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_LOGIN"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1)
return $RBAC_Response;
G::LoadClass( "user" );
$uid = (isset($_SESSION['CURRENT_USER']) ? $_SESSION['CURRENT_USER'] : $_SESSION['USER_LOGGED']);
$uid = (isset( $_SESSION['CURRENT_USER'] ) ? $_SESSION['CURRENT_USER'] : $_SESSION['USER_LOGGED']);
require_once 'classes/model/Users.php';
$oUser = new Users();
$form = $oUser->load($uid);
if (!isset($form['USR_RESUME']) || $form['USR_RESUME']==='') die(G::LoadTranslation('ID_WITHOUT_RESUME'));
$direction = PATH_IMAGES_ENVIRONMENT_FILES.$uid."/".$form['USR_RESUME'];
if (!file_exists($direction)) {
die('The file "' . $direction . '"doesn\'t exist in the server!');
$form = $oUser->load( $uid );
if (! isset( $form['USR_RESUME'] ) || $form['USR_RESUME'] === '')
die( G::LoadTranslation( 'ID_WITHOUT_RESUME' ) );
$direction = PATH_IMAGES_ENVIRONMENT_FILES . $uid . "/" . $form['USR_RESUME'];
if (! file_exists( $direction )) {
die( 'The file "' . $direction . '"doesn\'t exist in the server!' );
}
// echo $direction ;
header('Pragma: ');
header('Cache-Control: cache');
header( 'Pragma: ' );
header( 'Cache-Control: cache' );
G::sendHeaders($direction);
readfile($direction);
G::sendHeaders( $direction );
readfile( $direction );
//DumpHeaders($direction);
/*
* This function is verified to work with Netscape and the *very latest*
* version of IE. I don't know if it works with Opera, but it should now.
*/
function DumpHeaders($filename)
function DumpHeaders ($filename)
{
global $root_path;
if (!$filename) return;
if (! $filename)
return;
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
$isIE = 0;
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE ') !== false &&
strstr($HTTP_USER_AGENT, 'Opera') === false) {
if (strstr( $HTTP_USER_AGENT, 'compatible; MSIE ' ) !== false && strstr( $HTTP_USER_AGENT, 'Opera' ) === false) {
$isIE = 1;
}
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE 6') !== false &&
strstr($HTTP_USER_AGENT, 'Opera') === false) {
if (strstr( $HTTP_USER_AGENT, 'compatible; MSIE 6' ) !== false && strstr( $HTTP_USER_AGENT, 'Opera' ) === false) {
$isIE6 = 1;
}
// The ereg_replace function has been DEPRECATED as of PHP 5.3.0.
// $aux = ereg_replace('[^-a-zA-Z0-9\.]', '_', $filename);
$aux = preg_replace('/[^-a-zA-Z0-9\.]/', '_', $filename);
$aux = explode ('_', $aux);
$downloadName = $aux[ count($aux)-1 ];
// $downloadName = $filename;
$aux = preg_replace( '/[^-a-zA-Z0-9\.]/', '_', $filename );
$aux = explode( '_', $aux );
$downloadName = $aux[count( $aux ) - 1];
// $downloadName = $filename;
//$downloadName = ereg_replace('[^-a-zA-Z0-9\.]', '_', $filename);
if ($isIE && !isset($isIE6)) {
// http://support.microsoft.com/support/kb/articles/Q182/3/15.asp
// Do not have quotes around filename, but that applied to
// "attachment"... does it apply to inline too?
// This combination seems to work mostly. IE 5.5 SP 1 has
// known issues (see the Microsoft Knowledge Base)
header("Content-Disposition: inline; filename=$downloadName");
if ($isIE && ! isset( $isIE6 )) {
// http://support.microsoft.com/support/kb/articles/Q182/3/15.asp
// Do not have quotes around filename, but that applied to
// "attachment"... does it apply to inline too?
// This works for most types, but doesn't work with Word files
header("Content-Type: application/download; name=\"$downloadName\"");
//header("Content-Type: $type0/$type1; name=\"$downloadName\"");
//header("Content-Type: application/x-msdownload; name=\"$downloadName\"");
//header("Content-Type: application/octet-stream; name=\"$downloadName\"");
}
else {
header("Content-Disposition: attachment; filename=\"$downloadName\"");
header("Content-Type: application/octet-stream; name=\"$downloadName\"");
// This combination seems to work mostly. IE 5.5 SP 1 has
// known issues (see the Microsoft Knowledge Base)
header( "Content-Disposition: inline; filename=$downloadName" );
// This works for most types, but doesn't work with Word files
header( "Content-Type: application/download; name=\"$downloadName\"" );
//header("Content-Type: $type0/$type1; name=\"$downloadName\"");
//header("Content-Type: application/x-msdownload; name=\"$downloadName\"");
//header("Content-Type: application/octet-stream; name=\"$downloadName\"");
} else {
header( "Content-Disposition: attachment; filename=\"$downloadName\"" );
header( "Content-Type: application/octet-stream; name=\"$downloadName\"" );
}
//$filename = PATH_UPLOAD . "$filename";
readfile($filename);
readfile( $filename );
}
//G::header2( "location: /files/" .$_SESSION['ENVIRONMENT']. "/" .$appid, $filename);
?>