Merge pull request #800 from Jennydmz/master
CODE STYLE, workflow/engine/methods/setup/ PART 3 (final)
This commit is contained in:
@@ -1,73 +1,84 @@
|
||||
function abc(panel, txt) {
|
||||
/*
|
||||
* commonDialog ( '', 'saved' , 'saved', {}, '' ) ; setTimeout (
|
||||
* leimnud.closure({instance:myDialog,method:function(panel){
|
||||
*
|
||||
* myDialog.remove(); panel.tabLastSelected=false; panel.tabSelected=1;
|
||||
* panel.makeTab(); },args:panel}) , 1000 );
|
||||
*/
|
||||
var img = document.getElementById('workPeriodGraph');
|
||||
img.src = 'workPeriodGraph?b=' + Math.random();
|
||||
|
||||
function abc( panel, txt ) {
|
||||
/* commonDialog ( '', 'saved' , 'saved', {}, '' ) ;
|
||||
setTimeout ( leimnud.closure({instance:myDialog,method:function(panel){
|
||||
|
||||
myDialog.remove();
|
||||
panel.tabLastSelected=false;
|
||||
panel.tabSelected=1;
|
||||
panel.makeTab();
|
||||
},args:panel}) , 1000 );
|
||||
*/
|
||||
var img = document.getElementById( 'workPeriodGraph' );
|
||||
img.src = 'workPeriodGraph?b=' + Math.random() ;
|
||||
|
||||
// panel.clearContent();
|
||||
// panel.addContent ( txt );
|
||||
// panel.clearContent();
|
||||
// panel.addContent ( txt );
|
||||
return false;
|
||||
}
|
||||
|
||||
function showHideFilterForm( divName)
|
||||
{
|
||||
if (document.getElementById( divName ).style.display==='none')
|
||||
document.getElementById( divName).style.display = '';
|
||||
function showHideFilterForm(divName) {
|
||||
if (document.getElementById(divName).style.display === 'none')
|
||||
document.getElementById(divName).style.display = '';
|
||||
else
|
||||
document.getElementById( divName).style.display = 'none';
|
||||
document.getElementById(divName).style.display = 'none';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function newHoliday(ev) {
|
||||
var coor = leimnud.dom.mouse(ev);
|
||||
var myPanel=new leimnud.module.panel();
|
||||
myPanel.options={
|
||||
size:{w:500,h:200},
|
||||
position:{x:coor.x-200,y:coor.y},
|
||||
title:"New Holiday",
|
||||
theme:"panel",
|
||||
control:{
|
||||
close:true,
|
||||
drag:true
|
||||
var myPanel = new leimnud.module.panel();
|
||||
myPanel.options = {
|
||||
size : {
|
||||
w : 500,
|
||||
h : 200
|
||||
},
|
||||
fx: { modal:true }
|
||||
position : {
|
||||
x : coor.x - 200,
|
||||
y : coor.y
|
||||
},
|
||||
title : "New Holiday",
|
||||
theme : "panel",
|
||||
control : {
|
||||
close : true,
|
||||
drag : true
|
||||
},
|
||||
fx : {
|
||||
modal : true
|
||||
}
|
||||
};
|
||||
|
||||
myPanel.make();
|
||||
|
||||
var r = new leimnud.module.rpc.xmlhttp({url:"holidayNew.php"});
|
||||
r.callback=leimnud.closure({Function:function(rpc){
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url : "holidayNew.php"
|
||||
});
|
||||
r.callback = leimnud.closure({
|
||||
Function : function(rpc) {
|
||||
myPanel.addContent(rpc.xmlhttp.responseText);
|
||||
},args:r})
|
||||
},
|
||||
args : r
|
||||
})
|
||||
r.make();
|
||||
|
||||
}
|
||||
|
||||
function deleteHoliday( uid ) {
|
||||
function deleteHoliday(uid) {
|
||||
url = "setupAjax.php?action=deleteHoliday&uid=" + uid;
|
||||
var r = new leimnud.module.rpc.xmlhttp({url: url });
|
||||
r.callback=leimnud.closure({Function:function(rpc){
|
||||
//myPanel.addContent(rpc.xmlhttp.responseText);
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url : url
|
||||
});
|
||||
r.callback = leimnud.closure({
|
||||
Function : function(rpc) {
|
||||
// myPanel.addContent(rpc.xmlhttp.responseText);
|
||||
myPanel = setupPanel.panels.control;
|
||||
myPanel.tabLastSelected=false;
|
||||
myPanel.tabSelected=0;
|
||||
myPanel.tabLastSelected = false;
|
||||
myPanel.tabSelected = 0;
|
||||
myPanel.makeTab();
|
||||
|
||||
},args:r})
|
||||
},
|
||||
args : r
|
||||
})
|
||||
r.make();
|
||||
|
||||
|
||||
// myPanel.clearContent();
|
||||
// myPanel.addContent ( uid );
|
||||
// myPanel.clearContent();
|
||||
// myPanel.addContent ( uid );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -20,68 +20,63 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* New Admin User interface
|
||||
*
|
||||
* @author Erik A. O. <erik@colosa.com, aortiz.erik@gmail.com>
|
||||
* @date Apr 5th, 2010
|
||||
*/
|
||||
|
||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
|
||||
return $RBAC_Response;
|
||||
|
||||
$G_MAIN_MENU = "processmaker";
|
||||
$G_ID_MENU_SELECTED = "SETUP";
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH = new Publisher();
|
||||
global $G_TMP_MENU;
|
||||
$oMenu = new Menu();
|
||||
$oMenu->load('setup');
|
||||
$toolItems = Array();
|
||||
$oMenu->load( 'setup' );
|
||||
$toolItems = Array ();
|
||||
|
||||
foreach( $oMenu->Options as $i=>$option) {
|
||||
$toolItems[] = Array(
|
||||
'id' => $oMenu->Id[$i],
|
||||
'link' => ($oMenu->Options[$i]!='')? $oMenu->Options[$i]: '#',
|
||||
'onclick' => ($oMenu->JS[$i]!='')? $oMenu->JS[$i]: '',
|
||||
'label' => $oMenu->Labels[$i],
|
||||
'icon' => ($oMenu->Icons[$i]!='')? $oMenu->Icons[$i]: 'icon-pmlogo.png',
|
||||
'target'=> ($oMenu->JS[$i]!='')? '': 'admToolsContent'
|
||||
foreach ($oMenu->Options as $i => $option) {
|
||||
$toolItems[] = Array ('id' => $oMenu->Id[$i],'link' => ($oMenu->Options[$i] != '') ? $oMenu->Options[$i] : '#','onclick' => ($oMenu->JS[$i] != '') ? $oMenu->JS[$i] : '','label' => $oMenu->Labels[$i],'icon' => ($oMenu->Icons[$i] != '') ? $oMenu->Icons[$i] : 'icon-pmlogo.png','target' => ($oMenu->JS[$i] != '') ? '' : 'admToolsContent'
|
||||
);
|
||||
}
|
||||
|
||||
$template = new TemplatePower( PATH_TPL . 'setup' . PATH_SEP . 'tools.html' );
|
||||
$template->prepare();
|
||||
|
||||
$template->assign ('LeftWidth', '230');
|
||||
$template->assign ('contentHeight', '520');
|
||||
$template->assign( 'LeftWidth', '230' );
|
||||
$template->assign( 'contentHeight', '520' );
|
||||
|
||||
if( isset($_GET['i18']) ){
|
||||
if (isset( $_GET['i18'] )) {
|
||||
$_SESSION['TOOLS_VIEWTYPE'] = true;
|
||||
$template->assign ('displayLanguageTool', 'block');
|
||||
$template->assign( 'displayLanguageTool', 'block' );
|
||||
} else {
|
||||
$template->assign ('displayLanguageTool', 'none');
|
||||
$template->assign( 'displayLanguageTool', 'none' );
|
||||
}
|
||||
if( isset($_GET['newSite']) ){
|
||||
$template->assign ('displayNewSiteTool', 'block');
|
||||
if (isset( $_GET['newSite'] )) {
|
||||
$template->assign( 'displayNewSiteTool', 'block' );
|
||||
} else {
|
||||
$template->assign ('displayNewSiteTool', 'none');
|
||||
$template->assign( 'displayNewSiteTool', 'none' );
|
||||
}
|
||||
|
||||
|
||||
foreach($toolItems as $item) {
|
||||
$template->newBlock( 'tool_options');
|
||||
foreach($item as $propertyName=>$propertyValue)
|
||||
$template->assign ($propertyName, $propertyValue);
|
||||
foreach ($toolItems as $item) {
|
||||
$template->newBlock( 'tool_options' );
|
||||
foreach ($item as $propertyName => $propertyValue)
|
||||
$template->assign( $propertyName, $propertyValue );
|
||||
}
|
||||
|
||||
$G_PUBLISH->AddContent('template', '', '', '', $template );
|
||||
G::RenderPage('publish');
|
||||
if(isset($_GET['module'])){
|
||||
$G_PUBLISH->AddContent( 'template', '', '', '', $template );
|
||||
G::RenderPage( 'publish' );
|
||||
if (isset( $_GET['module'] )) {
|
||||
|
||||
print "
|
||||
<script>
|
||||
admToolsContent.location='".$_GET['module']."';
|
||||
admToolsContent.location='" . $_GET['module'] . "';
|
||||
</script>
|
||||
";
|
||||
}
|
||||
|
||||
|
||||
@@ -20,22 +20,22 @@
|
||||
*
|
||||
* 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_SETUP"))!=1) return $RBAC_Response;
|
||||
//$oSMTPJSON = new Services_JSON();
|
||||
//$oSMTPData = $oSMTPJSON->decode(stripslashes($_POST['data']));
|
||||
//$sOutput = '';
|
||||
G::LoadClass('setup');
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
|
||||
return $RBAC_Response;
|
||||
//$oSMTPJSON = new Services_JSON();
|
||||
//$oSMTPData = $oSMTPJSON->decode(stripslashes($_POST['data']));
|
||||
//$sOutput = '';
|
||||
G::LoadClass( 'setup' );
|
||||
|
||||
$oSMTPSetup = new Setup(new DBConnection);
|
||||
$oSMTPSetup = new Setup( new DBConnection() );
|
||||
|
||||
$action = strtolower ( $_GET['action'] );
|
||||
$data = $_GET;
|
||||
$action = strtolower( $_GET['action'] );
|
||||
$data = $_GET;
|
||||
|
||||
$arr = get_class_methods( get_class( $oSMTPSetup ) );
|
||||
foreach ($arr as $method) {
|
||||
if ($method == $action)
|
||||
$oSMTPSetup->{$action}( $_GET );
|
||||
}
|
||||
|
||||
$arr = get_class_methods( get_class($oSMTPSetup) );
|
||||
foreach ($arr as $method) {
|
||||
if ( $method == $action )
|
||||
$oSMTPSetup->{$action} ( $_GET );
|
||||
}
|
||||
?>
|
||||
@@ -20,97 +20,96 @@
|
||||
*
|
||||
* 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_CASES"))!=1) return $RBAC_Response;
|
||||
|
||||
$idDecode64 = base64_decode($_GET['id']);
|
||||
$idExploded = explode( '/', $idDecode64 );
|
||||
if ( $idExploded[0] == '' ) array_shift($idExploded);
|
||||
if ( $idExploded[0] == 'plugin' ) {
|
||||
|
||||
$idDecode64 = base64_decode( $_GET['id'] );
|
||||
$idExploded = explode( '/', $idDecode64 );
|
||||
if ($idExploded[0] == '')
|
||||
array_shift( $idExploded );
|
||||
if ($idExploded[0] == 'plugin') {
|
||||
//Get the Plugin Folder, always the first element
|
||||
$pluginFolder = $idExploded[1];
|
||||
$pluginFilename = PATH_PLUGINS . $pluginFolder . PATH_SEP . 'public_html'. PATH_SEP . $idExploded[2];
|
||||
if ( file_exists ( $pluginFilename ) ) {
|
||||
G::streamFile ( $pluginFilename );
|
||||
}
|
||||
die;
|
||||
$pluginFilename = PATH_PLUGINS . $pluginFolder . PATH_SEP . 'public_html' . PATH_SEP . $idExploded[2];
|
||||
if (file_exists( $pluginFilename )) {
|
||||
G::streamFile( $pluginFilename );
|
||||
}
|
||||
die();
|
||||
}
|
||||
|
||||
$ainfoSite = explode("/",$_SERVER["REQUEST_URI"]);
|
||||
$ainfoSite = explode( "/", $_SERVER["REQUEST_URI"] );
|
||||
//it was added to show the logo into management plugin add by krlos
|
||||
if(isset($_GET['wsName']) && $_GET['wsName']!=''){
|
||||
if (isset( $_GET['wsName'] ) && $_GET['wsName'] != '') {
|
||||
$ainfoSite[1] = $_GET['wsName'];
|
||||
}
|
||||
}
|
||||
//end add
|
||||
$dir=PATH_DATA."sites".PATH_SEP.str_replace("sys","",$ainfoSite[1]).PATH_SEP."files/logos";
|
||||
$imagen = $dir .PATH_SEP.$idDecode64;
|
||||
$dir = PATH_DATA . "sites" . PATH_SEP . str_replace( "sys", "", $ainfoSite[1] ) . PATH_SEP . "files/logos";
|
||||
$imagen = $dir . PATH_SEP . $idDecode64;
|
||||
|
||||
if (is_file( $imagen )) {
|
||||
showLogo( $imagen );
|
||||
|
||||
if (is_file($imagen))
|
||||
{
|
||||
showLogo($imagen);
|
||||
} else {
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
$newDir = PATH_DATA."sites".PATH_SEP.str_replace("sys","",$ainfoSite[1]).PATH_SEP."files/logos";
|
||||
$newDir = PATH_DATA . "sites" . PATH_SEP . str_replace( "sys", "", $ainfoSite[1] ) . PATH_SEP . "files/logos";
|
||||
$dir = PATH_HOME . "public_html/files/logos";
|
||||
|
||||
if(!is_dir($newDir)){
|
||||
G::mk_dir($newDir);
|
||||
if (! is_dir( $newDir )) {
|
||||
G::mk_dir( $newDir );
|
||||
}
|
||||
//this function does copy all logos from public_html/files/logos to /shared/site/yourSite/files/logos
|
||||
//cpyMoreLogos($dir,$newDir);
|
||||
$newDir .= PATH_SEP.$idDecode64;
|
||||
$dir .= PATH_SEP.$idDecode64;
|
||||
copy($dir,$newDir);
|
||||
showLogo($newDir);
|
||||
die;
|
||||
$newDir .= PATH_SEP . $idDecode64;
|
||||
$dir .= PATH_SEP . $idDecode64;
|
||||
copy( $dir, $newDir );
|
||||
showLogo( $newDir );
|
||||
die();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function showLogo($imagen){
|
||||
$info = @getimagesize($imagen);
|
||||
$fp = fopen($imagen, "rb");
|
||||
function showLogo ($imagen)
|
||||
{
|
||||
$info = @getimagesize( $imagen );
|
||||
$fp = fopen( $imagen, "rb" );
|
||||
if ($info && $fp) {
|
||||
header("Content-type: {$info['mime']}");
|
||||
fpassthru($fp);
|
||||
exit;
|
||||
header( "Content-type: {$info['mime']}" );
|
||||
fpassthru( $fp );
|
||||
exit();
|
||||
} else {
|
||||
throw new Exception("Image format not valid");
|
||||
}
|
||||
throw new Exception( "Image format not valid" );
|
||||
}
|
||||
}
|
||||
|
||||
function cpyMoreLogos($dir,$newDir){
|
||||
if (file_exists($dir)) {
|
||||
if ($handle = opendir($dir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if(($file!=".")&&($file!="..")) {
|
||||
$extention=explode(".", $file);
|
||||
$aImageProp=getimagesize($dir.'/'.$file, $info);
|
||||
$sfileExtention = strtoupper($extention[count($extention)-1]);
|
||||
if( in_array($sfileExtention, array('JPG','JPEG','PNG','GIF') ) ) {
|
||||
function cpyMoreLogos ($dir, $newDir)
|
||||
{
|
||||
if (file_exists( $dir )) {
|
||||
if ($handle = opendir( $dir )) {
|
||||
while (false !== ($file = readdir( $handle ))) {
|
||||
if (($file != ".") && ($file != "..")) {
|
||||
$extention = explode( ".", $file );
|
||||
$aImageProp = getimagesize( $dir . '/' . $file, $info );
|
||||
$sfileExtention = strtoupper( $extention[count( $extention ) - 1] );
|
||||
if (in_array( $sfileExtention, array ('JPG','JPEG','PNG','GIF'
|
||||
) )) {
|
||||
|
||||
$dir1 = $dir.PATH_SEP.$file;
|
||||
$dir2 = $newDir.PATH_SEP.$file;
|
||||
$dir1 = $dir . PATH_SEP . $file;
|
||||
$dir2 = $newDir . PATH_SEP . $file;
|
||||
//print $dir1 ." *** ".$dir2."<br><br>";
|
||||
copy($dir1,$dir2);
|
||||
|
||||
copy( $dir1, $dir2 );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
closedir( $handle );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
die;
|
||||
|
||||
die();
|
||||
|
||||
?>
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,255 +1,250 @@
|
||||
<?php
|
||||
|
||||
if (!isset($_REQUEST ['action'])) {
|
||||
$res ['success'] = false;
|
||||
$res ['error']=$res ['message'] = 'You may request an action';
|
||||
if (! isset( $_REQUEST['action'] )) {
|
||||
$res['success'] = false;
|
||||
$res['error'] = $res['message'] = 'You may request an action';
|
||||
|
||||
print G::json_encode($res);
|
||||
die ();
|
||||
print G::json_encode( $res );
|
||||
die();
|
||||
}
|
||||
if (!function_exists($_REQUEST ['action'])) {
|
||||
$res ['success'] = false;
|
||||
$res ['error']=$res ['message'] = 'The requested action does not exist';
|
||||
if (! function_exists( $_REQUEST['action'] )) {
|
||||
$res['success'] = false;
|
||||
$res['error'] = $res['message'] = 'The requested action does not exist';
|
||||
|
||||
print G::json_encode($res);
|
||||
die ();
|
||||
print G::json_encode( $res );
|
||||
die();
|
||||
}
|
||||
$restrictedFunctions=array('copy_skin_folder','addTarFolder');
|
||||
if (in_array($_REQUEST ['action'],$restrictedFunctions)) {
|
||||
$res ['success'] = false;
|
||||
$res ['error']=$res ['message'] = 'The requested action does not exist *';
|
||||
print G::json_encode($res);
|
||||
die ();
|
||||
$restrictedFunctions = array ('copy_skin_folder','addTarFolder'
|
||||
);
|
||||
if (in_array( $_REQUEST['action'], $restrictedFunctions )) {
|
||||
$res['success'] = false;
|
||||
$res['error'] = $res['message'] = 'The requested action does not exist *';
|
||||
print G::json_encode( $res );
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
$functionName = $_REQUEST ['action'];
|
||||
$functionParams = isset($_REQUEST ['params']) ? $_REQUEST ['params'] : array();
|
||||
$functionName = $_REQUEST['action'];
|
||||
$functionParams = isset( $_REQUEST['params'] ) ? $_REQUEST['params'] : array ();
|
||||
|
||||
$functionName();
|
||||
|
||||
function updatePageSize()
|
||||
function updatePageSize ()
|
||||
{
|
||||
G::LoadClass('configuration');
|
||||
G::LoadClass( 'configuration' );
|
||||
$c = new Configurations();
|
||||
$arr['pageSize'] = $_REQUEST['size'];
|
||||
$arr['dateSave'] = date('Y-m-d H:i:s');
|
||||
$config = Array();
|
||||
$arr['dateSave'] = date( 'Y-m-d H:i:s' );
|
||||
$config = Array ();
|
||||
$config[] = $arr;
|
||||
$c->aConfig = $config;
|
||||
$c->saveConfig('skinsList', 'pageSize', '', $_SESSION['USER_LOGGED']);
|
||||
$c->saveConfig( 'skinsList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
echo '{success: true}';
|
||||
}
|
||||
|
||||
function skinList()
|
||||
function skinList ()
|
||||
{
|
||||
G::loadClass('system');
|
||||
G::loadClass( 'system' );
|
||||
|
||||
$skinList = System::getSkingList();
|
||||
|
||||
$wildcard = '';
|
||||
if(isset($_REQUEST['activeskin']))
|
||||
{
|
||||
if (isset( $_REQUEST['activeskin'] )) {
|
||||
$wildcard = '@';
|
||||
}
|
||||
foreach ($skinList['skins'] as $key => $value) {
|
||||
if ($value['SKIN_FOLDER_ID'] != 'simplified' && $value['SKIN_FOLDER_ID'] != 'uxs') {
|
||||
if($skinList['currentSkin'] == $value['SKIN_FOLDER_ID']){
|
||||
$value['SKIN_STATUS'] = $wildcard . G::LoadTranslation('ID_ACTIVE');
|
||||
if ($skinList['currentSkin'] == $value['SKIN_FOLDER_ID']) {
|
||||
$value['SKIN_STATUS'] = $wildcard . G::LoadTranslation( 'ID_ACTIVE' );
|
||||
$value['SKIN_NAME'] = $wildcard . $value['SKIN_NAME'];
|
||||
$value['SKIN_DESCRIPTION'] = $wildcard . $value['SKIN_DESCRIPTION'];
|
||||
$value['SKIN_AUTHOR'] = $wildcard . $value['SKIN_AUTHOR'];
|
||||
$value['SKIN_CREATEDATE'] = $wildcard . $value['SKIN_CREATEDATE'];
|
||||
$value['SKIN_MODIFIEDDATE'] = $wildcard . $value['SKIN_MODIFIEDDATE'];
|
||||
}
|
||||
else{
|
||||
$value['SKIN_STATUS'] = G::LoadTranslation('ID_INACTIVE');
|
||||
} else {
|
||||
$value['SKIN_STATUS'] = G::LoadTranslation( 'ID_INACTIVE' );
|
||||
}
|
||||
$skinListArray['skins'][] = $value;
|
||||
}
|
||||
}
|
||||
$skinListArray['currentSkin'] = $skinList['currentSkin'];
|
||||
echo G::json_encode($skinListArray);
|
||||
echo G::json_encode( $skinListArray );
|
||||
}
|
||||
|
||||
function newSkin($baseSkin='classic')
|
||||
function newSkin ($baseSkin = 'classic')
|
||||
{
|
||||
$skinBase = $baseSkin != "" ? strtolower($baseSkin) : 'classic';
|
||||
if ((isset($_REQUEST['skinBase'])) && ($_REQUEST['skinBase'] != "")) {
|
||||
$skinBase = strtolower($_REQUEST['skinBase']);
|
||||
$skinBase = $baseSkin != "" ? strtolower( $baseSkin ) : 'classic';
|
||||
if ((isset( $_REQUEST['skinBase'] )) && ($_REQUEST['skinBase'] != "")) {
|
||||
$skinBase = strtolower( $_REQUEST['skinBase'] );
|
||||
}
|
||||
|
||||
try {
|
||||
if (!(isset($_REQUEST['skinName']))) {
|
||||
throw ( new Exception(G::LoadTranslation('ID_SKIN_NAME_REQUIRED')) );
|
||||
if (! (isset( $_REQUEST['skinName'] ))) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_NAME_REQUIRED' ) ));
|
||||
}
|
||||
if (!(isset($_REQUEST['skinFolder']))) {
|
||||
throw ( new Exception(G::LoadTranslation('ID_SKIN_FOLDER_REQUIRED')) );
|
||||
if (! (isset( $_REQUEST['skinFolder'] ))) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_FOLDER_REQUIRED' ) ));
|
||||
}
|
||||
//Should validate skin folder name here
|
||||
//if....
|
||||
|
||||
|
||||
$skinName = $_REQUEST['skinName'];
|
||||
$skinFolder = $_REQUEST['skinFolder'];
|
||||
$skinDescription = isset($_REQUEST['skinDescription']) ? $_REQUEST['skinDescription'] : '';
|
||||
$skinAuthor = isset($_REQUEST['skinAuthor']) ? $_REQUEST['skinAuthor'] : 'ProcessMaker Team';
|
||||
$skinDescription = isset( $_REQUEST['skinDescription'] ) ? $_REQUEST['skinDescription'] : '';
|
||||
$skinAuthor = isset( $_REQUEST['skinAuthor'] ) ? $_REQUEST['skinAuthor'] : 'ProcessMaker Team';
|
||||
|
||||
if (is_dir(PATH_CUSTOM_SKINS . $skinFolder)) {
|
||||
throw ( new Exception(G::LoadTranslation('ID_SKIN_ALREADY_EXISTS')) );
|
||||
if (is_dir( PATH_CUSTOM_SKINS . $skinFolder )) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_ALREADY_EXISTS' ) ));
|
||||
}
|
||||
if (strtolower($skinFolder) == 'classic') {
|
||||
throw ( new Exception(G::LoadTranslation('ID_SKIN_ALREADY_EXISTS')) );
|
||||
if (strtolower( $skinFolder ) == 'classic') {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_ALREADY_EXISTS' ) ));
|
||||
}
|
||||
|
||||
//All validations OK then create skin
|
||||
switch ($skinBase) {
|
||||
//Validate skin base
|
||||
case 'uxmodern':
|
||||
copy_skin_folder(G::ExpandPath("skinEngine") . 'uxmodern' . PATH_SEP, PATH_CUSTOM_SKINS .
|
||||
$skinFolder,array("config.xml"));
|
||||
$pathBase=G::ExpandPath("skinEngine") . 'base' . PATH_SEP;
|
||||
copy_skin_folder( G::ExpandPath( "skinEngine" ) . 'uxmodern' . PATH_SEP, PATH_CUSTOM_SKINS . $skinFolder, array ("config.xml"
|
||||
) );
|
||||
$pathBase = G::ExpandPath( "skinEngine" ) . 'base' . PATH_SEP;
|
||||
break;
|
||||
case 'classic':
|
||||
//Special Copy of this dir + xmlreplace
|
||||
copy_skin_folder(G::ExpandPath("skinEngine") . 'base' . PATH_SEP, PATH_CUSTOM_SKINS .
|
||||
$skinFolder,array("config.xml","baseCss"));
|
||||
$pathBase=G::ExpandPath("skinEngine") . 'base' . PATH_SEP;
|
||||
copy_skin_folder( G::ExpandPath( "skinEngine" ) . 'base' . PATH_SEP, PATH_CUSTOM_SKINS . $skinFolder, array ("config.xml","baseCss"
|
||||
) );
|
||||
$pathBase = G::ExpandPath( "skinEngine" ) . 'base' . PATH_SEP;
|
||||
break;
|
||||
default:
|
||||
//Commmon copy/paste of a folder + xmlrepalce
|
||||
copy_skin_folder(PATH_CUSTOM_SKINS . $skinBase, PATH_CUSTOM_SKINS . $skinFolder,array("config.xml"));
|
||||
$pathBase=PATH_CUSTOM_SKINS.$skinBase;
|
||||
copy_skin_folder( PATH_CUSTOM_SKINS . $skinBase, PATH_CUSTOM_SKINS . $skinFolder, array ("config.xml"
|
||||
) );
|
||||
$pathBase = PATH_CUSTOM_SKINS . $skinBase;
|
||||
break;
|
||||
}
|
||||
//ReBuild config file
|
||||
//TODO: Improve this pre_replace lines
|
||||
$configFileOriginal = $pathBase . PATH_SEP . 'config.xml';
|
||||
$configFileFinal = PATH_CUSTOM_SKINS . $skinFolder . PATH_SEP . 'config.xml';
|
||||
$xmlConfiguration = file_get_contents($configFileOriginal);
|
||||
$xmlConfiguration = preg_replace('/(<id>)(.+?)(<\/id>)/i', '<id>' . G::generateUniqueID() .
|
||||
'</id><!-- $2 -->', $xmlConfiguration);
|
||||
$xmlConfiguration = preg_replace("/(<name>)(.+?)(<\/name>)/i", "<name>" . $skinName .
|
||||
"</name><!-- $2 -->", $xmlConfiguration);
|
||||
$xmlConfiguration = preg_replace("/(<description>)(.+?)(<\/description>)/i", "<description>" .
|
||||
$skinDescription . "</description><!-- $2 -->", $xmlConfiguration);
|
||||
$xmlConfiguration = preg_replace("/(<author>)(.+?)(<\/author>)/i", "<author>" . $skinAuthor .
|
||||
"</author><!-- $2 -->", $xmlConfiguration);
|
||||
$xmlConfiguration = preg_replace("/(<createDate>)(.+?)(<\/createDate>)/i", "<createDate>" .
|
||||
date("Y-m-d H:i:s") . "</createDate><!-- $2 -->", $xmlConfiguration);
|
||||
$xmlConfiguration = preg_replace("/(<modifiedDate>)(.+?)(<\/modifiedDate>)/i", "<modifiedDate>" .
|
||||
date("Y-m-d H:i:s") . "</modifiedDate><!-- $2 -->", $xmlConfiguration);
|
||||
file_put_contents($configFileFinal, $xmlConfiguration);
|
||||
$xmlConfiguration = file_get_contents( $configFileOriginal );
|
||||
$xmlConfiguration = preg_replace( '/(<id>)(.+?)(<\/id>)/i', '<id>' . G::generateUniqueID() . '</id><!-- $2 -->', $xmlConfiguration );
|
||||
$xmlConfiguration = preg_replace( "/(<name>)(.+?)(<\/name>)/i", "<name>" . $skinName . "</name><!-- $2 -->", $xmlConfiguration );
|
||||
$xmlConfiguration = preg_replace( "/(<description>)(.+?)(<\/description>)/i", "<description>" . $skinDescription . "</description><!-- $2 -->", $xmlConfiguration );
|
||||
$xmlConfiguration = preg_replace( "/(<author>)(.+?)(<\/author>)/i", "<author>" . $skinAuthor . "</author><!-- $2 -->", $xmlConfiguration );
|
||||
$xmlConfiguration = preg_replace( "/(<createDate>)(.+?)(<\/createDate>)/i", "<createDate>" . date( "Y-m-d H:i:s" ) . "</createDate><!-- $2 -->", $xmlConfiguration );
|
||||
$xmlConfiguration = preg_replace( "/(<modifiedDate>)(.+?)(<\/modifiedDate>)/i", "<modifiedDate>" . date( "Y-m-d H:i:s" ) . "</modifiedDate><!-- $2 -->", $xmlConfiguration );
|
||||
file_put_contents( $configFileFinal, $xmlConfiguration );
|
||||
|
||||
$response['success'] = true;
|
||||
$response['message'] = G::LoadTranslation('ID_SKIN_SUCCESS_CREATE');
|
||||
print_r(G::json_encode($response));
|
||||
$response['message'] = G::LoadTranslation( 'ID_SKIN_SUCCESS_CREATE' );
|
||||
print_r( G::json_encode( $response ) );
|
||||
} catch (Exception $e) {
|
||||
$response['success'] = false;
|
||||
$response['message'] = $e->getMessage();
|
||||
$response['error'] = $e->getMessage();
|
||||
print_r(G::json_encode($response));
|
||||
print_r( G::json_encode( $response ) );
|
||||
}
|
||||
}
|
||||
|
||||
function importSkin()
|
||||
function importSkin ()
|
||||
{
|
||||
try {
|
||||
if (!isset($_FILES['uploadedFile'])) {
|
||||
throw ( new Exception(G::LoadTranslation('ID_SKIN_FILE_REQUIRED')) );
|
||||
if (! isset( $_FILES['uploadedFile'] )) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_FILE_REQUIRED' ) ));
|
||||
}
|
||||
$uploadedInstances = count($_FILES['uploadedFile']['name']);
|
||||
$uploadedInstances = count( $_FILES['uploadedFile']['name'] );
|
||||
$sw_error = false;
|
||||
$sw_error_exists = isset($_FILES['uploadedFile']['error']);
|
||||
$sw_error_exists = isset( $_FILES['uploadedFile']['error'] );
|
||||
$emptyInstances = 0;
|
||||
$quequeUpload = array();
|
||||
$quequeUpload = array ();
|
||||
|
||||
// upload files & check for errors
|
||||
$tmp = $_FILES['uploadedFile']['tmp_name'];
|
||||
$items = stripslashes($_FILES['uploadedFile']['name']);
|
||||
$items = stripslashes( $_FILES['uploadedFile']['name'] );
|
||||
if ($sw_error_exists) {
|
||||
$up_err = $_FILES['uploadedFile']['error'];
|
||||
} else {
|
||||
$up_err= ( file_exists($tmp) ? 0 : 4);
|
||||
$up_err = (file_exists( $tmp ) ? 0 : 4);
|
||||
}
|
||||
|
||||
if ($items == "" || $up_err == 4) {
|
||||
throw ( new Exception(G::LoadTranslation('ID_SKIN_FILE_REQUIRED')));
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_FILE_REQUIRED' ) ));
|
||||
}
|
||||
if ($up_err == 1 || $up_err == 2) {
|
||||
throw ( new Exception(G::LoadTranslation('ID_FILE_TOO_BIG')));
|
||||
throw (new Exception( G::LoadTranslation( 'ID_FILE_TOO_BIG' ) ));
|
||||
//$errors[$i]='miscfilesize';
|
||||
}
|
||||
if ($up_err == 3) {
|
||||
throw ( new Exception(G::LoadTranslation('ID_ERROR_UPLOAD_FILE_CONTACT_ADMINISTRATOR')));
|
||||
throw (new Exception( G::LoadTranslation( 'ID_ERROR_UPLOAD_FILE_CONTACT_ADMINISTRATOR' ) ));
|
||||
//$errors[$i]='miscfilepart';
|
||||
}
|
||||
if (!@is_uploaded_file($tmp)) {
|
||||
throw ( new Exception(G::LoadTranslation('ID_ERROR_UPLOAD_FILE_CONTACT_ADMINISTRATOR')));
|
||||
if (! @is_uploaded_file( $tmp )) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_ERROR_UPLOAD_FILE_CONTACT_ADMINISTRATOR' ) ));
|
||||
//$errors[$i]='uploadfile';
|
||||
}
|
||||
$fileInfo = pathinfo($items);
|
||||
$validType = array('tar', 'gz');
|
||||
$fileInfo = pathinfo( $items );
|
||||
$validType = array ('tar','gz'
|
||||
);
|
||||
|
||||
if (!in_array($fileInfo['extension'], $validType)) {
|
||||
throw ( new Exception(G::LoadTranslation('ID_FILE_UPLOAD_INCORRECT_EXTENSION')));
|
||||
if (! in_array( $fileInfo['extension'], $validType )) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_FILE_UPLOAD_INCORRECT_EXTENSION' ) ));
|
||||
//$errors[$i]='wrongtype';
|
||||
}
|
||||
|
||||
$filename = $items;
|
||||
$tempPath = PATH_CUSTOM_SKINS . '.tmp' . PATH_SEP;
|
||||
G::verifyPath($tempPath, true);
|
||||
G::verifyPath( $tempPath, true );
|
||||
$tempName = $tmp;
|
||||
G::uploadFile($tempName, $tempPath, $filename);
|
||||
G::LoadThirdParty('pear/Archive', 'Tar');
|
||||
$tar = new Archive_Tar($tempPath . $filename);
|
||||
G::uploadFile( $tempName, $tempPath, $filename );
|
||||
G::LoadThirdParty( 'pear/Archive', 'Tar' );
|
||||
$tar = new Archive_Tar( $tempPath . $filename );
|
||||
$aFiles = $tar->listContent();
|
||||
$swConfigFile = false;
|
||||
|
||||
foreach ($aFiles as $key => $val) {
|
||||
if (basename($val['filename']) == 'config.xml') {
|
||||
$skinName = dirname($val['filename']);
|
||||
$skinArray = explode("/", $skinName);
|
||||
if (count($skinArray) == 1) {
|
||||
if (basename( $val['filename'] ) == 'config.xml') {
|
||||
$skinName = dirname( $val['filename'] );
|
||||
$skinArray = explode( "/", $skinName );
|
||||
if (count( $skinArray ) == 1) {
|
||||
$swConfigFile = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$swConfigFile) {
|
||||
@unlink(PATH_CUSTOM_SKINS . '.tmp' . PATH_SEP . $filename);
|
||||
throw ( new Exception(G::LoadTranslation('ID_SKIN_CONFIGURATION_MISSING')));
|
||||
if (! $swConfigFile) {
|
||||
@unlink( PATH_CUSTOM_SKINS . '.tmp' . PATH_SEP . $filename );
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_CONFIGURATION_MISSING' ) ));
|
||||
}
|
||||
|
||||
if (is_dir(PATH_CUSTOM_SKINS . $skinName)) {
|
||||
if ((isset($_REQUEST['overwrite_files'])) && ($_REQUEST['overwrite_files'] == 'on')) {
|
||||
G::rm_dir(PATH_CUSTOM_SKINS . $skinName, false);
|
||||
if (is_dir( PATH_CUSTOM_SKINS . $skinName )) {
|
||||
if ((isset( $_REQUEST['overwrite_files'] )) && ($_REQUEST['overwrite_files'] == 'on')) {
|
||||
G::rm_dir( PATH_CUSTOM_SKINS . $skinName, false );
|
||||
} else {
|
||||
throw ( new Exception(G::LoadTranslation('ID_SKIN_ALREADY_EXISTS')));
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_ALREADY_EXISTS' ) ));
|
||||
}
|
||||
}
|
||||
$res = $tar->extract(PATH_CUSTOM_SKINS);
|
||||
if (!$res) {
|
||||
throw ( new Exception(G::LoadTranslation('ID_SKIN_ERROR_EXTRACTING')));
|
||||
$res = $tar->extract( PATH_CUSTOM_SKINS );
|
||||
if (! $res) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_ERROR_EXTRACTING' ) ));
|
||||
}
|
||||
//Delete Temporal
|
||||
@unlink(PATH_CUSTOM_SKINS . '.tmp' . PATH_SEP . $filename);
|
||||
@unlink( PATH_CUSTOM_SKINS . '.tmp' . PATH_SEP . $filename );
|
||||
|
||||
$response['success'] = true;
|
||||
$response['message'] = G::LoadTranslation('ID_SKIN_SUCCESSFUL_IMPORTED');
|
||||
print_r(G::json_encode($response));
|
||||
$response['message'] = G::LoadTranslation( 'ID_SKIN_SUCCESSFUL_IMPORTED' );
|
||||
print_r( G::json_encode( $response ) );
|
||||
} catch (Exception $e) {
|
||||
$response['success'] = false;
|
||||
$response['message'] = $e->getMessage();
|
||||
$response['error'] = $e->getMessage();
|
||||
print_r(G::json_encode($response));
|
||||
print_r( G::json_encode( $response ) );
|
||||
}
|
||||
}
|
||||
|
||||
function exportSkin($skinToExport="")
|
||||
function exportSkin ($skinToExport = "")
|
||||
{
|
||||
try {
|
||||
if (!isset($_REQUEST['SKIN_FOLDER_ID'])) {
|
||||
throw ( new Exception(G::LoadTranslation('ID_SKIN_NAME_REQUIRED')) );
|
||||
if (! isset( $_REQUEST['SKIN_FOLDER_ID'] )) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_NAME_REQUIRED' ) ));
|
||||
}
|
||||
|
||||
$skinName = $_REQUEST['SKIN_FOLDER_ID'];
|
||||
@@ -257,113 +252,116 @@ function exportSkin($skinToExport="")
|
||||
$skinFolderBase = PATH_CUSTOM_SKINS . $skinName;
|
||||
$skinFolder = $skinFolderBase . PATH_SEP;
|
||||
$skinTar = PATH_CUSTOM_SKINS . $skinName . '.tar';
|
||||
if (!is_dir($skinFolder)) {
|
||||
throw ( new Exception(G::LoadTranslation('ID_SKIN_DOESNT_EXIST')) );
|
||||
if (! is_dir( $skinFolder )) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_DOESNT_EXIST' ) ));
|
||||
}
|
||||
if (!file_exists($skinFolder . "config.xml")) {
|
||||
throw ( new Exception(G::LoadTranslation('ID_SKIN_CONFIGURATION_MISSING')) );
|
||||
if (! file_exists( $skinFolder . "config.xml" )) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_CONFIGURATION_MISSING' ) ));
|
||||
}
|
||||
|
||||
if (file_exists($skinTar)) {
|
||||
if (file_exists( $skinTar )) {
|
||||
//try to delete
|
||||
if (!unlink($skinTar)) {
|
||||
throw ( new Exception(G::LoadTranslation('ID_SKIN_FOLDER_PERMISSIONS')) );
|
||||
if (! unlink( $skinTar )) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_FOLDER_PERMISSIONS' ) ));
|
||||
}
|
||||
}
|
||||
|
||||
//Try to generate tar file
|
||||
G::LoadThirdParty('pear/Archive', 'Tar');
|
||||
$tar = new Archive_Tar($skinTar);
|
||||
G::LoadThirdParty( 'pear/Archive', 'Tar' );
|
||||
$tar = new Archive_Tar( $skinTar );
|
||||
$tar->_compress = false;
|
||||
|
||||
addTarFolder($tar, $skinFolder, PATH_CUSTOM_SKINS);
|
||||
addTarFolder( $tar, $skinFolder, PATH_CUSTOM_SKINS );
|
||||
|
||||
$response['success'] = true;
|
||||
$response['message'] = $skinTar;
|
||||
|
||||
print_r(G::json_encode($response));
|
||||
print_r( G::json_encode( $response ) );
|
||||
} catch (Exception $e) {
|
||||
$response['success'] = false;
|
||||
$response['message'] = $e->getMessage();
|
||||
print_r(G::json_encode($response));
|
||||
print_r( G::json_encode( $response ) );
|
||||
}
|
||||
}
|
||||
function deleteSkin()
|
||||
|
||||
function deleteSkin ()
|
||||
{
|
||||
try {
|
||||
if (!(isset($_REQUEST['SKIN_FOLDER_ID']))) {
|
||||
throw (new Exception(G::LoadTranslation('ID_SKIN_FOLDER_REQUIRED')));
|
||||
if (! (isset( $_REQUEST['SKIN_FOLDER_ID'] ))) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_FOLDER_REQUIRED' ) ));
|
||||
}
|
||||
if (($_REQUEST['SKIN_FOLDER_ID'])=="classic") {
|
||||
throw (new Exception(G::LoadTranslation('ID_SKIN_FOLDER_NOT_DELETEABLE')));
|
||||
if (($_REQUEST['SKIN_FOLDER_ID']) == "classic") {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_FOLDER_NOT_DELETEABLE' ) ));
|
||||
}
|
||||
$folderId=$_REQUEST['SKIN_FOLDER_ID'];
|
||||
if (!is_dir(PATH_CUSTOM_SKINS.$folderId)) {
|
||||
throw (new Exception(G::LoadTranslation('ID_SKIN_NOT_EXISTS')));
|
||||
$folderId = $_REQUEST['SKIN_FOLDER_ID'];
|
||||
if (! is_dir( PATH_CUSTOM_SKINS . $folderId )) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_NOT_EXISTS' ) ));
|
||||
}
|
||||
//Delete
|
||||
G::rm_dir(PATH_CUSTOM_SKINS.$folderId);
|
||||
G::rm_dir( PATH_CUSTOM_SKINS . $folderId );
|
||||
$response['success'] = true;
|
||||
$response['message'] = "$folderId deleted";
|
||||
} catch (Exception $e) {
|
||||
$response['success'] = false;
|
||||
$response['error']=$response['message'] = $e->getMessage();
|
||||
print_r(G::json_encode($response));
|
||||
$response['error'] = $response['message'] = $e->getMessage();
|
||||
print_r( G::json_encode( $response ) );
|
||||
}
|
||||
}
|
||||
function streamSkin()
|
||||
|
||||
function streamSkin ()
|
||||
{
|
||||
$skinTar = $_REQUEST['file'];
|
||||
$bDownload = true;
|
||||
G::streamFile($skinTar, $bDownload, basename($skinTar));
|
||||
@unlink($fileTar);
|
||||
G::streamFile( $skinTar, $bDownload, basename( $skinTar ) );
|
||||
@unlink( $fileTar );
|
||||
}
|
||||
|
||||
function addTarFolder($tar, $pathBase, $pluginHome)
|
||||
function addTarFolder ($tar, $pathBase, $pluginHome)
|
||||
{
|
||||
$aux = explode(PATH_SEP, $pathBase);
|
||||
if ($aux[count($aux) - 2] == '.svn') {
|
||||
$aux = explode( PATH_SEP, $pathBase );
|
||||
if ($aux[count( $aux ) - 2] == '.svn') {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($handle = opendir($pathBase)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if (is_file($pathBase . $file)) {
|
||||
if ($handle = opendir( $pathBase )) {
|
||||
while (false !== ($file = readdir( $handle ))) {
|
||||
if (is_file( $pathBase . $file )) {
|
||||
//print "file $file \n";
|
||||
$tar->addModify($pathBase . $file, '', $pluginHome);
|
||||
$tar->addModify( $pathBase . $file, '', $pluginHome );
|
||||
}
|
||||
if (is_dir($pathBase . $file) && $file != '..' && $file != '.') {
|
||||
if (is_dir( $pathBase . $file ) && $file != '..' && $file != '.') {
|
||||
//print "dir $pathBase$file \n";
|
||||
addTarFolder($tar, $pathBase . $file . PATH_SEP, $pluginHome);
|
||||
addTarFolder( $tar, $pathBase . $file . PATH_SEP, $pluginHome );
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
closedir( $handle );
|
||||
}
|
||||
}
|
||||
|
||||
function copy_skin_folder($path, $dest, $exclude=array())
|
||||
function copy_skin_folder ($path, $dest, $exclude = array())
|
||||
{
|
||||
$defaultExcluded=array(".","..");
|
||||
$excludedItems=array_merge($defaultExcluded,$exclude);
|
||||
if (is_dir($path)) {
|
||||
@mkdir($dest);
|
||||
$objects = scandir($path);
|
||||
if (sizeof($objects) > 0) {
|
||||
$defaultExcluded = array (".",".."
|
||||
);
|
||||
$excludedItems = array_merge( $defaultExcluded, $exclude );
|
||||
if (is_dir( $path )) {
|
||||
@mkdir( $dest );
|
||||
$objects = scandir( $path );
|
||||
if (sizeof( $objects ) > 0) {
|
||||
foreach ($objects as $file) {
|
||||
if (in_array($file,$excludedItems)) {
|
||||
if (in_array( $file, $excludedItems )) {
|
||||
continue;
|
||||
}
|
||||
// go on
|
||||
if (is_dir($path . PATH_SEP . $file)) {
|
||||
copy_skin_folder($path . PATH_SEP . $file, $dest . PATH_SEP . $file,$exclude);
|
||||
if (is_dir( $path . PATH_SEP . $file )) {
|
||||
copy_skin_folder( $path . PATH_SEP . $file, $dest . PATH_SEP . $file, $exclude );
|
||||
} else {
|
||||
copy($path . PATH_SEP . $file, $dest . PATH_SEP . $file);
|
||||
copy( $path . PATH_SEP . $file, $dest . PATH_SEP . $file );
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} elseif (is_file($path)) {
|
||||
return copy($path, $dest);
|
||||
} elseif (is_file( $path )) {
|
||||
return copy( $path, $dest );
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* skinsExport.php
|
||||
*
|
||||
@@ -20,27 +21,28 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
function copyFile ( $input, $output ) {
|
||||
$content = file_get_contents ( $input );
|
||||
$filename = $output . PATH_SEP . basename ( $input );
|
||||
return file_put_contents ( $filename, $content );
|
||||
}
|
||||
function copyFile ($input, $output)
|
||||
{
|
||||
$content = file_get_contents( $input );
|
||||
$filename = $output . PATH_SEP . basename( $input );
|
||||
return file_put_contents( $filename, $content );
|
||||
}
|
||||
|
||||
function savePluginFile ( $tplName, $fileName, $fields ) {
|
||||
$pluginTpl = PATH_GULLIVER_HOME . 'bin' . PATH_SEP . 'tasks' .PATH_SEP . 'templates' . PATH_SEP . $tplName . '.tpl';
|
||||
function savePluginFile ($tplName, $fileName, $fields)
|
||||
{
|
||||
$pluginTpl = PATH_GULLIVER_HOME . 'bin' . PATH_SEP . 'tasks' . PATH_SEP . 'templates' . PATH_SEP . $tplName . '.tpl';
|
||||
$template = new TemplatePower( $pluginTpl );
|
||||
$template->prepare();
|
||||
|
||||
if ( is_array ($fields) ) {
|
||||
foreach ( $fields as $block => $data ) {
|
||||
if (is_array( $fields )) {
|
||||
foreach ($fields as $block => $data) {
|
||||
$template->gotoBlock( "_ROOT" );
|
||||
if ( is_array( $data) )
|
||||
foreach ( $data as $rowId => $row ) {
|
||||
if (is_array( $data ))
|
||||
foreach ($data as $rowId => $row) {
|
||||
$template->newBlock( $block );
|
||||
foreach ( $row as $key => $val )
|
||||
foreach ($row as $key => $val)
|
||||
$template->assign( $key, $val );
|
||||
}
|
||||
else
|
||||
@@ -49,38 +51,40 @@
|
||||
}
|
||||
|
||||
$content = $template->getOutputContent();
|
||||
$iSize = file_put_contents ( $fileName, $content );
|
||||
$iSize = file_put_contents( $fileName, $content );
|
||||
return $iSize;
|
||||
}
|
||||
}
|
||||
|
||||
function addTarFolder ( $tar, $pathBase,$pluginHome ) {
|
||||
$aux = explode( PATH_SEP, $pathBase);
|
||||
if ( $aux[count($aux) -2 ] == '.svn' ) return;
|
||||
function addTarFolder ($tar, $pathBase, $pluginHome)
|
||||
{
|
||||
$aux = explode( PATH_SEP, $pathBase );
|
||||
if ($aux[count( $aux ) - 2] == '.svn')
|
||||
return;
|
||||
|
||||
if ($handle = opendir( $pathBase )) {
|
||||
while ( false !== ($file = readdir($handle))) {
|
||||
if ( is_file ( $pathBase . $file ) ) {
|
||||
while (false !== ($file = readdir( $handle ))) {
|
||||
if (is_file( $pathBase . $file )) {
|
||||
//print "file $file \n";
|
||||
$tar->addModify( $pathBase . $file,'', $pluginHome);
|
||||
$tar->addModify( $pathBase . $file, '', $pluginHome );
|
||||
}
|
||||
if ( is_dir ( $pathBase . $file ) && $file != '..' && $file != '.' ) {
|
||||
if (is_dir( $pathBase . $file ) && $file != '..' && $file != '.') {
|
||||
//print "dir $pathBase$file \n";
|
||||
addTarFolder ( $tar, $pathBase . $file . PATH_SEP ,$pluginHome);
|
||||
addTarFolder( $tar, $pathBase . $file . PATH_SEP, $pluginHome );
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
closedir( $handle );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function packPlugin ( $pluginName, $version ) {
|
||||
function packPlugin ($pluginName, $version)
|
||||
{
|
||||
|
||||
$pathBase = PATH_DATA . 'skins' . PATH_SEP . $pluginName . PATH_SEP;
|
||||
$pathHome = PATH_DATA . 'skins' . PATH_SEP . $pluginName ;
|
||||
$pathHome = PATH_DATA . 'skins' . PATH_SEP . $pluginName;
|
||||
$fileTar = PATH_DATA . 'skins' . PATH_SEP . $pluginName . '-' . $version . '.tar';
|
||||
|
||||
G::LoadSystem ('templatePower');
|
||||
/*
|
||||
G::LoadSystem( 'templatePower' );
|
||||
/*
|
||||
$pluginDirectory = PATH_PLUGINS . $pluginName;
|
||||
$pluginOutDirectory = PATH_OUTTRUNK . 'plugins' . PATH_SEP . $pluginName;
|
||||
$pluginHome = PATH_OUTTRUNK . 'plugins' . PATH_SEP . $pluginName;
|
||||
@@ -92,93 +96,92 @@
|
||||
die ;
|
||||
}
|
||||
*/
|
||||
G::LoadThirdParty( 'pear/Archive','Tar');
|
||||
$tar = new Archive_Tar ( $fileTar);
|
||||
$tar->_compress=false;
|
||||
G::LoadThirdParty( 'pear/Archive', 'Tar' );
|
||||
$tar = new Archive_Tar( $fileTar );
|
||||
$tar->_compress = false;
|
||||
|
||||
//$tar->createModify( $pathHome . PATH_SEP . $pluginName . '.php' ,'', $pathHome);
|
||||
addTarFolder ( $tar, $pathBase, $pathHome );
|
||||
addTarFolder( $tar, $pathBase, $pathHome );
|
||||
$aFiles = $tar->listContent();
|
||||
return $fileTar;
|
||||
}
|
||||
}
|
||||
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_SETUP'))
|
||||
{
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
switch ($RBAC->userCanAccess( 'PM_SETUP' )) {
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
G::LoadClass("system");
|
||||
G::LoadClass( "system" );
|
||||
|
||||
$id = $_GET['id'];
|
||||
$id = $_GET['id'];
|
||||
|
||||
$fileObj = PATH_SKINS . $id . '.cnf';
|
||||
$fileObj = PATH_SKINS . $id . '.cnf';
|
||||
|
||||
if ( !file_exists($fileObj) ) {
|
||||
if (! file_exists( $fileObj )) {
|
||||
$oConf = new stdClass();
|
||||
$oConf->name = $id;
|
||||
$oConf->description = "description of skin $id ";
|
||||
$oConf->version = 1;
|
||||
file_put_contents ( $fileObj, serialize ( $oConf) );
|
||||
}
|
||||
file_put_contents( $fileObj, serialize( $oConf ) );
|
||||
}
|
||||
|
||||
$oConf = unserialize ( file_get_contents ( $fileObj ));
|
||||
$oConf->version += 1;
|
||||
file_put_contents ( $fileObj, serialize ( $oConf) );
|
||||
$oConf = unserialize( file_get_contents( $fileObj ) );
|
||||
$oConf->version += 1;
|
||||
file_put_contents( $fileObj, serialize( $oConf ) );
|
||||
|
||||
$pathHome = PATH_DATA . 'skins' . PATH_SEP . $id . PATH_SEP;
|
||||
$pathBase = PATH_DATA . 'skins' . PATH_SEP . $id . PATH_SEP . $id . PATH_SEP;
|
||||
$pathPublic = $pathBase . 'data' . PATH_SEP . 'public_html' . PATH_SEP ;
|
||||
$pathImages = PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'images' . PATH_SEP;
|
||||
$pathHome = PATH_DATA . 'skins' . PATH_SEP . $id . PATH_SEP;
|
||||
$pathBase = PATH_DATA . 'skins' . PATH_SEP . $id . PATH_SEP . $id . PATH_SEP;
|
||||
$pathPublic = $pathBase . 'data' . PATH_SEP . 'public_html' . PATH_SEP;
|
||||
$pathImages = PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'images' . PATH_SEP;
|
||||
|
||||
G::mk_dir ( $pathBase );
|
||||
G::mk_dir ( $pathBase . 'data' );
|
||||
G::mk_dir ( $pathPublic );
|
||||
G::mk_dir ( $pathPublic . 'images' );
|
||||
G::mk_dir( $pathBase );
|
||||
G::mk_dir( $pathBase . 'data' );
|
||||
G::mk_dir( $pathPublic );
|
||||
G::mk_dir( $pathPublic . 'images' );
|
||||
|
||||
// file_put_contents ( PATH_DATA . 'skins' . PATH_SEP . $id , "hello world" );
|
||||
$fields['className'] = $id;
|
||||
$fields['version'] = $oConf->version;
|
||||
$fields['description'] = $oConf->description;
|
||||
$fields['PMversion'] = System::getVersion();
|
||||
savePluginFile ( 'skinPluginMainClass' , $pathHome . $id . '.php', $fields );
|
||||
$fields['className'] = $id;
|
||||
$fields['version'] = $oConf->version;
|
||||
$fields['description'] = $oConf->description;
|
||||
$fields['PMversion'] = System::getVersion();
|
||||
savePluginFile( 'skinPluginMainClass', $pathHome . $id . '.php', $fields );
|
||||
|
||||
savePluginFile ( 'skinPluginClass' , $pathBase . 'class.' . $id . '.php', $fields );
|
||||
savePluginFile( 'skinPluginClass', $pathBase . 'class.' . $id . '.php', $fields );
|
||||
|
||||
copyFile ( PATH_SKINS . $id . '.php' , $pathBase . 'data' );
|
||||
copyFile ( PATH_SKINS . $id . '.html' , $pathBase . 'data' );
|
||||
copyFile ( PATH_SKINS . $id . '.cnf' , $pathBase . 'data' );
|
||||
copyFile( PATH_SKINS . $id . '.php', $pathBase . 'data' );
|
||||
copyFile( PATH_SKINS . $id . '.html', $pathBase . 'data' );
|
||||
copyFile( PATH_SKINS . $id . '.cnf', $pathBase . 'data' );
|
||||
|
||||
copyFile ( PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'iepngfix.htc' , $pathPublic );
|
||||
copyFile ( PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'style.css' , $pathPublic );
|
||||
copyFile( PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'iepngfix.htc', $pathPublic );
|
||||
copyFile( PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'style.css', $pathPublic );
|
||||
|
||||
|
||||
$aFiles = array ();
|
||||
if ($handle = opendir( $pathImages )) {
|
||||
while ( false !== ($file = readdir($handle))) {
|
||||
if ( substr($file,0,1) != '.' ) {
|
||||
if ( isset($aFiles[ $file ]) ) $aFiles[$file] = 0;
|
||||
copyFile ( $pathImages. $file , $pathPublic . 'images' . PATH_SEP );
|
||||
$aFiles = array ();
|
||||
if ($handle = opendir( $pathImages )) {
|
||||
while (false !== ($file = readdir( $handle ))) {
|
||||
if (substr( $file, 0, 1 ) != '.') {
|
||||
if (isset( $aFiles[$file] ))
|
||||
$aFiles[$file] = 0;
|
||||
copyFile( $pathImages . $file, $pathPublic . 'images' . PATH_SEP );
|
||||
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
closedir( $handle );
|
||||
}
|
||||
|
||||
$fileTar = packPlugin ( $id, $oConf->version );
|
||||
$fileTar = packPlugin( $id, $oConf->version );
|
||||
|
||||
$bDownload = true;
|
||||
G::streamFile( $fileTar, $bDownload, basename( $fileTar ) );
|
||||
|
||||
$bDownload = true;
|
||||
G::streamFile ( $fileTar, $bDownload, basename($fileTar) );
|
||||
@G::rm_dir( $pathHome );
|
||||
@unlink( $fileTar );
|
||||
|
||||
@G::rm_dir ($pathHome);
|
||||
@unlink ($fileTar);
|
||||
|
||||
@@ -20,13 +20,12 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1){
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
//G::header('location: ../login/login');
|
||||
die;
|
||||
die();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
@@ -34,120 +33,117 @@ $G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CALENDAR';
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
G::LoadClass('configuration');
|
||||
G::LoadClass( 'configuration' );
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration('skinList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
$configPage = $c->getConfiguration( 'skinList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('setup/skinList', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('setup/skinList'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('CONFIG', $Config);
|
||||
$oHeadPublisher->assign('SYS_SKIN', SYS_SKIN);
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'setup/skinList', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'setup/skinList' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'CONFIG', $Config );
|
||||
$oHeadPublisher->assign( 'SYS_SKIN', SYS_SKIN );
|
||||
|
||||
$oHeadPublisher->assign('FORMATS',$c->getFormats());
|
||||
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
die;
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
die();
|
||||
|
||||
global $RBAC;
|
||||
$access = $RBAC->userCanAccess('PM_SETUP');
|
||||
if( $access != 1 ){
|
||||
switch ($access)
|
||||
{
|
||||
case -1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
$access = $RBAC->userCanAccess( 'PM_SETUP' );
|
||||
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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
// lets display the items
|
||||
$items[] = array ( 'id' => 'char', 'title' => 'char', 'type' => 'char', 'creator' => 'char' ,
|
||||
'modifiedBy' => 'char', 'filename' => 'char', 'size' => 'char', 'mime' => 'char');
|
||||
// lets display the items
|
||||
$items[] = array ('id' => 'char','title' => 'char','type' => 'char','creator' => 'char','modifiedBy' => 'char','filename' => 'char','size' => 'char','mime' => 'char'
|
||||
);
|
||||
|
||||
//***************** Skins **************************
|
||||
$aFiles = array ();
|
||||
if ($handle = opendir( PATH_SKINS )) {
|
||||
while ( false !== ($file = readdir($handle))) {
|
||||
G::pr($file);
|
||||
$filename = substr ( $file,0, strrpos($file, '.'));
|
||||
//***************** Skins **************************
|
||||
$aFiles = array ();
|
||||
if ($handle = opendir( PATH_SKINS )) {
|
||||
while (false !== ($file = readdir( $handle ))) {
|
||||
G::pr( $file );
|
||||
$filename = substr( $file, 0, strrpos( $file, '.' ) );
|
||||
|
||||
// list of no complete skins
|
||||
$aFilterSkinsList = Array('blank', 'green', 'raw', 'tracker', 'iphone', 'green-submenu', 'extJsInitLoad', 'extJs' );
|
||||
$aFilterSkinsList = Array ('blank','green','raw','tracker','iphone','green-submenu','extJsInitLoad','extJs'
|
||||
);
|
||||
|
||||
if ( !is_dir(PATH_SKINS. $file) ) {
|
||||
if ( !in_array($filename, $aFilterSkinsList) /*&& /*/ && !strpos($file, '.tar', 1) ) {
|
||||
if ( !isset($aFiles[ $filename ]) ) $aFiles[$filename] = 0;
|
||||
if ( strpos($file, '.php', 1) ) $aFiles[ $filename ] += 1;
|
||||
if ( strpos($file, '.html',1) ) $aFiles[ $filename ] += 2;
|
||||
if (! is_dir( PATH_SKINS . $file )) {
|
||||
if (! in_array( $filename, $aFilterSkinsList ) /*&& /*/ && ! strpos( $file, '.tar', 1 )) {
|
||||
if (! isset( $aFiles[$filename] ))
|
||||
$aFiles[$filename] = 0;
|
||||
if (strpos( $file, '.php', 1 ))
|
||||
$aFiles[$filename] += 1;
|
||||
if (strpos( $file, '.html', 1 ))
|
||||
$aFiles[$filename] += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closedir($handle);
|
||||
|
||||
closedir( $handle );
|
||||
|
||||
//now walk in the array to get the .cnf file and display properties
|
||||
foreach ( $aFiles as $key => $val ) {
|
||||
foreach ($aFiles as $key => $val) {
|
||||
$description = '';
|
||||
$version = '';
|
||||
if ( file_exists ( PATH_SKINS . $key . '.cnf' ) ) {
|
||||
$serial = file_get_contents ( PATH_SKINS . $key . '.cnf' );
|
||||
$previousErrorRep = ini_get("error_reporting");
|
||||
error_reporting( E_ERROR ) ;
|
||||
$prop = unserialize ( $serial );
|
||||
if (file_exists( PATH_SKINS . $key . '.cnf' )) {
|
||||
$serial = file_get_contents( PATH_SKINS . $key . '.cnf' );
|
||||
$previousErrorRep = ini_get( "error_reporting" );
|
||||
error_reporting( E_ERROR );
|
||||
$prop = unserialize( $serial );
|
||||
error_reporting( $previousErrorRep );
|
||||
if ( !is_object( $prop ) ) {
|
||||
@unlink ( PATH_SKINS . $key . '.cnf');
|
||||
if (! is_object( $prop )) {
|
||||
@unlink( PATH_SKINS . $key . '.cnf' );
|
||||
}
|
||||
if ( isset ( $prop) && isset($prop->description) ) $description = $prop->description;
|
||||
if ( isset ( $prop) && isset($prop->version ) ) $version = $prop->version;
|
||||
if (isset( $prop ) && isset( $prop->description ))
|
||||
$description = $prop->description;
|
||||
if (isset( $prop ) && isset( $prop->version ))
|
||||
$version = $prop->version;
|
||||
}
|
||||
|
||||
$linkPackValue = G::LoadTranslation('ID_EXPORT') ;
|
||||
$link = 'skinsExport?id=' . $key ;
|
||||
$items[] = array (
|
||||
'id' => count($items),
|
||||
'name' => $key,
|
||||
'filename' => $key,
|
||||
'description' => $description,
|
||||
'version' => $version,
|
||||
'url' => $link,
|
||||
'linkPackValue' => $linkPackValue
|
||||
$linkPackValue = G::LoadTranslation( 'ID_EXPORT' );
|
||||
$link = 'skinsExport?id=' . $key;
|
||||
$items[] = array ('id' => count( $items ),'name' => $key,'filename' => $key,'description' => $description,'version' => $version,'url' => $link,'linkPackValue' => $linkPackValue
|
||||
);
|
||||
}
|
||||
$folders['items'] = $items;
|
||||
}
|
||||
}
|
||||
|
||||
$_DBArray['plugins'] = $items;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$_DBArray['plugins'] = $items;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
|
||||
G::LoadClass( 'ArrayPeer');
|
||||
$c = new Criteria ('dbarray');
|
||||
$c->setDBArrayTable('plugins');
|
||||
$c->addAscendingOrderByColumn ('id');
|
||||
G::LoadClass( 'ArrayPeer' );
|
||||
$c = new Criteria( 'dbarray' );
|
||||
$c->setDBArrayTable( 'plugins' );
|
||||
$c->addAscendingOrderByColumn( 'id' );
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_SUB_MENU_SELECTED = 'SKINS';
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_SUB_MENU_SELECTED = 'SKINS';
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/skinsList', $c );
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/skinsList', $c );
|
||||
|
||||
G::RenderPage('publishBlank', 'blank');
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
|
||||
|
||||
@@ -20,39 +20,38 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
$access = $RBAC->userCanAccess('PM_SETUP');
|
||||
if( $access != 1 ){
|
||||
switch ($access)
|
||||
{
|
||||
case -1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
$access = $RBAC->userCanAccess( 'PM_SETUP' );
|
||||
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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
|
||||
return $RBAC_Response;
|
||||
|
||||
$dbc = new DBConnection;
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_SUB_MENU_SELECTED = 'SKINS';
|
||||
$dbc = new DBConnection();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_SUB_MENU_SELECTED = 'SKINS';
|
||||
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', "setup/skinsNew", '', null, "skinsSave");
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', "setup/skinsNew", '', null, "skinsSave" );
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* skinsSave.php
|
||||
*
|
||||
@@ -20,76 +21,68 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function xcopy ( $pathSource, $pathTarget ) {
|
||||
G::mk_dir ($pathTarget);
|
||||
function xcopy ($pathSource, $pathTarget)
|
||||
{
|
||||
G::mk_dir( $pathTarget );
|
||||
if ($handle = opendir( $pathSource )) {
|
||||
while ( false !== ($file = readdir($handle))) {
|
||||
if ( substr($file,0,1) != '.' && !is_dir ($file) ) {
|
||||
$content = file_get_contents ( $pathSource . $file );
|
||||
$filename = $pathTarget . $file ;
|
||||
file_put_contents ( $filename, $content );
|
||||
while (false !== ($file = readdir( $handle ))) {
|
||||
if (substr( $file, 0, 1 ) != '.' && ! is_dir( $file )) {
|
||||
$content = file_get_contents( $pathSource . $file );
|
||||
$filename = $pathTarget . $file;
|
||||
file_put_contents( $filename, $content );
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
closedir( $handle );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_SETUP'))
|
||||
{
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
switch ($RBAC->userCanAccess( 'PM_SETUP' )) {
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
G::LoadClass("system");
|
||||
G::LoadClass( "system" );
|
||||
|
||||
$id = strip_tags ( str_replace ( ' ', '_', trim ($_POST['form']['NAME']) ) );
|
||||
$desc = $_POST['form']['DESCRIPTION'];
|
||||
$id = strip_tags( str_replace( ' ', '_', trim( $_POST['form']['NAME'] ) ) );
|
||||
$desc = $_POST['form']['DESCRIPTION'];
|
||||
|
||||
$fileObj = PATH_SKINS . $id . '.cnf';
|
||||
$fileObj = PATH_SKINS . $id . '.cnf';
|
||||
|
||||
if ( !file_exists($fileObj) ) {
|
||||
if (! file_exists( $fileObj )) {
|
||||
$oConf = new stdClass();
|
||||
$oConf->name = $id;
|
||||
$oConf->description = $desc;
|
||||
$oConf->version = 1;
|
||||
file_put_contents ( $fileObj, serialize ( $oConf) );
|
||||
}
|
||||
file_put_contents( $fileObj, serialize( $oConf ) );
|
||||
}
|
||||
|
||||
$oConf = unserialize ( file_get_contents ( $fileObj ));
|
||||
$oConf = unserialize( file_get_contents( $fileObj ) );
|
||||
|
||||
$contentPHP = file_get_contents ( PATH_SKINS . 'green.php' );
|
||||
$contentPHP = str_replace ( 'green.html', $id.'.html', $contentPHP );
|
||||
file_put_contents ( PATH_SKINS . $id . '.php', $contentPHP );
|
||||
$contentPHP = file_get_contents( PATH_SKINS . 'green.php' );
|
||||
$contentPHP = str_replace( 'green.html', $id . '.html', $contentPHP );
|
||||
file_put_contents( PATH_SKINS . $id . '.php', $contentPHP );
|
||||
|
||||
$contentHTML = file_get_contents ( PATH_SKINS . 'green.html' );
|
||||
$contentHTML = str_replace ( 'green', $id , $contentHTML );
|
||||
file_put_contents ( PATH_SKINS . $id . '.html', $contentHTML );
|
||||
$contentHTML = file_get_contents( PATH_SKINS . 'green.html' );
|
||||
$contentHTML = str_replace( 'green', $id, $contentHTML );
|
||||
file_put_contents( PATH_SKINS . $id . '.html', $contentHTML );
|
||||
|
||||
$pathImages = PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'images' . PATH_SEP;
|
||||
G::mk_dir ( $pathImages );
|
||||
$pathImages = PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'images' . PATH_SEP;
|
||||
G::mk_dir( $pathImages );
|
||||
|
||||
xcopy (
|
||||
PATH_HTML . 'skins' . PATH_SEP . 'green' . PATH_SEP ,
|
||||
PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP
|
||||
);
|
||||
xcopy( PATH_HTML . 'skins' . PATH_SEP . 'green' . PATH_SEP, PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP );
|
||||
|
||||
xcopy (
|
||||
PATH_HTML . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'images'. PATH_SEP,
|
||||
PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'images'. PATH_SEP
|
||||
);
|
||||
xcopy( PATH_HTML . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'images' . PATH_SEP, PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'images' . PATH_SEP );
|
||||
|
||||
G::Header( 'Location: ../../' . $id . '/setup/skinsList' );
|
||||
|
||||
G::Header ( 'Location: ../../' . $id . '/setup/skinsList' );
|
||||
|
||||
@@ -20,55 +20,53 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
global $RBAC;
|
||||
$access = $RBAC->userCanAccess('PM_SETUP_ADVANCE');
|
||||
if( $access != 1 ){
|
||||
switch ($access)
|
||||
{
|
||||
case -1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
$access = $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' );
|
||||
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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
//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;
|
||||
$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;
|
||||
if ($postMaxSize < $uploadMaxSize)
|
||||
$uploadMaxSize = $postMaxSize;
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_ID_SUB_MENU_SELECTED = 'UPGRADE';
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_ID_SUB_MENU_SELECTED = 'UPGRADE';
|
||||
G::LoadClass( "system" );
|
||||
|
||||
G::LoadClass("system");
|
||||
$Fields['PM_VERSION'] = System::getVersion();
|
||||
$Fields['MAX_FILE_SIZE'] = $uploadMaxSize . " (" . $UPLOAD_MAX_SIZE . ") ";
|
||||
|
||||
$Fields['PM_VERSION'] = System::getVersion();
|
||||
$Fields['MAX_FILE_SIZE'] = $uploadMaxSize . " (" . $UPLOAD_MAX_SIZE . ") ";
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/upgrade', '', $Fields, 'upgrade_System');
|
||||
G::RenderPage('publishBlank', 'blank');
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/upgrade', '', $Fields, 'upgrade_System' );
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
|
||||
|
||||
@@ -40,3 +40,4 @@ $aRequiredPermissions = array('PM_LOGIN',
|
||||
'PM_FOLDERS_ADD_FOLDER',
|
||||
'PM_FOLDERS_ADD_FILE'
|
||||
);
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -30,20 +29,19 @@
|
||||
* @date May 12th, 2010
|
||||
*/
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_SETUP_ADVANCE'))
|
||||
{
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
switch ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' )) {
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
set_time_limit(0);
|
||||
set_time_limit( 0 );
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
@@ -54,28 +52,28 @@ require_once "classes/class.system.php";
|
||||
$oSystem = new System();
|
||||
|
||||
try {
|
||||
if( ! $oSystem->verifyFileForUpgrade() ){
|
||||
throw ( new Exception ("There was an error uploading the file, probably the file size if greater than upload_max_filesize parameter in php.ini, please check this parameter and try again." ) );
|
||||
if (! $oSystem->verifyFileForUpgrade()) {
|
||||
throw (new Exception( "There was an error uploading the file, probably the file size if greater than upload_max_filesize parameter in php.ini, please check this parameter and try again." ));
|
||||
}
|
||||
$oSystem->cleanupUpgradeDirectory();
|
||||
$oSystem->getUpgradedFilesList();
|
||||
|
||||
$ver = $oSystem->upgrade();
|
||||
$G_PUBLISH = new Publisher;
|
||||
$aMessage['THEMESSAGE1'] = G::LoadTranslation('ID_UPGRADE_READY') ." <b>". $ver[0] ."</b> ". G::LoadTranslation('ID_TO') ." <b>". $ver[1] ."</b>";
|
||||
$aMessage['THEMESSAGE2'] = file_get_contents($oSystem->sUpgradeFileList);
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aMessage['THEMESSAGE1'] = G::LoadTranslation( 'ID_UPGRADE_READY' ) . " <b>" . $ver[0] . "</b> " . G::LoadTranslation( 'ID_TO' ) . " <b>" . $ver[1] . "</b>";
|
||||
$aMessage['THEMESSAGE2'] = file_get_contents( $oSystem->sUpgradeFileList );
|
||||
$aMessage['THEMESSAGE3'] = '';
|
||||
|
||||
if ( !is_Array($oSystem->aErrors) || count($oSystem->aErrors) == 0 )
|
||||
$aMessage['THEMESSAGE4'] = G::LoadTranslation('ID_NONE');
|
||||
if (! is_Array( $oSystem->aErrors ) || count( $oSystem->aErrors ) == 0)
|
||||
$aMessage['THEMESSAGE4'] = G::LoadTranslation( 'ID_NONE' );
|
||||
else
|
||||
$aMessage['THEMESSAGE4'] = implode( "\n", $oSystem->aErrors) ;
|
||||
$aMessage['THEMESSAGE4'] = implode( "\n", $oSystem->aErrors );
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
if( file_exists(PATH_CORE . 'js' . PATH_SEP . 'setup' . PATH_SEP . 'upgrade_System.js') ){
|
||||
$oHeadPublisher->addScriptFile('/jscore/setup/upgrade_System.js');
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
if (file_exists( PATH_CORE . 'js' . PATH_SEP . 'setup' . PATH_SEP . 'upgrade_System.js' )) {
|
||||
$oHeadPublisher->addScriptFile( '/jscore/setup/upgrade_System.js' );
|
||||
} else {
|
||||
$oHeadPublisher->addScriptCode("function upgradeSystem(wsCount) {
|
||||
$oHeadPublisher->addScriptCode( "function upgradeSystem(wsCount) {
|
||||
document.getElementById('form[THETITLE3]').innerHTML = wsCount + ' workspaces to update.';
|
||||
document.getElementById('form[SUBTITLE4]').innerHTML = ' <img src='/images/alert.gif' width='13' height='13' border='0'> Please wait...';
|
||||
updateWorkspace(wsCount);
|
||||
@@ -93,18 +91,18 @@ try {
|
||||
updateWorkspace(id-1);
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
};");
|
||||
};" );
|
||||
}
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showInfoUpdate', '', $aMessage );
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showInfoUpdate', '', $aMessage );
|
||||
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
G::evalJScript('upgradeSystem('.count($oSystem->aWorkspaces).')');
|
||||
exit(0);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$G_PUBLISH = new Publisher;
|
||||
G::evalJScript( 'upgradeSystem(' . count( $oSystem->aWorkspaces ) . ')' );
|
||||
exit( 0 );
|
||||
} catch (Exception $e) {
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
exit(0);
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
|
||||
@@ -20,72 +20,72 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
global $DB_ADAPTER;
|
||||
global $DB_HOST;
|
||||
global $DB_USER;
|
||||
global $DB_PASS;
|
||||
global $DB_NAME;
|
||||
set_time_limit (0);
|
||||
global $DB_ADAPTER;
|
||||
global $DB_HOST;
|
||||
global $DB_USER;
|
||||
global $DB_PASS;
|
||||
global $DB_NAME;
|
||||
set_time_limit( 0 );
|
||||
|
||||
$id = '';
|
||||
if ( isset($_POST['id'] ) ) $id = $_POST['id'];
|
||||
$id = '';
|
||||
if (isset( $_POST['id'] ))
|
||||
$id = $_POST['id'];
|
||||
|
||||
G::LoadClass('languages');
|
||||
G::LoadSystem('database_mysql');
|
||||
G::LoadClass( 'languages' );
|
||||
G::LoadSystem( 'database_mysql' );
|
||||
|
||||
$aUpgradeData = unserialize( file_get_contents (PATH_DATA . 'log' . PATH_SEP . "upgrade.data.bin" ));
|
||||
$aWorkspaces = $aUpgradeData['workspaces'];
|
||||
$aUpgradeData = unserialize( file_get_contents( PATH_DATA . 'log' . PATH_SEP . "upgrade.data.bin" ) );
|
||||
$aWorkspaces = $aUpgradeData['workspaces'];
|
||||
|
||||
if ( is_array ( $aWorkspaces ) && count($aWorkspaces) > 0 ) {
|
||||
$workspace = array_shift ( $aUpgradeData['workspaces']);
|
||||
if (is_array( $aWorkspaces ) && count( $aWorkspaces ) > 0) {
|
||||
$workspace = array_shift( $aUpgradeData['workspaces'] );
|
||||
|
||||
eval ( getDatabaseCredentials(PATH_DB . $workspace . PATH_SEP . 'db.php')) ;
|
||||
$oDataBase = new database($DB_ADAPTER, $DB_HOST, $DB_USER, $DB_PASS, $DB_NAME);
|
||||
eval( getDatabaseCredentials( PATH_DB . $workspace . PATH_SEP . 'db.php' ) );
|
||||
$oDataBase = new database( $DB_ADAPTER, $DB_HOST, $DB_USER, $DB_PASS, $DB_NAME );
|
||||
$oDataBase->iFetchType = MYSQL_NUM;
|
||||
|
||||
//processing .po file
|
||||
if ( $aUpgradeData['sPoFile'] != '' ) {
|
||||
if ($aUpgradeData['sPoFile'] != '') {
|
||||
$oLanguages = new languages();
|
||||
$oLanguages->importLanguage($aUpgradeData['sPoFile'], $aUpgradeData['bForceXmlPoFile'] );
|
||||
$oLanguages->importLanguage( $aUpgradeData['sPoFile'], $aUpgradeData['bForceXmlPoFile'] );
|
||||
$aUpgradeData['bForceXmlPoFile'] = false;
|
||||
}
|
||||
|
||||
if ($aUpgradeData['sSchemaFile'] != '')
|
||||
processMasterSchemaFile( $aUpgradeData['sSchemaFile'] );
|
||||
|
||||
|
||||
//draw a gauge control indicating the progress in workspaces
|
||||
$gauge = intval( (( $aUpgradeData['wsQuantity'] - count($aWorkspaces) + 1 ) / $aUpgradeData['wsQuantity'] ) * 301 );
|
||||
$gauge = intval( (($aUpgradeData['wsQuantity'] - count( $aWorkspaces ) + 1) / $aUpgradeData['wsQuantity']) * 301 );
|
||||
print "<table cellpadding=0><tr><td><img src='/images/ajax-loader.gif' border=0/></td><td>";
|
||||
print "<div style='border-style:solid;border-width:1px; border-color: #A1C868; width:300px; height:19px;' >";
|
||||
print "<div style='color:#FFF; height:16px; text-align:center; padding-top:3px; background-image: url(/skins/green/images/bm.jpg); background-repeat: repeat-x; width: {$gauge}px' ></div> </div>";
|
||||
print "</td><td width='40%'><font color=black> Upgrading the workspace </font><b><font color=green>$workspace</font></b></td><td width=250 align=right>| $id Remaining</td></tr></table>";
|
||||
file_put_contents (PATH_DATA . 'log' . PATH_SEP . "upgrade.data.bin", serialize($aUpgradeData) );
|
||||
}
|
||||
else {
|
||||
file_put_contents( PATH_DATA . 'log' . PATH_SEP . "upgrade.data.bin", serialize( $aUpgradeData ) );
|
||||
} else {
|
||||
print "<table cellpadding=0><tr><td> </td><td>";
|
||||
print "<div style='border-style:solid;border-width:1px; border-color: #A1C868; width:300px; height:19px;' >";
|
||||
print "<div style='color:#FFF; height:16px; text-align:center; padding-top:3px; background-image: url(/skins/green/images/bm.jpg); background-repeat: repeat-x; width: 301px' ></div> </div>";
|
||||
print "</td><td> Finished! All workspaces were upgraded successfully.</td></tr></table>";
|
||||
}
|
||||
}
|
||||
|
||||
die;
|
||||
die();
|
||||
|
||||
function getDatabaseCredentials ( $dbFile ) {
|
||||
function getDatabaseCredentials ($dbFile)
|
||||
{
|
||||
$sContent = file_get_contents( $dbFile );
|
||||
$sContent = str_replace('<?php', '', $sContent);
|
||||
$sContent = str_replace('<?', '', $sContent);
|
||||
$sContent = str_replace('?>', '', $sContent);
|
||||
$sContent = str_replace('define', '', $sContent);
|
||||
$sContent = str_replace("('", '$', $sContent);
|
||||
$sContent = str_replace("',", '=', $sContent);
|
||||
$sContent = str_replace(");", ';', $sContent);
|
||||
$sContent = str_replace( '<?php', '', $sContent );
|
||||
$sContent = str_replace( '<?', '', $sContent );
|
||||
$sContent = str_replace( '?>', '', $sContent );
|
||||
$sContent = str_replace( 'define', '', $sContent );
|
||||
$sContent = str_replace( "('", '$', $sContent );
|
||||
$sContent = str_replace( "',", '=', $sContent );
|
||||
$sContent = str_replace( ");", ';', $sContent );
|
||||
return $sContent;
|
||||
}
|
||||
|
||||
function processMasterSchemaFile ( $sSchemaFile ) {
|
||||
function processMasterSchemaFile ($sSchemaFile)
|
||||
{
|
||||
global $DB_ADAPTER;
|
||||
global $DB_HOST;
|
||||
global $DB_USER;
|
||||
@@ -94,32 +94,31 @@ function processMasterSchemaFile ( $sSchemaFile ) {
|
||||
global $aUpgradeData;
|
||||
|
||||
//convert newSchema to array
|
||||
if ( isset($aUpgradeData['aNewSchema']) ) {
|
||||
if (isset( $aUpgradeData['aNewSchema'] )) {
|
||||
$aNewSchema = $aUpgradeData['aNewSchema'];
|
||||
}
|
||||
else {
|
||||
$aNewSchema = schemaToArray($sSchemaFile);
|
||||
} else {
|
||||
$aNewSchema = schemaToArray( $sSchemaFile );
|
||||
$aUpgradeData['aNewSchema'] = $aNewSchema;
|
||||
}
|
||||
$aOldSchema = processSchemaFile();
|
||||
if ( is_null($aOldSchema) ) {
|
||||
if (is_null( $aOldSchema )) {
|
||||
return;
|
||||
}
|
||||
$aChanges = obtainChanges($aOldSchema, $aNewSchema);
|
||||
$aChanges = obtainChanges( $aOldSchema, $aNewSchema );
|
||||
|
||||
$oDataBase = new database($DB_ADAPTER, $DB_HOST, $DB_USER, $DB_PASS, $DB_NAME);
|
||||
if ( !$oDataBase->isConnected() ) {
|
||||
$oDataBase = new database( $DB_ADAPTER, $DB_HOST, $DB_USER, $DB_PASS, $DB_NAME );
|
||||
if (! $oDataBase->isConnected()) {
|
||||
return;
|
||||
}
|
||||
$oDataBase->iFetchType = MYSQL_NUM;
|
||||
|
||||
$oDataBase->logQuery ( count ($aChanges ) );
|
||||
$oDataBase->logQuery( count( $aChanges ) );
|
||||
|
||||
foreach ($aChanges['tablesToAdd'] as $sTable => $aColumns) {
|
||||
$oDataBase->executeQuery($oDataBase->generateCreateTableSQL($sTable, $aColumns));
|
||||
if (isset($aChanges['tablesToAdd'][$sTable]['INDEXES'])) {
|
||||
$oDataBase->executeQuery( $oDataBase->generateCreateTableSQL( $sTable, $aColumns ) );
|
||||
if (isset( $aChanges['tablesToAdd'][$sTable]['INDEXES'] )) {
|
||||
foreach ($aChanges['tablesToAdd'][$sTable]['INDEXES'] as $indexName => $aIndex) {
|
||||
$oDataBase->executeQuery($oDataBase->generateAddKeysSQL($sTable, $indexName, $aIndex ) );
|
||||
$oDataBase->executeQuery( $oDataBase->generateAddKeysSQL( $sTable, $indexName, $aIndex ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,13 +128,13 @@ function processMasterSchemaFile ( $sSchemaFile ) {
|
||||
foreach ($aAction as $sColumn => $vData) {
|
||||
switch ($sAction) {
|
||||
case 'DROP':
|
||||
$oDataBase->executeQuery($oDataBase->generateDropColumnSQL($sTable, $vData));
|
||||
$oDataBase->executeQuery( $oDataBase->generateDropColumnSQL( $sTable, $vData ) );
|
||||
break;
|
||||
case 'ADD':
|
||||
$oDataBase->executeQuery($oDataBase->generateAddColumnSQL($sTable, $sColumn, $vData));
|
||||
$oDataBase->executeQuery( $oDataBase->generateAddColumnSQL( $sTable, $sColumn, $vData ) );
|
||||
break;
|
||||
case 'CHANGE':
|
||||
$oDataBase->executeQuery($oDataBase->generateChangeColumnSQL($sTable, $sColumn, $vData));
|
||||
$oDataBase->executeQuery( $oDataBase->generateChangeColumnSQL( $sTable, $sColumn, $vData ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -143,22 +142,22 @@ function processMasterSchemaFile ( $sSchemaFile ) {
|
||||
}
|
||||
|
||||
foreach ($aChanges['tablesWithNewIndex'] as $sTable => $aIndexes) {
|
||||
foreach ($aIndexes as $sIndexName => $aIndexFields ) {
|
||||
$oDataBase->executeQuery($oDataBase->generateAddKeysSQL($sTable, $sIndexName, $aIndexFields ));
|
||||
foreach ($aIndexes as $sIndexName => $aIndexFields) {
|
||||
$oDataBase->executeQuery( $oDataBase->generateAddKeysSQL( $sTable, $sIndexName, $aIndexFields ) );
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($aChanges['tablesToAlterIndex'] as $sTable => $aIndexes) {
|
||||
foreach ($aIndexes as $sIndexName => $aIndexFields ) {
|
||||
$oDataBase->executeQuery($oDataBase->generateDropKeySQL($sTable, $sIndexName ));
|
||||
$oDataBase->executeQuery($oDataBase->generateAddKeysSQL($sTable, $sIndexName, $aIndexFields ));
|
||||
foreach ($aIndexes as $sIndexName => $aIndexFields) {
|
||||
$oDataBase->executeQuery( $oDataBase->generateDropKeySQL( $sTable, $sIndexName ) );
|
||||
$oDataBase->executeQuery( $oDataBase->generateAddKeysSQL( $sTable, $sIndexName, $aIndexFields ) );
|
||||
}
|
||||
}
|
||||
$oDataBase->close();
|
||||
}
|
||||
|
||||
|
||||
function processSchemaFile( ) {
|
||||
function processSchemaFile ()
|
||||
{
|
||||
global $DB_ADAPTER;
|
||||
global $DB_HOST;
|
||||
global $DB_USER;
|
||||
@@ -166,35 +165,35 @@ function processSchemaFile( ) {
|
||||
global $DB_NAME;
|
||||
|
||||
try {
|
||||
G::LoadSystem( 'database_' . strtolower($DB_ADAPTER));
|
||||
G::LoadSystem( 'database_' . strtolower( $DB_ADAPTER ) );
|
||||
|
||||
$aOldSchema = array();
|
||||
$oDataBase = new database($DB_ADAPTER, $DB_HOST, $DB_USER, $DB_PASS, $DB_NAME);
|
||||
$aOldSchema = array ();
|
||||
$oDataBase = new database( $DB_ADAPTER, $DB_HOST, $DB_USER, $DB_PASS, $DB_NAME );
|
||||
|
||||
if ( !$oDataBase->isConnected() ) {
|
||||
$oDataBase->logQuery ('Does not exist an available connection!');
|
||||
return NULL;
|
||||
if (! $oDataBase->isConnected()) {
|
||||
$oDataBase->logQuery( 'Does not exist an available connection!' );
|
||||
return null;
|
||||
}
|
||||
|
||||
$oDataBase->iFetchType = MYSQL_NUM;
|
||||
$oDataset1 = $oDataBase->executeQuery($oDataBase->generateShowTablesSQL());
|
||||
$oDataset1 = $oDataBase->executeQuery( $oDataBase->generateShowTablesSQL() );
|
||||
|
||||
} catch ( Exception $e ) {
|
||||
$oDataBase->logQuery ( $e->getmessage() );
|
||||
return NULL;
|
||||
} catch (Exception $e) {
|
||||
$oDataBase->logQuery( $e->getmessage() );
|
||||
return null;
|
||||
}
|
||||
|
||||
//going thru all tables in current WF_ database
|
||||
while ($aRow1 = $oDataBase->getRegistry( $oDataset1) ) {
|
||||
$aPrimaryKeys = array();
|
||||
$sTable = strtoupper($aRow1[0]);
|
||||
while ($aRow1 = $oDataBase->getRegistry( $oDataset1 )) {
|
||||
$aPrimaryKeys = array ();
|
||||
$sTable = strtoupper( $aRow1[0] );
|
||||
|
||||
//get description of each table, ( column and primary keys )
|
||||
//$oDataset2 = $oDataBase->executeQuery( $oDataBase->generateDescTableSQL($aRow1[0]) );
|
||||
$oDataset2 = $oDataBase->executeQuery( $oDataBase->generateDescTableSQL($sTable ) );
|
||||
$aOldSchema[ $sTable ] = array();
|
||||
$oDataset2 = $oDataBase->executeQuery( $oDataBase->generateDescTableSQL( $sTable ) );
|
||||
$aOldSchema[$sTable] = array ();
|
||||
$oDataBase->iFetchType = MYSQL_ASSOC;
|
||||
while ($aRow2 = $oDataBase->getRegistry($oDataset2)) {
|
||||
while ($aRow2 = $oDataBase->getRegistry( $oDataset2 )) {
|
||||
$aOldSchema[$sTable][$aRow2['Field']]['Field'] = $aRow2['Field'];
|
||||
$aOldSchema[$sTable][$aRow2['Field']]['Type'] = $aRow2['Type'];
|
||||
$aOldSchema[$sTable][$aRow2['Field']]['Null'] = $aRow2['Null'];
|
||||
@@ -202,14 +201,14 @@ function processSchemaFile( ) {
|
||||
}
|
||||
|
||||
//get indexes of each table SHOW INDEX FROM `ADDITIONAL_TABLES`; -- WHERE Key_name <> 'PRIMARY'
|
||||
$oDataset2 = $oDataBase->executeQuery($oDataBase->generateTableIndexSQL($aRow1[0]));
|
||||
$oDataset2 = $oDataBase->executeQuery( $oDataBase->generateTableIndexSQL( $aRow1[0] ) );
|
||||
$oDataBase->iFetchType = MYSQL_ASSOC;
|
||||
while ($aRow2 = $oDataBase->getRegistry($oDataset2)) {
|
||||
if ( !isset($aOldSchema[$sTable]['INDEXES']) ) {
|
||||
$aOldSchema[$sTable]['INDEXES'] = array();
|
||||
while ($aRow2 = $oDataBase->getRegistry( $oDataset2 )) {
|
||||
if (! isset( $aOldSchema[$sTable]['INDEXES'] )) {
|
||||
$aOldSchema[$sTable]['INDEXES'] = array ();
|
||||
}
|
||||
if (!isset($aOldSchema[$sTable]['INDEXES'][$aRow2['Key_name']] ) ) {
|
||||
$aOldSchema[$sTable]['INDEXES'][$aRow2['Key_name']] = array();
|
||||
if (! isset( $aOldSchema[$sTable]['INDEXES'][$aRow2['Key_name']] )) {
|
||||
$aOldSchema[$sTable]['INDEXES'][$aRow2['Key_name']] = array ();
|
||||
}
|
||||
$aOldSchema[$sTable]['INDEXES'][$aRow2['Key_name']][] = $aRow2['Column_name'];
|
||||
}
|
||||
@@ -217,65 +216,68 @@ function processSchemaFile( ) {
|
||||
$oDataBase->iFetchType = MYSQL_NUM; //this line is neccesary because the next fetch needs to be with MYSQL_NUM
|
||||
}
|
||||
//finally return the array with old schema obtained from the Database
|
||||
if ( count($aOldSchema) == 0 ) $aOldSchema = null;
|
||||
if (count( $aOldSchema ) == 0)
|
||||
$aOldSchema = null;
|
||||
return $aOldSchema;
|
||||
}
|
||||
|
||||
//process the schema file in the patch file, and obtain an array
|
||||
function schemaToArray($sSchemaFile) {
|
||||
function schemaToArray ($sSchemaFile)
|
||||
{
|
||||
try {
|
||||
$aSchema = array();
|
||||
$aSchema = array ();
|
||||
$oXml = new DomDocument();
|
||||
$oXml->load($sSchemaFile);
|
||||
$aTables = $oXml->getElementsByTagName('table');
|
||||
$oXml->load( $sSchemaFile );
|
||||
$aTables = $oXml->getElementsByTagName( 'table' );
|
||||
foreach ($aTables as $oTable) {
|
||||
$aPrimaryKeys = array();
|
||||
$sTableName = $oTable->getAttribute('name');
|
||||
$aSchema[$sTableName] = array();
|
||||
$aColumns = $oTable->getElementsByTagName('column');
|
||||
$aPrimaryKeys = array ();
|
||||
$sTableName = $oTable->getAttribute( 'name' );
|
||||
$aSchema[$sTableName] = array ();
|
||||
$aColumns = $oTable->getElementsByTagName( 'column' );
|
||||
foreach ($aColumns as $oColumn) {
|
||||
$sColumName = $oColumn->getAttribute('name');
|
||||
$aSchema[$sTableName][$sColumName] = array();
|
||||
$aVendors = $oColumn->getElementsByTagName('vendor');
|
||||
$sColumName = $oColumn->getAttribute( 'name' );
|
||||
$aSchema[$sTableName][$sColumName] = array ();
|
||||
$aVendors = $oColumn->getElementsByTagName( 'vendor' );
|
||||
foreach ($aVendors as $oVendor) {
|
||||
if ($oVendor->getAttribute('type') == DB_ADAPTER) {
|
||||
if ($oVendor->getAttribute( 'type' ) == DB_ADAPTER) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
$aParameters = $oColumn->getElementsByTagName('parameter');
|
||||
$aParameters = $oColumn->getElementsByTagName( 'parameter' );
|
||||
foreach ($aParameters as $oParameter) {
|
||||
$parameterName = ucwords($oParameter->getAttribute('name'));
|
||||
if ( $parameterName == 'Key' && strtoupper($oParameter->getAttribute('value')) == 'PRI' ) {
|
||||
$aPrimaryKeys[] = $oColumn->getAttribute('name');
|
||||
$parameterName = ucwords( $oParameter->getAttribute( 'name' ) );
|
||||
if ($parameterName == 'Key' && strtoupper( $oParameter->getAttribute( 'value' ) ) == 'PRI') {
|
||||
$aPrimaryKeys[] = $oColumn->getAttribute( 'name' );
|
||||
}
|
||||
|
||||
if ( in_array ( $parameterName, array('Field','Type','Null','Default') ) ) {
|
||||
$aSchema[$sTableName][$sColumName][$parameterName] = $oParameter->getAttribute('value');
|
||||
if (in_array( $parameterName, array ('Field','Type','Null','Default'
|
||||
) )) {
|
||||
$aSchema[$sTableName][$sColumName][$parameterName] = $oParameter->getAttribute( 'value' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_array($aPrimaryKeys) && count($aPrimaryKeys) > 0 ) {
|
||||
if (is_array( $aPrimaryKeys ) && count( $aPrimaryKeys ) > 0) {
|
||||
$aSchema[$sTableName]['INDEXES']['PRIMARY'] = $aPrimaryKeys;
|
||||
}
|
||||
$aIndexes = $oTable->getElementsByTagName('index');
|
||||
$aIndexes = $oTable->getElementsByTagName( 'index' );
|
||||
foreach ($aIndexes as $oIndex) {
|
||||
$aIndex = array();
|
||||
$aIndexesColumns = $oIndex->getElementsByTagName('index-column');
|
||||
$aIndex = array ();
|
||||
$aIndexesColumns = $oIndex->getElementsByTagName( 'index-column' );
|
||||
foreach ($aIndexesColumns as $oIndexColumn) {
|
||||
$aIndex[] = $oIndexColumn->getAttribute('name');
|
||||
$aIndex[] = $oIndexColumn->getAttribute( 'name' );
|
||||
}
|
||||
$aSchema[$sTableName]['INDEXES'][ $oIndex->getAttribute('name') ] = $aIndex;
|
||||
$aSchema[$sTableName]['INDEXES'][$oIndex->getAttribute( 'name' )] = $aIndex;
|
||||
}
|
||||
}
|
||||
return $aSchema;
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
throw $oError;
|
||||
}
|
||||
}
|
||||
|
||||
function obtainChanges($aOldSchema, $aNewSchema) {
|
||||
function obtainChanges ($aOldSchema, $aNewSchema)
|
||||
{
|
||||
//$aChanges = array('tablesToDelete' => array(), 'tablesToAdd' => array(), 'tablesToAlter' => array());
|
||||
//Tables to delete, but this is disabled
|
||||
//foreach ($aOldSchema as $sTableName => $aColumns) {
|
||||
@@ -286,19 +288,21 @@ function obtainChanges($aOldSchema, $aNewSchema) {
|
||||
// }
|
||||
//}
|
||||
|
||||
$aChanges = array('tablesToAdd' => array(), 'tablesToAlter' => array(), 'tablesWithNewIndex' => array(), 'tablesToAlterIndex'=> array());
|
||||
|
||||
$aChanges = array ('tablesToAdd' => array (),'tablesToAlter' => array (),'tablesWithNewIndex' => array (),'tablesToAlterIndex' => array ()
|
||||
);
|
||||
|
||||
//new tables to create and alter
|
||||
foreach ($aNewSchema as $sTableName => $aColumns) {
|
||||
if (!isset($aOldSchema[$sTableName])) {
|
||||
if (! isset( $aOldSchema[$sTableName] )) {
|
||||
$aChanges['tablesToAdd'][$sTableName] = $aColumns;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
//drop old columns
|
||||
foreach ($aOldSchema[$sTableName] as $sColumName => $aParameters) {
|
||||
if (!isset($aNewSchema[$sTableName][$sColumName])) {
|
||||
if (!isset($aChanges['tablesToAlter'][$sTableName])) {
|
||||
$aChanges['tablesToAlter'][$sTableName] = array('DROP' => array(), 'ADD' => array(), 'CHANGE' => array());
|
||||
if (! isset( $aNewSchema[$sTableName][$sColumName] )) {
|
||||
if (! isset( $aChanges['tablesToAlter'][$sTableName] )) {
|
||||
$aChanges['tablesToAlter'][$sTableName] = array ('DROP' => array (),'ADD' => array (),'CHANGE' => array ()
|
||||
);
|
||||
}
|
||||
$aChanges['tablesToAlter'][$sTableName]['DROP'][$sColumName] = $sColumName;
|
||||
}
|
||||
@@ -308,52 +312,55 @@ function obtainChanges($aOldSchema, $aNewSchema) {
|
||||
//foreach ($aNewSchema[$sTableName] as $sColumName => $aParameters) {
|
||||
foreach ($aColumns as $sColumName => $aParameters) {
|
||||
if ($sColumName != 'INDEXES') {
|
||||
if (!isset($aOldSchema[$sTableName][$sColumName])) { //this column doesnt exist in oldschema
|
||||
if (!isset($aChanges['tablesToAlter'][$sTableName])) {
|
||||
$aChanges['tablesToAlter'][$sTableName] = array('DROP' => array(), 'ADD' => array(), 'CHANGE' => array());
|
||||
if (! isset( $aOldSchema[$sTableName][$sColumName] )) { //this column doesnt exist in oldschema
|
||||
if (! isset( $aChanges['tablesToAlter'][$sTableName] )) {
|
||||
$aChanges['tablesToAlter'][$sTableName] = array ('DROP' => array (),'ADD' => array (),'CHANGE' => array ()
|
||||
);
|
||||
}
|
||||
$aChanges['tablesToAlter'][$sTableName]['ADD'][$sColumName] = $aParameters;
|
||||
}
|
||||
else { //the column exists
|
||||
} else { //the column exists
|
||||
$newField = $aNewSchema[$sTableName][$sColumName];
|
||||
$oldField = $aOldSchema[$sTableName][$sColumName];
|
||||
//both are null, no change is required
|
||||
if ( !isset($newField['Default']) && !isset($oldField['Default'])) $changeDefaultAttr = false;
|
||||
if (! isset( $newField['Default'] ) && ! isset( $oldField['Default'] ))
|
||||
$changeDefaultAttr = false;
|
||||
//one of them is null, change IS required
|
||||
if ( !isset($newField['Default']) && isset($oldField['Default']) && $oldField['Default']!= '') $changeDefaultAttr = true;
|
||||
if ( isset($newField['Default']) && !isset($oldField['Default'])) $changeDefaultAttr = true;
|
||||
if (! isset( $newField['Default'] ) && isset( $oldField['Default'] ) && $oldField['Default'] != '')
|
||||
$changeDefaultAttr = true;
|
||||
if (isset( $newField['Default'] ) && ! isset( $oldField['Default'] ))
|
||||
$changeDefaultAttr = true;
|
||||
//both are defined and they are different.
|
||||
if ( isset($newField['Default']) && isset($oldField['Default']) ) {
|
||||
if ( $newField['Default'] != $oldField['Default'] )
|
||||
if (isset( $newField['Default'] ) && isset( $oldField['Default'] )) {
|
||||
if ($newField['Default'] != $oldField['Default'])
|
||||
$changeDefaultAttr = true;
|
||||
else
|
||||
$changeDefaultAttr = false;
|
||||
}
|
||||
//special cases
|
||||
// BLOB and TEXT columns cannot have DEFAULT values. http://dev.mysql.com/doc/refman/5.0/en/blob.html
|
||||
if ( in_array(strtolower($newField['Type']), array('text','mediumtext') ) )
|
||||
if (in_array( strtolower( $newField['Type'] ), array ('text','mediumtext'
|
||||
) ))
|
||||
$changeDefaultAttr = false;
|
||||
|
||||
//#1067 - Invalid default value for datetime field
|
||||
if ( in_array($newField['Type'], array('datetime')) && isset($newField['Default']) && $newField['Default']== '' )
|
||||
if (in_array( $newField['Type'], array ('datetime'
|
||||
) ) && isset( $newField['Default'] ) && $newField['Default'] == '')
|
||||
$changeDefaultAttr = false;
|
||||
|
||||
//#1067 - Invalid default value for int field
|
||||
if ( substr($newField['Type'], 0, 3 ) && isset($newField['Default']) && $newField['Default']== '' )
|
||||
if (substr( $newField['Type'], 0, 3 ) && isset( $newField['Default'] ) && $newField['Default'] == '')
|
||||
$changeDefaultAttr = false;
|
||||
|
||||
//if any difference exists, then insert the difference in aChanges
|
||||
if ( $newField['Field'] != $oldField['Field'] ||
|
||||
$newField['Type'] != $oldField['Type'] ||
|
||||
$newField['Null'] != $oldField['Null'] ||
|
||||
$changeDefaultAttr ) {
|
||||
if (!isset($aChanges['tablesToAlter'][$sTableName])) {
|
||||
$aChanges['tablesToAlter'][$sTableName] = array('DROP' => array(), 'ADD' => array(), 'CHANGE' => array());
|
||||
if ($newField['Field'] != $oldField['Field'] || $newField['Type'] != $oldField['Type'] || $newField['Null'] != $oldField['Null'] || $changeDefaultAttr) {
|
||||
if (! isset( $aChanges['tablesToAlter'][$sTableName] )) {
|
||||
$aChanges['tablesToAlter'][$sTableName] = array ('DROP' => array (),'ADD' => array (),'CHANGE' => array ()
|
||||
);
|
||||
}
|
||||
$aChanges['tablesToAlter'][$sTableName]['CHANGE'][$sColumName]['Field'] = $newField['Field'];
|
||||
$aChanges['tablesToAlter'][$sTableName]['CHANGE'][$sColumName]['Type'] = $newField['Type'];
|
||||
$aChanges['tablesToAlter'][$sTableName]['CHANGE'][$sColumName]['Null'] = $newField['Null'];
|
||||
if ( isset($newField['Default']) )
|
||||
if (isset( $newField['Default'] ))
|
||||
$aChanges['tablesToAlter'][$sTableName]['CHANGE'][$sColumName]['Default'] = $newField['Default'];
|
||||
else
|
||||
$aChanges['tablesToAlter'][$sTableName]['CHANGE'][$sColumName]['Default'] = null;
|
||||
@@ -361,21 +368,21 @@ function obtainChanges($aOldSchema, $aNewSchema) {
|
||||
}
|
||||
}
|
||||
} //only columns, no the indexes column
|
||||
}//foreach $aColumns
|
||||
} //foreach $aColumns
|
||||
|
||||
|
||||
//now check the indexes of table
|
||||
if ( isset($aNewSchema[$sTableName]['INDEXES']) ) {
|
||||
foreach ( $aNewSchema[$sTableName]['INDEXES'] as $indexName => $indexFields ) {
|
||||
if (!isset( $aOldSchema[$sTableName]['INDEXES'][$indexName]) ) {
|
||||
if (!isset($aChanges['tablesWithNewIndex'][$sTableName])) {
|
||||
$aChanges['tablesWithNewIndex'][$sTableName] = array();
|
||||
if (isset( $aNewSchema[$sTableName]['INDEXES'] )) {
|
||||
foreach ($aNewSchema[$sTableName]['INDEXES'] as $indexName => $indexFields) {
|
||||
if (! isset( $aOldSchema[$sTableName]['INDEXES'][$indexName] )) {
|
||||
if (! isset( $aChanges['tablesWithNewIndex'][$sTableName] )) {
|
||||
$aChanges['tablesWithNewIndex'][$sTableName] = array ();
|
||||
}
|
||||
$aChanges['tablesWithNewIndex'][$sTableName][$indexName] = $indexFields;
|
||||
}
|
||||
else {
|
||||
if ( $aOldSchema[$sTableName]['INDEXES'][$indexName] != $indexFields ) {
|
||||
if (!isset($aChanges['tablesToAlterIndex'][$sTableName])) {
|
||||
$aChanges['tablesToAlterIndex'][$sTableName] = array();
|
||||
} else {
|
||||
if ($aOldSchema[$sTableName]['INDEXES'][$indexName] != $indexFields) {
|
||||
if (! isset( $aChanges['tablesToAlterIndex'][$sTableName] )) {
|
||||
$aChanges['tablesToAlterIndex'][$sTableName] = array ();
|
||||
}
|
||||
$aChanges['tablesToAlterIndex'][$sTableName][$indexName] = $indexFields;
|
||||
}
|
||||
|
||||
@@ -20,42 +20,42 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
global $RBAC;
|
||||
G::LoadClass('replacementLogo');
|
||||
global $RBAC;
|
||||
G::LoadClass( 'replacementLogo' );
|
||||
|
||||
if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1){
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
die;
|
||||
}
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
die();
|
||||
}
|
||||
|
||||
//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;
|
||||
//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;
|
||||
$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;
|
||||
$Fields['MAX_FILE_SIZE'] = $uploadMaxSize . " (" . $UPLOAD_MAX_SIZE . ") ";
|
||||
if ($postMaxSize < $uploadMaxSize)
|
||||
$uploadMaxSize = $postMaxSize;
|
||||
$Fields['MAX_FILE_SIZE'] = $uploadMaxSize . " (" . $UPLOAD_MAX_SIZE . ") ";
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_ID_SUB_MENU_SELECTED = 'LOGO';
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_ID_SUB_MENU_SELECTED = 'LOGO';
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/uplogo', '', $Fields );
|
||||
$G_PUBLISH = new Publisher();
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/uplogo', '', $Fields );
|
||||
|
||||
$G_PUBLISH->AddContent('view', 'setup/uplogo' );
|
||||
G::RenderPage( "publishBlank", "blank");
|
||||
$G_PUBLISH->AddContent( 'view', 'setup/uplogo' );
|
||||
G::RenderPage( "publishBlank", "blank" );
|
||||
|
||||
?>
|
||||
<script>
|
||||
@@ -100,3 +100,4 @@
|
||||
window.location = 'uplogo';
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -20,37 +20,34 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_FACTORY') != 1){
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_FACTORY' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
//G::header('location: ../login/login');
|
||||
die;
|
||||
die();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
//$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
//$G_ID_SUB_MENU_SELECTED = 'WEBSERVICES';
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
//$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
//$G_ID_SUB_MENU_SELECTED = 'WEBSERVICES';
|
||||
|
||||
if (!extension_loaded('soap')) {
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/wsMessage');
|
||||
|
||||
if (! extension_loaded( 'soap' )) {
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsMessage' );
|
||||
G::RenderPage( "publish" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('view', 'setup/webServicesTree' );
|
||||
$G_PUBLISH->AddContent('smarty', 'groups/groups_usersList', '', '', array());
|
||||
} else {
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'setup/webServicesTree' );
|
||||
$G_PUBLISH->AddContent( 'smarty', 'groups/groups_usersList', '', '', array () );
|
||||
|
||||
G::RenderPage( "publish-treeview", 'blank');
|
||||
}
|
||||
|
||||
$link_Edit = G::encryptlink('webServicesSetup');
|
||||
$link_List = G::encryptlink('webServicesList');
|
||||
G::RenderPage( "publish-treeview", 'blank' );
|
||||
}
|
||||
|
||||
$link_Edit = G::encryptlink( 'webServicesSetup' );
|
||||
$link_List = G::encryptlink( 'webServicesList' );
|
||||
|
||||
?>
|
||||
<script>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,17 +20,17 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_FACTORY') != 1){
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_FACTORY' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
//G::header('location: ../login/login');
|
||||
die;
|
||||
die();
|
||||
}
|
||||
|
||||
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
|
||||
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
|
||||
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'setup/webServicesTree' );
|
||||
G::RenderPage( "publish-raw", "raw" );
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('view', 'setup/webServicesTree' );
|
||||
G::RenderPage( "publish-raw" , "raw" );
|
||||
?>
|
||||
|
||||
@@ -20,44 +20,44 @@
|
||||
*
|
||||
* 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_FACTORY"))!=1) return $RBAC_Response;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1)
|
||||
return $RBAC_Response;
|
||||
|
||||
G::LoadClass('groups');
|
||||
G::LoadClass( 'groups' );
|
||||
|
||||
$dbc = new DBConnection();
|
||||
$ses = new DBSession($dbc);
|
||||
$dbc = new DBConnection();
|
||||
$ses = new DBSession( $dbc );
|
||||
|
||||
if (!isset($_SESSION['END_POINT'])) {
|
||||
if (! isset( $_SESSION['END_POINT'] )) {
|
||||
$aFields['WS_HOST'] = $_SERVER['HTTP_HOST'];
|
||||
$aFields['WS_WORKSPACE'] = SYS_SYS;
|
||||
} else {
|
||||
if (strpos( $_SESSION['END_POINT'], 'https' ) !== false) {
|
||||
preg_match( '@^(?:https://)?([^/]+)@i', $_SESSION['END_POINT'], $coincidencias );
|
||||
} else {
|
||||
preg_match( '@^(?:http://)?([^/]+)@i', $_SESSION['END_POINT'], $coincidencias );
|
||||
}
|
||||
else {
|
||||
if (strpos($_SESSION['END_POINT'], 'https') !== false) {
|
||||
preg_match('@^(?:https://)?([^/]+)@i', $_SESSION['END_POINT'], $coincidencias);
|
||||
}
|
||||
else {
|
||||
preg_match('@^(?:http://)?([^/]+)@i', $_SESSION['END_POINT'], $coincidencias);
|
||||
}
|
||||
$aAux = explode(':', $coincidencias[1]);
|
||||
$aAux = explode( ':', $coincidencias[1] );
|
||||
$aFields['WS_HOST'] = $aAux[0];
|
||||
$aFields['WS_PORT'] = (isset($aAux[1]) ? $aAux[1] : '');
|
||||
$aAux = explode($aAux[0] . (isset($aAux[1]) ? ':' . $aAux[1] : ''), $_SESSION['END_POINT']);
|
||||
$aAux = explode('/', $aAux[1]);
|
||||
$aFields['WS_WORKSPACE'] = substr($aAux[1], 3);
|
||||
}
|
||||
$aFields['WS_PORT'] = (isset( $aAux[1] ) ? $aAux[1] : '');
|
||||
$aAux = explode( $aAux[0] . (isset( $aAux[1] ) ? ':' . $aAux[1] : ''), $_SESSION['END_POINT'] );
|
||||
$aAux = explode( '/', $aAux[1] );
|
||||
$aFields['WS_WORKSPACE'] = substr( $aAux[1], 3 );
|
||||
}
|
||||
|
||||
$rows[] = array ( 'uid' => 'char', 'name' => 'char', 'age' => 'integer', 'balance' => 'float' );
|
||||
$rows[] = array ( 'uid' => 'http', 'name' => 'http' );
|
||||
$rows[] = array ( 'uid' => 'https', 'name' => 'https' );
|
||||
$rows[] = array ('uid' => 'char','name' => 'char','age' => 'integer','balance' => 'float'
|
||||
);
|
||||
$rows[] = array ('uid' => 'http','name' => 'http'
|
||||
);
|
||||
$rows[] = array ('uid' => 'https','name' => 'https'
|
||||
);
|
||||
|
||||
$_DBArray['protocol'] = $rows;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/webServicesSetup', '', $aFields , 'webServicesSetupSave');
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/webServicesSetup', '', $aFields, 'webServicesSetupSave' );
|
||||
|
||||
G::RenderPage( "publish" , "raw" );
|
||||
G::RenderPage( "publish", "raw" );
|
||||
|
||||
?>
|
||||
@@ -1,22 +1,16 @@
|
||||
<?php
|
||||
unset($_SESSION['WS_SESSION_ID']);
|
||||
unset( $_SESSION['WS_SESSION_ID'] );
|
||||
|
||||
if($_POST['form']['WS_PROTOCOL']!='' && $_POST['form']['WS_WORKSPACE']!='')
|
||||
{
|
||||
if($_POST['form']['WS_PORT']!='')
|
||||
{
|
||||
$_SESSION['END_POINT']=$_POST['form']['WS_PROTOCOL'].'://' .$_POST['form']['WS_HOST'] . ':' .$_POST['form']['WS_PORT'] .'/sys' .$_POST['form']['WS_WORKSPACE'].'/en/classic/services/wsdl2';
|
||||
G::header('location: webServices?x=1');
|
||||
}
|
||||
else
|
||||
{ $_SESSION['END_POINT']=$_POST['form']['WS_PROTOCOL'].'://' .$_POST['form']['WS_HOST'] .'/sys' .$_POST['form']['WS_WORKSPACE'].'/en/classic/services/wsdl2';
|
||||
G::header('location: webServices?x=1');
|
||||
}
|
||||
$_SESSION['WS_WORKSPACE']=$_POST['form']['WS_WORKSPACE'];
|
||||
}
|
||||
else
|
||||
{
|
||||
G::header('location: webServices?x=0');
|
||||
if ($_POST['form']['WS_PROTOCOL'] != '' && $_POST['form']['WS_WORKSPACE'] != '') {
|
||||
if ($_POST['form']['WS_PORT'] != '') {
|
||||
$_SESSION['END_POINT'] = $_POST['form']['WS_PROTOCOL'] . '://' . $_POST['form']['WS_HOST'] . ':' . $_POST['form']['WS_PORT'] . '/sys' . $_POST['form']['WS_WORKSPACE'] . '/en/classic/services/wsdl2';
|
||||
G::header( 'location: webServices?x=1' );
|
||||
} else {
|
||||
$_SESSION['END_POINT'] = $_POST['form']['WS_PROTOCOL'] . '://' . $_POST['form']['WS_HOST'] . '/sys' . $_POST['form']['WS_WORKSPACE'] . '/en/classic/services/wsdl2';
|
||||
G::header( 'location: webServices?x=1' );
|
||||
}
|
||||
$_SESSION['WS_WORKSPACE'] = $_POST['form']['WS_WORKSPACE'];
|
||||
} else {
|
||||
G::header( 'location: webServices?x=0' );
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -20,32 +20,35 @@
|
||||
*
|
||||
* 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_SETUP"))!=1) return $RBAC_Response;
|
||||
G::LoadInclude('ajax');
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
|
||||
return $RBAC_Response;
|
||||
G::LoadInclude( 'ajax' );
|
||||
|
||||
$G_ENABLE_BLANK_SKIN = true;
|
||||
$G_ENABLE_BLANK_SKIN = true;
|
||||
|
||||
$ARR_WEEKDAYS[0] = array('SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY');
|
||||
$ARR_WEEKDAYS['es'] = array("Domingo?", "Lunes?", "Martes?", "Miércoles?", "Jueves?", "Viernes?", "Sábado?");
|
||||
$ARR_WEEKDAYS['en'] = array("Sunday?", "Monday?", "Tuesday?", "Wednesday?", "Thursday?", "Friday?", "Saturday?");
|
||||
$ARR_WEEKDAYS['fa'] = array('یکشنبه','دوشنبه','سه شنبه','چهارشنبه','پنجشنبه ','جمعه','آدینه');
|
||||
$ARR_WEEKDAYS[0] = array ('SUNDAY','MONDAY','TUESDAY','WEDNESDAY','THURSDAY','FRIDAY','SATURDAY'
|
||||
);
|
||||
$ARR_WEEKDAYS['es'] = array ("Domingo?","Lunes?","Martes?","Miércoles?","Jueves?","Viernes?","Sábado?"
|
||||
);
|
||||
$ARR_WEEKDAYS['en'] = array ("Sunday?","Monday?","Tuesday?","Wednesday?","Thursday?","Friday?","Saturday?"
|
||||
);
|
||||
$ARR_WEEKDAYS['fa'] = array ('یکشنبه','دوشنبه','سه شنبه','چهارشنبه','پنجشنبه ','جمعه','آدینه'
|
||||
);
|
||||
|
||||
$dbc = new DBConnection;
|
||||
$ses = new DBSession($dbc);
|
||||
$dbc = new DBConnection();
|
||||
$ses = new DBSession( $dbc );
|
||||
|
||||
$holidays=$ses->execute( "SELECT LEX_VALUE FROM LEXICO WHERE LEX_TOPIC ='NOWORKINGDAY' ");
|
||||
$holidays = $ses->execute( "SELECT LEX_VALUE FROM LEXICO WHERE LEX_TOPIC ='NOWORKINGDAY' " );
|
||||
|
||||
$config=array();
|
||||
for($id=0;$id<7;$id++)
|
||||
{
|
||||
$res=$ses->execute(" SELECT * FROM LEXICO WHERE LEX_KEY = '".$ARR_WEEKDAYS[0][$id]."' AND LEX_TOPIC ='HOLIDAY' ");
|
||||
$res=$res->read();
|
||||
$config[$ARR_WEEKDAYS[0][$id]]=$res['LEX_VALUE'];
|
||||
$config = array ();
|
||||
for ($id = 0; $id < 7; $id ++) {
|
||||
$res = $ses->execute( " SELECT * FROM LEXICO WHERE LEX_KEY = '" . $ARR_WEEKDAYS[0][$id] . "' AND LEX_TOPIC ='HOLIDAY' " );
|
||||
$res = $res->read();
|
||||
$config[$ARR_WEEKDAYS[0][$id]] = $res['LEX_VALUE'];
|
||||
}
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/weekend', '',$config ,'' );
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/weekend', '', $config, '' );
|
||||
G::RenderPage( 'publish' );
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
*
|
||||
* 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_SETUP"))!=1) return $RBAC_Response;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
|
||||
return $RBAC_Response;
|
||||
G::ForceLogin( 'WF_PROCESS' );
|
||||
G::LoadInclude('ajax');
|
||||
G::LoadInclude( 'ajax' );
|
||||
|
||||
$G_HELP_PAGE = "setup-environment-time-controls-weekend";
|
||||
|
||||
@@ -36,35 +36,37 @@ $G_ID_MENU_SELECTED = "SETUP";
|
||||
$G_ID_SUB_MENU_SELECTED = "ENVIRONMENT";
|
||||
$G_ID_THIRD_MENU_SELECTED = "WEEKEND";
|
||||
|
||||
$dbc = new DBConnection;
|
||||
$ses = new DBSession($dbc);
|
||||
$dbc = new DBConnection();
|
||||
$ses = new DBSession( $dbc );
|
||||
|
||||
$holidays=$ses->execute('SELECT LEX_VALUE FROM LEXICO WHERE LEX_TOPIC ="HOLIDAY"');
|
||||
$holidays = $ses->execute( 'SELECT LEX_VALUE FROM LEXICO WHERE LEX_TOPIC ="HOLIDAY"' );
|
||||
|
||||
$funcion=strtolower(get_ajax_value('function'));
|
||||
$funcions=get_defined_functions();
|
||||
if (in_array($funcion,$funcions['user'])) eval($funcion.'();');
|
||||
$funcion = strtolower( get_ajax_value( 'function' ) );
|
||||
$funcions = get_defined_functions();
|
||||
if (in_array( $funcion, $funcions['user'] ))
|
||||
eval( $funcion . '();' );
|
||||
|
||||
function setDays()
|
||||
function setDays ()
|
||||
{
|
||||
$days=get_ajax_value('days');
|
||||
$values=get_ajax_value('values');
|
||||
$days=explode(',',$days);
|
||||
$values=explode(',',$values);
|
||||
for($r=1;$r<sizeof($days);$r++)
|
||||
setDay($days[$r],$values[$r]);
|
||||
$days = get_ajax_value( 'days' );
|
||||
$values = get_ajax_value( 'values' );
|
||||
$days = explode( ',', $days );
|
||||
$values = explode( ',', $values );
|
||||
for ($r = 1; $r < sizeof( $days ); $r ++)
|
||||
setDay( $days[$r], $values[$r] );
|
||||
}
|
||||
function setDay($day,$dayValue)
|
||||
|
||||
function setDay ($day, $dayValue)
|
||||
{
|
||||
global $ses;
|
||||
$dayValue = (strcasecmp($dayValue,'true')==0)?1:0;
|
||||
$res=$ses->execute(" SELECT * FROM LEXICO WHERE LEX_KEY = '$day' AND LEX_TOPIC ='HOLIDAY' ");
|
||||
if ($res->count()==0)
|
||||
$res=$ses->execute(" INSERT INTO LEXICO (LEX_TOPIC, LEX_KEY, LEX_VALUE) VALUES ('HOLIDAY', '$day', $dayValue) ");
|
||||
$dayValue = (strcasecmp( $dayValue, 'true' ) == 0) ? 1 : 0;
|
||||
$res = $ses->execute( " SELECT * FROM LEXICO WHERE LEX_KEY = '$day' AND LEX_TOPIC ='HOLIDAY' " );
|
||||
if ($res->count() == 0)
|
||||
$res = $ses->execute( " INSERT INTO LEXICO (LEX_TOPIC, LEX_KEY, LEX_VALUE) VALUES ('HOLIDAY', '$day', $dayValue) " );
|
||||
else
|
||||
$res=$ses->execute(" UPDATE LEXICO SET LEX_VALUE = $dayValue WHERE LEX_KEY = '$day' AND LEX_TOPIC ='HOLIDAY' ");
|
||||
$res=$ses->execute(" SELECT * FROM LEXICO WHERE LEX_KEY = '$day' AND LEX_TOPIC ='HOLIDAY' ");
|
||||
$res=$res->read();
|
||||
echo ($res['LEX_VALUE']=='1')?'true':'false';
|
||||
$res = $ses->execute( " UPDATE LEXICO SET LEX_VALUE = $dayValue WHERE LEX_KEY = '$day' AND LEX_TOPIC ='HOLIDAY' " );
|
||||
$res = $ses->execute( " SELECT * FROM LEXICO WHERE LEX_KEY = '$day' AND LEX_TOPIC ='HOLIDAY' " );
|
||||
$res = $res->read();
|
||||
echo ($res['LEX_VALUE'] == '1') ? 'true' : 'false';
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
function abc(panel, txt) {
|
||||
/*
|
||||
* commonDialog ( '', 'saved' , 'saved', {}, '' ) ; setTimeout (
|
||||
* leimnud.closure({instance:myDialog,method:function(panel){
|
||||
*
|
||||
* myDialog.remove(); panel.tabLastSelected=false; panel.tabSelected=1;
|
||||
* panel.makeTab(); },args:panel}) , 1000 );
|
||||
*/
|
||||
var img = document.getElementById('workPeriodGraph');
|
||||
img.src = 'workPeriodGraph?b=' + Math.random();
|
||||
|
||||
function abc( panel, txt ) {
|
||||
/* commonDialog ( '', 'saved' , 'saved', {}, '' ) ;
|
||||
setTimeout ( leimnud.closure({instance:myDialog,method:function(panel){
|
||||
|
||||
myDialog.remove();
|
||||
panel.tabLastSelected=false;
|
||||
panel.tabSelected=1;
|
||||
panel.makeTab();
|
||||
},args:panel}) , 1000 );
|
||||
*/
|
||||
var img = document.getElementById( 'workPeriodGraph' );
|
||||
img.src = 'workPeriodGraph?b=' + Math.random() ;
|
||||
|
||||
// panel.clearContent();
|
||||
// panel.addContent ( txt );
|
||||
// panel.clearContent();
|
||||
// panel.addContent ( txt );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,30 +20,30 @@
|
||||
*
|
||||
* 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_SETUP"))!=1) return $RBAC_Response;
|
||||
$G_ENABLE_BLANK_SKIN = true;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
|
||||
return $RBAC_Response;
|
||||
$G_ENABLE_BLANK_SKIN = true;
|
||||
|
||||
G::LoadClass( "workPeriod" );
|
||||
G::LoadClass( "workPeriod" );
|
||||
|
||||
$dbc = new DBConnection;
|
||||
$ses = new DBSession( $dbc );
|
||||
$obj = new workPeriod( $dbc );
|
||||
$dbc = new DBConnection();
|
||||
$ses = new DBSession( $dbc );
|
||||
$obj = new workPeriod( $dbc );
|
||||
|
||||
$row = $obj->Load ();
|
||||
$row = $obj->Load();
|
||||
|
||||
$row['SUNDAY'] = $row['noWorkingDays'][0];
|
||||
$row['MONDAY'] = $row['noWorkingDays'][1];
|
||||
$row['TUESDAY'] = $row['noWorkingDays'][2];
|
||||
$row['WEDNESDAY'] = $row['noWorkingDays'][3];
|
||||
$row['THURSDAY'] = $row['noWorkingDays'][4];
|
||||
$row['FRIDAY'] = $row['noWorkingDays'][5];
|
||||
$row['SATURDAY'] = $row['noWorkingDays'][6];
|
||||
$row['SUNDAY'] = $row['noWorkingDays'][0];
|
||||
$row['MONDAY'] = $row['noWorkingDays'][1];
|
||||
$row['TUESDAY'] = $row['noWorkingDays'][2];
|
||||
$row['WEDNESDAY'] = $row['noWorkingDays'][3];
|
||||
$row['THURSDAY'] = $row['noWorkingDays'][4];
|
||||
$row['FRIDAY'] = $row['noWorkingDays'][5];
|
||||
$row['SATURDAY'] = $row['noWorkingDays'][6];
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent( "image", "image", "workPeriodGraph" );
|
||||
$G_PUBLISH->AddContent( "xmlform", "xmlform", "setup/workPeriod","", $row , "workPeriodSave" );
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( "image", "image", "workPeriodGraph" );
|
||||
$G_PUBLISH->AddContent( "xmlform", "xmlform", "setup/workPeriod", "", $row, "workPeriodSave" );
|
||||
|
||||
G::RenderPage( 'publish' );
|
||||
|
||||
G::RenderPage( 'publish' );
|
||||
?>
|
||||
@@ -20,83 +20,85 @@
|
||||
*
|
||||
* 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_SETUP"))!=1) return $RBAC_Response;
|
||||
Header("Content-type: image/jpeg");
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
|
||||
return $RBAC_Response;
|
||||
Header( "Content-type: image/jpeg" );
|
||||
|
||||
G::LoadClass( "workPeriod" );
|
||||
G::LoadClass( "workPeriod" );
|
||||
|
||||
$dbc = new DBConnection;
|
||||
$ses = new DBSession( $dbc );
|
||||
$obj = new workPeriod( $dbc );
|
||||
$dbc = new DBConnection();
|
||||
$ses = new DBSession( $dbc );
|
||||
$obj = new workPeriod( $dbc );
|
||||
|
||||
$row = $obj->Load ();
|
||||
$row = $obj->Load();
|
||||
|
||||
$initPeriod1 = $row['initPeriod1']/ 60;
|
||||
$endPeriod1 = $row['endPeriod1'] / 60;
|
||||
$initPeriod2 = $row['initPeriod2']/ 60;
|
||||
$endPeriod2 = $row['endPeriod2'] / 60;
|
||||
$noWorkingDays = $row['noWorkingDays'];
|
||||
$initPeriod1 = $row['initPeriod1'] / 60;
|
||||
$endPeriod1 = $row['endPeriod1'] / 60;
|
||||
$initPeriod2 = $row['initPeriod2'] / 60;
|
||||
$endPeriod2 = $row['endPeriod2'] / 60;
|
||||
$noWorkingDays = $row['noWorkingDays'];
|
||||
|
||||
$cant = 7;
|
||||
$cant = 7;
|
||||
|
||||
$w = 660;
|
||||
$h = $cant*18 + 20;
|
||||
$im= ImageCreate($w, $h);
|
||||
$width = $w;
|
||||
$height = $h;
|
||||
$center_x = intval($width / 2);
|
||||
$center_y = intval($height / 2);
|
||||
$w = 660;
|
||||
$h = $cant * 18 + 20;
|
||||
$im = ImageCreate( $w, $h );
|
||||
$width = $w;
|
||||
$height = $h;
|
||||
$center_x = intval( $width / 2 );
|
||||
$center_y = intval( $height / 2 );
|
||||
|
||||
$bgcolor = ImageColorAllocate($im, 250, 250, 255);
|
||||
$plomo = ImageColorAllocate($im, 220, 220, 220);
|
||||
$orange = ImageColorAllocate($im, 255, 64, 64);
|
||||
$gris = ImageColorAllocate($im, 150, 150, 155);
|
||||
$white = ImageColorAllocate($im, 255, 255, 255);
|
||||
$red = ImageColorAllocate($im, 255, 0, 0);
|
||||
$brown = ImageColorAllocate($im, 160, 80, 0);
|
||||
$black = ImageColorAllocate($im, 0,0,0);
|
||||
ImageFilledRectangle($im, 0, 0, $width-1, $height-1, $bgcolor);
|
||||
ImageRectangle ($im, 0, 0, $width-1, $height-1, $black);
|
||||
$bgcolor = ImageColorAllocate( $im, 250, 250, 255 );
|
||||
$plomo = ImageColorAllocate( $im, 220, 220, 220 );
|
||||
$orange = ImageColorAllocate( $im, 255, 64, 64 );
|
||||
$gris = ImageColorAllocate( $im, 150, 150, 155 );
|
||||
$white = ImageColorAllocate( $im, 255, 255, 255 );
|
||||
$red = ImageColorAllocate( $im, 255, 0, 0 );
|
||||
$brown = ImageColorAllocate( $im, 160, 80, 0 );
|
||||
$black = ImageColorAllocate( $im, 0, 0, 0 );
|
||||
ImageFilledRectangle( $im, 0, 0, $width - 1, $height - 1, $bgcolor );
|
||||
ImageRectangle( $im, 0, 0, $width - 1, $height - 1, $black );
|
||||
|
||||
$x = 10;
|
||||
$y = 20;
|
||||
$x1 = 78;
|
||||
$x2 = $x1 + 2 * 6;
|
||||
|
||||
$x = 10; $y = 20;
|
||||
$x1 = 78;
|
||||
$x2 = $x1 + 2*6;
|
||||
$weekday[0] = 'Sunday';
|
||||
$weekday[1] = 'Monday';
|
||||
$weekday[2] = 'Tuesday';
|
||||
$weekday[3] = 'Wednesday';
|
||||
$weekday[4] = 'Thursday';
|
||||
$weekday[5] = 'Friday';
|
||||
$weekday[6] = 'Saturday';
|
||||
|
||||
$weekday[0] = 'Sunday';
|
||||
$weekday[1] = 'Monday';
|
||||
$weekday[2] = 'Tuesday';
|
||||
$weekday[3] = 'Wednesday';
|
||||
$weekday[4] = 'Thursday';
|
||||
$weekday[5] = 'Friday';
|
||||
$weekday[6] = 'Saturday';
|
||||
|
||||
for ( $day = 0; $day < count ($weekday ); $day ++ ) {
|
||||
ImageString($im, 2, $x, $y, $weekday[$day], $black);
|
||||
for ($i = 0; $i < 24*6; $i++) {
|
||||
ImageRectangle($im, $x1+$i* 4, $y, $x1+ ($i+1)*4, $y+12, $plomo );
|
||||
if ( $i >= $initPeriod1 * 6 && $i < $endPeriod2 * 6 && ( $i < $endPeriod1 * 6 || $i >= $initPeriod2 * 6 ) )
|
||||
for ($day = 0; $day < count( $weekday ); $day ++) {
|
||||
ImageString( $im, 2, $x, $y, $weekday[$day], $black );
|
||||
for ($i = 0; $i < 24 * 6; $i ++) {
|
||||
ImageRectangle( $im, $x1 + $i * 4, $y, $x1 + ($i + 1) * 4, $y + 12, $plomo );
|
||||
if ($i >= $initPeriod1 * 6 && $i < $endPeriod2 * 6 && ($i < $endPeriod1 * 6 || $i >= $initPeriod2 * 6))
|
||||
$color = $orange;
|
||||
else
|
||||
$color = $white;
|
||||
if ( isset ( $noWorkingDays[ $day ]) && $noWorkingDays[ $day ] ) $color = $white;
|
||||
ImageFillToBorder($im, $x1+$i*4+1, $y+1, $plomo, $color );
|
||||
if (isset( $noWorkingDays[$day] ) && $noWorkingDays[$day])
|
||||
$color = $white;
|
||||
ImageFillToBorder( $im, $x1 + $i * 4 + 1, $y + 1, $plomo, $color );
|
||||
}
|
||||
|
||||
$y+=18;
|
||||
}
|
||||
$y += 18;
|
||||
}
|
||||
|
||||
$y = 20;
|
||||
for ($i = 0; $i <= 24; $i++) {
|
||||
ImageLine($im, $x1+$i* 4*6, $y-5, $x1+ $i*4*6, $y-5+18*$cant, $gris);
|
||||
if ( $i < 24 ) {
|
||||
ImageLine($im, $x2+$i* 4*6, $y-5, $x2+ $i*4*6, $y-5+18*$cant, $plomo);
|
||||
ImageString($im, 1, $x1+$i* 4*6, $y-10, $i, $black);
|
||||
$y = 20;
|
||||
for ($i = 0; $i <= 24; $i ++) {
|
||||
ImageLine( $im, $x1 + $i * 4 * 6, $y - 5, $x1 + $i * 4 * 6, $y - 5 + 18 * $cant, $gris );
|
||||
if ($i < 24) {
|
||||
ImageLine( $im, $x2 + $i * 4 * 6, $y - 5, $x2 + $i * 4 * 6, $y - 5 + 18 * $cant, $plomo );
|
||||
ImageString( $im, 1, $x1 + $i * 4 * 6, $y - 10, $i, $black );
|
||||
}
|
||||
}
|
||||
//ImageString($im, 2, 5, 5, $initPeriod1*6 . ", $endPeriod1, $initPeriod2, $endPeriod2 ", $black);
|
||||
}
|
||||
//ImageString($im, 2, 5, 5, $initPeriod1*6 . ", $endPeriod1, $initPeriod2, $endPeriod2 ", $black);
|
||||
|
||||
|
||||
ImageJpeg( $im );
|
||||
|
||||
ImageJpeg($im);
|
||||
?>
|
||||
@@ -20,24 +20,24 @@
|
||||
*
|
||||
* 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_SETUP"))!=1) return $RBAC_Response;
|
||||
G::LoadClass( "workPeriod" );
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
|
||||
return $RBAC_Response;
|
||||
G::LoadClass( "workPeriod" );
|
||||
|
||||
$frm = $_POST['form'];
|
||||
$noWorkingDays[0] = isset ( $frm['SUNDAY'] ) && $frm['SUNDAY'] != '';
|
||||
$noWorkingDays[1] = isset ( $frm['MONDAY'] ) && $frm['MONDAY'] != '';
|
||||
$noWorkingDays[2] = isset ( $frm['TUESDAY'] ) && $frm['TUESDAY'] != '';
|
||||
$noWorkingDays[3] = isset ( $frm['WEDNESDAY']) && $frm['WEDNESDAY'] != '';
|
||||
$noWorkingDays[4] = isset ( $frm['THURSDAY'] ) && $frm['THURSDAY'] != '';
|
||||
$noWorkingDays[5] = isset ( $frm['FRIDAY'] ) && $frm['FRIDAY'] != '';
|
||||
$noWorkingDays[6] = isset ( $frm['SATURDAY'] ) && $frm['SATURDAY'] != '';
|
||||
$frm = $_POST['form'];
|
||||
$noWorkingDays[0] = isset( $frm['SUNDAY'] ) && $frm['SUNDAY'] != '';
|
||||
$noWorkingDays[1] = isset( $frm['MONDAY'] ) && $frm['MONDAY'] != '';
|
||||
$noWorkingDays[2] = isset( $frm['TUESDAY'] ) && $frm['TUESDAY'] != '';
|
||||
$noWorkingDays[3] = isset( $frm['WEDNESDAY'] ) && $frm['WEDNESDAY'] != '';
|
||||
$noWorkingDays[4] = isset( $frm['THURSDAY'] ) && $frm['THURSDAY'] != '';
|
||||
$noWorkingDays[5] = isset( $frm['FRIDAY'] ) && $frm['FRIDAY'] != '';
|
||||
$noWorkingDays[6] = isset( $frm['SATURDAY'] ) && $frm['SATURDAY'] != '';
|
||||
|
||||
$dbc = new DBConnection();
|
||||
$obj = new workPeriod( $dbc );
|
||||
$obj->Save ( $frm['initPeriod1'], $frm['endPeriod1'], $frm['initPeriod2'], $frm['endPeriod2'], $noWorkingDays );
|
||||
$dbc = new DBConnection();
|
||||
$obj = new workPeriod( $dbc );
|
||||
$obj->Save( $frm['initPeriod1'], $frm['endPeriod1'], $frm['initPeriod2'], $frm['endPeriod2'], $noWorkingDays );
|
||||
|
||||
print "ok";
|
||||
die();
|
||||
|
||||
print "ok";
|
||||
die;
|
||||
?>
|
||||
@@ -20,31 +20,29 @@
|
||||
*
|
||||
* 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;
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
require_once 'classes/model/Step.php';
|
||||
$oStep = new Step();
|
||||
$aFields = $oStep->load($_GET['UID']);
|
||||
G::LoadClass('xmlfield_InputPM');
|
||||
$aFields = $oStep->load( $_GET['UID'] );
|
||||
G::LoadClass( 'xmlfield_InputPM' );
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'steps/conditions_Edit', '', $aFields, '../steps/conditions_Save');
|
||||
G::RenderPage('publish-raw' , 'raw');
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'steps/conditions_Edit', '', $aFields, '../steps/conditions_Save' );
|
||||
G::RenderPage( 'publish-raw', 'raw' );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,34 +20,33 @@
|
||||
*
|
||||
* 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;
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
require_once 'classes/model/Step.php';
|
||||
$oStep = new Step();
|
||||
if(isset ($_POST['form']))
|
||||
$value=$_POST['form'];
|
||||
if (isset( $_POST['form'] ))
|
||||
$value = $_POST['form'];
|
||||
else
|
||||
$value=$_POST;
|
||||
$oStep->update(array('STEP_UID' => $value['STEP_UID'], 'STEP_CONDITION' => $value['STEP_CONDITION']));
|
||||
G::LoadClass('processMap');
|
||||
$value = $_POST;
|
||||
$oStep->update( array ('STEP_UID' => $value['STEP_UID'],'STEP_CONDITION' => $value['STEP_CONDITION']
|
||||
) );
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->getStepsCriteria($value['TAS_UID']);
|
||||
$oProcessMap->getStepsCriteria( $value['TAS_UID'] );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,77 +20,74 @@
|
||||
*
|
||||
* 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;
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
require_once 'classes/model/StepTrigger.php';
|
||||
require_once 'classes/model/Triggers.php';
|
||||
G::LoadInclude('ajax');
|
||||
if (!empty($_GET)) {
|
||||
$aData = urldecode_values($_GET);
|
||||
}
|
||||
else {
|
||||
if (!isset($_POST['form'])) {
|
||||
$aData = urldecode_values($_POST);
|
||||
}
|
||||
else {
|
||||
$aData = urldecode_values($_POST['form']);
|
||||
G::LoadInclude( 'ajax' );
|
||||
if (! empty( $_GET )) {
|
||||
$aData = urldecode_values( $_GET );
|
||||
} else {
|
||||
if (! isset( $_POST['form'] )) {
|
||||
$aData = urldecode_values( $_POST );
|
||||
} else {
|
||||
$aData = urldecode_values( $_POST['form'] );
|
||||
}
|
||||
}
|
||||
switch ($aData['action']) {
|
||||
case 'showTriggers':
|
||||
G::LoadClass('processMap');
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
if ($aData['sType'] == 'BEFORE') {
|
||||
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'steps/triggersBefore_List', $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], $aData['sType']), array('STEP' => $aData['sStep']));
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'steps/triggersBefore_List', $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], $aData['sType'] ), array ('STEP' => $aData['sStep']
|
||||
) );
|
||||
} else {
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'steps/triggersAfter_List', $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], $aData['sType'] ), array ('STEP' => $aData['sStep']
|
||||
) );
|
||||
}
|
||||
else {
|
||||
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'steps/triggersAfter_List', $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], $aData['sType']), array('STEP' => $aData['sStep']));
|
||||
}
|
||||
G::RenderPage('publish-twocolumns', 'raw');
|
||||
G::RenderPage( 'publish-twocolumns', 'raw' );
|
||||
break;
|
||||
case 'availableTriggers':
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn('TRI_UID');
|
||||
$oCriteria->add(StepTriggerPeer::TAS_UID , $_SESSION['TASK']);
|
||||
$oCriteria->add(StepTriggerPeer::STEP_UID, $aData['sStep']);
|
||||
$oCriteria->add(StepTriggerPeer::ST_TYPE , $aData['sType']);
|
||||
$oDataset = StepTriggerPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( 'TRI_UID' );
|
||||
$oCriteria->add( StepTriggerPeer::TAS_UID, $_SESSION['TASK'] );
|
||||
$oCriteria->add( StepTriggerPeer::STEP_UID, $aData['sStep'] );
|
||||
$oCriteria->add( StepTriggerPeer::ST_TYPE, $aData['sType'] );
|
||||
$oDataset = StepTriggerPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$sUIDs = "'0'";
|
||||
$aUIDs = array();
|
||||
$aUIDs = array ();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$sUIDs .= ",'" . $aRow['TRI_UID'] . "'";
|
||||
$aUIDs[] = $aRow['TRI_UID'];
|
||||
$oDataset->next();
|
||||
}
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn('COUNT(TRI_UID) AS CANTITY');
|
||||
$oCriteria->add(TriggersPeer::TRI_UID, $aUIDs, Criteria::NOT_IN);
|
||||
$oCriteria->add(TriggersPeer::PRO_UID, $aData['sProcess']);
|
||||
$oDataset = TriggersPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( 'COUNT(TRI_UID) AS CANTITY' );
|
||||
$oCriteria->add( TriggersPeer::TRI_UID, $aUIDs, Criteria::NOT_IN );
|
||||
$oCriteria->add( TriggersPeer::PRO_UID, $aData['sProcess'] );
|
||||
$oDataset = TriggersPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
if ((int)$aRow['CANTITY'] > 0) {
|
||||
if ((int) $aRow['CANTITY'] > 0) {
|
||||
$aFields['LANG'] = SYS_LANG;
|
||||
$aFields['UIDS'] = $sUIDs;
|
||||
$aFields['PROCESS'] = $aData['sProcess'];
|
||||
@@ -98,25 +95,25 @@ try {
|
||||
$aFields['STEP_UID'] = $aData['sStep'];
|
||||
$aFields['ST_TYPE'] = $aData['sType'];
|
||||
global $G_PUBLISH;
|
||||
G::LoadClass('xmlfield_InputPM');
|
||||
G::LoadClass( 'xmlfield_InputPM' );
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'steps/triggers_Assign', '', $aFields, '../steps/steps_Ajax');
|
||||
G::RenderPage('publish', 'raw');
|
||||
}
|
||||
else {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'steps/triggers_Assign', '', $aFields, '../steps/steps_Ajax' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
} else {
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'steps/triggers_NoAssign', '');
|
||||
G::RenderPage('publish', 'raw');
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'steps/triggers_NoAssign', '' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
}
|
||||
break;
|
||||
case 'assignTrigger':
|
||||
$aFields = array('STEP_UID' => $aData['STEP_UID'], 'TAS_UID' => $_SESSION['TASK'], 'TRI_UID' => $aData['TRI_UID'], 'ST_TYPE' => $aData['ST_TYPE']);
|
||||
$aFields = array ('STEP_UID' => $aData['STEP_UID'],'TAS_UID' => $_SESSION['TASK'],'TRI_UID' => $aData['TRI_UID'],'ST_TYPE' => $aData['ST_TYPE']
|
||||
);
|
||||
$oStepTrigger = new StepTrigger();
|
||||
$oStepTrigger->create($aFields);
|
||||
$oStepTrigger->create( $aFields );
|
||||
$aFields['ST_CONDITION'] = $aData['ST_CONDITION'];
|
||||
$aFields['ST_POSITION'] = ($oStepTrigger->getNextPosition($aData['STEP_UID'], $aData['ST_TYPE']) - 1);
|
||||
$oStepTrigger->update($aFields);
|
||||
$aFields['ST_POSITION'] = ($oStepTrigger->getNextPosition( $aData['STEP_UID'], $aData['ST_TYPE'] ) - 1);
|
||||
$oStepTrigger->update( $aFields );
|
||||
break;
|
||||
case 'editTriggerCondition':
|
||||
require_once 'classes/model/Step.php';
|
||||
@@ -128,55 +125,53 @@ try {
|
||||
$aFields['ST_TYPE'] = $aData['sType'];
|
||||
|
||||
$Trigger = new Triggers();
|
||||
$aRow = $Trigger->load($aData['sTrigger']);
|
||||
$aRow = $Trigger->load( $aData['sTrigger'] );
|
||||
|
||||
$oStepTrigger = new StepTrigger();
|
||||
$aFields = $oStepTrigger->load($aFields['STEP_UID'], $_SESSION['TASK'], $aFields['TRI_UID'], $aFields['ST_TYPE']);
|
||||
$aFields = $oStepTrigger->load( $aFields['STEP_UID'], $_SESSION['TASK'], $aFields['TRI_UID'], $aFields['ST_TYPE'] );
|
||||
$aFields['action'] = 'saveTriggerCondition';
|
||||
$aFields['PROCESS'] = $aRow['PRO_UID'];
|
||||
global $G_PUBLISH;
|
||||
G::LoadClass('xmlfield_InputPM');
|
||||
G::LoadClass( 'xmlfield_InputPM' );
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'steps/triggersCondition_Edit', '', $aFields, '../steps/steps_Ajax');
|
||||
G::RenderPage('publish', 'raw');
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'steps/triggersCondition_Edit', '', $aFields, '../steps/steps_Ajax' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'saveTriggerCondition':
|
||||
$oStepTrigger = new StepTrigger();
|
||||
$oStepTrigger->update(array('STEP_UID' => $aData['STEP_UID'], 'TAS_UID' => $_SESSION['TASK'], 'TRI_UID' => $aData['TRI_UID'], 'ST_TYPE' => $aData['ST_TYPE'], 'ST_CONDITION' => $aData['ST_CONDITION']));
|
||||
$oStepTrigger->update( array ('STEP_UID' => $aData['STEP_UID'],'TAS_UID' => $_SESSION['TASK'],'TRI_UID' => $aData['TRI_UID'],'ST_TYPE' => $aData['ST_TYPE'],'ST_CONDITION' => $aData['ST_CONDITION']
|
||||
) );
|
||||
break;
|
||||
case 'upTrigger':
|
||||
$aData['iPosition'] = (int)$aData['iPosition'];
|
||||
$aData['iPosition'] = (int) $aData['iPosition'];
|
||||
$oStepTrigger = new StepTrigger();
|
||||
$oStepTrigger->up($aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'], $aData['iPosition']);
|
||||
$oStepTrigger->up( $aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'], $aData['iPosition'] );
|
||||
break;
|
||||
case 'downTrigger':
|
||||
$aData['iPosition'] = (int)$aData['iPosition'];
|
||||
$aData['iPosition'] = (int) $aData['iPosition'];
|
||||
$oStepTrigger = new StepTrigger();
|
||||
$oStepTrigger->down($aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'], $aData['iPosition']);
|
||||
$oStepTrigger->down( $aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'], $aData['iPosition'] );
|
||||
break;
|
||||
case 'ofToAssignTrigger':
|
||||
$oStepTrigger = new StepTrigger();
|
||||
$oStepTrigger->reOrder($aData['sStep'], $_SESSION['TASK'], $aData['sType'], $aData['iPosition']);
|
||||
$oStepTrigger->remove($aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType']);
|
||||
$oStepTrigger->reOrder( $aData['sStep'], $_SESSION['TASK'], $aData['sType'], $aData['iPosition'] );
|
||||
$oStepTrigger->remove( $aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'] );
|
||||
break;
|
||||
|
||||
case 'counterTriggers':
|
||||
G::LoadClass('processMap');
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oCriteria1 = $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], $aData['sType']);
|
||||
$oCriteria1 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], $aData['sType'] );
|
||||
if ($aData['sType'] == 'BEFORE') {
|
||||
$oCriteria2 = $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], 'AFTER');
|
||||
$oCriteria2 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], 'AFTER' );
|
||||
} else {
|
||||
$oCriteria2 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], 'BEFORE' );
|
||||
}
|
||||
else {
|
||||
$oCriteria2 = $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], 'BEFORE');
|
||||
}
|
||||
$iCantity = StepTriggerPeer::doCount($oCriteria1);
|
||||
$iTotal = $iCantity + StepTriggerPeer::doCount($oCriteria2);
|
||||
$iCantity = StepTriggerPeer::doCount( $oCriteria1 );
|
||||
$iTotal = $iCantity + StepTriggerPeer::doCount( $oCriteria2 );
|
||||
echo $iTotal . '|' . $iCantity;
|
||||
break;
|
||||
}
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,32 +20,29 @@
|
||||
*
|
||||
* 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;
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
require_once 'classes/model/Step.php';
|
||||
$oStep = new Step();
|
||||
$oStep->reOrder($_POST['STEP_UID'], $_POST['STEP_POSITION']);
|
||||
$oStep->remove($_POST['STEP_UID']);
|
||||
G::LoadClass('processMap');
|
||||
$oStep->reOrder( $_POST['STEP_UID'], $_POST['STEP_POSITION'] );
|
||||
$oStep->remove( $_POST['STEP_UID'] );
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->getStepsCriteria($_POST['TASK']);
|
||||
$oProcessMap->getStepsCriteria( $_POST['TASK'] );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,31 +20,28 @@
|
||||
*
|
||||
* 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;
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
require_once 'classes/model/Step.php';
|
||||
$oStep = new Step();
|
||||
$oStep->down($_POST['STEP_UID'], $_POST['TASK'] ,$_POST['STEP_POSITION']);
|
||||
G::LoadClass('processMap');
|
||||
$oStep->down( $_POST['STEP_UID'], $_POST['TASK'], $_POST['STEP_POSITION'] );
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->getStepsCriteria($_POST['TASK']);
|
||||
$oProcessMap->getStepsCriteria( $_POST['TASK'] );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,30 +20,28 @@
|
||||
*
|
||||
* 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;
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
G::LoadClass('processMap');
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'steps/steps_availableBB', $oProcessMap->getAvailableBBCriteria($_GET['PROCESS'], $_GET['TASK']), $_GET);
|
||||
G::RenderPage('publish-raw', 'raw');
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'steps/steps_availableBB', $oProcessMap->getAvailableBBCriteria( $_GET['PROCESS'], $_GET['TASK'] ), $_GET );
|
||||
G::RenderPage( 'publish-raw', 'raw' );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,35 +20,31 @@
|
||||
*
|
||||
* 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;
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
require_once 'classes/model/Step.php';
|
||||
$oStep = new Step();
|
||||
$sStepUID = $oStep->create(array('PRO_UID' => $_POST['sProcess'], 'TAS_UID' => $_POST['sTask']));
|
||||
$oStep->update(array('STEP_UID' => $sStepUID,
|
||||
'STEP_TYPE_OBJ' => $_POST['sType'],
|
||||
'STEP_UID_OBJ' => $_POST['sUID'],
|
||||
'STEP_POSITION' => ($oStep->getNextPosition($_POST['sTask']) - 1),
|
||||
'STEP_MODE' => (isset($_POST['sMode'])) ? $_POST['sMode'] : 'EDIT'));
|
||||
G::LoadClass('processMap');
|
||||
$sStepUID = $oStep->create( array ('PRO_UID' => $_POST['sProcess'],'TAS_UID' => $_POST['sTask']
|
||||
) );
|
||||
$oStep->update( array ('STEP_UID' => $sStepUID,'STEP_TYPE_OBJ' => $_POST['sType'],'STEP_UID_OBJ' => $_POST['sUID'],'STEP_POSITION' => ($oStep->getNextPosition( $_POST['sTask'] ) - 1),'STEP_MODE' => (isset( $_POST['sMode'] )) ? $_POST['sMode'] : 'EDIT'
|
||||
) );
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->getStepsCriteria($_POST['sTask']);
|
||||
$oProcessMap->getStepsCriteria( $_POST['sTask'] );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,51 +20,49 @@
|
||||
*
|
||||
* 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;
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
//srequire_once 'classes/model/StepTrigger.php';
|
||||
|
||||
G::LoadClass('processMap');
|
||||
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
|
||||
switch ($_POST['action']) {
|
||||
case 'availableSupervisorDynaforms':
|
||||
$oProcessMap->availableSupervisorDynaforms($_POST['PRO_UID']);
|
||||
$oProcessMap->availableSupervisorDynaforms( $_POST['PRO_UID'] );
|
||||
break;
|
||||
case 'assignSupervisorDynaform':
|
||||
$oProcessMap->assignSupervisorStep($_POST['PRO_UID'], 'DYNAFORM', $_POST['DYN_UID']);
|
||||
$oProcessMap->assignSupervisorStep( $_POST['PRO_UID'], 'DYNAFORM', $_POST['DYN_UID'] );
|
||||
break;
|
||||
case 'removeSupervisorDynaform':
|
||||
$oProcessMap->removeSupervisorStep($_POST['STEP_UID'], $_POST['PRO_UID'], 'DYNAFORM', $_POST['DYN_UID'], $_POST['STEP_POSITION']);
|
||||
$oProcessMap->removeSupervisorStep( $_POST['STEP_UID'], $_POST['PRO_UID'], 'DYNAFORM', $_POST['DYN_UID'], $_POST['STEP_POSITION'] );
|
||||
break;
|
||||
case 'availableSupervisorInputs':
|
||||
$oProcessMap->availableSupervisorInputs($_POST['PRO_UID']);
|
||||
$oProcessMap->availableSupervisorInputs( $_POST['PRO_UID'] );
|
||||
break;
|
||||
case 'assignSupervisorInput':
|
||||
$oProcessMap->assignSupervisorStep($_POST['PRO_UID'], 'INPUT_DOCUMENT', $_POST['INP_DOC_UID']);
|
||||
$oProcessMap->assignSupervisorStep( $_POST['PRO_UID'], 'INPUT_DOCUMENT', $_POST['INP_DOC_UID'] );
|
||||
break;
|
||||
case 'removeSupervisorInput':
|
||||
$oProcessMap->removeSupervisorStep($_POST['STEP_UID'], $_POST['PRO_UID'], 'INPUT_DOCUMENT', $_POST['INP_DOC_UID'], $_POST['STEP_POSITION']);
|
||||
$oProcessMap->removeSupervisorStep( $_POST['STEP_UID'], $_POST['PRO_UID'], 'INPUT_DOCUMENT', $_POST['INP_DOC_UID'], $_POST['STEP_POSITION'] );
|
||||
break;
|
||||
}
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,31 +20,28 @@
|
||||
*
|
||||
* 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;
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
require_once 'classes/model/Step.php';
|
||||
$oStep = new Step();
|
||||
$oStep->up($_POST['STEP_UID'], $_POST['TASK'] ,$_POST['STEP_POSITION']);
|
||||
G::LoadClass('processMap');
|
||||
$oStep->up( $_POST['STEP_UID'], $_POST['TASK'], $_POST['STEP_POSITION'] );
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->getStepsCriteria($_POST['TASK']);
|
||||
$oProcessMap->getStepsCriteria( $_POST['TASK'] );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
/**
|
||||
*
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com>
|
||||
* @date Jan 10th, 2010
|
||||
*/
|
||||
@@ -31,60 +31,62 @@
|
||||
require "classes/model/Translation.php";
|
||||
|
||||
$action = $_REQUEST['action'];
|
||||
unset($_REQUEST['action']);
|
||||
unset( $_REQUEST['action'] );
|
||||
$ajax = new Ajax();
|
||||
$ajax->$action($_REQUEST);
|
||||
$ajax->$action( $_REQUEST );
|
||||
|
||||
class Ajax
|
||||
{
|
||||
function getList($params)
|
||||
|
||||
function getList ($params)
|
||||
{
|
||||
$search = isset($params['search']) ? $params['search'] : null;
|
||||
$params['dateFrom'] = str_replace('T00:00:00','',$params['dateFrom']);
|
||||
$params['dateTo'] = str_replace('T00:00:00','',$params['dateTo']);
|
||||
$result = Translation::getAll('en', $params['start'], $params['limit'], $search, $params['dateFrom'], $params['dateTo']);
|
||||
$search = isset( $params['search'] ) ? $params['search'] : null;
|
||||
$params['dateFrom'] = str_replace( 'T00:00:00', '', $params['dateFrom'] );
|
||||
$params['dateTo'] = str_replace( 'T00:00:00', '', $params['dateTo'] );
|
||||
$result = Translation::getAll( 'en', $params['start'], $params['limit'], $search, $params['dateFrom'], $params['dateTo'] );
|
||||
//$result = Translation::getAll('en', $params['start'], $params['limit'], $search);
|
||||
|
||||
|
||||
/*foreach($result->data as $i=>$row){
|
||||
$result->data[$i]['TRN_VALUE'] = substr($row['TRN_VALUE'], 0, 15) . '...';
|
||||
}*/
|
||||
|
||||
echo G::json_encode($result);
|
||||
echo G::json_encode( $result );
|
||||
}
|
||||
|
||||
function save()
|
||||
function save ()
|
||||
{
|
||||
try{
|
||||
require_once ( "classes/model/Translation.php" );
|
||||
try {
|
||||
require_once ("classes/model/Translation.php");
|
||||
$id = $_POST['id'];
|
||||
$label = preg_replace("[\n|\r|\n\r]", ' ', $_POST['label']);
|
||||
$label = preg_replace( "[\n|\r|\n\r]", ' ', $_POST['label'] );
|
||||
|
||||
$res = Translation::addTranslation('LABEL', $id, 'en', $label);
|
||||
if ( $res['codError'] < 0 ) {
|
||||
$res = Translation::addTranslation( 'LABEL', $id, 'en', $label );
|
||||
if ($res['codError'] < 0) {
|
||||
$result->success = false;
|
||||
$result->msg = $res['message'];
|
||||
} else {
|
||||
$result->success = true;
|
||||
$result->msg = 'Label '.$id.' saved Successfully!';
|
||||
$result->msg = 'Label ' . $id . ' saved Successfully!';
|
||||
}
|
||||
|
||||
} catch(Exception $e){
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
print G::json_encode($result);
|
||||
print G::json_encode( $result );
|
||||
}
|
||||
|
||||
function delete()
|
||||
function delete ()
|
||||
{
|
||||
require_once ( "classes/model/Translation.php" );
|
||||
$ids = explode(',', $_POST['IDS']);
|
||||
require_once ("classes/model/Translation.php");
|
||||
$ids = explode( ',', $_POST['IDS'] );
|
||||
$category = 'LABEL';
|
||||
|
||||
try{
|
||||
foreach($ids as $id){
|
||||
try {
|
||||
foreach ($ids as $id) {
|
||||
$tr = TranslationPeer::retrieveByPK( $category, $id, 'en' );
|
||||
if ( ( is_object ( $tr ) && get_class ($tr) == 'Translation' ) ) {
|
||||
if ((is_object( $tr ) && get_class( $tr ) == 'Translation')) {
|
||||
$tr->delete();
|
||||
}
|
||||
}
|
||||
@@ -92,27 +94,26 @@ class Ajax
|
||||
$result->success = true;
|
||||
$result->msg = 'Deleted Successfully!';
|
||||
|
||||
} catch(Exception $e){
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
print G::json_encode($result);
|
||||
print G::json_encode( $result );
|
||||
}
|
||||
|
||||
function rebuild()
|
||||
function rebuild ()
|
||||
{
|
||||
try{
|
||||
require_once ( "classes/model/Translation.php" );
|
||||
$t = new Translation;
|
||||
$result = Translation::generateFileTranslation('en');
|
||||
try {
|
||||
require_once ("classes/model/Translation.php");
|
||||
$t = new Translation();
|
||||
$result = Translation::generateFileTranslation( 'en' );
|
||||
$result['success'] = true;
|
||||
|
||||
} catch(Exception $e){
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
print G::json_encode($result);
|
||||
print G::json_encode( $result );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,64 +20,63 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* Created on 11-02-2008
|
||||
*
|
||||
* @author David Callizaya <davidsantos@colosa.com>
|
||||
*/
|
||||
G::LoadSystem("webResource");
|
||||
G::LoadSystem( "webResource" );
|
||||
|
||||
class dvServices extends WebResource
|
||||
{
|
||||
function get_session_vars()
|
||||
|
||||
function get_session_vars ()
|
||||
{
|
||||
$cur=array_keys($_SESSION);
|
||||
$res='';
|
||||
foreach($cur as $key)
|
||||
{
|
||||
$res.='* '.$key.'<br/>';
|
||||
$cur = array_keys( $_SESSION );
|
||||
$res = '';
|
||||
foreach ($cur as $key) {
|
||||
$res .= '* ' . $key . '<br/>';
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
function get_session_xmlforms()
|
||||
|
||||
function get_session_xmlforms ()
|
||||
{
|
||||
$cur=array_keys($_SESSION);
|
||||
$res='';
|
||||
$colors=array('white','#EEFFFF');
|
||||
$colori=0;$count=0;
|
||||
$cur = array_keys( $_SESSION );
|
||||
$res = '';
|
||||
$colors = array ('white','#EEFFFF'
|
||||
);
|
||||
$colori = 0;
|
||||
$count = 0;
|
||||
//Get xmlforms in session
|
||||
foreach($cur as $key)
|
||||
{
|
||||
$res.='<div style="background-color:'.$colors[$colori].';">';
|
||||
$xml=G::getUIDName($key,'');
|
||||
if (strpos($xml,'.xml')!==false)
|
||||
{
|
||||
$res.='<i>FORM:</i> '.$xml;
|
||||
$colori=$colori ^ 1;
|
||||
$count++;
|
||||
foreach ($cur as $key) {
|
||||
$res .= '<div style="background-color:' . $colors[$colori] . ';">';
|
||||
$xml = G::getUIDName( $key, '' );
|
||||
if (strpos( $xml, '.xml' ) !== false) {
|
||||
$res .= '<i>FORM:</i> ' . $xml;
|
||||
$colori = $colori ^ 1;
|
||||
$count ++;
|
||||
}
|
||||
$res.='</div>';
|
||||
$res .= '</div>';
|
||||
}
|
||||
//Get pagedTable in session
|
||||
foreach($cur as $key)
|
||||
{
|
||||
$res.='<div style="background-color:'.$colors[$colori].';">';
|
||||
if (substr($key,0,11)==="pagedTable[")
|
||||
{
|
||||
$xml=G::getUIDName(substr($key,11,-1),'');
|
||||
$res.='<i>TABLE:</i> '.$xml;
|
||||
$colori=$colori ^ 1;
|
||||
$count++;
|
||||
foreach ($cur as $key) {
|
||||
$res .= '<div style="background-color:' . $colors[$colori] . ';">';
|
||||
if (substr( $key, 0, 11 ) === "pagedTable[") {
|
||||
$xml = G::getUIDName( substr( $key, 11, - 1 ), '' );
|
||||
$res .= '<i>TABLE:</i> ' . $xml;
|
||||
$colori = $colori ^ 1;
|
||||
$count ++;
|
||||
}
|
||||
$res.='</div>';
|
||||
$res .= '</div>';
|
||||
}
|
||||
return array("count"=>$count,"html"=>$res);
|
||||
return array ("count" => $count,"html" => $res
|
||||
);
|
||||
}
|
||||
}
|
||||
$o=new dvServices($_SERVER['REQUEST_URI'],$_POST);
|
||||
$o = new dvServices( $_SERVER['REQUEST_URI'], $_POST );
|
||||
//av.buenos aires maxparedes
|
||||
//tienda viva.
|
||||
//122
|
||||
|
||||
?>
|
||||
@@ -20,10 +20,8 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
unset($_SESSION['TOOLS_VIEWTYPE']);
|
||||
$newFile = str_replace ( 'index.php', 'translations.php' , __FILE__ ) ;
|
||||
return $newFile;
|
||||
|
||||
unset( $_SESSION['TOOLS_VIEWTYPE'] );
|
||||
$newFile = str_replace( 'index.php', 'translations.php', __FILE__ );
|
||||
return $newFile;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('tools/main', true);
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'tools/main', true );
|
||||
|
||||
//$oHeadPublisher->assign('_ENV_CURRENT_DATE', $conf->getSystemDate(date('Y-m-d')));
|
||||
G::RenderPage('publish', 'extJs');
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
|
||||
@@ -20,12 +20,10 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('view', 'tools/methodsPermissions' );
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'tools/methodsPermissions' );
|
||||
|
||||
G::RenderPage( 'publish' );
|
||||
G::RenderPage( 'publish' );
|
||||
|
||||
?>
|
||||
@@ -20,268 +20,220 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
G::LoadClass("webResource");
|
||||
define('GET_PERMISSION_REG_EXP','/(G::\\s*genericForceLogin\\s*\\(\\s*[\'"])(\\w+)([\'"]\\s*,\\s*[\'"].+[\'"],.+\\)\\s*)|(\\$RBAC->userCanAccess\\s*\\(\\s*[\'"])(\\w+)([\'"]\\s*\\))/i');
|
||||
define('GET_PERMISSION_REG_EXP2','/\\s*if\\s*\\(\\s*\\(\\s*\\$RBAC_Response\\s*=\\s*\\$RBAC->userCanAccess\\s*\\(\\s*[\'"]\\w+[\'"]\\s*\\)\\s*\\)\\s*!=1\\s*\\)\\s*return(?:.*)?;\\s*/i');
|
||||
class phpFile extends webResource
|
||||
G::LoadClass( "webResource" );
|
||||
define( 'GET_PERMISSION_REG_EXP', '/(G::\\s*genericForceLogin\\s*\\(\\s*[\'"])(\\w+)([\'"]\\s*,\\s*[\'"].+[\'"],.+\\)\\s*)|(\\$RBAC->userCanAccess\\s*\\(\\s*[\'"])(\\w+)([\'"]\\s*\\))/i' );
|
||||
define( 'GET_PERMISSION_REG_EXP2', '/\\s*if\\s*\\(\\s*\\(\\s*\\$RBAC_Response\\s*=\\s*\\$RBAC->userCanAccess\\s*\\(\\s*[\'"]\\w+[\'"]\\s*\\)\\s*\\)\\s*!=1\\s*\\)\\s*return(?:.*)?;\\s*/i' );
|
||||
|
||||
class phpFile extends webResource
|
||||
{
|
||||
|
||||
function _get_permissions ($filename)
|
||||
{
|
||||
function _get_permissions($filename)
|
||||
{
|
||||
$aSource = file( $filename);
|
||||
$aOutSource = array();
|
||||
$aSource = file( $filename );
|
||||
$aOutSource = array ();
|
||||
$source = implode( '', $aSource );
|
||||
$regExp=GET_PERMISSION_REG_EXP;
|
||||
$permissions=array();
|
||||
$lines=array();
|
||||
$len=preg_match_all($regExp,$source,$matches,PREG_OFFSET_CAPTURE);
|
||||
for($r=0; $r < $len; $r++)
|
||||
{
|
||||
$match=$matches[0][$r][0];
|
||||
$permission=($matches[2][$r][0]!='') ? $matches[2][$r][0]:$matches[5][$r][0];
|
||||
$toPrint=($matches[2][$r][0]!='') ?
|
||||
(
|
||||
htmlentities($matches[1][$r][0],ENT_QUOTES,'utf-8').
|
||||
'<b>'.htmlentities($matches[2][$r][0],ENT_QUOTES,'utf-8').'</b>'.
|
||||
htmlentities($matches[3][$r][0],ENT_QUOTES,'utf-8')
|
||||
)
|
||||
:
|
||||
(
|
||||
htmlentities($matches[4][$r][0],ENT_QUOTES,'utf-8').
|
||||
'<b>'.htmlentities($matches[5][$r][0],ENT_QUOTES,'utf-8').'</b>'.
|
||||
htmlentities($matches[6][$r][0],ENT_QUOTES,'utf-8')
|
||||
);
|
||||
$row = $this->_getLine($aSource,$matches[0][$r][1]);
|
||||
if (array_search($permission,$permissions)===FALSE)
|
||||
{
|
||||
$permissions[]=$permission;
|
||||
$lines[]=$row;
|
||||
$regExp = GET_PERMISSION_REG_EXP;
|
||||
$permissions = array ();
|
||||
$lines = array ();
|
||||
$len = preg_match_all( $regExp, $source, $matches, PREG_OFFSET_CAPTURE );
|
||||
for ($r = 0; $r < $len; $r ++) {
|
||||
$match = $matches[0][$r][0];
|
||||
$permission = ($matches[2][$r][0] != '') ? $matches[2][$r][0] : $matches[5][$r][0];
|
||||
$toPrint = ($matches[2][$r][0] != '') ? (htmlentities( $matches[1][$r][0], ENT_QUOTES, 'utf-8' ) . '<b>' . htmlentities( $matches[2][$r][0], ENT_QUOTES, 'utf-8' ) . '</b>' . htmlentities( $matches[3][$r][0], ENT_QUOTES, 'utf-8' )) : (htmlentities( $matches[4][$r][0], ENT_QUOTES, 'utf-8' ) . '<b>' . htmlentities( $matches[5][$r][0], ENT_QUOTES, 'utf-8' ) . '</b>' . htmlentities( $matches[6][$r][0], ENT_QUOTES, 'utf-8' ));
|
||||
$row = $this->_getLine( $aSource, $matches[0][$r][1] );
|
||||
if (array_search( $permission, $permissions ) === false) {
|
||||
$permissions[] = $permission;
|
||||
$lines[] = $row;
|
||||
}
|
||||
//TODO: Need to htmlencode the rest of the line that is not in match. Ex. < ? php
|
||||
if ($row>0) $aOutSource[$row-1]=str_replace($match,$toPrint,isset($aOutSource[$row-1])?$aOutSource[$row-1]:$aSource[$row-1]);
|
||||
$aOutSource[$row]=str_replace($match,$toPrint,isset($aOutSource[$row])?$aOutSource[$row]:$aSource[$row]);
|
||||
if ($row<(sizeof($aSource)-1)) $aOutSource[$row+1]=str_replace($match,$toPrint,isset($aOutSource[$row+1])?$aOutSource[$row+1]:$aSource[$row+1]);
|
||||
if ($row > 0)
|
||||
$aOutSource[$row - 1] = str_replace( $match, $toPrint, isset( $aOutSource[$row - 1] ) ? $aOutSource[$row - 1] : $aSource[$row - 1] );
|
||||
$aOutSource[$row] = str_replace( $match, $toPrint, isset( $aOutSource[$row] ) ? $aOutSource[$row] : $aSource[$row] );
|
||||
if ($row < (sizeof( $aSource ) - 1))
|
||||
$aOutSource[$row + 1] = str_replace( $match, $toPrint, isset( $aOutSource[$row + 1] ) ? $aOutSource[$row + 1] : $aSource[$row + 1] );
|
||||
}
|
||||
ksort($aOutSource);
|
||||
$row0=0;$html='';
|
||||
foreach($aOutSource as $row => $line)
|
||||
{
|
||||
if (($row-1) > $row0) $html.=$this->_printLine($row,'...');
|
||||
$html.=$this->_printLine($row+1,$line,true,$aSource[$row],$filename.'?'.$row);
|
||||
$row0=$row;
|
||||
ksort( $aOutSource );
|
||||
$row0 = 0;
|
||||
$html = '';
|
||||
foreach ($aOutSource as $row => $line) {
|
||||
if (($row - 1) > $row0)
|
||||
$html .= $this->_printLine( $row, '...' );
|
||||
$html .= $this->_printLine( $row + 1, $line, true, $aSource[$row], $filename . '?' . $row );
|
||||
$row0 = $row;
|
||||
}
|
||||
return array (
|
||||
($html==='')?'Dont have RBAC validation!':('<table>'.$html.'</table>'),
|
||||
$permissions,
|
||||
$lines
|
||||
return array (($html === '') ? 'Dont have RBAC validation!' : ('<table>' . $html . '</table>'),$permissions,$lines
|
||||
);
|
||||
}
|
||||
function get_permissions($filename)
|
||||
|
||||
function get_permissions ($filename)
|
||||
{
|
||||
$res=$this->_get_permissions($filename);
|
||||
$res = $this->_get_permissions( $filename );
|
||||
return $res[0];
|
||||
}
|
||||
function modify_line($filename,$row,$value)
|
||||
{
|
||||
$aSource = file( $filename);
|
||||
$line=$aSource[$row];
|
||||
$nl=(strlen($line)>=2)&&(substr($line,-2,2)=="\r\n")?
|
||||
"\r\n":
|
||||
((strlen($line)>=1)&&(substr($line,-1,1)=="\n")?"\n":"");
|
||||
$aSource[$row]=$value.$nl;
|
||||
/*Save change*/
|
||||
$fp=fopen($filename,'w');
|
||||
fwrite($fp,implode('',$aSource));
|
||||
fclose($fp);
|
||||
/*Format line*/
|
||||
$regExp=GET_PERMISSION_REG_EXP;
|
||||
$line=$aSource[$row];
|
||||
$len=preg_match_all($regExp,$line,$matches,PREG_OFFSET_CAPTURE);
|
||||
for($r=0; $r < $len; $r++)
|
||||
{
|
||||
$match=$matches[0][$r][0];
|
||||
$toPrint=($matches[2][$r][0]!='') ?
|
||||
(
|
||||
htmlentities($matches[1][$r][0],ENT_QUOTES,'utf-8').
|
||||
'<b>'.htmlentities($matches[2][$r][0],ENT_QUOTES,'utf-8').'</b>'.
|
||||
htmlentities($matches[3][$r][0],ENT_QUOTES,'utf-8')
|
||||
)
|
||||
:
|
||||
(
|
||||
htmlentities($matches[4][$r][0],ENT_QUOTES,'utf-8').
|
||||
'<b>'.htmlentities($matches[5][$r][0],ENT_QUOTES,'utf-8').'</b>'.
|
||||
htmlentities($matches[6][$r][0],ENT_QUOTES,'utf-8')
|
||||
);
|
||||
$line=str_replace($match,$toPrint,$line);
|
||||
}
|
||||
return array($line,$aSource[$row]);
|
||||
}
|
||||
function set_header($filename,$value)
|
||||
{
|
||||
$aFields=array("_FILENAME_"=>basename( $filename ) );
|
||||
$value = G::replaceDataField( $value , $aFields );
|
||||
$aOrigin = file( $filename);
|
||||
//It suposse that allway start with <?. or <?php
|
||||
$line=$aOrigin[0];
|
||||
$nl=(strlen($line)>=2)&&(substr($line,-2,2)=="\r\n")?
|
||||
"\r\n":
|
||||
((strlen($line)>=1)&&(substr($line,-1,1)=="\n")?"\n":"");
|
||||
|
||||
$codigo = implode('',$aOrigin);
|
||||
$pattern='/\/\*[\w\W]+\* '.'ProcessMaker Open Source'.'[\w\W]+?\*\//i';
|
||||
if (preg_match($pattern,$codigo))
|
||||
function modify_line ($filename, $row, $value)
|
||||
{
|
||||
$codigo=preg_replace( $pattern, $value , $codigo );
|
||||
}
|
||||
else
|
||||
{
|
||||
$aSource=array();
|
||||
$aSource[0]=$aOrigin[0];
|
||||
$aSource[1]=$value.$nl;
|
||||
for($r=1;$r<sizeof($aOrigin);$r++)
|
||||
{
|
||||
$aSource[]=$aOrigin[$r];
|
||||
}
|
||||
$codigo=implode('',$aSource);
|
||||
}
|
||||
$aSource = file( $filename );
|
||||
$line = $aSource[$row];
|
||||
$nl = (strlen( $line ) >= 2) && (substr( $line, - 2, 2 ) == "\r\n") ? "\r\n" : ((strlen( $line ) >= 1) && (substr( $line, - 1, 1 ) == "\n") ? "\n" : "");
|
||||
$aSource[$row] = $value . $nl;
|
||||
/*Save change*/
|
||||
$fp=fopen($filename,'w');
|
||||
fwrite($fp,$codigo);
|
||||
fclose($fp);
|
||||
return $this->get_permissions($filename);
|
||||
$fp = fopen( $filename, 'w' );
|
||||
fwrite( $fp, implode( '', $aSource ) );
|
||||
fclose( $fp );
|
||||
/*Format line*/
|
||||
$regExp = GET_PERMISSION_REG_EXP;
|
||||
$line = $aSource[$row];
|
||||
$len = preg_match_all( $regExp, $line, $matches, PREG_OFFSET_CAPTURE );
|
||||
for ($r = 0; $r < $len; $r ++) {
|
||||
$match = $matches[0][$r][0];
|
||||
$toPrint = ($matches[2][$r][0] != '') ? (htmlentities( $matches[1][$r][0], ENT_QUOTES, 'utf-8' ) . '<b>' . htmlentities( $matches[2][$r][0], ENT_QUOTES, 'utf-8' ) . '</b>' . htmlentities( $matches[3][$r][0], ENT_QUOTES, 'utf-8' )) : (htmlentities( $matches[4][$r][0], ENT_QUOTES, 'utf-8' ) . '<b>' . htmlentities( $matches[5][$r][0], ENT_QUOTES, 'utf-8' ) . '</b>' . htmlentities( $matches[6][$r][0], ENT_QUOTES, 'utf-8' ));
|
||||
$line = str_replace( $match, $toPrint, $line );
|
||||
}
|
||||
function add_permission($filename,$value)
|
||||
{
|
||||
$aOrigin = file( $filename);
|
||||
//It suposse that allway start with <?. or <?php
|
||||
$aSource[0]=$aOrigin[0];
|
||||
$line=$aOrigin[0];
|
||||
$nl=(strlen($line)>=2)&&(substr($line,-2,2)=="\r\n")?
|
||||
"\r\n":
|
||||
((strlen($line)>=1)&&(substr($line,-1,1)=="\n")?"\n":"");
|
||||
$aSource[1]=$value.$nl;
|
||||
for($r=1;$r<sizeof($aOrigin);$r++)
|
||||
{
|
||||
$aSource[]=$aOrigin[$r];
|
||||
}
|
||||
/*Save change*/
|
||||
$fp=fopen($filename,'w');
|
||||
fwrite($fp,implode('',$aSource));
|
||||
fclose($fp);
|
||||
return $this->get_permissions($filename);
|
||||
}
|
||||
function _getLine(&$aSource,$pos)
|
||||
{
|
||||
$i=1;
|
||||
while ($pos>sizeof($aSource[$i]))
|
||||
{
|
||||
$pos-=strlen($aSource[$i]);
|
||||
$i++;
|
||||
}
|
||||
return $i-1;
|
||||
}
|
||||
function _printLine($row,$txt,$editable=false,$editValue='',$name='')
|
||||
{
|
||||
if ($editable)
|
||||
{
|
||||
return '<tr><td><input value="X" type="button" style="width:100%;" '.
|
||||
' name="'.htmlentities($name,ENT_QUOTES,'utf-8').'"'.
|
||||
' onclick="removeLine(this);"/></td>'.
|
||||
'<td class="treeContent" align="right">'.$row.'</td>
|
||||
<td class="treeNode"><span onclick="switchViewEdit(this,this.nextSibling);">'.
|
||||
$txt.'</span>'.
|
||||
'<input class="treeNode"'.
|
||||
' name="'.htmlentities($name,ENT_QUOTES,'utf-8').'"'.
|
||||
' style="border:none;width:100%;display:none;"'.
|
||||
' onblur="switchEditView(this.previousSibling,this);"'.
|
||||
' value="'.htmlentities($editValue,ENT_QUOTES,'utf-8').'"/></td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
return '<tr><td></td>'.
|
||||
'<td class="treeContent" align="right">'.$row.'</td>'.
|
||||
'<td class="treeNode">'.$txt.'</td></tr>';
|
||||
}
|
||||
}
|
||||
function set_permission($filename,$permission)
|
||||
{
|
||||
list($html,$permissions)=$this->_get_permissions($filename);
|
||||
if (array_search($permission,$permissions)===FALSE)
|
||||
{
|
||||
$this->add_permission
|
||||
(
|
||||
$filename,
|
||||
'if (($RBAC_Response=$RBAC->userCanAccess("'.$permission.'"))!=1) return $RBAC_Response;'
|
||||
return array ($line,$aSource[$row]
|
||||
);
|
||||
}
|
||||
return $this->get_permissions($filename);
|
||||
|
||||
function set_header ($filename, $value)
|
||||
{
|
||||
$aFields = array ("_FILENAME_" => basename( $filename )
|
||||
);
|
||||
$value = G::replaceDataField( $value, $aFields );
|
||||
$aOrigin = file( $filename );
|
||||
//It suposse that allway start with <?. or <?php
|
||||
$line = $aOrigin[0];
|
||||
$nl = (strlen( $line ) >= 2) && (substr( $line, - 2, 2 ) == "\r\n") ? "\r\n" : ((strlen( $line ) >= 1) && (substr( $line, - 1, 1 ) == "\n") ? "\n" : "");
|
||||
|
||||
$codigo = implode( '', $aOrigin );
|
||||
$pattern = '/\/\*[\w\W]+\* ' . 'ProcessMaker Open Source' . '[\w\W]+?\*\//i';
|
||||
if (preg_match( $pattern, $codigo )) {
|
||||
$codigo = preg_replace( $pattern, $value, $codigo );
|
||||
} else {
|
||||
$aSource = array ();
|
||||
$aSource[0] = $aOrigin[0];
|
||||
$aSource[1] = $value . $nl;
|
||||
for ($r = 1; $r < sizeof( $aOrigin ); $r ++) {
|
||||
$aSource[] = $aOrigin[$r];
|
||||
}
|
||||
function set_path_permission($path,$permission)
|
||||
$codigo = implode( '', $aSource );
|
||||
}
|
||||
/*Save change*/
|
||||
$fp = fopen( $filename, 'w' );
|
||||
fwrite( $fp, $codigo );
|
||||
fclose( $fp );
|
||||
return $this->get_permissions( $filename );
|
||||
}
|
||||
|
||||
function add_permission ($filename, $value)
|
||||
{
|
||||
$files=glob($path.'*.php');
|
||||
foreach($files as $file)
|
||||
$aOrigin = file( $filename );
|
||||
//It suposse that allway start with <?. or <?php
|
||||
$aSource[0] = $aOrigin[0];
|
||||
$line = $aOrigin[0];
|
||||
$nl = (strlen( $line ) >= 2) && (substr( $line, - 2, 2 ) == "\r\n") ? "\r\n" : ((strlen( $line ) >= 1) && (substr( $line, - 1, 1 ) == "\n") ? "\n" : "");
|
||||
$aSource[1] = $value . $nl;
|
||||
for ($r = 1; $r < sizeof( $aOrigin ); $r ++) {
|
||||
$aSource[] = $aOrigin[$r];
|
||||
}
|
||||
/*Save change*/
|
||||
$fp = fopen( $filename, 'w' );
|
||||
fwrite( $fp, implode( '', $aSource ) );
|
||||
fclose( $fp );
|
||||
return $this->get_permissions( $filename );
|
||||
}
|
||||
|
||||
function _getLine (&$aSource, $pos)
|
||||
{
|
||||
$this->set_permission($file,$permission);
|
||||
$i = 1;
|
||||
while ($pos > sizeof( $aSource[$i] )) {
|
||||
$pos -= strlen( $aSource[$i] );
|
||||
$i ++;
|
||||
}
|
||||
return $i - 1;
|
||||
}
|
||||
|
||||
function _printLine ($row, $txt, $editable = false, $editValue = '', $name = '')
|
||||
{
|
||||
if ($editable) {
|
||||
return '<tr><td><input value="X" type="button" style="width:100%;" ' . ' name="' . htmlentities( $name, ENT_QUOTES, 'utf-8' ) . '"' . ' onclick="removeLine(this);"/></td>' . '<td class="treeContent" align="right">' . $row . '</td>
|
||||
<td class="treeNode"><span onclick="switchViewEdit(this,this.nextSibling);">' . $txt . '</span>' . '<input class="treeNode"' . ' name="' . htmlentities( $name, ENT_QUOTES, 'utf-8' ) . '"' . ' style="border:none;width:100%;display:none;"' . ' onblur="switchEditView(this.previousSibling,this);"' . ' value="' . htmlentities( $editValue, ENT_QUOTES, 'utf-8' ) . '"/></td></tr>';
|
||||
} else {
|
||||
return '<tr><td></td>' . '<td class="treeContent" align="right">' . $row . '</td>' . '<td class="treeNode">' . $txt . '</td></tr>';
|
||||
}
|
||||
}
|
||||
function set_path_header($path,$header)
|
||||
|
||||
function set_permission ($filename, $permission)
|
||||
{
|
||||
$files=glob($path.'*.php');
|
||||
$filesMod=array();
|
||||
foreach($files as $file)
|
||||
{
|
||||
$filesMod[]=$file;
|
||||
$this->set_header($file,$header);
|
||||
list ($html, $permissions) = $this->_get_permissions( $filename );
|
||||
if (array_search( $permission, $permissions ) === false) {
|
||||
$this->add_permission( $filename, 'if (($RBAC_Response=$RBAC->userCanAccess("' . $permission . '"))!=1) return $RBAC_Response;' );
|
||||
}
|
||||
$dirs=glob($path.'*', GLOB_MARK );
|
||||
foreach($dirs as $dir)
|
||||
return $this->get_permissions( $filename );
|
||||
}
|
||||
|
||||
function set_path_permission ($path, $permission)
|
||||
{
|
||||
if (substr( $dir , -1 , 1 )=='/') $this->set_path_header($dir,$header);
|
||||
$files = glob( $path . '*.php' );
|
||||
foreach ($files as $file) {
|
||||
$this->set_permission( $file, $permission );
|
||||
}
|
||||
}
|
||||
|
||||
function set_path_header ($path, $header)
|
||||
{
|
||||
$files = glob( $path . '*.php' );
|
||||
$filesMod = array ();
|
||||
foreach ($files as $file) {
|
||||
$filesMod[] = $file;
|
||||
$this->set_header( $file, $header );
|
||||
}
|
||||
$dirs = glob( $path . '*', GLOB_MARK );
|
||||
foreach ($dirs as $dir) {
|
||||
if (substr( $dir, - 1, 1 ) == '/')
|
||||
$this->set_path_header( $dir, $header );
|
||||
}
|
||||
return $filesMod;
|
||||
}
|
||||
function remove_path_permission($path,$permission)
|
||||
|
||||
function remove_path_permission ($path, $permission)
|
||||
{
|
||||
$files=glob($path.'*.php');
|
||||
foreach($files as $file)
|
||||
{
|
||||
$this->remove_permission($file,$permission);
|
||||
$files = glob( $path . '*.php' );
|
||||
foreach ($files as $file) {
|
||||
$this->remove_permission( $file, $permission );
|
||||
}
|
||||
}
|
||||
function remove_line($filename,$line)
|
||||
|
||||
function remove_line ($filename, $line)
|
||||
{
|
||||
$aSource = file($filename);
|
||||
unset($aSource[$line]);
|
||||
$aSource = file( $filename );
|
||||
unset( $aSource[$line] );
|
||||
/*Save change*/
|
||||
$fp=fopen($filename,'w');
|
||||
fwrite($fp,implode('',$aSource));
|
||||
fclose($fp);
|
||||
return $this->get_permissions($filename);
|
||||
$fp = fopen( $filename, 'w' );
|
||||
fwrite( $fp, implode( '', $aSource ) );
|
||||
fclose( $fp );
|
||||
return $this->get_permissions( $filename );
|
||||
}
|
||||
function remove_permission($filename,$permission)
|
||||
|
||||
function remove_permission ($filename, $permission)
|
||||
{
|
||||
$aSource = file( $filename);
|
||||
list($html,$permissions,$lines) = $this->_get_permissions($filename);
|
||||
if (($row=array_search($permission,$permissions))!==FALSE)
|
||||
{
|
||||
$line=$lines[$row];
|
||||
if (preg_match(GET_PERMISSION_REG_EXP2,$aSource[$line]))
|
||||
{
|
||||
unset($aSource[$line]);
|
||||
$msg="Removed.";
|
||||
}
|
||||
else
|
||||
{
|
||||
$msg="Can not be removed!";
|
||||
$aSource = file( $filename );
|
||||
list ($html, $permissions, $lines) = $this->_get_permissions( $filename );
|
||||
if (($row = array_search( $permission, $permissions )) !== false) {
|
||||
$line = $lines[$row];
|
||||
if (preg_match( GET_PERMISSION_REG_EXP2, $aSource[$line] )) {
|
||||
unset( $aSource[$line] );
|
||||
$msg = "Removed.";
|
||||
} else {
|
||||
$msg = "Can not be removed!";
|
||||
}
|
||||
}
|
||||
/*Save change*/
|
||||
$fp=fopen($filename,'w');
|
||||
fwrite($fp,implode('',$aSource));
|
||||
fclose($fp);
|
||||
return $this->get_permissions($filename);
|
||||
$fp = fopen( $filename, 'w' );
|
||||
fwrite( $fp, implode( '', $aSource ) );
|
||||
fclose( $fp );
|
||||
return $this->get_permissions( $filename );
|
||||
}
|
||||
}
|
||||
$phpFile=new phpFile('methodsPermissions_Ajax',$_POST);
|
||||
?>
|
||||
}
|
||||
$phpFile = new phpFile( 'methodsPermissions_Ajax', $_POST );
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<style>
|
||||
.tableOption {
|
||||
color:#005791 !important;
|
||||
color: #005791 !important;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
@@ -25,21 +25,20 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
$G_MAIN_MENU = 'tools';
|
||||
$G_SUB_MENU = 'toolsTranslations';
|
||||
$G_ID_MENU_SELECTED = 'TRANSLATION';
|
||||
$G_ID_SUB_MENU_SELECTED = 'TRANSLATION_LIST';
|
||||
$G_MAIN_MENU = 'tools';
|
||||
$G_SUB_MENU = 'toolsTranslations';
|
||||
$G_ID_MENU_SELECTED = 'TRANSLATION';
|
||||
$G_ID_SUB_MENU_SELECTED = 'TRANSLATION_LIST';
|
||||
|
||||
$table="TRANSLATION";
|
||||
$table = "TRANSLATION";
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('pagedtable', 'paged-table', 'tools/translationsList', '', array() , '');
|
||||
if( isset($_SESSION['TOOLS_VIEWTYPE']) ) {
|
||||
G::RenderPage('publishBlank', 'green-submenu');
|
||||
} else {
|
||||
G::RenderPage('publish');
|
||||
}
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'pagedtable', 'paged-table', 'tools/translationsList', '', array (), '' );
|
||||
if (isset( $_SESSION['TOOLS_VIEWTYPE'] )) {
|
||||
G::RenderPage( 'publishBlank', 'green-submenu' );
|
||||
} else {
|
||||
G::RenderPage( 'publish' );
|
||||
}
|
||||
|
||||
|
||||
@@ -20,19 +20,18 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$G_MAIN_MENU = 'tools';
|
||||
$G_SUB_MENU = 'toolsTranslations';
|
||||
$G_ID_MENU_SELECTED = 'TRANSLATION';
|
||||
$G_ID_SUB_MENU_SELECTED = 'TRANSLATION_ADD';
|
||||
$G_MAIN_MENU = 'tools';
|
||||
$G_SUB_MENU = 'toolsTranslations';
|
||||
$G_ID_MENU_SELECTED = 'TRANSLATION';
|
||||
$G_ID_SUB_MENU_SELECTED = 'TRANSLATION_ADD';
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'tools/translationAdd', '', null, 'translationsSave' );
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tools/translationAdd', '', null, 'translationsSave' );
|
||||
|
||||
if (isset( $_SESSION['TOOLS_VIEWTYPE'] ) && $_SESSION['TOOLS_VIEWTYPE'] == 'blank') {
|
||||
G::RenderPage( 'publishBlank', 'green-submenu' );
|
||||
} else {
|
||||
G::RenderPage( 'publish' );
|
||||
}
|
||||
|
||||
if( isset($_SESSION['TOOLS_VIEWTYPE']) && $_SESSION['TOOLS_VIEWTYPE'] == 'blank') {
|
||||
G::RenderPage('publishBlank', 'green-submenu');
|
||||
} else {
|
||||
G::RenderPage('publish');
|
||||
}
|
||||
?>
|
||||
@@ -20,71 +20,71 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
ini_set('display_errors','off');
|
||||
G::LoadInclude('ajax');
|
||||
$function = get_ajax_value('function');
|
||||
$cat = get_ajax_value('cat');
|
||||
$node = get_ajax_value('node');
|
||||
$lang = get_ajax_value('lang');
|
||||
$langLabel = get_ajax_value('langLabel');
|
||||
$text = get_ajax_value('text');
|
||||
$table="TRANSLATION";
|
||||
$dbc = new DBConnection;
|
||||
$ses = new DBSession($dbc);
|
||||
switch($function)
|
||||
{
|
||||
ini_set( 'display_errors', 'off' );
|
||||
G::LoadInclude( 'ajax' );
|
||||
$function = get_ajax_value( 'function' );
|
||||
$cat = get_ajax_value( 'cat' );
|
||||
$node = get_ajax_value( 'node' );
|
||||
$lang = get_ajax_value( 'lang' );
|
||||
$langLabel = get_ajax_value( 'langLabel' );
|
||||
$text = get_ajax_value( 'text' );
|
||||
$table = "TRANSLATION";
|
||||
$dbc = new DBConnection();
|
||||
$ses = new DBSession( $dbc );
|
||||
switch ($function) {
|
||||
case "editLabel":
|
||||
case "changeLabel":
|
||||
$query=$ses->execute("select * from $table where TRN_CATEGORY='$cat' and TRN_ID='$node' and TRN_LANG='$lang'",false);
|
||||
if ($query->count()===0) {echo("Not found $cat:$node:$lang in table '$table'");return;}
|
||||
if ($query->count()>1) {echo("The $cat:$node:$lang in table '$table' is not unique");return;}
|
||||
$res=$query->read();
|
||||
switch($function)
|
||||
{
|
||||
$query = $ses->execute( "select * from $table where TRN_CATEGORY='$cat' and TRN_ID='$node' and TRN_LANG='$lang'", false );
|
||||
if ($query->count() === 0) {
|
||||
echo ("Not found $cat:$node:$lang in table '$table'");
|
||||
return;
|
||||
}
|
||||
if ($query->count() > 1) {
|
||||
echo ("The $cat:$node:$lang in table '$table' is not unique");
|
||||
return;
|
||||
}
|
||||
$res = $query->read();
|
||||
switch ($function) {
|
||||
case "editLabel":
|
||||
$myID="input_".$cat."_".$node."_".$lang;
|
||||
$myID='aux';
|
||||
echo("<input id='$myID' type='text' value='".htmlspecialchars($res['TRN_VALUE'])."' ".
|
||||
ajax_event("onblur","translationsAjax.php",
|
||||
'lang_'.$cat.'_'.$node.'_'.$lang,
|
||||
"'function=changeLabel&cat=".urlencode($cat).
|
||||
"&node=".urlencode($node).
|
||||
"&lang=".urlencode($lang).
|
||||
"&langLabel='+encodeURI(getElementById('$myID').value)",'')
|
||||
."/>");
|
||||
$myID = "input_" . $cat . "_" . $node . "_" . $lang;
|
||||
$myID = 'aux';
|
||||
echo ("<input id='$myID' type='text' value='" . htmlspecialchars( $res['TRN_VALUE'] ) . "' " . ajax_event( "onblur", "translationsAjax.php", 'lang_' . $cat . '_' . $node . '_' . $lang, "'function=changeLabel&cat=" . urlencode( $cat ) . "&node=" . urlencode( $node ) . "&lang=" . urlencode( $lang ) . "&langLabel='+encodeURI(getElementById('$myID').value)", '' ) . "/>");
|
||||
break;
|
||||
case "changeLabel":
|
||||
$update=$ses->execute("update $table set TRN_VALUE='$langLabel' where TRN_CATEGORY='$cat' and TRN_ID='$node' and TRN_LANG='$lang'",false);
|
||||
$query=$ses->execute("select * from $table where TRN_CATEGORY='$cat' and TRN_ID='$node' and TRN_LANG='$lang'",false);
|
||||
if ($query->count()===0) {echo("Not found $cat:$node:$lang in table '$table'");return;}
|
||||
if ($query->count()>1) {echo("The $cat:$node:$lang in table '$table' is not unique");return;}
|
||||
$res=$query->read();
|
||||
echo(htmlspecialchars($res['TRN_VALUE']));
|
||||
$update = $ses->execute( "update $table set TRN_VALUE='$langLabel' where TRN_CATEGORY='$cat' and TRN_ID='$node' and TRN_LANG='$lang'", false );
|
||||
$query = $ses->execute( "select * from $table where TRN_CATEGORY='$cat' and TRN_ID='$node' and TRN_LANG='$lang'", false );
|
||||
if ($query->count() === 0) {
|
||||
echo ("Not found $cat:$node:$lang in table '$table'");
|
||||
return;
|
||||
}
|
||||
if ($query->count() > 1) {
|
||||
echo ("The $cat:$node:$lang in table '$table' is not unique");
|
||||
return;
|
||||
}
|
||||
$res = $query->read();
|
||||
echo (htmlspecialchars( $res['TRN_VALUE'] ));
|
||||
break;
|
||||
break;
|
||||
}
|
||||
G::LoadClass( "translation" );
|
||||
|
||||
$dbc = new DBConnection;
|
||||
$obj = new Translation;
|
||||
$obj->SetTo($dbc );
|
||||
$dbc = new DBConnection();
|
||||
$obj = new Translation();
|
||||
$obj->SetTo( $dbc );
|
||||
$translation2 = $obj->generateFileTranslation();
|
||||
break;
|
||||
case "listLanguage":
|
||||
$query=$ses->execute("select distinct TRN_LANG from $table",false);
|
||||
$template = new TemplatePower(PATH_CORE . 'templates/tools/translationsTP.html');
|
||||
$query = $ses->execute( "select distinct TRN_LANG from $table", false );
|
||||
$template = new TemplatePower( PATH_CORE . 'templates/tools/translationsTP.html' );
|
||||
$template->prepare();
|
||||
$template->newBlock("languageList");
|
||||
$template->assign("ajaxDelLang",ajax_event("onclick","translationsAjax","showSpace",
|
||||
"'function=delLanguage&lang='+encodeURI(getElementById('language').value)",'hideLangBar'));
|
||||
$template->newBlock( "languageList" );
|
||||
$template->assign( "ajaxDelLang", ajax_event( "onclick", "translationsAjax", "showSpace", "'function=delLanguage&lang='+encodeURI(getElementById('language').value)", 'hideLangBar' ) );
|
||||
|
||||
for($r=1;$r<=$query->count();$r++)
|
||||
{
|
||||
$res=$query->read();
|
||||
$template->newBlock("languageItem");
|
||||
$template->assign("langIdRadio",$res['TRN_LANG']);
|
||||
for ($r = 1; $r <= $query->count(); $r ++) {
|
||||
$res = $query->read();
|
||||
$template->newBlock( "languageItem" );
|
||||
$template->assign( "langIdRadio", $res['TRN_LANG'] );
|
||||
}
|
||||
$template->printToScreen();
|
||||
break;
|
||||
@@ -94,124 +94,112 @@ switch($function)
|
||||
case "addLanguage":
|
||||
case "delLanguage":
|
||||
case "delField":
|
||||
switch($function)
|
||||
{
|
||||
switch ($function) {
|
||||
case "show":
|
||||
$query=$ses->execute("select * from $table ORDER BY TRN_CATEGORY ASC , TRN_ID ASC , TRN_LANG ASC ",false);
|
||||
$query = $ses->execute( "select * from $table ORDER BY TRN_CATEGORY ASC , TRN_ID ASC , TRN_LANG ASC ", false );
|
||||
break;
|
||||
case "search":
|
||||
$query=$ses->execute("select * from $table where (TRN_CATEGORY like '%$text%') or (TRN_ID like '%$text%') or (TRN_LANG like '%$text%') or (TRN_VALUE like '%$text%') ORDER BY TRN_CATEGORY ASC , TRN_ID ASC , TRN_LANG ASC ",false);
|
||||
$query = $ses->execute( "select * from $table where (TRN_CATEGORY like '%$text%') or (TRN_ID like '%$text%') or (TRN_LANG like '%$text%') or (TRN_VALUE like '%$text%') ORDER BY TRN_CATEGORY ASC , TRN_ID ASC , TRN_LANG ASC ", false );
|
||||
break;
|
||||
case "addField":
|
||||
if (!defined('LANGUAGES')) define('LANGUAGES',SYS_LANG);
|
||||
$languages=explode(",",LANGUAGES);
|
||||
foreach($languages as $lang)
|
||||
{
|
||||
if (! defined( 'LANGUAGES' ))
|
||||
define( 'LANGUAGES', SYS_LANG );
|
||||
$languages = explode( ",", LANGUAGES );
|
||||
foreach ($languages as $lang) {
|
||||
//$langLabel=$cat;
|
||||
/* $update=$ses->execute("insert into $table(TRN_CATEGORY , TRN_ID , TRN_LANG , TRN_VALUE )
|
||||
/* $update=$ses->execute("insert into $table(TRN_CATEGORY , TRN_ID , TRN_LANG , TRN_VALUE )
|
||||
values ('$cat','$node','$lang','$langLabel')",false);*/
|
||||
$update=$ses->execute("insert into $table(TRN_CATEGORY , TRN_ID , TRN_LANG , TRN_VALUE )
|
||||
values ('LABEL','$node','$lang','$langLabel')",false);
|
||||
$update = $ses->execute( "insert into $table(TRN_CATEGORY , TRN_ID , TRN_LANG , TRN_VALUE )
|
||||
values ('LABEL','$node','$lang','$langLabel')", false );
|
||||
}
|
||||
$query=$ses->execute("select * from $table ORDER BY TRN_CATEGORY ASC , TRN_ID ASC , TRN_LANG ASC ",false);
|
||||
$query = $ses->execute( "select * from $table ORDER BY TRN_CATEGORY ASC , TRN_ID ASC , TRN_LANG ASC ", false );
|
||||
break;
|
||||
case "addLanguage":
|
||||
//SELECT distinct TRN_CATEGORY, TRN_ID, 'ne', 'new value' FROM TRANSLATION WHERE TRN_LANG<>'ne'
|
||||
//INSERT INTO TRANSLATION(TRN_CATEGORY, TRN_ID, TRN_LANG , TRN_VALUE ) SELECT distinct TRN_CATEGORY, TRN_ID, 'ne', TRN_VALUE FROM TRANSLATION WHERE TRN_LANG<>'ne'
|
||||
$query1=$ses->execute("select * from $table where TRN_LANG='$lang'",false);
|
||||
$query2=$ses->execute("select distinct TRN_CATEGORY, TRN_ID from $table",false);
|
||||
$existe=array();
|
||||
for($r=1;$r<=$query1->count();$r++)
|
||||
{
|
||||
$res=$query1->read();
|
||||
$existe[$res['TRN_CATEGORY']."_".$res['TRN_ID']]=$res;
|
||||
//SELECT distinct TRN_CATEGORY, TRN_ID, 'ne', 'new value' FROM TRANSLATION WHERE TRN_LANG<>'ne'
|
||||
//INSERT INTO TRANSLATION(TRN_CATEGORY, TRN_ID, TRN_LANG , TRN_VALUE ) SELECT distinct TRN_CATEGORY, TRN_ID, 'ne', TRN_VALUE FROM TRANSLATION WHERE TRN_LANG<>'ne'
|
||||
$query1 = $ses->execute( "select * from $table where TRN_LANG='$lang'", false );
|
||||
$query2 = $ses->execute( "select distinct TRN_CATEGORY, TRN_ID from $table", false );
|
||||
$existe = array ();
|
||||
for ($r = 1; $r <= $query1->count(); $r ++) {
|
||||
$res = $query1->read();
|
||||
$existe[$res['TRN_CATEGORY'] . "_" . $res['TRN_ID']] = $res;
|
||||
}
|
||||
for($r=1;$r<=$query2->count();$r++)
|
||||
{
|
||||
$res=$query2->read();
|
||||
$cat=$res['TRN_CATEGORY'];
|
||||
$node=$res['TRN_ID'];
|
||||
$langLabel=$res['TRN_CATEGORY'];
|
||||
if (!array_key_exists($cat."_".$node,$existe))
|
||||
for ($r = 1; $r <= $query2->count(); $r ++) {
|
||||
$res = $query2->read();
|
||||
$cat = $res['TRN_CATEGORY'];
|
||||
$node = $res['TRN_ID'];
|
||||
$langLabel = $res['TRN_CATEGORY'];
|
||||
if (! array_key_exists( $cat . "_" . $node, $existe ))
|
||||
/* $update=$ses->execute("insert into $table(TRN_CATEGORY , TRN_ID , TRN_LANG , TRN_VALUE )
|
||||
values ('$cat','$node','$lang','$langLabel')",false);*/
|
||||
$update=$ses->execute("insert into $table(TRN_CATEGORY , TRN_ID , TRN_LANG , TRN_VALUE )
|
||||
values ('LABELS','$node','en','$langLabel')",false);
|
||||
unset($update);
|
||||
$update = $ses->execute( "insert into $table(TRN_CATEGORY , TRN_ID , TRN_LANG , TRN_VALUE )
|
||||
values ('LABELS','$node','en','$langLabel')", false );
|
||||
unset( $update );
|
||||
}
|
||||
unset($existe);
|
||||
unset($query1);unset($query2);
|
||||
$query=$ses->execute("select * from $table ORDER BY TRN_CATEGORY ASC , TRN_ID ASC , TRN_LANG ASC ",false);
|
||||
unset( $existe );
|
||||
unset( $query1 );
|
||||
unset( $query2 );
|
||||
$query = $ses->execute( "select * from $table ORDER BY TRN_CATEGORY ASC , TRN_ID ASC , TRN_LANG ASC ", false );
|
||||
break;
|
||||
case "delLanguage":
|
||||
$update=$ses->execute("delete from $table where TRN_LANG='$lang'",false);
|
||||
$query=$ses->execute("select * from $table ORDER BY TRN_CATEGORY ASC , TRN_ID ASC , TRN_LANG ASC ",false);
|
||||
$update = $ses->execute( "delete from $table where TRN_LANG='$lang'", false );
|
||||
$query = $ses->execute( "select * from $table ORDER BY TRN_CATEGORY ASC , TRN_ID ASC , TRN_LANG ASC ", false );
|
||||
break;
|
||||
case "delField":
|
||||
$update=$ses->execute("delete from $table where TRN_CATEGORY='$cat' and TRN_ID='$node' and TRN_LANG='$lang'",false);
|
||||
$update = $ses->execute( "delete from $table where TRN_CATEGORY='$cat' and TRN_ID='$node' and TRN_LANG='$lang'", false );
|
||||
//echo("delete from $table where TRN_CATEGORY='$cat' and TRN_ID='$node' and TRN_LANG='$lang'");
|
||||
$query=$ses->execute("select * from $table ORDER BY TRN_CATEGORY ASC , TRN_ID ASC , TRN_LANG ASC ",false);
|
||||
$query = $ses->execute( "select * from $table ORDER BY TRN_CATEGORY ASC , TRN_ID ASC , TRN_LANG ASC ", false );
|
||||
break;
|
||||
}
|
||||
$template = new TemplatePower(PATH_CORE . 'templates/tools/translationsTP.html');
|
||||
$template = new TemplatePower( PATH_CORE . 'templates/tools/translationsTP.html' );
|
||||
$template->prepare();
|
||||
$template->newBlock("CONTENT");
|
||||
$template->newBlock("table");
|
||||
$aCat="";$aNode="";
|
||||
for($i=1;$i<=$query->count();$i++)
|
||||
{
|
||||
$template->newBlock("row");
|
||||
$res=$query->read();
|
||||
$cat=$res['TRN_CATEGORY'];
|
||||
$node=$res['TRN_ID'];
|
||||
$lang=$res['TRN_LANG'];
|
||||
$langLabel=$res['TRN_VALUE'];
|
||||
if ($cat!=$aCat)
|
||||
{
|
||||
$template->newBlock("TDcat");
|
||||
$template->assign("catId",$res['TRN_CATEGORY']);
|
||||
$template->assign("ajaxDelField",
|
||||
ajax_event('onclick','translationsAjax','showSpace',
|
||||
"'function=delField".
|
||||
"&cat=".urlencode($cat).
|
||||
"&node=".urlencode($node).
|
||||
"&lang=".urlencode($lang)."'",''));
|
||||
$template->newBlock( "CONTENT" );
|
||||
$template->newBlock( "table" );
|
||||
$aCat = "";
|
||||
$aNode = "";
|
||||
for ($i = 1; $i <= $query->count(); $i ++) {
|
||||
$template->newBlock( "row" );
|
||||
$res = $query->read();
|
||||
$cat = $res['TRN_CATEGORY'];
|
||||
$node = $res['TRN_ID'];
|
||||
$lang = $res['TRN_LANG'];
|
||||
$langLabel = $res['TRN_VALUE'];
|
||||
if ($cat != $aCat) {
|
||||
$template->newBlock( "TDcat" );
|
||||
$template->assign( "catId", $res['TRN_CATEGORY'] );
|
||||
$template->assign( "ajaxDelField", ajax_event( 'onclick', 'translationsAjax', 'showSpace', "'function=delField" . "&cat=" . urlencode( $cat ) . "&node=" . urlencode( $node ) . "&lang=" . urlencode( $lang ) . "'", '' ) );
|
||||
}
|
||||
if (($cat!=$aCat) ||
|
||||
($node!=$aNode))
|
||||
{
|
||||
$template->newBlock("TDnode");
|
||||
$template->assign("nodeId",$res['TRN_ID']);
|
||||
if (($cat != $aCat) || ($node != $aNode)) {
|
||||
$template->newBlock( "TDnode" );
|
||||
$template->assign( "nodeId", $res['TRN_ID'] );
|
||||
}
|
||||
//$aCat=$cat;
|
||||
//$aNode=$node;
|
||||
$template->goToBlock("row");
|
||||
$template->assign("catId",$res['TRN_CATEGORY']);
|
||||
$template->assign("nodeId",$res['TRN_ID']);
|
||||
$template->assign("langId",$lang);
|
||||
$template->assign("langLabel",$langLabel);
|
||||
$template->assign("ajaxLabel","onclick=\"if (!document.getElementById('aux'))".
|
||||
ajax_init('translationsAjax.php',
|
||||
'lang_'.$cat.'_'.$node.'_'.$lang,
|
||||
"'function=editLabel".
|
||||
"&cat=".urlencode($cat).
|
||||
"&node=".urlencode($node).
|
||||
"&lang=".urlencode($lang)."'",'focusInputLabel')
|
||||
.'"');
|
||||
$template->goToBlock( "row" );
|
||||
$template->assign( "catId", $res['TRN_CATEGORY'] );
|
||||
$template->assign( "nodeId", $res['TRN_ID'] );
|
||||
$template->assign( "langId", $lang );
|
||||
$template->assign( "langLabel", $langLabel );
|
||||
$template->assign( "ajaxLabel", "onclick=\"if (!document.getElementById('aux'))" . ajax_init( 'translationsAjax.php', 'lang_' . $cat . '_' . $node . '_' . $lang, "'function=editLabel" . "&cat=" . urlencode( $cat ) . "&node=" . urlencode( $node ) . "&lang=" . urlencode( $lang ) . "'", 'focusInputLabel' ) . '"' );
|
||||
}
|
||||
$template->printToScreen();
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
function ajax_event($event="onclick",$page,$div,$param,$freturn="")
|
||||
|
||||
|
||||
function ajax_event ($event = "onclick", $page, $div, $param, $freturn = "")
|
||||
{
|
||||
if ($freturn==='') $freturn="''";
|
||||
if ($freturn === '')
|
||||
$freturn = "''";
|
||||
return "$event=\"ajax_init('$page','$div',$param,$freturn)\"";
|
||||
}
|
||||
function ajax_init($page,$div,$param,$freturn="")
|
||||
|
||||
function ajax_init ($page, $div, $param, $freturn = "")
|
||||
{
|
||||
if ($freturn=='') $freturn="''";
|
||||
if ($freturn == '')
|
||||
$freturn = "''";
|
||||
return "ajax_init('$page','$div',$param,$freturn);";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,24 +20,24 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
//to do: improve the way to pass two or more parameters in the paged-table ( link )
|
||||
|
||||
$aux = explode ( '|', $_GET['id'] );
|
||||
$category = str_replace ( '"', '', $aux[0] );
|
||||
$id = str_replace ( '"', '', $aux[1] );
|
||||
//to do: improve the way to pass two or more parameters in the paged-table ( link )
|
||||
|
||||
|
||||
require_once ( "classes/model/Translation.php" );
|
||||
//if exists the row in the database propel will update it, otherwise will insert.
|
||||
$tr = TranslationPeer::retrieveByPK( $category, $id, 'en' );
|
||||
$aux = explode( '|', $_GET['id'] );
|
||||
$category = str_replace( '"', '', $aux[0] );
|
||||
$id = str_replace( '"', '', $aux[1] );
|
||||
|
||||
if ( ( is_object ( $tr ) && get_class ($tr) == 'Translation' ) ) {
|
||||
require_once ("classes/model/Translation.php");
|
||||
//if exists the row in the database propel will update it, otherwise will insert.
|
||||
$tr = TranslationPeer::retrieveByPK( $category, $id, 'en' );
|
||||
|
||||
if ((is_object( $tr ) && get_class( $tr ) == 'Translation')) {
|
||||
$tr->delete();
|
||||
}
|
||||
}
|
||||
// else
|
||||
|
||||
G::Header('location: translations');
|
||||
?>
|
||||
|
||||
G::Header( 'location: translations' );
|
||||
|
||||
|
||||
@@ -20,41 +20,39 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
//to do: improve the way to pass two or more parameters in the paged-table ( link )
|
||||
|
||||
$aux = explode ( '|', $_GET['id'] );
|
||||
$category = str_replace ( '"', '', $aux[0] );
|
||||
$id = str_replace ( '"', '', $aux[1] );
|
||||
//to do: improve the way to pass two or more parameters in the paged-table ( link )
|
||||
|
||||
|
||||
require_once ( "classes/model/Translation.php" );
|
||||
//if exists the row in the database propel will update it, otherwise will insert.
|
||||
$tr = TranslationPeer::retrieveByPK( $category, $id, 'en' );
|
||||
$aux = explode( '|', $_GET['id'] );
|
||||
$category = str_replace( '"', '', $aux[0] );
|
||||
$id = str_replace( '"', '', $aux[1] );
|
||||
|
||||
if ( ( is_object ( $tr ) && get_class ($tr) == 'Translation' ) ) {
|
||||
require_once ("classes/model/Translation.php");
|
||||
//if exists the row in the database propel will update it, otherwise will insert.
|
||||
$tr = TranslationPeer::retrieveByPK( $category, $id, 'en' );
|
||||
|
||||
if ((is_object( $tr ) && get_class( $tr ) == 'Translation')) {
|
||||
$fields['trn_category'] = $tr->getTrnCategory();
|
||||
$fields['trn_id'] = $tr->getTrnId();
|
||||
$fields['trn_value'] = $tr->getTrnValue();
|
||||
}
|
||||
else
|
||||
$fields = array();
|
||||
} else
|
||||
$fields = array ();
|
||||
|
||||
$G_MAIN_MENU = 'tools';
|
||||
$G_SUB_MENU = 'toolsTranslations';
|
||||
$G_ID_MENU_SELECTED = 'TOOLS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'ADD_TRANSLATION';
|
||||
$G_MAIN_MENU = 'tools';
|
||||
$G_SUB_MENU = 'toolsTranslations';
|
||||
$G_ID_MENU_SELECTED = 'TOOLS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'ADD_TRANSLATION';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$dbc = new DBConnection();
|
||||
$ses = new DBSession( $dbc );
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tools/translationAdd', '', $fields, 'translationsSave' );
|
||||
if (isset( $_SESSION['TOOLS_VIEWTYPE'] ) && $_SESSION['TOOLS_VIEWTYPE'] == 'blank') {
|
||||
G::RenderPage( 'publishBlank', 'green-submenu' );
|
||||
} else {
|
||||
G::RenderPage( 'publish' );
|
||||
}
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$dbc = new DBConnection;
|
||||
$ses = new DBSession($dbc);
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'tools/translationAdd', '', $fields, 'translationsSave' );
|
||||
if( isset($_SESSION['TOOLS_VIEWTYPE']) && $_SESSION['TOOLS_VIEWTYPE'] == 'blank') {
|
||||
G::RenderPage('publishBlank', 'green-submenu');
|
||||
} else {
|
||||
G::RenderPage('publish');
|
||||
}
|
||||
?>
|
||||
@@ -20,17 +20,16 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
$form = $_POST['form'];
|
||||
require_once ( "classes/model/Translation.php" );
|
||||
$form['trn_value'] = preg_replace("[\n|\r|\n\r]", ' ', $form['trn_value']);
|
||||
$form = $_POST['form'];
|
||||
require_once ("classes/model/Translation.php");
|
||||
$form['trn_value'] = preg_replace( "[\n|\r|\n\r]", ' ', $form['trn_value'] );
|
||||
|
||||
//$t = new Translation;
|
||||
$res = Translation::addTranslation( $form['trn_category'], $form['trn_id'], 'en', $form['trn_value'] );
|
||||
if ($res['codError'] < 0) {
|
||||
G::SendMessageText( $res['message'], 'error' );
|
||||
}
|
||||
G::Header( 'location: translations' );
|
||||
|
||||
//$t = new Translation;
|
||||
$res = Translation::addTranslation( $form['trn_category'], $form['trn_id'], 'en' , $form['trn_value'] );
|
||||
if ( $res['codError'] < 0 ) {
|
||||
G::SendMessageText ( $res['message'] , 'error' );
|
||||
}
|
||||
G::Header('location: translations');
|
||||
?>
|
||||
@@ -20,24 +20,23 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once ( "classes/model/Translation.php" );
|
||||
require_once ("classes/model/Translation.php");
|
||||
|
||||
$t = new Translation;
|
||||
$fields = Translation::generateFileTranslation('en');
|
||||
$t = new Translation();
|
||||
$fields = Translation::generateFileTranslation( 'en' );
|
||||
|
||||
$G_MAIN_MENU = 'tools';
|
||||
$G_SUB_MENU = 'toolsTranslations';
|
||||
$G_ID_MENU_SELECTED = 'TRANSLATION';
|
||||
$G_ID_SUB_MENU_SELECTED = 'TRANSLATION_REBUILD';
|
||||
$G_MAIN_MENU = 'tools';
|
||||
$G_SUB_MENU = 'toolsTranslations';
|
||||
$G_ID_MENU_SELECTED = 'TRANSLATION';
|
||||
$G_ID_SUB_MENU_SELECTED = 'TRANSLATION_REBUILD';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tools/updateTranslation', '', $fields );
|
||||
if (isset( $_SESSION['TOOLS_VIEWTYPE'] ) && $_SESSION['TOOLS_VIEWTYPE'] == 'blank') {
|
||||
G::RenderPage( 'publishBlank', 'green-submenu' );
|
||||
} else {
|
||||
G::RenderPage( 'publish' );
|
||||
}
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'tools/updateTranslation', '', $fields);
|
||||
if( isset($_SESSION['TOOLS_VIEWTYPE']) && $_SESSION['TOOLS_VIEWTYPE'] == 'blank') {
|
||||
G::RenderPage('publishBlank', 'green-submenu');
|
||||
} else {
|
||||
G::RenderPage('publish');
|
||||
}
|
||||
?>
|
||||
@@ -20,55 +20,52 @@
|
||||
*
|
||||
* 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);
|
||||
$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_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 = Array ();
|
||||
while ($rs->next()) {
|
||||
$rows[] = $rs->getRow();
|
||||
// if (!file_exists($aux['USR_PHOTO'])) $aux['USR_PHOTO'] = 'public_html/images/user.gif';
|
||||
// $rows[] = $aux;
|
||||
// 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 ) . '}';
|
||||
|
||||
|
||||
@@ -20,9 +20,7 @@
|
||||
*
|
||||
* 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;
|
||||
|
||||
@@ -20,18 +20,17 @@
|
||||
*
|
||||
* 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 ();
|
||||
$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');
|
||||
if (isset( $_GET['type'] )) {
|
||||
$G_PUBLISH->AddContent( 'view', 'users/usersReload' );
|
||||
G::RenderPage( "publishBlank", "blank" );
|
||||
} else {
|
||||
$G_PUBLISH->AddContent( 'view', 'users/usersLoad' );
|
||||
G::RenderPage( "publish" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
*
|
||||
* 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 );
|
||||
|
||||
|
||||
@@ -20,57 +20,53 @@
|
||||
*
|
||||
* 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');
|
||||
$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');
|
||||
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']);
|
||||
unset( $_SESSION['CURRENT_USER'] );
|
||||
$oUser = new Users();
|
||||
$aFields = $oUser->load($_SESSION['USER_LOGGED']);
|
||||
$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['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);
|
||||
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<');
|
||||
$depFields = $oDepInfo->load( $userFields['DEP_UID'] . 'xy<' );
|
||||
$aFields['USR_REPORTS_TO'] .= " (" . $depFields['DEPO_TITLE'] . ")";
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
catch( Exception $e ) {
|
||||
}
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$aFields['USR_REPORTS_TO'] = ' ';
|
||||
}
|
||||
|
||||
try {
|
||||
$depFields = $oDepInfo->load($aFields['DEP_UID']);
|
||||
$depFields = $oDepInfo->load( $aFields['DEP_UID'] );
|
||||
$aFields['USR_DEPARTMENT'] = $depFields['DEPO_TITLE'];
|
||||
}
|
||||
catch( Exception $e ) {
|
||||
} catch (Exception $e) {
|
||||
$oUser = UsersPeer::retrieveByPk( $_SESSION['USER_LOGGED'] );
|
||||
$oUser->setDepUid( '' );
|
||||
$oUser->save();
|
||||
@@ -79,24 +75,24 @@ try {
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'MY_ACCOUNT';
|
||||
$G_PUBLISH = new Publisher;
|
||||
|
||||
$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'],'');
|
||||
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
|
||||
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']: '';
|
||||
$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']){
|
||||
switch ($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE']) {
|
||||
case 'PROCESSMAKER_ADMIN':
|
||||
$aFields['PREF_DEFAULT_MENUSELECTED'] = 'PM_USERS';
|
||||
break;
|
||||
@@ -109,34 +105,39 @@ try {
|
||||
$aFields['PREF_DEFAULT_LANG'] = SYS_LANG;
|
||||
}
|
||||
//G::pr($RBAC->aUserInfo);
|
||||
$rows[] = Array('id'=>'char', 'name'=>'char');
|
||||
$rows[] = Array ('id' => 'char','name' => 'char'
|
||||
);
|
||||
|
||||
foreach ($RBAC->aUserInfo['PROCESSMAKER']['PERMISSIONS'] as $permission) {
|
||||
|
||||
foreach($RBAC->aUserInfo['PROCESSMAKER']['PERMISSIONS'] as $permission){
|
||||
|
||||
switch($permission['PER_CODE']){
|
||||
switch ($permission['PER_CODE']) {
|
||||
case 'PM_USERS':
|
||||
case 'PM_SETUP':
|
||||
$rows[] = Array('id'=>'PM_SETUP', 'name'=>strtoupper(G::LoadTranslation('ID_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')));
|
||||
$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')));
|
||||
$rows[] = Array ('id' => 'PM_FACTORY','name' => strtoupper( G::LoadTranslation( 'ID_APPLICATIONS' ) )
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
global $G_TMP_MENU;
|
||||
$oMenu = new Menu();
|
||||
$oMenu->load('cases');
|
||||
$oMenu->load( 'cases' );
|
||||
|
||||
$rowsCasesMenu[] = Array('id'=>'char', 'name'=>'char');
|
||||
$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]);
|
||||
foreach ($oMenu->Id as $i => $item) {
|
||||
if ($oMenu->Types[$i] != 'blockHeader') {
|
||||
$rowsCasesMenu[] = Array ('id' => $item,'name' => $oMenu->Labels[$i]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,22 +148,21 @@ try {
|
||||
$_DBArray['CASES_MENU'] = $rowsCasesMenu;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
|
||||
G::LoadClass('ArrayPeer');
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('menutab');
|
||||
G::LoadClass( 'ArrayPeer' );
|
||||
$oCriteria = new Criteria( 'dbarray' );
|
||||
$oCriteria->setDBArrayTable( 'menutab' );
|
||||
|
||||
$oCriteria2 = new Criteria('dbarray');
|
||||
$oCriteria2->setDBArrayTable('CASES_MENU');
|
||||
$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');
|
||||
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_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());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,106 +20,107 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
try {ini_set('display_errors','1');
|
||||
try {
|
||||
ini_set( 'display_errors', '1' );
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_LOGIN'))
|
||||
{
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
switch ($RBAC->userCanAccess( 'PM_LOGIN' )) {
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
if (isset($_FILES['form']['name']['USR_RESUME'])) {
|
||||
if (isset( $_FILES['form']['name']['USR_RESUME'] )) {
|
||||
$_POST['form']['USR_RESUME'] = $_FILES['form']['name']['USR_RESUME'];
|
||||
}
|
||||
if ($_POST['form']['USR_EMAIL'] != '') {
|
||||
// The ereg function has been DEPRECATED as of PHP 5.3.0.
|
||||
// if (!ereg("^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$", $_POST['form']['USR_EMAIL'])) {
|
||||
if ( !preg_match("/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$/", $_POST['form']['USR_EMAIL'])) {
|
||||
G::SendTemporalMessage ('ID_INCORRECT_EMAIL', 'error');
|
||||
if (! preg_match( "/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$/", $_POST['form']['USR_EMAIL'] )) {
|
||||
G::SendTemporalMessage( 'ID_INCORRECT_EMAIL', 'error' );
|
||||
}
|
||||
}
|
||||
if (!isset($_POST['form']['USR_NEW_PASS'])) {
|
||||
if (! isset( $_POST['form']['USR_NEW_PASS'] )) {
|
||||
$_POST['form']['USR_NEW_PASS'] = '';
|
||||
}
|
||||
if ($_POST['form']['USR_NEW_PASS'] != '') {
|
||||
$_POST['form']['USR_PASSWORD'] = md5($_POST['form']['USR_NEW_PASS']);
|
||||
$_POST['form']['USR_PASSWORD'] = md5( $_POST['form']['USR_NEW_PASS'] );
|
||||
}
|
||||
if (!isset($_POST['form']['USR_CITY'])) {
|
||||
if (! isset( $_POST['form']['USR_CITY'] )) {
|
||||
$_POST['form']['USR_CITY'] = '';
|
||||
}
|
||||
if (!isset($_POST['form']['USR_LOCATION'])) {
|
||||
if (! isset( $_POST['form']['USR_LOCATION'] )) {
|
||||
$_POST['form']['USR_LOCATION'] = '';
|
||||
}
|
||||
if (!isset($_POST['form']['USR_ROLE'])) {
|
||||
if (! isset( $_POST['form']['USR_ROLE'] )) {
|
||||
$_POST['form']['USR_ROLE'] = '';
|
||||
}
|
||||
$aData['USR_UID'] = $_POST['form']['USR_UID'];
|
||||
$aData['USR_USERNAME'] = $_POST['form']['USR_USERNAME'];
|
||||
if (isset($_POST['form']['USR_PASSWORD'])) {
|
||||
if (isset( $_POST['form']['USR_PASSWORD'] )) {
|
||||
if ($_POST['form']['USR_PASSWORD'] != '') {
|
||||
$aData['USR_PASSWORD'] = $_POST['form']['USR_PASSWORD'];
|
||||
require_once 'classes/model/UsersProperties.php';
|
||||
$oUserProperty = new UsersProperties();
|
||||
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($_POST['form']['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($_POST['form']['USR_NEW_PASS'])))));
|
||||
$aErrors = $oUserProperty->validatePassword($_POST['form']['USR_NEW_PASS'], $aUserProperty['USR_LAST_UPDATE_DATE'], $aUserProperty['USR_LOGGED_NEXT_TIME']);
|
||||
if (count($aErrors) > 0) {
|
||||
$sDescription = G::LoadTranslation('ID_POLICY_ALERT').':<br /><br />';
|
||||
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists( $_POST['form']['USR_UID'], array ('USR_PASSWORD_HISTORY' => serialize( array (md5( $_POST['form']['USR_NEW_PASS'] )
|
||||
) )
|
||||
) );
|
||||
$aErrors = $oUserProperty->validatePassword( $_POST['form']['USR_NEW_PASS'], $aUserProperty['USR_LAST_UPDATE_DATE'], $aUserProperty['USR_LOGGED_NEXT_TIME'] );
|
||||
if (count( $aErrors ) > 0) {
|
||||
$sDescription = G::LoadTranslation( 'ID_POLICY_ALERT' ) . ':<br /><br />';
|
||||
foreach ($aErrors as $sError) {
|
||||
switch ($sError) {
|
||||
case 'ID_PPP_MINIMUN_LENGTH':
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).': ' . PPP_MINIMUN_LENGTH . '<br />';
|
||||
$sDescription .= ' - ' . G::LoadTranslation( $sError ) . ': ' . PPP_MINIMUN_LENGTH . '<br />';
|
||||
break;
|
||||
case 'ID_PPP_MAXIMUN_LENGTH':
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).': ' . PPP_MAXIMUN_LENGTH . '<br />';
|
||||
$sDescription .= ' - ' . G::LoadTranslation( $sError ) . ': ' . PPP_MAXIMUN_LENGTH . '<br />';
|
||||
break;
|
||||
case 'ID_PPP_EXPIRATION_IN':
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).' ' . PPP_EXPIRATION_IN . ' ' . G::LoadTranslation('ID_DAYS') . '<br />';
|
||||
$sDescription .= ' - ' . G::LoadTranslation( $sError ) . ' ' . PPP_EXPIRATION_IN . ' ' . G::LoadTranslation( 'ID_DAYS' ) . '<br />';
|
||||
break;
|
||||
default:
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).'<br />';
|
||||
$sDescription .= ' - ' . G::LoadTranslation( $sError ) . '<br />';
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sDescription .= '<br />' . G::LoadTranslation('ID_PLEASE_CHANGE_PASSWORD_POLICY');
|
||||
G::SendMessageText($sDescription, 'warning');
|
||||
G::header('Location: ' . $_SERVER['HTTP_REFERER']);
|
||||
die;
|
||||
$sDescription .= '<br />' . G::LoadTranslation( 'ID_PLEASE_CHANGE_PASSWORD_POLICY' );
|
||||
G::SendMessageText( $sDescription, 'warning' );
|
||||
G::header( 'Location: ' . $_SERVER['HTTP_REFERER'] );
|
||||
die();
|
||||
}
|
||||
$aHistory = unserialize($aUserProperty['USR_PASSWORD_HISTORY']);
|
||||
if (!is_array($aHistory)) {
|
||||
$aHistory = array();
|
||||
$aHistory = unserialize( $aUserProperty['USR_PASSWORD_HISTORY'] );
|
||||
if (! is_array( $aHistory )) {
|
||||
$aHistory = array ();
|
||||
}
|
||||
if (!defined('PPP_PASSWORD_HISTORY')) {
|
||||
define('PPP_PASSWORD_HISTORY', 0);
|
||||
if (! defined( 'PPP_PASSWORD_HISTORY' )) {
|
||||
define( 'PPP_PASSWORD_HISTORY', 0 );
|
||||
}
|
||||
if (PPP_PASSWORD_HISTORY > 0) {
|
||||
if (count($aHistory) >= PPP_PASSWORD_HISTORY) {
|
||||
array_shift($aHistory);
|
||||
if (count( $aHistory ) >= PPP_PASSWORD_HISTORY) {
|
||||
array_shift( $aHistory );
|
||||
}
|
||||
$aHistory[] = $_POST['form']['USR_NEW_PASS'];
|
||||
}
|
||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date( 'Y-m-d H:i:s' );
|
||||
$aUserProperty['USR_LOGGED_NEXT_TIME'] = 1;
|
||||
$aUserProperty['USR_PASSWORD_HISTORY'] = serialize($aHistory);
|
||||
$oUserProperty->update($aUserProperty);
|
||||
$aUserProperty['USR_PASSWORD_HISTORY'] = serialize( $aHistory );
|
||||
$oUserProperty->update( $aUserProperty );
|
||||
}
|
||||
}
|
||||
$aData['USR_FIRSTNAME'] = $_POST['form']['USR_FIRSTNAME'];
|
||||
$aData['USR_LASTNAME'] = $_POST['form']['USR_LASTNAME'];
|
||||
$aData['USR_EMAIL'] = $_POST['form']['USR_EMAIL'];
|
||||
$aData['USR_DUE_DATE'] = $_POST['form']['USR_DUE_DATE'];
|
||||
$aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$RBAC->updateUser($aData);
|
||||
$aData['USR_PASSWORD'] = md5($_POST['form']['USR_USERNAME']);//fake :p
|
||||
$aData['USR_UPDATE_DATE'] = date( 'Y-m-d H:i:s' );
|
||||
$RBAC->updateUser( $aData );
|
||||
$aData['USR_PASSWORD'] = md5( $_POST['form']['USR_USERNAME'] ); //fake :p
|
||||
$aData['USR_COUNTRY'] = $_POST['form']['USR_COUNTRY'];
|
||||
$aData['USR_CITY'] = $_POST['form']['USR_CITY'];
|
||||
$aData['USR_LOCATION'] = $_POST['form']['USR_LOCATION'];
|
||||
@@ -132,14 +133,14 @@ try {ini_set('display_errors','1');
|
||||
}
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$oUser->update($aData);
|
||||
$oUser->update( $aData );
|
||||
if ($_FILES['form']['tmp_name']['USR_PHOTO'] != '') {
|
||||
$aAux = explode('.', $_FILES['form']['name']['USR_PHOTO']);
|
||||
G::uploadFile($_FILES['form']['tmp_name']['USR_PHOTO'], PATH_IMAGES_ENVIRONMENT_USERS, $aData['USR_UID'] . '.' . $aAux[1]);
|
||||
G::resizeImage(PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.' . $aAux[1], 96, 96, PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.gif');
|
||||
$aAux = explode( '.', $_FILES['form']['name']['USR_PHOTO'] );
|
||||
G::uploadFile( $_FILES['form']['tmp_name']['USR_PHOTO'], PATH_IMAGES_ENVIRONMENT_USERS, $aData['USR_UID'] . '.' . $aAux[1] );
|
||||
G::resizeImage( PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.' . $aAux[1], 96, 96, PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.gif' );
|
||||
}
|
||||
if ($_FILES['form']['tmp_name']['USR_RESUME'] != '') {
|
||||
G::uploadFile($_FILES['form']['tmp_name']['USR_RESUME'], PATH_IMAGES_ENVIRONMENT_FILES . $aData['USR_UID'] . '/', $_FILES['form']['name']['USR_RESUME']);
|
||||
G::uploadFile( $_FILES['form']['tmp_name']['USR_RESUME'], PATH_IMAGES_ENVIRONMENT_FILES . $aData['USR_UID'] . '/', $_FILES['form']['name']['USR_RESUME'] );
|
||||
}
|
||||
|
||||
/* Saving preferences */
|
||||
@@ -147,27 +148,22 @@ try {ini_set('display_errors','1');
|
||||
$def_menu = $_POST['form']['PREF_DEFAULT_MENUSELECTED'];
|
||||
$def_cases_menu = $_POST['form']['PREF_DEFAULT_CASES_MENUSELECTED'];
|
||||
|
||||
G::loadClass('configuration');
|
||||
G::loadClass( 'configuration' );
|
||||
|
||||
$oConf = new Configurations;
|
||||
$aConf = Array(
|
||||
'DEFAULT_LANG'=>$def_lang,
|
||||
'DEFAULT_MENU'=>$def_menu,
|
||||
'DEFAULT_CASES_MENU'=>$def_cases_menu
|
||||
$oConf = new Configurations();
|
||||
$aConf = Array ('DEFAULT_LANG' => $def_lang,'DEFAULT_MENU' => $def_menu,'DEFAULT_CASES_MENU' => $def_cases_menu
|
||||
);
|
||||
|
||||
/*UPDATING SESSION VARIABLES*/
|
||||
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
|
||||
$aUser = $RBAC->userObj->load( $_SESSION['USER_LOGGED'] );
|
||||
$_SESSION['USR_FULLNAME'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
|
||||
|
||||
|
||||
$oConf->aConfig = $aConf;
|
||||
$oConf->saveConfig('USER_PREFERENCES', '', '',$_SESSION['USER_LOGGED']);
|
||||
$oConf->saveConfig( 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'] );
|
||||
|
||||
G::SendTemporalMessage('ID_CHANGES_SAVED', 'info', 'labels');
|
||||
G::header('location: myInfo');
|
||||
G::SendTemporalMessage( 'ID_CHANGES_SAVED', 'info', 'labels' );
|
||||
G::header( 'location: myInfo' );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -2,120 +2,124 @@
|
||||
|
||||
global $RBAC;
|
||||
|
||||
switch($_POST['action'])
|
||||
{
|
||||
case 'countryList' :
|
||||
switch ($_POST['action']) {
|
||||
case 'countryList':
|
||||
require_once ("classes/model/IsoCountry.php");
|
||||
$c = new Criteria();
|
||||
$c->add(IsoCountryPeer::IC_UID, NULL, Criteria::ISNOTNULL);
|
||||
$c->add( IsoCountryPeer::IC_UID, NULL, Criteria::ISNOTNULL );
|
||||
|
||||
$countries = IsoCountryPeer::doSelect($c);
|
||||
foreach ( $countries as $rowid => $row ) {
|
||||
$oData[] = Array('IC_UID'=>$row->getICUid(),'IC_NAME'=>$row->getICName());
|
||||
$countries = IsoCountryPeer::doSelect( $c );
|
||||
foreach ($countries as $rowid => $row) {
|
||||
$oData[] = Array ('IC_UID' => $row->getICUid(),'IC_NAME' => $row->getICName()
|
||||
);
|
||||
}
|
||||
print(G::json_encode($oData));
|
||||
print (G::json_encode( $oData )) ;
|
||||
break;
|
||||
|
||||
case 'stateList' :
|
||||
case 'stateList':
|
||||
require_once ("classes/model/IsoSubdivision.php");
|
||||
$c = new Criteria();
|
||||
$country = $_POST['IC_UID'];
|
||||
$c->add(IsoSubdivisionPeer::IC_UID, $country, Criteria::EQUAL);
|
||||
$locations = IsoSubdivisionPeer::doSelect($c);
|
||||
$c->add( IsoSubdivisionPeer::IC_UID, $country, Criteria::EQUAL );
|
||||
$locations = IsoSubdivisionPeer::doSelect( $c );
|
||||
|
||||
$oData = Array();
|
||||
foreach( $locations as $rowid => $row ) {
|
||||
$oData = Array ();
|
||||
foreach ($locations as $rowid => $row) {
|
||||
if (($row->getISUid() != '') && ($row->getISName() != ''))
|
||||
$oData[] = Array('IS_UID' => $row->getISUid(), 'IS_NAME' => $row->getISName());
|
||||
$oData[] = Array ('IS_UID' => $row->getISUid(),'IS_NAME' => $row->getISName()
|
||||
);
|
||||
}
|
||||
print(G::json_encode($oData));
|
||||
print (G::json_encode( $oData )) ;
|
||||
break;
|
||||
|
||||
case 'locationList' :
|
||||
case 'locationList':
|
||||
require_once ("classes/model/IsoLocation.php");
|
||||
$c = new Criteria();
|
||||
$country = $_POST['IC_UID'];
|
||||
$state = $_POST['IS_UID'];
|
||||
$c->add(IsoLocationPeer::IC_UID, $country, Criteria::EQUAL);
|
||||
$c->add(IsoLocationPeer::IS_UID, $state, Criteria::EQUAL);
|
||||
$locations = IsoLocationPeer::doSelect($c);
|
||||
$c->add( IsoLocationPeer::IC_UID, $country, Criteria::EQUAL );
|
||||
$c->add( IsoLocationPeer::IS_UID, $state, Criteria::EQUAL );
|
||||
$locations = IsoLocationPeer::doSelect( $c );
|
||||
|
||||
$oData = Array();
|
||||
foreach ( $locations as $rowid => $row ) {
|
||||
$oData = Array ();
|
||||
foreach ($locations as $rowid => $row) {
|
||||
if (($row->getILUid() != '') && ($row->getILName() != ''))
|
||||
$oData[] = Array('IL_UID' => $row->getILUid(), 'IL_NAME' => $row->getILName());
|
||||
}
|
||||
print(G::json_encode($oData));
|
||||
break;
|
||||
case 'usersList' :
|
||||
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, array('ACTIVE', 'VACATION'), Criteria::IN);
|
||||
if (isset($_POST['USR_UID'])) {
|
||||
$oCriteria->add(UsersPeer::USR_UID, $_POST['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();
|
||||
if (isset($_POST['addNone']) && $_POST['addNone'] == '1') {
|
||||
$aUserInfo[] = array('USR_UID' => '', 'USER_FULLNAME' => '- ' . G::LoadTranslation('ID_NONE') . ' -');
|
||||
}
|
||||
while ( $oDataset->next()) {
|
||||
$aRow1 = $oDataset->getRow();
|
||||
|
||||
$infoUser = G::getFormatUserList($defaultOption,$aRow1);
|
||||
$aUserInfo[] = array(
|
||||
'USR_UID' => $aRow1['USR_UID'],
|
||||
'USER_FULLNAME' => $infoUser
|
||||
$oData[] = Array ('IL_UID' => $row->getILUid(),'IL_NAME' => $row->getILName()
|
||||
);
|
||||
}
|
||||
print(G::json_encode($aUserInfo));
|
||||
print (G::json_encode( $oData )) ;
|
||||
break;
|
||||
case 'usersList':
|
||||
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, array ('ACTIVE','VACATION'
|
||||
), Criteria::IN );
|
||||
if (isset( $_POST['USR_UID'] )) {
|
||||
$oCriteria->add( UsersPeer::USR_UID, $_POST['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 ();
|
||||
if (isset( $_POST['addNone'] ) && $_POST['addNone'] == '1') {
|
||||
$aUserInfo[] = array ('USR_UID' => '','USER_FULLNAME' => '- ' . G::LoadTranslation( 'ID_NONE' ) . ' -'
|
||||
);
|
||||
}
|
||||
while ($oDataset->next()) {
|
||||
$aRow1 = $oDataset->getRow();
|
||||
|
||||
$infoUser = G::getFormatUserList( $defaultOption, $aRow1 );
|
||||
$aUserInfo[] = array ('USR_UID' => $aRow1['USR_UID'],'USER_FULLNAME' => $infoUser
|
||||
);
|
||||
}
|
||||
print (G::json_encode( $aUserInfo )) ;
|
||||
|
||||
break;
|
||||
|
||||
case 'availableCalendars' :
|
||||
G::LoadClass ( 'calendar' );
|
||||
$calendar = new Calendar ( );
|
||||
$calendarObj = $calendar->getCalendarList ( true, true );
|
||||
$oData[] = array('CALENDAR_UID' => '', 'CALENDAR_NAME' => '- None -');
|
||||
foreach ( $calendarObj ['array'] as $rowid => $row ) {
|
||||
case 'availableCalendars':
|
||||
G::LoadClass( 'calendar' );
|
||||
$calendar = new Calendar();
|
||||
$calendarObj = $calendar->getCalendarList( true, true );
|
||||
$oData[] = array ('CALENDAR_UID' => '','CALENDAR_NAME' => '- None -'
|
||||
);
|
||||
foreach ($calendarObj['array'] as $rowid => $row) {
|
||||
if ($rowid > 0)
|
||||
$oData[] = array('CALENDAR_UID' => $row['CALENDAR_UID'], 'CALENDAR_NAME' => $row['CALENDAR_NAME']);
|
||||
$oData[] = array ('CALENDAR_UID' => $row['CALENDAR_UID'],'CALENDAR_NAME' => $row['CALENDAR_NAME']
|
||||
);
|
||||
}
|
||||
print(G::json_encode($oData));
|
||||
print (G::json_encode( $oData )) ;
|
||||
break;
|
||||
case 'rolesList':
|
||||
require_once PATH_RBAC."model/Roles.php";
|
||||
require_once PATH_RBAC . "model/Roles.php";
|
||||
$roles = new Roles();
|
||||
$rolesData = $roles->getAllRoles();
|
||||
foreach( $rolesData as $rowid => $row ) {
|
||||
$oData[] = array('ROL_UID' => $row['ROL_CODE'],'ROL_CODE' => $row['ROL_CODE']);
|
||||
foreach ($rolesData as $rowid => $row) {
|
||||
$oData[] = array ('ROL_UID' => $row['ROL_CODE'],'ROL_CODE' => $row['ROL_CODE']
|
||||
);
|
||||
}
|
||||
print(G::json_encode($oData));
|
||||
print (G::json_encode( $oData )) ;
|
||||
break;
|
||||
case 'saveUser' :
|
||||
case 'saveUser':
|
||||
try {
|
||||
$form = $_POST;
|
||||
|
||||
if ( isset($_POST['USR_UID'])) {
|
||||
if (isset( $_POST['USR_UID'] )) {
|
||||
$form['USR_UID'] = $_POST['USR_UID'];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$form['USR_UID'] = '';
|
||||
}
|
||||
/*
|
||||
/*
|
||||
if ( isset($_FILES['USR_RESUME']['name']) ) {
|
||||
if ($_FILES['USR_RESUME']['tmp_name'] != '') {
|
||||
$form['USR_RESUME'] = $_FILES['USR_RESUME']['name'];
|
||||
@@ -125,19 +129,19 @@ switch($_POST['action'])
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (!isset($form['USR_NEW_PASS'])) {
|
||||
if (! isset( $form['USR_NEW_PASS'] )) {
|
||||
$form['USR_NEW_PASS'] = '';
|
||||
}
|
||||
if ($form['USR_NEW_PASS'] != '') {
|
||||
$form['USR_PASSWORD'] = md5($form['USR_NEW_PASS']);
|
||||
$form['USR_PASSWORD'] = md5( $form['USR_NEW_PASS'] );
|
||||
}
|
||||
if (!isset($form['USR_CITY'])) {
|
||||
if (! isset( $form['USR_CITY'] )) {
|
||||
$form['USR_CITY'] = '';
|
||||
}
|
||||
if (!isset($form['USR_LOCATION'])) {
|
||||
if (! isset( $form['USR_LOCATION'] )) {
|
||||
$form['USR_LOCATION'] = '';
|
||||
}
|
||||
if (!isset($form['USR_AUTH_USER_DN'])) {
|
||||
if (! isset( $form['USR_AUTH_USER_DN'] )) {
|
||||
$form['USR_AUTH_USER_DN'] = '';
|
||||
}
|
||||
|
||||
@@ -148,17 +152,17 @@ switch($_POST['action'])
|
||||
$aData['USR_LASTNAME'] = $form['USR_LASTNAME'];
|
||||
$aData['USR_EMAIL'] = $form['USR_EMAIL'];
|
||||
$aData['USR_DUE_DATE'] = $form['USR_DUE_DATE'];
|
||||
$aData['USR_CREATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$aData['USR_BIRTHDAY'] = date('Y-m-d');
|
||||
$aData['USR_CREATE_DATE'] = date( 'Y-m-d H:i:s' );
|
||||
$aData['USR_UPDATE_DATE'] = date( 'Y-m-d H:i:s' );
|
||||
$aData['USR_BIRTHDAY'] = date( 'Y-m-d' );
|
||||
$aData['USR_AUTH_USER_DN'] = $form['USR_AUTH_USER_DN'];
|
||||
//fixing bug in inactive user when the admin create a new user.
|
||||
$statusWF = $form['USR_STATUS'];
|
||||
$aData['USR_STATUS'] = $form['USR_STATUS'] == 'ACTIVE' ? 1 : 0;
|
||||
$sUserUID = $RBAC->createUser($aData, $form['USR_ROLE'] );
|
||||
$sUserUID = $RBAC->createUser( $aData, $form['USR_ROLE'] );
|
||||
$aData['USR_STATUS'] = $statusWF;
|
||||
$aData['USR_UID'] = $sUserUID;
|
||||
$aData['USR_PASSWORD'] = md5($sUserUID);//fake :p
|
||||
$aData['USR_PASSWORD'] = md5( $sUserUID ); //fake :p
|
||||
$aData['USR_COUNTRY'] = $form['USR_COUNTRY'];
|
||||
$aData['USR_CITY'] = $form['USR_CITY'];
|
||||
$aData['USR_LOCATION'] = $form['USR_LOCATION'];
|
||||
@@ -166,27 +170,26 @@ switch($_POST['action'])
|
||||
$aData['USR_PHONE'] = $form['USR_PHONE'];
|
||||
$aData['USR_ZIP_CODE'] = $form['USR_ZIP_CODE'];
|
||||
$aData['USR_POSITION'] = $form['USR_POSITION'];
|
||||
// $aData['USR_RESUME'] = $form['USR_RESUME'];
|
||||
// $aData['USR_RESUME'] = $form['USR_RESUME'];
|
||||
$aData['USR_ROLE'] = $form['USR_ROLE'];
|
||||
$aData['USR_REPLACED_BY'] = $form['USR_REPLACED_BY'];
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$oUser->create($aData);
|
||||
$oUser->create( $aData );
|
||||
|
||||
if ($_FILES['USR_PHOTO']['error'] != 1) {
|
||||
//print (PATH_IMAGES_ENVIRONMENT_USERS);
|
||||
if ($_FILES['USR_PHOTO']['tmp_name'] != '') {
|
||||
G::uploadFile($_FILES['USR_PHOTO']['tmp_name'], PATH_IMAGES_ENVIRONMENT_USERS, $sUserUID . '.gif');
|
||||
G::uploadFile( $_FILES['USR_PHOTO']['tmp_name'], PATH_IMAGES_ENVIRONMENT_USERS, $sUserUID . '.gif' );
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$result->success = false;
|
||||
$result->fileError = true;
|
||||
print(G::json_encode($result));
|
||||
die;
|
||||
print (G::json_encode( $result )) ;
|
||||
die();
|
||||
}
|
||||
/*
|
||||
/*
|
||||
if ($_FILES['USR_RESUME']['error'] != 1) {
|
||||
if ($_FILES['USR_RESUME']['tmp_name'] != '') {
|
||||
G::uploadFile($_FILES['USR_RESUME']['tmp_name'], PATH_IMAGES_ENVIRONMENT_FILES . $sUserUID . '/', $_FILES['USR_RESUME']['name']);
|
||||
@@ -199,112 +202,110 @@ switch($_POST['action'])
|
||||
die;
|
||||
}
|
||||
*/
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$aData['USR_UID'] = $form['USR_UID'];
|
||||
$aData['USR_USERNAME'] = $form['USR_USERNAME'];
|
||||
|
||||
if (isset($form['USR_PASSWORD'])) {
|
||||
if (isset( $form['USR_PASSWORD'] )) {
|
||||
|
||||
if ($form['USR_PASSWORD'] != '') {
|
||||
$aData['USR_PASSWORD'] = $form['USR_PASSWORD'];
|
||||
require_once 'classes/model/UsersProperties.php';
|
||||
$oUserProperty = new UsersProperties();
|
||||
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($form['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($form['USR_PASSWORD'])))));
|
||||
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists( $form['USR_UID'], array ('USR_PASSWORD_HISTORY' => serialize( array (md5( $form['USR_PASSWORD'] )
|
||||
) )
|
||||
) );
|
||||
|
||||
$memKey = 'rbacSession' . session_id();
|
||||
$memcache = & PMmemcached::getSingleton(defined('SYS_SYS') ? SYS_SYS : '');
|
||||
if ( ($RBAC->aUserInfo = $memcache->get($memKey)) === false ) {
|
||||
$RBAC->loadUserRolePermission($RBAC->sSystem, $_SESSION['USER_LOGGED'] );
|
||||
$memcache = & PMmemcached::getSingleton( defined( 'SYS_SYS' ) ? SYS_SYS : '' );
|
||||
if (($RBAC->aUserInfo = $memcache->get( $memKey )) === false) {
|
||||
$RBAC->loadUserRolePermission( $RBAC->sSystem, $_SESSION['USER_LOGGED'] );
|
||||
$memcache->set( $memKey, $RBAC->aUserInfo, PMmemcached::EIGHT_HOURS );
|
||||
}
|
||||
if( $RBAC->aUserInfo[ 'PROCESSMAKER' ]['ROLE']['ROL_CODE']=='PROCESSMAKER_ADMIN'){
|
||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
if ($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'] == 'PROCESSMAKER_ADMIN') {
|
||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date( 'Y-m-d H:i:s' );
|
||||
$aUserProperty['USR_LOGGED_NEXT_TIME'] = 1;
|
||||
$oUserProperty->update($aUserProperty);
|
||||
$oUserProperty->update( $aUserProperty );
|
||||
}
|
||||
|
||||
$aErrors = $oUserProperty->validatePassword($form['USR_NEW_PASS'], $aUserProperty['USR_LAST_UPDATE_DATE'], 0);
|
||||
$aErrors = $oUserProperty->validatePassword( $form['USR_NEW_PASS'], $aUserProperty['USR_LAST_UPDATE_DATE'], 0 );
|
||||
|
||||
|
||||
if (count($aErrors) > 0) {
|
||||
$sDescription = G::LoadTranslation('ID_POLICY_ALERT').':,';
|
||||
if (count( $aErrors ) > 0) {
|
||||
$sDescription = G::LoadTranslation( 'ID_POLICY_ALERT' ) . ':,';
|
||||
foreach ($aErrors as $sError) {
|
||||
switch ($sError) {
|
||||
case 'ID_PPP_MINIMUN_LENGTH':
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).': ' . PPP_MINIMUN_LENGTH . ',';
|
||||
$sDescription .= ' - ' . G::LoadTranslation( $sError ) . ': ' . PPP_MINIMUN_LENGTH . ',';
|
||||
break;
|
||||
case 'ID_PPP_MAXIMUN_LENGTH':
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).': ' . PPP_MAXIMUN_LENGTH . ',';
|
||||
$sDescription .= ' - ' . G::LoadTranslation( $sError ) . ': ' . PPP_MAXIMUN_LENGTH . ',';
|
||||
break;
|
||||
case 'ID_PPP_EXPIRATION_IN':
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).' ' . PPP_EXPIRATION_IN . ' ' . G::LoadTranslation('ID_DAYS') . ',';
|
||||
$sDescription .= ' - ' . G::LoadTranslation( $sError ) . ' ' . PPP_EXPIRATION_IN . ' ' . G::LoadTranslation( 'ID_DAYS' ) . ',';
|
||||
break;
|
||||
default:
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).',';
|
||||
$sDescription .= ' - ' . G::LoadTranslation( $sError ) . ',';
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sDescription .= ''.G::LoadTranslation('ID_PLEASE_CHANGE_PASSWORD_POLICY');
|
||||
$sDescription .= '' . G::LoadTranslation( 'ID_PLEASE_CHANGE_PASSWORD_POLICY' );
|
||||
$result->success = false;
|
||||
$result->msg = $sDescription;
|
||||
print(G::json_encode($result));
|
||||
die;
|
||||
|
||||
print (G::json_encode( $result )) ;
|
||||
die();
|
||||
|
||||
}
|
||||
$aHistory = unserialize($aUserProperty['USR_PASSWORD_HISTORY']);
|
||||
if (!is_array($aHistory)) {
|
||||
$aHistory = array();
|
||||
$aHistory = unserialize( $aUserProperty['USR_PASSWORD_HISTORY'] );
|
||||
if (! is_array( $aHistory )) {
|
||||
$aHistory = array ();
|
||||
}
|
||||
if (!defined('PPP_PASSWORD_HISTORY')) {
|
||||
define('PPP_PASSWORD_HISTORY', 0);
|
||||
if (! defined( 'PPP_PASSWORD_HISTORY' )) {
|
||||
define( 'PPP_PASSWORD_HISTORY', 0 );
|
||||
}
|
||||
if (PPP_PASSWORD_HISTORY > 0) {
|
||||
//it's looking a password igual into aHistory array that was send for post in md5 way
|
||||
$c = 0;
|
||||
$sw = 1;
|
||||
while (count($aHistory) >= 1 && count($aHistory) > $c && $sw ){
|
||||
if (strcmp(trim($aHistory[$c]), trim($form['USR_PASSWORD'])) == 0){
|
||||
while (count( $aHistory ) >= 1 && count( $aHistory ) > $c && $sw) {
|
||||
if (strcmp( trim( $aHistory[$c] ), trim( $form['USR_PASSWORD'] ) ) == 0) {
|
||||
$sw = 0;
|
||||
}
|
||||
$c++;
|
||||
$c ++;
|
||||
}
|
||||
if ($sw == 0) {
|
||||
$sDescription = G::LoadTranslation('ID_POLICY_ALERT').':<br /><br />';
|
||||
$sDescription .= ' - ' . G::LoadTranslation('PASSWORD_HISTORY').': ' . PPP_PASSWORD_HISTORY . '<br />';
|
||||
$sDescription .= '<br />' . G::LoadTranslation('ID_PLEASE_CHANGE_PASSWORD_POLICY').'';
|
||||
$sDescription = G::LoadTranslation( 'ID_POLICY_ALERT' ) . ':<br /><br />';
|
||||
$sDescription .= ' - ' . G::LoadTranslation( 'PASSWORD_HISTORY' ) . ': ' . PPP_PASSWORD_HISTORY . '<br />';
|
||||
$sDescription .= '<br />' . G::LoadTranslation( 'ID_PLEASE_CHANGE_PASSWORD_POLICY' ) . '';
|
||||
$result->success = false;
|
||||
$result->msg = $sDescription;
|
||||
print(G::json_encode($result));
|
||||
print (G::json_encode( $result )) ;
|
||||
die();
|
||||
}
|
||||
|
||||
if (count($aHistory) >= PPP_PASSWORD_HISTORY) {
|
||||
$sLastPassw = array_shift($aHistory);
|
||||
if (count( $aHistory ) >= PPP_PASSWORD_HISTORY) {
|
||||
$sLastPassw = array_shift( $aHistory );
|
||||
}
|
||||
$aHistory[] = $form['USR_PASSWORD'];
|
||||
}
|
||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date( 'Y-m-d H:i:s' );
|
||||
$aUserProperty['USR_LOGGED_NEXT_TIME'] = 1;
|
||||
$aUserProperty['USR_PASSWORD_HISTORY'] = serialize($aHistory);
|
||||
$oUserProperty->update($aUserProperty);
|
||||
$aUserProperty['USR_PASSWORD_HISTORY'] = serialize( $aHistory );
|
||||
$oUserProperty->update( $aUserProperty );
|
||||
}
|
||||
}
|
||||
$aData['USR_FIRSTNAME'] = $form['USR_FIRSTNAME'];
|
||||
$aData['USR_LASTNAME'] = $form['USR_LASTNAME'];
|
||||
$aData['USR_EMAIL'] = $form['USR_EMAIL'];
|
||||
$aData['USR_DUE_DATE'] = $form['USR_DUE_DATE'];
|
||||
$aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
if (isset($form['USR_STATUS'])) {
|
||||
$aData['USR_UPDATE_DATE'] = date( 'Y-m-d H:i:s' );
|
||||
if (isset( $form['USR_STATUS'] )) {
|
||||
$aData['USR_STATUS'] = $form['USR_STATUS'];
|
||||
}
|
||||
if (isset($form['USR_ROLE'])) {
|
||||
$RBAC->updateUser($aData, $form['USR_ROLE']);
|
||||
}
|
||||
else {
|
||||
$RBAC->updateUser($aData);
|
||||
if (isset( $form['USR_ROLE'] )) {
|
||||
$RBAC->updateUser( $aData, $form['USR_ROLE'] );
|
||||
} else {
|
||||
$RBAC->updateUser( $aData );
|
||||
}
|
||||
$aData['USR_COUNTRY'] = $form['USR_COUNTRY'];
|
||||
$aData['USR_CITY'] = $form['USR_CITY'];
|
||||
@@ -313,39 +314,38 @@ switch($_POST['action'])
|
||||
$aData['USR_PHONE'] = $form['USR_PHONE'];
|
||||
$aData['USR_ZIP_CODE'] = $form['USR_ZIP_CODE'];
|
||||
$aData['USR_POSITION'] = $form['USR_POSITION'];
|
||||
/*
|
||||
/*
|
||||
if ($form['USR_RESUME'] != '') {
|
||||
$aData['USR_RESUME'] = $form['USR_RESUME'];
|
||||
}
|
||||
*/
|
||||
if (isset($form['USR_ROLE'])) {
|
||||
if (isset( $form['USR_ROLE'] )) {
|
||||
$aData['USR_ROLE'] = $form['USR_ROLE'];
|
||||
}
|
||||
|
||||
if(isset($form['USR_REPLACED_BY'])){
|
||||
if (isset( $form['USR_REPLACED_BY'] )) {
|
||||
$aData['USR_REPLACED_BY'] = $form['USR_REPLACED_BY'];
|
||||
}
|
||||
if(isset($form['USR_AUTH_USER_DN'])){
|
||||
if (isset( $form['USR_AUTH_USER_DN'] )) {
|
||||
$aData['USR_AUTH_USER_DN'] = $form['USR_AUTH_USER_DN'];
|
||||
}
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$oUser->update($aData);
|
||||
$oUser->update( $aData );
|
||||
if ($_FILES['USR_PHOTO']['error'] != 1) {
|
||||
if ($_FILES['USR_PHOTO']['tmp_name'] != '') {
|
||||
$aAux = explode('.', $_FILES['USR_PHOTO']['name']);
|
||||
G::uploadFile($_FILES['USR_PHOTO']['tmp_name'], PATH_IMAGES_ENVIRONMENT_USERS, $aData['USR_UID'] . '.' . $aAux[1]);
|
||||
G::resizeImage(PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.' . $aAux[1], 96, 96, PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.gif');
|
||||
$aAux = explode( '.', $_FILES['USR_PHOTO']['name'] );
|
||||
G::uploadFile( $_FILES['USR_PHOTO']['tmp_name'], PATH_IMAGES_ENVIRONMENT_USERS, $aData['USR_UID'] . '.' . $aAux[1] );
|
||||
G::resizeImage( PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.' . $aAux[1], 96, 96, PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.gif' );
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$result->success = false;
|
||||
$result->fileError = true;
|
||||
print(G::json_encode($result));
|
||||
die;
|
||||
print (G::json_encode( $result )) ;
|
||||
die();
|
||||
}
|
||||
/*
|
||||
/*
|
||||
if ($_FILES['USR_RESUME']['error'] != 1) {
|
||||
if ($_FILES['USR_RESUME']['tmp_name'] != '') {
|
||||
G::uploadFile($_FILES['USR_RESUME']['tmp_name'], PATH_IMAGES_ENVIRONMENT_FILES . $aData['USR_UID'] . '/', $_FILES['USR_RESUME']['name']);
|
||||
@@ -361,46 +361,43 @@ switch($_POST['action'])
|
||||
/* Saving preferences */
|
||||
$def_lang = $form['PREF_DEFAULT_LANG'];
|
||||
$def_menu = $form['PREF_DEFAULT_MENUSELECTED'];
|
||||
$def_cases_menu = isset($form['PREF_DEFAULT_CASES_MENUSELECTED']) ? $form['PREF_DEFAULT_CASES_MENUSELECTED'] : '';
|
||||
$def_cases_menu = isset( $form['PREF_DEFAULT_CASES_MENUSELECTED'] ) ? $form['PREF_DEFAULT_CASES_MENUSELECTED'] : '';
|
||||
|
||||
G::loadClass('configuration');
|
||||
G::loadClass( 'configuration' );
|
||||
|
||||
$oConf = new Configurations;
|
||||
$aConf = Array(
|
||||
'DEFAULT_LANG' => $def_lang,
|
||||
'DEFAULT_MENU' => $def_menu,
|
||||
'DEFAULT_CASES_MENU' => $def_cases_menu
|
||||
$oConf = new Configurations();
|
||||
$aConf = Array ('DEFAULT_LANG' => $def_lang,'DEFAULT_MENU' => $def_menu,'DEFAULT_CASES_MENU' => $def_cases_menu
|
||||
);
|
||||
|
||||
/*UPDATING SESSION VARIABLES*/
|
||||
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
|
||||
$aUser = $RBAC->userObj->load( $_SESSION['USER_LOGGED'] );
|
||||
//$_SESSION['USR_FULLNAME'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
|
||||
|
||||
|
||||
$oConf->aConfig = $aConf;
|
||||
$oConf->saveConfig('USER_PREFERENCES', '', '',$_SESSION['USER_LOGGED']);
|
||||
$oConf->saveConfig( 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'] );
|
||||
|
||||
}
|
||||
|
||||
if ( $_SESSION['USER_LOGGED'] == $form['USR_UID'] ) {
|
||||
if ($_SESSION['USER_LOGGED'] == $form['USR_UID']) {
|
||||
/* UPDATING SESSION VARIABLES */
|
||||
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
|
||||
$aUser = $RBAC->userObj->load( $_SESSION['USER_LOGGED'] );
|
||||
$_SESSION['USR_FULLNAME'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
|
||||
}
|
||||
|
||||
|
||||
//Save Calendar assigment
|
||||
if ((isset($form['USR_CALENDAR']))) {
|
||||
if ((isset( $form['USR_CALENDAR'] ))) {
|
||||
//Save Calendar ID for this user
|
||||
G::LoadClass("calendar");
|
||||
G::LoadClass( "calendar" );
|
||||
$calendarObj = new Calendar();
|
||||
$calendarObj->assignCalendarTo($aData['USR_UID'], $form['USR_CALENDAR'], 'USER');
|
||||
$calendarObj->assignCalendarTo( $aData['USR_UID'], $form['USR_CALENDAR'], 'USER' );
|
||||
}
|
||||
$result->success = true;
|
||||
print(G::json_encode($result));
|
||||
}catch (Exception $e) {
|
||||
print (G::json_encode( $result )) ;
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->error = $e->getMessage();
|
||||
print(G::json_encode($result));
|
||||
print (G::json_encode( $result )) ;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -408,28 +405,28 @@ switch($_POST['action'])
|
||||
require_once 'classes/model/Users.php';
|
||||
$_SESSION['CURRENT_USER'] = $_POST['USR_UID'];
|
||||
$oUser = new Users();
|
||||
$aFields = $oUser->loadDetailed($_POST['USR_UID']);
|
||||
$aFields = $oUser->loadDetailed( $_POST['USR_UID'] );
|
||||
|
||||
//Load Calendar options and falue for this user
|
||||
G::LoadClass ( 'calendar' );
|
||||
$calendar = new Calendar ( );
|
||||
$calendarInfo = $calendar->getCalendarFor ( $_POST['USR_UID'], $_POST['USR_UID'], $_POST['USR_UID'] );
|
||||
G::LoadClass( 'calendar' );
|
||||
$calendar = new Calendar();
|
||||
$calendarInfo = $calendar->getCalendarFor( $_POST['USR_UID'], $_POST['USR_UID'], $_POST['USR_UID'] );
|
||||
//If the function returns a DEFAULT calendar it means that this object doesn't have assigned any calendar
|
||||
$aFields ['USR_CALENDAR'] = $calendarInfo ['CALENDAR_APPLIED'] != 'DEFAULT' ? $calendarInfo ['CALENDAR_UID'] : "";
|
||||
$aFields['USR_CALENDAR'] = $calendarInfo['CALENDAR_APPLIED'] != 'DEFAULT' ? $calendarInfo['CALENDAR_UID'] : "";
|
||||
|
||||
#verifying if it has any preferences on the configurations table
|
||||
G::loadClass('configuration');
|
||||
$oConf = new Configurations;
|
||||
$oConf->loadConfig($x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '');
|
||||
G::loadClass( 'configuration' );
|
||||
$oConf = new Configurations();
|
||||
$oConf->loadConfig( $x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '' );
|
||||
|
||||
$aFields['PREF_DEFAULT_MENUSELECTED']='';
|
||||
$aFields['PREF_DEFAULT_CASES_MENUSELECTED']='';
|
||||
if( sizeof($oConf->Fields) > 0){ #this user has a configuration record
|
||||
$aFields['PREF_DEFAULT_MENUSELECTED'] = '';
|
||||
$aFields['PREF_DEFAULT_CASES_MENUSELECTED'] = '';
|
||||
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']: '';
|
||||
$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']){
|
||||
switch ($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE']) {
|
||||
case 'PROCESSMAKER_ADMIN':
|
||||
$aFields['PREF_DEFAULT_MENUSELECTED'] = 'PM_SETUP';
|
||||
break;
|
||||
@@ -441,12 +438,12 @@ switch($_POST['action'])
|
||||
}
|
||||
$aFields['PREF_DEFAULT_LANG'] = SYS_LANG;
|
||||
}
|
||||
if ($aFields['USR_REPLACED_BY'] != ''){
|
||||
if ($aFields['USR_REPLACED_BY'] != '') {
|
||||
$user = new Users();
|
||||
$u = $user->load($aFields['USR_REPLACED_BY']);
|
||||
$u = $user->load( $aFields['USR_REPLACED_BY'] );
|
||||
$c = new Configurations();
|
||||
$replaced_by = $c->usersNameFormat($u['USR_USERNAME'], $u['USR_FIRSTNAME'], $u['USR_LASTNAME']);
|
||||
}else{
|
||||
$replaced_by = $c->usersNameFormat( $u['USR_USERNAME'], $u['USR_FIRSTNAME'], $u['USR_LASTNAME'] );
|
||||
} else {
|
||||
$replaced_by = '';
|
||||
}
|
||||
|
||||
@@ -455,177 +452,183 @@ switch($_POST['action'])
|
||||
$menuSelected = '';
|
||||
|
||||
if ($aFields['PREF_DEFAULT_MENUSELECTED'] != '') {
|
||||
foreach ( $RBAC->aUserInfo['PROCESSMAKER']['PERMISSIONS'] as $permission ) {
|
||||
if ($aFields['PREF_DEFAULT_MENUSELECTED']==$permission['PER_CODE']) {
|
||||
foreach ($RBAC->aUserInfo['PROCESSMAKER']['PERMISSIONS'] as $permission) {
|
||||
if ($aFields['PREF_DEFAULT_MENUSELECTED'] == $permission['PER_CODE']) {
|
||||
switch ($permission['PER_CODE']) {
|
||||
case 'PM_USERS' :
|
||||
case 'PM_SETUP' :
|
||||
$menuSelected = strtoupper(G::LoadTranslation('ID_SETUP'));
|
||||
case 'PM_USERS':
|
||||
case 'PM_SETUP':
|
||||
$menuSelected = strtoupper( G::LoadTranslation( 'ID_SETUP' ) );
|
||||
break;
|
||||
case 'PM_CASES' :
|
||||
$menuSelected = strtoupper(G::LoadTranslation('ID_CASES'));
|
||||
case 'PM_CASES':
|
||||
$menuSelected = strtoupper( G::LoadTranslation( 'ID_CASES' ) );
|
||||
break;
|
||||
case 'PM_FACTORY' :
|
||||
$menuSelected = strtoupper(G::LoadTranslation('ID_APPLICATIONS'));
|
||||
case 'PM_FACTORY':
|
||||
$menuSelected = strtoupper( G::LoadTranslation( 'ID_APPLICATIONS' ) );
|
||||
break;
|
||||
case 'PM_DASHBOARD':
|
||||
$menuSelected = strtoupper(G::LoadTranslation('ID_DASHBOARD'));
|
||||
$menuSelected = strtoupper( G::LoadTranslation( 'ID_DASHBOARD' ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$aFields['MENUSELECTED_NAME'] = $menuSelected;
|
||||
|
||||
$oMenu = new Menu();
|
||||
$oMenu->load('cases');
|
||||
$oMenu->load( 'cases' );
|
||||
$casesMenuSelected = '';
|
||||
|
||||
if ($aFields['PREF_DEFAULT_CASES_MENUSELECTED'] != ''){
|
||||
foreach($oMenu->Id as $i => $item){
|
||||
if ($aFields['PREF_DEFAULT_CASES_MENUSELECTED'] != '') {
|
||||
foreach ($oMenu->Id as $i => $item) {
|
||||
|
||||
if ($aFields['PREF_DEFAULT_CASES_MENUSELECTED'] == $item)
|
||||
$casesMenuSelected =$oMenu->Labels[$i];
|
||||
$casesMenuSelected = $oMenu->Labels[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$aFields['CASES_MENUSELECTED_NAME'] = $casesMenuSelected;
|
||||
|
||||
$aFields['USR_COUNTRY_NAME'] = (!empty($aFields['USR_COUNTRY_NAME']))? $aFields['USR_COUNTRY_NAME'] : '';
|
||||
$aFields['USR_CITY_NAME'] = (!empty($aFields['USR_CITY_NAME']))? $aFields['USR_CITY_NAME'] : '';
|
||||
$aFields['USR_LOCATION_NAME'] = (!empty($aFields['USR_LOCATION_NAME']))? $aFields['USR_LOCATION_NAME'] : '';
|
||||
$aFields['USR_COUNTRY_NAME'] = (! empty( $aFields['USR_COUNTRY_NAME'] )) ? $aFields['USR_COUNTRY_NAME'] : '';
|
||||
$aFields['USR_CITY_NAME'] = (! empty( $aFields['USR_CITY_NAME'] )) ? $aFields['USR_CITY_NAME'] : '';
|
||||
$aFields['USR_LOCATION_NAME'] = (! empty( $aFields['USR_LOCATION_NAME'] )) ? $aFields['USR_LOCATION_NAME'] : '';
|
||||
|
||||
$result->success = true;
|
||||
$result->user = $aFields;
|
||||
|
||||
print(G::json_encode($result));
|
||||
print (G::json_encode( $result )) ;
|
||||
break;
|
||||
|
||||
case 'defaultMainMenuOptionList';
|
||||
foreach($RBAC->aUserInfo['PROCESSMAKER']['PERMISSIONS'] as $permission){
|
||||
switch($permission['PER_CODE']){
|
||||
case 'defaultMainMenuOptionList':
|
||||
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')));
|
||||
$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')));
|
||||
$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')));
|
||||
$rows[] = Array ('id' => 'PM_FACTORY','name' => strtoupper( G::LoadTranslation( 'ID_APPLICATIONS' ) )
|
||||
);
|
||||
break;
|
||||
case 'PM_DASHBOARD':
|
||||
$rows[] = Array('id'=>'PM_DASHBOARD', 'name'=>strtoupper(G::LoadTranslation('ID_DASHBOARD')));
|
||||
$rows[] = Array ('id' => 'PM_DASHBOARD','name' => strtoupper( G::LoadTranslation( 'ID_DASHBOARD' ) )
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
print(G::json_encode($rows));
|
||||
print (G::json_encode( $rows )) ;
|
||||
break;
|
||||
case 'defaultCasesMenuOptionList';
|
||||
case 'defaultCasesMenuOptionList':
|
||||
|
||||
$oMenu = new Menu();
|
||||
$oMenu->load('cases');
|
||||
$oMenu->load( 'cases' );
|
||||
|
||||
foreach($oMenu->Id as $i=>$item){
|
||||
if( $oMenu->Types[$i] != 'blockHeader' ){
|
||||
$rowsCasesMenu[] = Array('id'=>$item, 'name' => $oMenu->Labels[$i]);
|
||||
foreach ($oMenu->Id as $i => $item) {
|
||||
if ($oMenu->Types[$i] != 'blockHeader') {
|
||||
$rowsCasesMenu[] = Array ('id' => $item,'name' => $oMenu->Labels[$i]
|
||||
);
|
||||
}
|
||||
}
|
||||
print(G::json_encode($rowsCasesMenu));
|
||||
print (G::json_encode( $rowsCasesMenu )) ;
|
||||
break;
|
||||
case 'testPassword';
|
||||
case 'testPassword':
|
||||
require_once 'classes/model/UsersProperties.php';
|
||||
$oUserProperty = new UsersProperties();
|
||||
|
||||
$aFields = array();
|
||||
$aFields = array ();
|
||||
$color = '';
|
||||
$img = '';
|
||||
$dateNow = date('Y-m-d H:i:s');
|
||||
$aErrors = $oUserProperty->validatePassword($_POST['PASSWORD_TEXT'], $dateNow, $dateNow);
|
||||
$dateNow = date( 'Y-m-d H:i:s' );
|
||||
$aErrors = $oUserProperty->validatePassword( $_POST['PASSWORD_TEXT'], $dateNow, $dateNow );
|
||||
|
||||
if (!empty($aErrors)) {
|
||||
if (! empty( $aErrors )) {
|
||||
$img = '/images/delete.png';
|
||||
$color = 'red';
|
||||
if (!defined('NO_DISPLAY_USERNAME')) {
|
||||
define('NO_DISPLAY_USERNAME', 1);
|
||||
if (! defined( 'NO_DISPLAY_USERNAME' )) {
|
||||
define( 'NO_DISPLAY_USERNAME', 1 );
|
||||
}
|
||||
$aFields = array();
|
||||
$aFields['DESCRIPTION'] = G::LoadTranslation('ID_POLICY_ALERT').':<br />';
|
||||
$aFields = array ();
|
||||
$aFields['DESCRIPTION'] = G::LoadTranslation( 'ID_POLICY_ALERT' ) . ':<br />';
|
||||
|
||||
foreach ($aErrors as $sError) {
|
||||
switch ($sError) {
|
||||
case 'ID_PPP_MINIMUM_LENGTH':
|
||||
$aFields['DESCRIPTION'] .= ' - ' . G::LoadTranslation($sError).': ' . PPP_MINIMUM_LENGTH . '<br />';
|
||||
$aFields[substr($sError, 3)] = PPP_MINIMUM_LENGTH;
|
||||
$aFields['DESCRIPTION'] .= ' - ' . G::LoadTranslation( $sError ) . ': ' . PPP_MINIMUM_LENGTH . '<br />';
|
||||
$aFields[substr( $sError, 3 )] = PPP_MINIMUM_LENGTH;
|
||||
break;
|
||||
case 'ID_PPP_MAXIMUM_LENGTH':
|
||||
$aFields['DESCRIPTION'] .= ' - ' . G::LoadTranslation($sError).': ' . PPP_MAXIMUM_LENGTH . '<br />';
|
||||
$aFields[substr($sError, 3)] = PPP_MAXIMUM_LENGTH;
|
||||
$aFields['DESCRIPTION'] .= ' - ' . G::LoadTranslation( $sError ) . ': ' . PPP_MAXIMUM_LENGTH . '<br />';
|
||||
$aFields[substr( $sError, 3 )] = PPP_MAXIMUM_LENGTH;
|
||||
break;
|
||||
case 'ID_PPP_EXPIRATION_IN':
|
||||
$aFields['DESCRIPTION'] .= ' - ' . G::LoadTranslation($sError).' ' . PPP_EXPIRATION_IN . ' ' . G::LoadTranslation('ID_DAYS') . '<br />';
|
||||
$aFields[substr($sError, 3)] = PPP_EXPIRATION_IN;
|
||||
$aFields['DESCRIPTION'] .= ' - ' . G::LoadTranslation( $sError ) . ' ' . PPP_EXPIRATION_IN . ' ' . G::LoadTranslation( 'ID_DAYS' ) . '<br />';
|
||||
$aFields[substr( $sError, 3 )] = PPP_EXPIRATION_IN;
|
||||
break;
|
||||
default:
|
||||
$aFields['DESCRIPTION'] .= ' - ' . G::LoadTranslation($sError).'<br />';
|
||||
$aFields[substr($sError, 3)] = 1;
|
||||
$aFields['DESCRIPTION'] .= ' - ' . G::LoadTranslation( $sError ) . '<br />';
|
||||
$aFields[substr( $sError, 3 )] = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$aFields['DESCRIPTION'] .= G::LoadTranslation('ID_PLEASE_CHANGE_PASSWORD_POLICY') . '</span>';
|
||||
$aFields['DESCRIPTION'] .= G::LoadTranslation( 'ID_PLEASE_CHANGE_PASSWORD_POLICY' ) . '</span>';
|
||||
$aFields['STATUS'] = false;
|
||||
} else {
|
||||
$color = 'green';
|
||||
$img = '/images/dialog-ok-apply.png';
|
||||
$aFields['DESCRIPTION'] = G::LoadTranslation('ID_PASSWORD_COMPLIES_POLICIES') . '</span>';
|
||||
$aFields['DESCRIPTION'] = G::LoadTranslation( 'ID_PASSWORD_COMPLIES_POLICIES' ) . '</span>';
|
||||
$aFields['STATUS'] = true;
|
||||
}
|
||||
$span = '<span style="color: ' . $color . '; font: 9px tahoma,arial,helvetica,sans-serif;">';
|
||||
$gif = '<img width="13" height="13" border="0" src="' . $img . '">';
|
||||
$aFields['DESCRIPTION'] = $span . $gif . $aFields['DESCRIPTION'];
|
||||
print(G::json_encode($aFields));
|
||||
print (G::json_encode( $aFields )) ;
|
||||
break;
|
||||
case 'testUsername';
|
||||
case 'testUsername':
|
||||
require_once 'classes/model/Users.php';
|
||||
$_POST['NEW_USERNAME'] = trim($_POST['NEW_USERNAME']);
|
||||
$USR_UID = isset($_POST['USR_UID'])? $_POST['USR_UID'] : '';
|
||||
$_POST['NEW_USERNAME'] = trim( $_POST['NEW_USERNAME'] );
|
||||
$USR_UID = isset( $_POST['USR_UID'] ) ? $_POST['USR_UID'] : '';
|
||||
|
||||
$response = array( "success" => true );
|
||||
$response = array ("success" => true
|
||||
);
|
||||
|
||||
$oCriteria = new Criteria();
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_USERNAME );
|
||||
|
||||
$oCriteria->add(UsersPeer::USR_USERNAME, $_POST['NEW_USERNAME']);
|
||||
$oCriteria->add( UsersPeer::USR_USERNAME, $_POST['NEW_USERNAME'] );
|
||||
if ($USR_UID != '') {
|
||||
$oCriteria->add(UsersPeer::USR_UID, array($_POST['USR_UID']), Criteria::NOT_IN);
|
||||
$oCriteria->add( UsersPeer::USR_UID, array ($_POST['USR_UID']
|
||||
), Criteria::NOT_IN );
|
||||
}
|
||||
$oDataset = UsersPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset = UsersPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
|
||||
if (is_array($aRow) || $_POST['NEW_USERNAME'] == '') {
|
||||
if (is_array( $aRow ) || $_POST['NEW_USERNAME'] == '') {
|
||||
$color = 'red';
|
||||
$img = '/images/delete.png';
|
||||
$dataVar['USER_ID'] = $_POST['NEW_USERNAME'];
|
||||
$text = G::LoadTranslation('ID_USERNAME_ALREADY_EXISTS', $dataVar);
|
||||
$text = ($_POST['NEW_USERNAME'] == '') ? G::LoadTranslation('ID_MSG_ERROR_USR_USERNAME') : $text;
|
||||
$text = G::LoadTranslation( 'ID_USERNAME_ALREADY_EXISTS', $dataVar );
|
||||
$text = ($_POST['NEW_USERNAME'] == '') ? G::LoadTranslation( 'ID_MSG_ERROR_USR_USERNAME' ) : $text;
|
||||
$response['exists'] = true;
|
||||
} else {
|
||||
$color = 'green';
|
||||
$img = '/images/dialog-ok-apply.png';
|
||||
$text = G::LoadTranslation('ID_USERNAME_CORRECT');
|
||||
$text = G::LoadTranslation( 'ID_USERNAME_CORRECT' );
|
||||
$response['exists'] = false;
|
||||
}
|
||||
|
||||
|
||||
$span = '<span style="color: ' . $color . '; font: 9px tahoma,arial,helvetica,sans-serif;">';
|
||||
$gif = '<img width="13" height="13" border="0" src="' . $img . '">';
|
||||
$response['descriptionText'] = $span . $gif . $text . '</span>';
|
||||
echo G::json_encode($response);
|
||||
echo G::json_encode( $response );
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -21,30 +21,29 @@
|
||||
*
|
||||
* 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' );
|
||||
|
||||
@@ -2,35 +2,37 @@
|
||||
global $RBAC;
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
unset($_SESSION['CURRENT_USER']);
|
||||
unset( $_SESSION['CURRENT_USER'] );
|
||||
$oUser = new Users();
|
||||
$aFields = $oUser->load($_SESSION['USER_LOGGED']);
|
||||
$aFields = $oUser->load( $_SESSION['USER_LOGGED'] );
|
||||
|
||||
if ($RBAC->userCanAccess('PM_EDITPERSONALINFO') == 1) { //he has permitions for edit his profile
|
||||
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);
|
||||
$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;
|
||||
$postMaxSize = (int) $POST_MAX_SIZE * $mul;
|
||||
|
||||
$UPLOAD_MAX_SIZE = ini_get('upload_max_filesize');
|
||||
$mul = substr($UPLOAD_MAX_SIZE, -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;
|
||||
$uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
|
||||
|
||||
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
|
||||
if ($postMaxSize < $uploadMaxSize)
|
||||
$uploadMaxSize = $postMaxSize;
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('users/users', true ); //adding a javascript file .js
|
||||
$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');
|
||||
$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' );
|
||||
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
<?php
|
||||
|
||||
//calculating the max upload file size;
|
||||
$POST_MAX_SIZE = ini_get('post_max_size');
|
||||
$mul = substr($POST_MAX_SIZE, -1);
|
||||
$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;
|
||||
$postMaxSize = (int) $POST_MAX_SIZE * $mul;
|
||||
|
||||
$UPLOAD_MAX_SIZE = ini_get('upload_max_filesize');
|
||||
$mul = substr($UPLOAD_MAX_SIZE, -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;
|
||||
$uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
|
||||
|
||||
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
|
||||
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' );
|
||||
|
||||
$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');
|
||||
|
||||
@@ -20,95 +20,86 @@
|
||||
*
|
||||
* 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_LOGIN'))
|
||||
{
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
switch ($RBAC->userCanAccess( 'PM_LOGIN' )) {
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
G::LoadInclude('ajax');
|
||||
if (isset($_POST['form']))
|
||||
{
|
||||
G::LoadInclude( 'ajax' );
|
||||
if (isset( $_POST['form'] )) {
|
||||
$_POST = $_POST['form'];
|
||||
}
|
||||
if(isset($_REQUEST['function'])){
|
||||
if (isset( $_REQUEST['function'] )) {
|
||||
//$value= $_POST['function'];
|
||||
$value = get_ajax_value('function');
|
||||
}else{
|
||||
$value = get_ajax_value( 'function' );
|
||||
} else {
|
||||
//$value= $_POST['functions'];
|
||||
$value = get_ajax_value('functions');
|
||||
$value = get_ajax_value( 'functions' );
|
||||
}
|
||||
switch ($value){
|
||||
switch ($value) {
|
||||
case 'verifyUsername':
|
||||
//print_r($_POST); die;
|
||||
$_POST['sOriginalUsername'] = get_ajax_value('sOriginalUsername');
|
||||
$_POST['sUsername'] = get_ajax_value('sUsername');
|
||||
if ($_POST['sOriginalUsername'] == $_POST['sUsername'])
|
||||
{
|
||||
$_POST['sOriginalUsername'] = get_ajax_value( 'sOriginalUsername' );
|
||||
$_POST['sUsername'] = get_ajax_value( 'sUsername' );
|
||||
if ($_POST['sOriginalUsername'] == $_POST['sUsername']) {
|
||||
echo '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
require_once 'classes/model/Users.php';
|
||||
G::LoadClass('Users');
|
||||
G::LoadClass( 'Users' );
|
||||
$oUser = new Users();
|
||||
$oCriteria=$oUser->loadByUsername($_POST['sUsername']);
|
||||
$oDataset = UsersPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oCriteria = $oUser->loadByUsername( $_POST['sUsername'] );
|
||||
$oDataset = UsersPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
//print_r($aRow); die;
|
||||
//if (!$aRow)
|
||||
if (!is_array($aRow))
|
||||
{
|
||||
if (! is_array( $aRow )) {
|
||||
echo '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
echo '1';
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'availableUsers':
|
||||
G::LoadClass('processMap');
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'users/users_AvailableUsers', $oProcessMap->getAvailableUsersCriteria($_GET['sTask'], $_GET['iType']));
|
||||
G::RenderPage('publish', 'raw');
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'users/users_AvailableUsers', $oProcessMap->getAvailableUsersCriteria( $_GET['sTask'], $_GET['iType'] ) );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'assign':
|
||||
G::LoadClass('tasks');
|
||||
G::LoadClass( 'tasks' );
|
||||
$oTasks = new Tasks();
|
||||
switch ((int)$_POST['TU_RELATION']) {
|
||||
switch ((int) $_POST['TU_RELATION']) {
|
||||
case 1:
|
||||
echo $oTasks->assignUser($_POST['TAS_UID'], $_POST['USR_UID'], $_POST['TU_TYPE']);
|
||||
echo $oTasks->assignUser( $_POST['TAS_UID'], $_POST['USR_UID'], $_POST['TU_TYPE'] );
|
||||
break;
|
||||
case 2:
|
||||
echo $oTasks->assignGroup($_POST['TAS_UID'], $_POST['USR_UID'], $_POST['TU_TYPE']);
|
||||
echo $oTasks->assignGroup( $_POST['TAS_UID'], $_POST['USR_UID'], $_POST['TU_TYPE'] );
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'ofToAssign':
|
||||
G::LoadClass('tasks');
|
||||
G::LoadClass( 'tasks' );
|
||||
$oTasks = new Tasks();
|
||||
switch ((int)$_POST['TU_RELATION']) {
|
||||
switch ((int) $_POST['TU_RELATION']) {
|
||||
case 1:
|
||||
echo $oTasks->ofToAssignUser($_POST['TAS_UID'], $_POST['USR_UID'], $_POST['TU_TYPE']);
|
||||
echo $oTasks->ofToAssignUser( $_POST['TAS_UID'], $_POST['USR_UID'], $_POST['TU_TYPE'] );
|
||||
break;
|
||||
case 2:
|
||||
echo $oTasks->ofToAssignGroup($_POST['TAS_UID'], $_POST['USR_UID'], $_POST['TU_TYPE']);
|
||||
echo $oTasks->ofToAssignGroup( $_POST['TAS_UID'], $_POST['USR_UID'], $_POST['TU_TYPE'] );
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -116,36 +107,36 @@ try {
|
||||
$_SESSION['iType'] = $_POST['TU_TYPE'];
|
||||
break;
|
||||
case 'deleteGroup':
|
||||
G::LoadClass('groups');
|
||||
G::LoadClass( 'groups' );
|
||||
$oGroup = new Groups();
|
||||
$oGroup->removeUserOfGroup($_POST['GRP_UID'], $_POST['USR_UID']);
|
||||
$oGroup->removeUserOfGroup( $_POST['GRP_UID'], $_POST['USR_UID'] );
|
||||
$_GET['sUserUID'] = $_POST['USR_UID'];
|
||||
$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' );
|
||||
break;
|
||||
case 'showUserGroupInterface':
|
||||
$_GET['sUserUID'] = $_POST['sUserUID'];
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('view', 'users/users_AssignGroup' );
|
||||
G::RenderPage('publish', 'raw');
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'users/users_AssignGroup' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'showUserGroups':
|
||||
$_GET['sUserUID'] = $_POST['sUserUID'];
|
||||
$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' );
|
||||
break;
|
||||
case 'assignUserToGroup':
|
||||
G::LoadClass('groups');
|
||||
G::LoadClass( 'groups' );
|
||||
$oGroup = new Groups();
|
||||
$oGroup->addUserToGroup($_POST['GRP_UID'], $_POST['USR_UID']);
|
||||
echo '<div align="center"><h2><font color="blue">'.G::LoadTranslation('ID_MSG_ASSIGN_DONE').'</font></h2></div>';
|
||||
$oGroup->addUserToGroup( $_POST['GRP_UID'], $_POST['USR_UID'] );
|
||||
echo '<div align="center"><h2><font color="blue">' . G::LoadTranslation( 'ID_MSG_ASSIGN_DONE' ) . '</font></h2></div>';
|
||||
break;
|
||||
case 'usersGroup':
|
||||
G::LoadClass('groups');
|
||||
G::LoadClass( 'groups' );
|
||||
$oGroup = new Groups();
|
||||
$aGroup = $oGroup->getUsersOfGroup($_POST['GRP_UID']);
|
||||
$aGroup = $oGroup->getUsersOfGroup( $_POST['GRP_UID'] );
|
||||
foreach ($aGroup as $iIndex => $aValues) {
|
||||
echo $aValues['USR_FIRSTNAME'] . ' ' . $aValues['USR_LASTNAME'] . '<br>';
|
||||
}
|
||||
@@ -153,39 +144,39 @@ try {
|
||||
|
||||
//This case is used to check if any of the user group has as role 'PROCESSMAKER_ADMIN',
|
||||
case 'usersAdminGroupExtJS':
|
||||
G::LoadClass('groups');
|
||||
G::LoadClass( 'groups' );
|
||||
$oGroup = new Groups();
|
||||
$aGroup = $oGroup->getUsersOfGroup($_POST['GRP_UID']);
|
||||
$aGroup = $oGroup->getUsersOfGroup( $_POST['GRP_UID'] );
|
||||
$responseUser = 'false';
|
||||
$usersAdmin = '';
|
||||
foreach ($aGroup as $iIndex => $aValues) {
|
||||
if ($aValues['USR_ROLE'] == 'PROCESSMAKER_ADMIN') {
|
||||
$responseUser = 'true';
|
||||
$usersAdmin .= $aValues['USR_FIRSTNAME'] . ' ' . $aValues['USR_LASTNAME'].', ';
|
||||
$usersAdmin .= $aValues['USR_FIRSTNAME'] . ' ' . $aValues['USR_LASTNAME'] . ', ';
|
||||
}
|
||||
}
|
||||
$usersAdmin = substr($usersAdmin, 0, -2);
|
||||
$usersAdmin = substr( $usersAdmin, 0, - 2 );
|
||||
|
||||
$result = new stdClass();
|
||||
$result->reponse = $responseUser;
|
||||
$result->users = $usersAdmin;
|
||||
|
||||
echo G::json_encode($result);
|
||||
echo G::json_encode( $result );
|
||||
break;
|
||||
case 'canDeleteUser':
|
||||
G::LoadClass('case');
|
||||
G::LoadClass( 'case' );
|
||||
$oProcessMap = new Cases();
|
||||
$USR_UID = $_POST['uUID'];
|
||||
$total = 0;
|
||||
$history = 0;
|
||||
$c = $oProcessMap->getCriteriaUsersCases('TO_DO', $USR_UID);
|
||||
$total += ApplicationPeer::doCount($c);
|
||||
$c = $oProcessMap->getCriteriaUsersCases('DRAFT', $USR_UID);
|
||||
$total += ApplicationPeer::doCount($c);
|
||||
$c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $USR_UID);
|
||||
$history += ApplicationPeer::doCount($c);
|
||||
$c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID);
|
||||
$history += ApplicationPeer::doCount($c);
|
||||
$c = $oProcessMap->getCriteriaUsersCases( 'TO_DO', $USR_UID );
|
||||
$total += ApplicationPeer::doCount( $c );
|
||||
$c = $oProcessMap->getCriteriaUsersCases( 'DRAFT', $USR_UID );
|
||||
$total += ApplicationPeer::doCount( $c );
|
||||
$c = $oProcessMap->getCriteriaUsersCases( 'COMPLETED', $USR_UID );
|
||||
$history += ApplicationPeer::doCount( $c );
|
||||
$c = $oProcessMap->getCriteriaUsersCases( 'CANCELLED', $USR_UID );
|
||||
$history += ApplicationPeer::doCount( $c );
|
||||
$response = '{success: true, candelete: ';
|
||||
$response .= ($total > 0) ? 'false' : 'true';
|
||||
$response .= ', hashistory: ';
|
||||
@@ -195,157 +186,157 @@ try {
|
||||
break;
|
||||
case 'deleteUser':
|
||||
$UID = $_POST['USR_UID'];
|
||||
G::LoadClass('tasks');
|
||||
G::LoadClass( 'tasks' );
|
||||
$oTasks = new Tasks();
|
||||
$oTasks->ofToAssignUserOfAllTasks($UID);
|
||||
G::LoadClass('groups');
|
||||
$oTasks->ofToAssignUserOfAllTasks( $UID );
|
||||
G::LoadClass( 'groups' );
|
||||
$oGroups = new Groups();
|
||||
$oGroups->removeUserOfAllGroups($UID);
|
||||
$RBAC->changeUserStatus($UID, 'CLOSED');
|
||||
$_GET['USR_USERNAME']='';
|
||||
$RBAC->updateUser(array('USR_UID' => $UID, 'USR_USERNAME' => $_GET['USR_USERNAME']),'');
|
||||
$oGroups->removeUserOfAllGroups( $UID );
|
||||
$RBAC->changeUserStatus( $UID, 'CLOSED' );
|
||||
$_GET['USR_USERNAME'] = '';
|
||||
$RBAC->updateUser( array ('USR_UID' => $UID,'USR_USERNAME' => $_GET['USR_USERNAME']
|
||||
), '' );
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$aFields = $oUser->load($UID);
|
||||
$aFields = $oUser->load( $UID );
|
||||
$aFields['USR_STATUS'] = 'CLOSED';
|
||||
$aFields['USR_USERNAME'] = '';
|
||||
$oUser->update($aFields);
|
||||
$oUser->update( $aFields );
|
||||
break;
|
||||
case 'changeUserStatus':
|
||||
$response = new stdclass();
|
||||
if (isset($_REQUEST['USR_UID']) && isset($_REQUEST['NEW_USR_STATUS'])) {
|
||||
$RBAC->changeUserStatus($_REQUEST['USR_UID'], ($_REQUEST['NEW_USR_STATUS'] == 'ACTIVE' ? 1 : 0));
|
||||
if (isset( $_REQUEST['USR_UID'] ) && isset( $_REQUEST['NEW_USR_STATUS'] )) {
|
||||
$RBAC->changeUserStatus( $_REQUEST['USR_UID'], ($_REQUEST['NEW_USR_STATUS'] == 'ACTIVE' ? 1 : 0) );
|
||||
require_once 'classes/model/Users.php';
|
||||
$userInstance = new Users();
|
||||
$userData = $userInstance->load($_REQUEST['USR_UID']);
|
||||
$userData = $userInstance->load( $_REQUEST['USR_UID'] );
|
||||
$userData['USR_STATUS'] = $_REQUEST['NEW_USR_STATUS'];
|
||||
$userInstance->update($userData);
|
||||
$userInstance->update( $userData );
|
||||
$response->status = 'OK';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$response->status = 'ERROR';
|
||||
$response->message = 'USR_UID and NEW_USR_STATUS parameters are required.';
|
||||
}
|
||||
die(G::json_encode($response));
|
||||
die( G::json_encode( $response ) );
|
||||
break;
|
||||
case 'availableGroups':
|
||||
G::LoadClass('groups');
|
||||
$filter = (isset($_POST['textFilter']))? $_POST['textFilter'] : '';
|
||||
G::LoadClass( 'groups' );
|
||||
$filter = (isset( $_POST['textFilter'] )) ? $_POST['textFilter'] : '';
|
||||
$groups = new Groups();
|
||||
$criteria = $groups->getAvailableGroupsCriteria($_REQUEST['uUID'],$filter);
|
||||
$objects = GroupwfPeer::doSelectRS($criteria);
|
||||
$objects->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
|
||||
$arr = Array();
|
||||
while ($objects->next()){
|
||||
$criteria = $groups->getAvailableGroupsCriteria( $_REQUEST['uUID'], $filter );
|
||||
$objects = GroupwfPeer::doSelectRS( $criteria );
|
||||
$objects->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$arr = Array ();
|
||||
while ($objects->next()) {
|
||||
$arr[] = $objects->getRow();
|
||||
}
|
||||
echo '{groups: '.G::json_encode($arr).'}';
|
||||
echo '{groups: ' . G::json_encode( $arr ) . '}';
|
||||
break;
|
||||
case 'assignedGroups':
|
||||
G::LoadClass('groups');
|
||||
$filter = (isset($_POST['textFilter']))? $_POST['textFilter'] : '';
|
||||
G::LoadClass( 'groups' );
|
||||
$filter = (isset( $_POST['textFilter'] )) ? $_POST['textFilter'] : '';
|
||||
$groups = new Groups();
|
||||
$criteria = $groups->getAssignedGroupsCriteria($_REQUEST['uUID'],$filter);
|
||||
$objects = GroupwfPeer::doSelectRS($criteria);
|
||||
$objects->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
|
||||
$arr = Array();
|
||||
while ($objects->next()){
|
||||
$criteria = $groups->getAssignedGroupsCriteria( $_REQUEST['uUID'], $filter );
|
||||
$objects = GroupwfPeer::doSelectRS( $criteria );
|
||||
$objects->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$arr = Array ();
|
||||
while ($objects->next()) {
|
||||
$arr[] = $objects->getRow();
|
||||
}
|
||||
echo '{groups: '.G::json_encode($arr).'}';
|
||||
echo '{groups: ' . G::json_encode( $arr ) . '}';
|
||||
break;
|
||||
case 'assignGroupsToUserMultiple':
|
||||
$USR_UID = $_POST['USR_UID'];
|
||||
$gUIDs = explode(',',$_POST['GRP_UID']);
|
||||
G::LoadClass('groups');
|
||||
$gUIDs = explode( ',', $_POST['GRP_UID'] );
|
||||
G::LoadClass( 'groups' );
|
||||
$oGroup = new Groups();
|
||||
foreach ($gUIDs as $GRP_UID){
|
||||
$oGroup->addUserToGroup($GRP_UID, $USR_UID);
|
||||
foreach ($gUIDs as $GRP_UID) {
|
||||
$oGroup->addUserToGroup( $GRP_UID, $USR_UID );
|
||||
}
|
||||
break;
|
||||
case 'deleteGroupsToUserMultiple':
|
||||
$USR_UID = $_POST['USR_UID'];
|
||||
$gUIDs = explode(',',$_POST['GRP_UID']);
|
||||
G::LoadClass('groups');
|
||||
$gUIDs = explode( ',', $_POST['GRP_UID'] );
|
||||
G::LoadClass( 'groups' );
|
||||
$oGroup = new Groups();
|
||||
foreach ($gUIDs as $GRP_UID){
|
||||
$oGroup->removeUserOfGroup($GRP_UID, $USR_UID);
|
||||
foreach ($gUIDs as $GRP_UID) {
|
||||
$oGroup->removeUserOfGroup( $GRP_UID, $USR_UID );
|
||||
}
|
||||
break;
|
||||
case 'authSources':
|
||||
$criteria = $RBAC->getAllAuthSources();
|
||||
$objects = AuthenticationSourcePeer::doSelectRS($criteria);
|
||||
$objects->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
|
||||
$arr = Array();
|
||||
if (isset($_REQUEST['cmb'])){
|
||||
if ($_REQUEST['cmb'] == 'yes'){
|
||||
$started = Array();
|
||||
$objects = AuthenticationSourcePeer::doSelectRS( $criteria );
|
||||
$objects->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$arr = Array ();
|
||||
if (isset( $_REQUEST['cmb'] )) {
|
||||
if ($_REQUEST['cmb'] == 'yes') {
|
||||
$started = Array ();
|
||||
$started['AUTH_SOURCE_UID'] = '';
|
||||
$started['AUTH_SOURCE_SHOW'] = G::LoadTranslation('ID_ALL');
|
||||
$started['AUTH_SOURCE_SHOW'] = G::LoadTranslation( 'ID_ALL' );
|
||||
$arr[] = $started;
|
||||
}
|
||||
}
|
||||
$started = Array();
|
||||
$started = Array ();
|
||||
$started['AUTH_SOURCE_UID'] = '00000000000000000000000000000000';
|
||||
//$started['AUTH_SOURCE_NAME'] = 'ProcessMaker';
|
||||
//$started['AUTH_SOURCE_TYPE'] = 'MYSQL';
|
||||
$started['AUTH_SOURCE_SHOW'] = 'ProcessMaker (MYSQL)';
|
||||
$arr[] = $started;
|
||||
while ($objects->next()){
|
||||
while ($objects->next()) {
|
||||
$row = $objects->getRow();
|
||||
$aux = Array();
|
||||
$aux = Array ();
|
||||
$aux['AUTH_SOURCE_UID'] = $row['AUTH_SOURCE_UID'];
|
||||
//$aux['AUTH_SOURCE_NAME'] = $row['AUTH_SOURCE_NAME'];
|
||||
//$aux['AUTH_SOURCE_TYPE'] = $row['AUTH_SOURCE_TYPE'];
|
||||
$aux['AUTH_SOURCE_SHOW'] = $row['AUTH_SOURCE_NAME'].' ('.$row['AUTH_SOURCE_PROVIDER'].')';
|
||||
$aux['AUTH_SOURCE_SHOW'] = $row['AUTH_SOURCE_NAME'] . ' (' . $row['AUTH_SOURCE_PROVIDER'] . ')';
|
||||
$arr[] = $aux;
|
||||
}
|
||||
echo '{sources: '.G::json_encode($arr).'}';
|
||||
echo '{sources: ' . G::json_encode( $arr ) . '}';
|
||||
break;
|
||||
case 'loadAuthSourceByUID':
|
||||
require_once 'classes/model/Users.php';
|
||||
$oCriteria=$RBAC->load($_POST['uUID']);
|
||||
$oCriteria = $RBAC->load( $_POST['uUID'] );
|
||||
$UID_AUTH = $oCriteria['UID_AUTH_SOURCE'];
|
||||
if (($UID_AUTH!='00000000000000000000000000000000')&&($UID_AUTH!='')){
|
||||
$aux = $RBAC->getAuthSource($UID_AUTH);
|
||||
$arr = Array();
|
||||
$arr['AUTH_SOURCE_NAME'] = $aux['AUTH_SOURCE_NAME'].' ('.$aux['AUTH_SOURCE_PROVIDER'].')';
|
||||
if (($UID_AUTH != '00000000000000000000000000000000') && ($UID_AUTH != '')) {
|
||||
$aux = $RBAC->getAuthSource( $UID_AUTH );
|
||||
$arr = Array ();
|
||||
$arr['AUTH_SOURCE_NAME'] = $aux['AUTH_SOURCE_NAME'] . ' (' . $aux['AUTH_SOURCE_PROVIDER'] . ')';
|
||||
$arr['AUTH_SOURCE_PROVIDER'] = $aux['AUTH_SOURCE_PROVIDER'];
|
||||
$aFields = $arr;
|
||||
}else{
|
||||
$arr = Array();
|
||||
} else {
|
||||
$arr = Array ();
|
||||
$arr['AUTH_SOURCE_NAME'] = 'ProcessMaker (MYSQL)';
|
||||
$arr['AUTH_SOURCE_PROVIDER'] = 'MYSQL';
|
||||
$aFields = $arr;
|
||||
}
|
||||
$res = Array();
|
||||
$res = Array ();
|
||||
$res['data'] = $oCriteria;
|
||||
$res['auth'] = $aFields;
|
||||
echo G::json_encode($res);
|
||||
echo G::json_encode( $res );
|
||||
break;
|
||||
case 'updateAuthServices':
|
||||
$aData = $RBAC->load($_POST['usr_uid']);
|
||||
unset($aData['USR_ROLE']);
|
||||
$aData = $RBAC->load( $_POST['usr_uid'] );
|
||||
unset( $aData['USR_ROLE'] );
|
||||
$auth_uid = $_POST['auth_source'];
|
||||
$auth_uid2 = $_POST['auth_source_uid'];
|
||||
if ($auth_uid == $auth_uid2){
|
||||
if ($auth_uid == $auth_uid2) {
|
||||
$auth_uid = $aData['UID_AUTH_SOURCE'];
|
||||
}
|
||||
if (($auth_uid=='00000000000000000000000000000000')||($auth_uid=='')){
|
||||
if (($auth_uid == '00000000000000000000000000000000') || ($auth_uid == '')) {
|
||||
$aData['USR_AUTH_TYPE'] = 'MYSQL';
|
||||
$aData['UID_AUTH_SOURCE'] = '';
|
||||
}else{
|
||||
$aFields = $RBAC->getAuthSource($auth_uid);
|
||||
} else {
|
||||
$aFields = $RBAC->getAuthSource( $auth_uid );
|
||||
$aData['USR_AUTH_TYPE'] = $aFields['AUTH_SOURCE_PROVIDER'];
|
||||
$aData['UID_AUTH_SOURCE'] = $auth_uid;
|
||||
}
|
||||
if (isset($_POST['auth_dn'])){
|
||||
if (isset( $_POST['auth_dn'] )) {
|
||||
$auth_dn = $_POST['auth_dn'];
|
||||
}else{
|
||||
} else {
|
||||
$auth_dn = "";
|
||||
}
|
||||
$aData['USR_AUTH_USER_DN'] = $auth_dn;
|
||||
$RBAC->updateUser($aData);
|
||||
$RBAC->updateUser( $aData );
|
||||
echo '{success: true}';
|
||||
break;
|
||||
case 'usersList':
|
||||
@@ -354,91 +345,86 @@ try {
|
||||
require_once 'classes/model/Department.php';
|
||||
require_once 'classes/model/AppCacheView.php';
|
||||
global $RBAC;
|
||||
G::LoadClass('configuration');
|
||||
G::LoadClass( 'configuration' );
|
||||
$co = new Configurations();
|
||||
$config = $co->getConfiguration('usersList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
|
||||
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
|
||||
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size;
|
||||
$filter = isset($_REQUEST['textFilter']) ? $_REQUEST['textFilter'] : '';
|
||||
$auths = isset($_REQUEST['auths']) ? $_REQUEST['auths'] : '';
|
||||
$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : '';
|
||||
$dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : 'ASC';
|
||||
$aUsers = Array();
|
||||
if ($auths != ''){
|
||||
$aUsers = $RBAC->getListUsersByAuthSource($auths);
|
||||
$config = $co->getConfiguration( 'usersList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
$limit_size = isset( $config['pageSize'] ) ? $config['pageSize'] : 20;
|
||||
$start = isset( $_REQUEST['start'] ) ? $_REQUEST['start'] : 0;
|
||||
$limit = isset( $_REQUEST['limit'] ) ? $_REQUEST['limit'] : $limit_size;
|
||||
$filter = isset( $_REQUEST['textFilter'] ) ? $_REQUEST['textFilter'] : '';
|
||||
$auths = isset( $_REQUEST['auths'] ) ? $_REQUEST['auths'] : '';
|
||||
$sort = isset( $_REQUEST['sort'] ) ? $_REQUEST['sort'] : '';
|
||||
$dir = isset( $_REQUEST['dir'] ) ? $_REQUEST['dir'] : 'ASC';
|
||||
$aUsers = Array ();
|
||||
if ($auths != '') {
|
||||
$aUsers = $RBAC->getListUsersByAuthSource( $auths );
|
||||
}
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn('COUNT(*) AS CNT');
|
||||
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)->addOr(
|
||||
$oCriteria->getNewCriterion(UsersPeer::USR_EMAIL,'%'.$filter.'%',Criteria::LIKE))));
|
||||
$oCriteria->add($cc);
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( 'COUNT(*) AS CNT' );
|
||||
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 )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_EMAIL, '%' . $filter . '%', Criteria::LIKE ) ) ) );
|
||||
$oCriteria->add( $cc );
|
||||
}
|
||||
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
|
||||
if ($auths != ''){
|
||||
$totalRows = sizeof($aUsers);
|
||||
}else{
|
||||
$oDataset = UsersPeer::DoSelectRs ($oCriteria);
|
||||
$oDataset->setFetchmode (ResultSet::FETCHMODE_ASSOC);
|
||||
$oCriteria->add( UsersPeer::USR_STATUS, array ('CLOSED'
|
||||
), Criteria::NOT_IN );
|
||||
if ($auths != '') {
|
||||
$totalRows = sizeof( $aUsers );
|
||||
} else {
|
||||
$oDataset = UsersPeer::DoSelectRs( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$row = $oDataset->getRow();
|
||||
$totalRows = $row['CNT'];
|
||||
}
|
||||
$oCriteria->clearSelectColumns();
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_ROLE);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_DUE_DATE);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_STATUS);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_UX);
|
||||
$oCriteria->addSelectColumn(UsersPeer::DEP_UID);
|
||||
$oCriteria->addAsColumn('LAST_LOGIN', 0);
|
||||
$oCriteria->addAsColumn('DEP_TITLE', 0);
|
||||
$oCriteria->addAsColumn('TOTAL_CASES', 0);
|
||||
$oCriteria->addAsColumn('DUE_DATE_OK', 1);
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_UID );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_USERNAME );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_FIRSTNAME );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_LASTNAME );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_EMAIL );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_ROLE );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_DUE_DATE );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_STATUS );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_UX );
|
||||
$oCriteria->addSelectColumn( UsersPeer::DEP_UID );
|
||||
$oCriteria->addAsColumn( 'LAST_LOGIN', 0 );
|
||||
$oCriteria->addAsColumn( 'DEP_TITLE', 0 );
|
||||
$oCriteria->addAsColumn( 'TOTAL_CASES', 0 );
|
||||
$oCriteria->addAsColumn( 'DUE_DATE_OK', 1 );
|
||||
$sep = "'";
|
||||
$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)->addOr(
|
||||
$oCriteria->getNewCriterion(UsersPeer::USR_EMAIL,'%'.$filter.'%',Criteria::LIKE))));
|
||||
$oCriteria->add($cc);
|
||||
$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 )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_EMAIL, '%' . $filter . '%', Criteria::LIKE ) ) ) );
|
||||
$oCriteria->add( $cc );
|
||||
}
|
||||
// $sw_add = false;
|
||||
// for ($i=0; $i < sizeof($aUsers); $i++){
|
||||
// if ($i>0){
|
||||
// $tmpL = $tmpL->addOr($oCriteria->getNewCriterion(UsersPeer::USR_UID, $aUsers[$i],Criteria::EQUAL));
|
||||
// }else{
|
||||
// $uList = $oCriteria->getNewCriterion(UsersPeer::USR_UID, $aUsers[$i],Criteria::EQUAL);
|
||||
// $tmpL = $uList;
|
||||
// $sw_add = true;
|
||||
// }
|
||||
// }
|
||||
// if ($sw_add) $oCriteria->add($uList);
|
||||
if (sizeof($aUsers) > 0){
|
||||
$oCriteria->add(UsersPeer::USR_UID, $aUsers, Criteria::IN);
|
||||
}else if ($totalRows==0 && $auths != ''){
|
||||
$oCriteria->add(UsersPeer::USR_UID,'',Criteria::IN);
|
||||
// $sw_add = false;
|
||||
// for ($i=0; $i < sizeof($aUsers); $i++){
|
||||
// if ($i>0){
|
||||
// $tmpL = $tmpL->addOr($oCriteria->getNewCriterion(UsersPeer::USR_UID, $aUsers[$i],Criteria::EQUAL));
|
||||
// }else{
|
||||
// $uList = $oCriteria->getNewCriterion(UsersPeer::USR_UID, $aUsers[$i],Criteria::EQUAL);
|
||||
// $tmpL = $uList;
|
||||
// $sw_add = true;
|
||||
// }
|
||||
// }
|
||||
// if ($sw_add) $oCriteria->add($uList);
|
||||
if (sizeof( $aUsers ) > 0) {
|
||||
$oCriteria->add( UsersPeer::USR_UID, $aUsers, Criteria::IN );
|
||||
} else if ($totalRows == 0 && $auths != '') {
|
||||
$oCriteria->add( UsersPeer::USR_UID, '', Criteria::IN );
|
||||
}
|
||||
if ($sort != '') {
|
||||
if ($dir == 'ASC') {
|
||||
$oCriteria->addAscendingOrderByColumn($sort);
|
||||
}
|
||||
else {
|
||||
$oCriteria->addDescendingOrderByColumn($sort);
|
||||
$oCriteria->addAscendingOrderByColumn( $sort );
|
||||
} else {
|
||||
$oCriteria->addDescendingOrderByColumn( $sort );
|
||||
}
|
||||
}
|
||||
$oCriteria->setOffset($start);
|
||||
$oCriteria->setLimit($limit);
|
||||
$oDataset = UsersPeer::DoSelectRs ($oCriteria);
|
||||
$oDataset->setFetchmode (ResultSet::FETCHMODE_ASSOC);
|
||||
$oCriteria->setOffset( $start );
|
||||
$oCriteria->setLimit( $limit );
|
||||
$oDataset = UsersPeer::DoSelectRs( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$Login = new LoginLog();
|
||||
$aLogin = $Login->getLastLoginAllUsers();
|
||||
@@ -451,41 +437,41 @@ try {
|
||||
require_once PATH_CONTROLLERS . 'adminProxy.php';
|
||||
$uxList = adminProxy::getUxTypesList();
|
||||
|
||||
$rows = Array();
|
||||
while($oDataset->next()){
|
||||
$rows = Array ();
|
||||
while ($oDataset->next()) {
|
||||
$row = $oDataset->getRow();
|
||||
$row['DUE_DATE_OK'] = (date('Y-m-d')>date('Y-m-d',strtotime($row['USR_DUE_DATE'])))? 0 : 1;
|
||||
$row['LAST_LOGIN'] = isset($aLogin[$row['USR_UID']]) ? $aLogin[$row['USR_UID']] : '';
|
||||
$row['TOTAL_CASES'] = isset($aCases[$row['USR_UID']]) ? $aCases[$row['USR_UID']] : 0;
|
||||
$row['DEP_TITLE'] = isset($aDepart[$row['USR_UID']]) ? $aDepart[$row['USR_UID']] : '';
|
||||
$row['USR_UX'] = isset($uxList[$row['USR_UX']]) ? $uxList[$row['USR_UX']] : $uxList['NORMAL'];
|
||||
$row['USR_AUTH_SOURCE'] = isset($aAuthSources[$row['USR_UID']]) ? $aAuthSources[$row['USR_UID']] : 'ProcessMaker (MYSQL)';
|
||||
$row['DUE_DATE_OK'] = (date( 'Y-m-d' ) > date( 'Y-m-d', strtotime( $row['USR_DUE_DATE'] ) )) ? 0 : 1;
|
||||
$row['LAST_LOGIN'] = isset( $aLogin[$row['USR_UID']] ) ? $aLogin[$row['USR_UID']] : '';
|
||||
$row['TOTAL_CASES'] = isset( $aCases[$row['USR_UID']] ) ? $aCases[$row['USR_UID']] : 0;
|
||||
$row['DEP_TITLE'] = isset( $aDepart[$row['USR_UID']] ) ? $aDepart[$row['USR_UID']] : '';
|
||||
$row['USR_UX'] = isset( $uxList[$row['USR_UX']] ) ? $uxList[$row['USR_UX']] : $uxList['NORMAL'];
|
||||
$row['USR_AUTH_SOURCE'] = isset( $aAuthSources[$row['USR_UID']] ) ? $aAuthSources[$row['USR_UID']] : 'ProcessMaker (MYSQL)';
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
echo '{users: '.G::json_encode($rows).', total_users: '.$totalRows.'}';
|
||||
echo '{users: ' . G::json_encode( $rows ) . ', total_users: ' . $totalRows . '}';
|
||||
break;
|
||||
case 'updatePageSize':
|
||||
G::LoadClass('configuration');
|
||||
G::LoadClass( 'configuration' );
|
||||
$c = new Configurations();
|
||||
$arr['pageSize'] = $_REQUEST['size'];
|
||||
$arr['dateSave'] = date('Y-m-d H:i:s');
|
||||
$config = Array();
|
||||
$arr['dateSave'] = date( 'Y-m-d H:i:s' );
|
||||
$config = Array ();
|
||||
$config[] = $arr;
|
||||
$c->aConfig = $config;
|
||||
$c->saveConfig('usersList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$c->saveConfig( 'usersList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
echo '{success: true}';
|
||||
break;
|
||||
case 'summaryUserData':
|
||||
require_once 'classes/model/Users.php';
|
||||
require_once 'classes/model/Department.php';
|
||||
require_once 'classes/model/AppCacheView.php';
|
||||
G::LoadClass('configuration');
|
||||
G::LoadClass( 'configuration' );
|
||||
$oUser = new Users();
|
||||
$data = $oUser->loadDetailed($_REQUEST['USR_UID']);
|
||||
$data['USR_STATUS'] = G::LoadTranslation('ID_' . $data['USR_STATUS']);
|
||||
$data = $oUser->loadDetailed( $_REQUEST['USR_UID'] );
|
||||
$data['USR_STATUS'] = G::LoadTranslation( 'ID_' . $data['USR_STATUS'] );
|
||||
$oAppCache = new AppCacheView();
|
||||
$aTypes = Array();
|
||||
$aTypes = Array ();
|
||||
$aTypes['to_do'] = 'CASES_INBOX';
|
||||
$aTypes['draft'] = 'CASES_DRAFT';
|
||||
$aTypes['cancelled'] = 'CASES_CANCELLED';
|
||||
@@ -493,30 +479,29 @@ try {
|
||||
$aTypes['paused'] = 'CASES_PAUSED';
|
||||
$aTypes['completed'] = 'CASES_COMPLETED';
|
||||
$aTypes['selfservice'] = 'CASES_SELFSERVICE';
|
||||
$aCount = $oAppCache->getAllCounters( array_keys($aTypes), $_REQUEST['USR_UID']);
|
||||
$aCount = $oAppCache->getAllCounters( array_keys( $aTypes ), $_REQUEST['USR_UID'] );
|
||||
$dep = new Department();
|
||||
if ($dep->existsDepartment($data['DEP_UID'])){
|
||||
$dep->Load($data['DEP_UID']);
|
||||
if ($dep->existsDepartment( $data['DEP_UID'] )) {
|
||||
$dep->Load( $data['DEP_UID'] );
|
||||
$dep_name = $dep->getDepTitle();
|
||||
}else{
|
||||
} else {
|
||||
$dep_name = '';
|
||||
}
|
||||
if ($data['USR_REPLACED_BY']!=''){
|
||||
if ($data['USR_REPLACED_BY'] != '') {
|
||||
$user = new Users();
|
||||
$u = $user->load($data['USR_REPLACED_BY']);
|
||||
$u = $user->load( $data['USR_REPLACED_BY'] );
|
||||
$c = new Configurations();
|
||||
$replaced_by = $c->usersNameFormat($u['USR_USERNAME'], $u['USR_FIRSTNAME'], $u['USR_LASTNAME']);
|
||||
}else{
|
||||
$replaced_by = $c->usersNameFormat( $u['USR_USERNAME'], $u['USR_FIRSTNAME'], $u['USR_LASTNAME'] );
|
||||
} else {
|
||||
$replaced_by = '';
|
||||
}
|
||||
$misc = Array();
|
||||
$misc = Array ();
|
||||
$misc['DEP_TITLE'] = $dep_name;
|
||||
$misc['REPLACED_NAME'] = $replaced_by;
|
||||
echo '{success: true, userdata: '.G::json_encode($data).', cases: '.G::json_encode($aCount).', misc: '.G::json_encode($misc).'}';
|
||||
echo '{success: true, userdata: ' . G::json_encode( $data ) . ', cases: ' . G::json_encode( $aCount ) . ', misc: ' . G::json_encode( $misc ) . '}';
|
||||
break;
|
||||
}
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,13 +20,12 @@
|
||||
*
|
||||
* 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';
|
||||
@@ -34,6 +33,8 @@ $G_MAIN_MENU = 'processmaker';
|
||||
$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' );
|
||||
|
||||
|
||||
@@ -20,27 +20,26 @@
|
||||
*
|
||||
* 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']);
|
||||
} 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');
|
||||
@@ -20,27 +20,25 @@
|
||||
*
|
||||
* 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;
|
||||
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;
|
||||
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;
|
||||
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';
|
||||
@@ -48,26 +46,25 @@ try {
|
||||
$oUser->remove($_GET['USR_UID']);*/
|
||||
|
||||
//print_r($_GET['USR_UID']); die
|
||||
G::LoadClass('tasks');
|
||||
G::LoadClass( 'tasks' );
|
||||
$oTasks = new Tasks();
|
||||
$oTasks->ofToAssignUserOfAllTasks($_GET['USR_UID']);
|
||||
G::LoadClass('groups');
|
||||
$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']),'');
|
||||
|
||||
$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 = $oUser->load( $_GET['USR_UID'] );
|
||||
$aFields['USR_STATUS'] = 'CLOSED';
|
||||
$aFields['USR_USERNAME'] = '';
|
||||
$oUser->update($aFields);
|
||||
G::header('location: users_List');
|
||||
$oUser->update( $aFields );
|
||||
G::header( 'location: users_List' );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,30 +20,28 @@
|
||||
*
|
||||
* 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'];
|
||||
$USR_UID = $_GET['USR_UID'];
|
||||
|
||||
G::LoadClass('case');
|
||||
$oProcessMap = new Cases();
|
||||
G::LoadClass( 'case' );
|
||||
$oProcessMap = new Cases();
|
||||
|
||||
$c = $oProcessMap->getCriteriaUsersCases('TO_DO', $USR_UID);
|
||||
$array["TO_DO"] = ApplicationPeer::doCount($c);
|
||||
$c = $oProcessMap->getCriteriaUsersCases( 'TO_DO', $USR_UID );
|
||||
$array["TO_DO"] = ApplicationPeer::doCount( $c );
|
||||
|
||||
$c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $USR_UID);
|
||||
$array["COMPLETED"] = ApplicationPeer::doCount($c);
|
||||
$c = $oProcessMap->getCriteriaUsersCases( 'COMPLETED', $USR_UID );
|
||||
$array["COMPLETED"] = ApplicationPeer::doCount( $c );
|
||||
|
||||
$c = $oProcessMap->getCriteriaUsersCases('DRAFT', $USR_UID);
|
||||
$array["DRAFT"] = ApplicationPeer::doCount($c);
|
||||
$c = $oProcessMap->getCriteriaUsersCases( 'DRAFT', $USR_UID );
|
||||
$array["DRAFT"] = ApplicationPeer::doCount( $c );
|
||||
|
||||
$c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID);
|
||||
$array["CANCELLED"] = ApplicationPeer::doCount($c);
|
||||
$c = $oProcessMap->getCriteriaUsersCases( 'CANCELLED', $USR_UID );
|
||||
$array["CANCELLED"] = ApplicationPeer::doCount( $c );
|
||||
|
||||
$array["USR_UID"]=$USR_UID;
|
||||
$array["USR_UID"] = $USR_UID;
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_DeleteAssign', '', $array, '');
|
||||
G::RenderPage('publish', 'raw');
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_DeleteAssign', '', $array, '' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
|
||||
?>
|
||||
@@ -20,25 +20,24 @@
|
||||
*
|
||||
* 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;
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
if (!isset($_GET['USR_UID'])) {
|
||||
if (! isset( $_GET['USR_UID'] )) {
|
||||
$_GET['USR_UID'] = '';
|
||||
}
|
||||
|
||||
@@ -46,119 +45,121 @@ try {
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'USERS';
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
if ($_GET['USR_UID'] != '') {
|
||||
$c=0;
|
||||
$oTemplatePower = new TemplatePower(PATH_TPL . 'users/users_DeleteReassign.html');
|
||||
$c = 0;
|
||||
$oTemplatePower = new TemplatePower( PATH_TPL . 'users/users_DeleteReassign.html' );
|
||||
$oTemplatePower->prepare();
|
||||
G::LoadClass('tasks');
|
||||
G::LoadClass('groups');
|
||||
G::LoadClass( 'tasks' );
|
||||
G::LoadClass( 'groups' );
|
||||
$oTasks = new Tasks();
|
||||
$oGroups = new Groups();
|
||||
$oUser = new Users();
|
||||
G::LoadClass('case');
|
||||
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']);
|
||||
$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);
|
||||
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 = ApplicationPeer::doSelectRS( $oCriteriaToDo );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$c++;
|
||||
$oTemplatePower->newBlock('cases');
|
||||
$aKeys = array_keys($aRow);
|
||||
$c ++;
|
||||
$oTemplatePower->newBlock( 'cases' );
|
||||
$aKeys = array_keys( $aRow );
|
||||
foreach ($aKeys as $sKey) {
|
||||
$oTemplatePower->assign($sKey, $aRow[$sKey]);
|
||||
$oTemplatePower->assign( $sKey, $aRow[$sKey] );
|
||||
}
|
||||
$aUsers = array($_GET['USR_UID']);
|
||||
$aAux1 = $oTasks->getGroupsOfTask($aRow['TAS_UID'], 1);
|
||||
$aUsers = array ($_GET['USR_UID']
|
||||
);
|
||||
$aAux1 = $oTasks->getGroupsOfTask( $aRow['TAS_UID'], 1 );
|
||||
foreach ($aAux1 as $aGroup) {
|
||||
$aAux2 = $oGroups->getUsersOfGroup($aGroup['GRP_UID']);
|
||||
$aAux2 = $oGroups->getUsersOfGroup( $aGroup['GRP_UID'] );
|
||||
foreach ($aAux2 as $aUser) {
|
||||
if (!in_array($aUser['USR_UID'], $aUsers)) {
|
||||
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'] . ')');
|
||||
$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);
|
||||
$aAux1 = $oTasks->getUsersOfTask( $aRow['TAS_UID'], 1 );
|
||||
foreach ($aAux1 as $aUser) {
|
||||
if (!in_array($aUser['USR_UID'], $aUsers)) {
|
||||
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'] . ')');
|
||||
$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'));
|
||||
$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 = ApplicationPeer::doSelectRS( $oCriteriaDraft );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$c++;
|
||||
$oTemplatePower->newBlock('cases');
|
||||
$aKeys = array_keys($aRow);
|
||||
$c ++;
|
||||
$oTemplatePower->newBlock( 'cases' );
|
||||
$aKeys = array_keys( $aRow );
|
||||
foreach ($aKeys as $sKey) {
|
||||
$oTemplatePower->assign($sKey, $aRow[$sKey]);
|
||||
$oTemplatePower->assign( $sKey, $aRow[$sKey] );
|
||||
}
|
||||
$aUsers = array($_GET['USR_UID']);
|
||||
$aAux1 = $oTasks->getGroupsOfTask($aRow['TAS_UID'], 1);
|
||||
$aUsers = array ($_GET['USR_UID']
|
||||
);
|
||||
$aAux1 = $oTasks->getGroupsOfTask( $aRow['TAS_UID'], 1 );
|
||||
foreach ($aAux1 as $aGroup) {
|
||||
$aAux2 = $oGroups->getUsersOfGroup($aGroup['GRP_UID']);
|
||||
$aAux2 = $oGroups->getUsersOfGroup( $aGroup['GRP_UID'] );
|
||||
foreach ($aAux2 as $aUser) {
|
||||
if (!in_array($aUser['USR_UID'], $aUsers)) {
|
||||
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'] . ')');
|
||||
$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);
|
||||
$aAux1 = $oTasks->getUsersOfTask( $aRow['TAS_UID'], 1 );
|
||||
foreach ($aAux1 as $aUser) {
|
||||
if (!in_array($aUser['USR_UID'], $aUsers)) {
|
||||
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'] . ')');
|
||||
$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'));
|
||||
$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);
|
||||
$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');
|
||||
G::RenderPage( 'publish' );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -21,70 +21,67 @@
|
||||
*
|
||||
* 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;
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
G::LoadClass('case');
|
||||
G::LoadClass( 'case' );
|
||||
$oCase = new Cases();
|
||||
$aCases = array();
|
||||
$aUsers = array();
|
||||
$c=0;
|
||||
if(isset($_POST['USERS']))
|
||||
{ if (is_array($_POST['USERS'])) {
|
||||
$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);
|
||||
$c ++;
|
||||
$oCase->reassignCase( $_POST['APPLICATIONS'][$sKey], $_POST['INDEXES'][$sKey], $_POST['USR_UID'], $sUser );
|
||||
$aCases[] = $_POST['APPLICATIONS'][$sKey];
|
||||
$aUsers[] = $sUser;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
G::LoadClass('case');
|
||||
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]);
|
||||
$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;
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
$aMessage['USR_UID'] = $_POST['USR_UID'];
|
||||
|
||||
$aMessage['MESSAGE'] = $sText;
|
||||
if($_POST['CONT']!=$c)
|
||||
$aMessage['EVA']=G::LoadTranslation('ID_CASESREASSIGN');//
|
||||
if ($_POST['CONT'] != $c)
|
||||
$aMessage['EVA'] = G::LoadTranslation( 'ID_CASESREASSIGN' ); //
|
||||
else
|
||||
$aMessage['EVA']='';
|
||||
$aMessage['EVA'] = '';
|
||||
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_ReassignShowInfo', '', $aMessage);
|
||||
G::RenderPage('publish');
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_ReassignShowInfo', '', $aMessage );
|
||||
G::RenderPage( 'publish' );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,143 +20,136 @@
|
||||
*
|
||||
* 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');
|
||||
$RBAC->requirePermissions( 'PM_USERS' );
|
||||
|
||||
// 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');
|
||||
if (! class_exists( 'XmlForm_Field_Image' )) {
|
||||
G::LoadClass( 'xmlfield_Image' );
|
||||
}
|
||||
require_once 'classes/model/Users.php';
|
||||
require_once 'classes/model/Department.php';
|
||||
|
||||
$_SESSION['CURRENT_USER'] = $_GET['USR_UID'];
|
||||
$oUser = new Users();
|
||||
$aFields = $oUser->load($_GET['USR_UID']);
|
||||
$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['MESSAGE6'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_ERROR_UPLOADING_IMAGE_TYPE'));
|
||||
$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['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' ) );
|
||||
$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 ) );
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'USERS';
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
//getting the user and department
|
||||
$oDepInfo = new Department();
|
||||
$oUser = UsersPeer::retrieveByPk( $aFields['USR_REPORTS_TO'] );
|
||||
if ($oUser != '')
|
||||
if ( get_class ($oUser) == 'Users' ) {
|
||||
$userFields = $oUser->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
if (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'] );
|
||||
$depFields = $oDepInfo->load( $userFields['DEP_UID'] );
|
||||
$aFields['USR_REPORTS_TO'] .= " (" . $depFields['DEPO_TITLE'] . ")";
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
catch( Exception $e ) {
|
||||
}
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$aFields['USR_REPORTS_TO'] = ' ';
|
||||
}
|
||||
|
||||
try {
|
||||
$depFields = $oDepInfo->load($aFields['DEP_UID']);
|
||||
$depFields = $oDepInfo->load( $aFields['DEP_UID'] );
|
||||
$aFields['USR_DEPARTMENT'] = $depFields['DEPO_TITLE'];
|
||||
}
|
||||
catch( Exception $e ) {
|
||||
} catch (Exception $e) {
|
||||
$oUser = UsersPeer::retrieveByPk( $_GET['USR_UID'] );
|
||||
$oUser->setDepUid( '' );
|
||||
$oUser->save();
|
||||
}
|
||||
|
||||
//Load Calendar options and falue for this user
|
||||
G::LoadClass ( 'calendar' );
|
||||
$calendar = new Calendar ( );
|
||||
$calendarObj = $calendar->getCalendarList ( true, true );
|
||||
G::LoadClass( 'calendar' );
|
||||
$calendar = new Calendar();
|
||||
$calendarObj = $calendar->getCalendarList( true, true );
|
||||
global $_DBArray;
|
||||
$_DBArray ['availableCalendars'] = $calendarObj ['array'];
|
||||
$_SESSION ['_DBArray'] = $_DBArray;
|
||||
$calendarInfo = $calendar->getCalendarFor ( $_GET['USR_UID'], $_GET['USR_UID'], $_GET['USR_UID'] );
|
||||
$_DBArray['availableCalendars'] = $calendarObj['array'];
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$calendarInfo = $calendar->getCalendarFor( $_GET['USR_UID'], $_GET['USR_UID'], $_GET['USR_UID'] );
|
||||
//If the function returns a DEFAULT calendar it means that this object doesn't have assigned any calendar
|
||||
$aFields ['USR_CALENDAR'] = $calendarInfo ['CALENDAR_APPLIED']!='DEFAULT'? $calendarInfo ['CALENDAR_UID']:"";
|
||||
$aFields['USR_CALENDAR'] = $calendarInfo['CALENDAR_APPLIED'] != 'DEFAULT' ? $calendarInfo['CALENDAR_UID'] : "";
|
||||
$aFields['RANDOM'] = rand();
|
||||
|
||||
/////////////////////////
|
||||
//SELECT USR_UID, CONCAT(USR_LASTNAME, " ", USR_FIRSTNAME) FROM USERS WHERE USR_STATUS = 1 AND USR_UID!= "@#USR_UID" 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);
|
||||
$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','');
|
||||
G::loadClass( 'configuration' );
|
||||
$oConf = new Configurations();
|
||||
$oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
|
||||
|
||||
$defaultOption = isset($oConf->aConfig['format'])? $oConf->aConfig['format']: '';
|
||||
$defaultOption = isset( $oConf->aConfig['format'] ) ? $oConf->aConfig['format'] : '';
|
||||
|
||||
$aUserInfo = array();
|
||||
$aUserInfo[] = array('USR_UID' => 'char','USER_FULLNAME' => 'char');
|
||||
while( $oDataset->next()){
|
||||
$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
|
||||
$infoUser = G::getFormatUserList( $defaultOption, $aRow1 );
|
||||
$aUserInfo[] = array ('USR_UID' => $aRow1['USR_UID'],'USER_FULLNAME' => $infoUser
|
||||
);
|
||||
}
|
||||
|
||||
//calculating the max upload file size;
|
||||
$POST_MAX_SIZE = ini_get('post_max_size');
|
||||
$mul = substr($POST_MAX_SIZE, -1);
|
||||
$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;
|
||||
$postMaxSize = (int) $POST_MAX_SIZE * $mul;
|
||||
|
||||
$UPLOAD_MAX_SIZE = ini_get('upload_max_filesize');
|
||||
$mul = substr($UPLOAD_MAX_SIZE, -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;
|
||||
$uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
|
||||
|
||||
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
|
||||
if ($postMaxSize < $uploadMaxSize)
|
||||
$uploadMaxSize = $postMaxSize;
|
||||
$aFields['MAX_FILES_SIZE'] = " (" . $UPLOAD_MAX_SIZE . ") ";
|
||||
|
||||
|
||||
global $_DBArray;
|
||||
$_DBArray['aUserInfo'] = $aUserInfo;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
if ($_GET['USR_AUTH_SOURCE'] == 'ProcessMaker (MYSQL)') {
|
||||
//always show this form users_EditRT.xml.
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_EditRT.xml', '', $aFields, 'users_Save?USR_UID=' . $_SESSION['CURRENT_USER']);
|
||||
}
|
||||
else {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_EditRT.xml', '', $aFields, 'users_Save?USR_UID=' . $_SESSION['CURRENT_USER'] );
|
||||
} else {
|
||||
//for users ldap always show this form users_EditLDAP.xml.
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_EditLDAP.xml', '', $aFields, 'users_Save?USR_UID=' . $_SESSION['CURRENT_USER']);
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_EditLDAP.xml', '', $aFields, 'users_Save?USR_UID=' . $_SESSION['CURRENT_USER'] );
|
||||
}
|
||||
|
||||
G::RenderPage('publish','blank');
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,36 +20,34 @@
|
||||
*
|
||||
* 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
|
||||
/**
|
||||
* 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());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,29 +20,28 @@
|
||||
*
|
||||
* 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;
|
||||
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;
|
||||
$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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -52,17 +51,18 @@ $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();
|
||||
$configPage = $c->getConfiguration('usersList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
$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());
|
||||
$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' );
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
@@ -20,98 +20,98 @@
|
||||
*
|
||||
* 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');
|
||||
$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'));
|
||||
$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));
|
||||
$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);
|
||||
$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;
|
||||
$postMaxSize = (int) $POST_MAX_SIZE * $mul;
|
||||
|
||||
$UPLOAD_MAX_SIZE = ini_get('upload_max_filesize');
|
||||
$mul = substr($UPLOAD_MAX_SIZE, -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;
|
||||
$uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
|
||||
|
||||
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
|
||||
if ($postMaxSize < $uploadMaxSize)
|
||||
$uploadMaxSize = $postMaxSize;
|
||||
$aFields['MAX_FILES_SIZE'] = " (" . $UPLOAD_MAX_SIZE . ") ";
|
||||
|
||||
//Load Calendar options and falue for this user
|
||||
G::LoadClass ( 'calendar' );
|
||||
$calendar = new Calendar ( );
|
||||
$calendarObj = $calendar->getCalendarList ( true, true );
|
||||
G::LoadClass( 'calendar' );
|
||||
$calendar = new Calendar();
|
||||
$calendarObj = $calendar->getCalendarList( true, true );
|
||||
global $_DBArray;
|
||||
$_DBArray ['availableCalendars'] = $calendarObj ['array'];
|
||||
$_SESSION ['_DBArray'] = $_DBArray;
|
||||
$_DBArray['availableCalendars'] = $calendarObj['array'];
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
|
||||
// $G_MAIN_MENU = 'processmaker';
|
||||
// $G_ID_MENU_SELECTED = 'USERS';
|
||||
|
||||
// $G_MAIN_MENU = 'processmaker';
|
||||
// $G_ID_MENU_SELECTED = 'USERS';
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'USERS';
|
||||
|
||||
/////////////////////////////
|
||||
//SELECT USR_UID, CONCAT(USR_LASTNAME, " ", USR_FIRSTNAME) FROM USERS WHERE USR_STATUS = 1 ORDER BY USR_LASTNAME
|
||||
/////////////////////////////
|
||||
//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 = 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);
|
||||
$oDataset = UsersPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
///////////////////////
|
||||
G::loadClass('configuration');
|
||||
$oConf = new Configurations;
|
||||
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS','');
|
||||
G::loadClass( 'configuration' );
|
||||
$oConf = new Configurations();
|
||||
$oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
|
||||
|
||||
$defaultOption = isset($oConf->aConfig['format'])? $oConf->aConfig['format']: '';
|
||||
$defaultOption = isset( $oConf->aConfig['format'] ) ? $oConf->aConfig['format'] : '';
|
||||
|
||||
$aUserInfo = array();
|
||||
$aUserInfo[] = array('USR_UID' => 'char','USER_FULLNAME' => 'char');
|
||||
while( $oDataset->next()){
|
||||
$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
|
||||
$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');
|
||||
$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());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,30 +20,28 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
try {
|
||||
G::LoadClass('case');
|
||||
G::LoadClass( 'case' );
|
||||
$oCase = new Cases();
|
||||
foreach($_POST['USER'] as $sProcessUID => $sUserUID) {
|
||||
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);
|
||||
$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);
|
||||
$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());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
*
|
||||
* 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'];
|
||||
$_GET['iStep'] = (int) $_GET['iStep'];
|
||||
switch ($_GET['iStep']) {
|
||||
case 1:
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_ReassignSelectType', '', array('USR_UID' => $_GET['USR_UID']), '');
|
||||
$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, '');
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_ReassignSelectSubType', '', $_POST, '' );
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -41,79 +41,78 @@ try {
|
||||
switch ($_POST['SUB_TYPE']) {
|
||||
case 'PROCESS':
|
||||
require_once 'classes/model/Users.php';
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
|
||||
$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);
|
||||
$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", "')'");
|
||||
$usr_completename_col = $oDataBase->concatString( "USR_LASTNAME", "' '", "USR_FIRSTNAME", " '('", "USR_USERNAME", "')'" );
|
||||
}
|
||||
|
||||
$oCriteria->addAsColumn('USR_COMPLETENAME', $usr_completename_col);
|
||||
$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);
|
||||
$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>';
|
||||
$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');
|
||||
$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);
|
||||
$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);
|
||||
$oCriteria->addGroupByColumn( ContentPeer::CON_VALUE );
|
||||
|
||||
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$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>');
|
||||
$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);
|
||||
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');
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,63 +20,58 @@
|
||||
*
|
||||
* 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;
|
||||
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;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
if ( empty($_POST) || !isset($_POST['form'])) {
|
||||
if( empty($_FILES) )
|
||||
throw ( new Exception (G::loadTranslation('ID_ERROR_UPLOADING_FILENAME') ) );
|
||||
if (empty( $_POST ) || ! isset( $_POST['form'] )) {
|
||||
if (empty( $_FILES ))
|
||||
throw (new Exception( G::loadTranslation( 'ID_ERROR_UPLOADING_FILENAME' ) ));
|
||||
else
|
||||
throw ( new Exception (G::loadTranslation('ID_POSTED_DATA_EMPTY') ) );
|
||||
throw (new Exception( G::loadTranslation( 'ID_POSTED_DATA_EMPTY' ) ));
|
||||
}
|
||||
|
||||
$form = $_POST['form'];
|
||||
|
||||
if ( isset($_GET['USR_UID'])) {
|
||||
if (isset( $_GET['USR_UID'] )) {
|
||||
$form['USR_UID'] = $_GET['USR_UID'];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$form['USR_UID'] = '';
|
||||
}
|
||||
|
||||
if ( isset($_FILES['form']['name']['USR_RESUME']) ) {
|
||||
if (isset( $_FILES['form']['name']['USR_RESUME'] )) {
|
||||
if ($_FILES['form']['tmp_name']['USR_RESUME'] != '') {
|
||||
$form['USR_RESUME'] = $_FILES['form']['name']['USR_RESUME'];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$form['USR_RESUME'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($form['USR_NEW_PASS'])) {
|
||||
if (! isset( $form['USR_NEW_PASS'] )) {
|
||||
$form['USR_NEW_PASS'] = '';
|
||||
}
|
||||
if ($form['USR_NEW_PASS'] != '') {
|
||||
$form['USR_PASSWORD'] = md5($form['USR_NEW_PASS']);
|
||||
$form['USR_PASSWORD'] = md5( $form['USR_NEW_PASS'] );
|
||||
}
|
||||
if (!isset($form['USR_CITY'])) {
|
||||
if (! isset( $form['USR_CITY'] )) {
|
||||
$form['USR_CITY'] = '';
|
||||
}
|
||||
if (!isset($form['USR_LOCATION'])) {
|
||||
if (! isset( $form['USR_LOCATION'] )) {
|
||||
$form['USR_LOCATION'] = '';
|
||||
}
|
||||
if (!isset($form['USR_AUTH_USER_DN'])) {
|
||||
if (! isset( $form['USR_AUTH_USER_DN'] )) {
|
||||
$form['USR_AUTH_USER_DN'] = '';
|
||||
}
|
||||
if ($form['USR_UID'] == '') {
|
||||
@@ -86,17 +81,17 @@ try {
|
||||
$aData['USR_LASTNAME'] = $form['USR_LASTNAME'];
|
||||
$aData['USR_EMAIL'] = $form['USR_EMAIL'];
|
||||
$aData['USR_DUE_DATE'] = $form['USR_DUE_DATE'];
|
||||
$aData['USR_CREATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$aData['USR_BIRTHDAY'] = date('Y-m-d');
|
||||
$aData['USR_CREATE_DATE'] = date( 'Y-m-d H:i:s' );
|
||||
$aData['USR_UPDATE_DATE'] = date( 'Y-m-d H:i:s' );
|
||||
$aData['USR_BIRTHDAY'] = date( 'Y-m-d' );
|
||||
$aData['USR_AUTH_USER_DN'] = $form['USR_AUTH_USER_DN'];
|
||||
//fixing bug in inactive user when the admin create a new user.
|
||||
$statusWF = $form['USR_STATUS'];
|
||||
$aData['USR_STATUS'] = $form['USR_STATUS'] == 'ACTIVE' ? 1 : 0;
|
||||
$sUserUID = $RBAC->createUser($aData, $form['USR_ROLE'] );
|
||||
$sUserUID = $RBAC->createUser( $aData, $form['USR_ROLE'] );
|
||||
$aData['USR_STATUS'] = $statusWF;
|
||||
$aData['USR_UID'] = $sUserUID;
|
||||
$aData['USR_PASSWORD'] = md5($sUserUID);//fake :p
|
||||
$aData['USR_PASSWORD'] = md5( $sUserUID ); //fake :p
|
||||
$aData['USR_COUNTRY'] = $form['USR_COUNTRY'];
|
||||
$aData['USR_CITY'] = $form['USR_CITY'];
|
||||
$aData['USR_LOCATION'] = $form['USR_LOCATION'];
|
||||
@@ -104,123 +99,121 @@ try {
|
||||
$aData['USR_PHONE'] = $form['USR_PHONE'];
|
||||
$aData['USR_ZIP_CODE'] = $form['USR_ZIP_CODE'];
|
||||
$aData['USR_POSITION'] = $form['USR_POSITION'];
|
||||
// Commented by removal of resume in the addition and modification of user.
|
||||
// $aData['USR_RESUME'] = $form['USR_RESUME'];
|
||||
// Commented by removal of resume in the addition and modification of user.
|
||||
// $aData['USR_RESUME'] = $form['USR_RESUME'];
|
||||
$aData['USR_ROLE'] = $form['USR_ROLE'];
|
||||
$aData['USR_REPLACED_BY'] = $form['USR_REPLACED_BY'];
|
||||
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$oUser->create($aData);
|
||||
$oUser->create( $aData );
|
||||
if ($_FILES['form']['error']['USR_PHOTO'] != 1) {
|
||||
if ($_FILES['form']['tmp_name']['USR_PHOTO'] != '') {
|
||||
G::uploadFile($_FILES['form']['tmp_name']['USR_PHOTO'], PATH_IMAGES_ENVIRONMENT_USERS, $sUserUID . '.gif');
|
||||
G::uploadFile( $_FILES['form']['tmp_name']['USR_PHOTO'], PATH_IMAGES_ENVIRONMENT_USERS, $sUserUID . '.gif' );
|
||||
}
|
||||
}
|
||||
else {
|
||||
G::SendTemporalMessage ('ID_FILE_TOO_BIG', 'error');
|
||||
} else {
|
||||
G::SendTemporalMessage( 'ID_FILE_TOO_BIG', 'error' );
|
||||
}
|
||||
if ($_FILES['form']['error']['USR_RESUME'] != 1) {
|
||||
if ($_FILES['form']['tmp_name']['USR_RESUME'] != '') {
|
||||
G::uploadFile($_FILES['form']['tmp_name']['USR_RESUME'], PATH_IMAGES_ENVIRONMENT_FILES . $sUserUID . '/', $_FILES['form']['name']['USR_RESUME']);
|
||||
G::uploadFile( $_FILES['form']['tmp_name']['USR_RESUME'], PATH_IMAGES_ENVIRONMENT_FILES . $sUserUID . '/', $_FILES['form']['name']['USR_RESUME'] );
|
||||
}
|
||||
} else {
|
||||
G::SendTemporalMessage( 'ID_FILE_TOO_BIG', 'error' );
|
||||
}
|
||||
else {
|
||||
G::SendTemporalMessage ('ID_FILE_TOO_BIG', 'error');
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$aData['USR_UID'] = $form['USR_UID'];
|
||||
$aData['USR_USERNAME'] = $form['USR_USERNAME'];
|
||||
|
||||
if (isset($form['USR_PASSWORD'])) {
|
||||
if (isset( $form['USR_PASSWORD'] )) {
|
||||
if ($form['USR_PASSWORD'] != '') {
|
||||
$aData['USR_PASSWORD'] = $form['USR_PASSWORD'];
|
||||
require_once 'classes/model/UsersProperties.php';
|
||||
$oUserProperty = new UsersProperties();
|
||||
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($form['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($form['USR_PASSWORD'])))));
|
||||
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists( $form['USR_UID'], array ('USR_PASSWORD_HISTORY' => serialize( array (md5( $form['USR_PASSWORD'] )
|
||||
) )
|
||||
) );
|
||||
|
||||
$RBAC->loadUserRolePermission( 'PROCESSMAKER', $_SESSION['USER_LOGGED'] );
|
||||
if( $RBAC->aUserInfo[ 'PROCESSMAKER' ]['ROLE']['ROL_CODE']=='PROCESSMAKER_ADMIN'){
|
||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
if ($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'] == 'PROCESSMAKER_ADMIN') {
|
||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date( 'Y-m-d H:i:s' );
|
||||
$aUserProperty['USR_LOGGED_NEXT_TIME'] = 1;
|
||||
$oUserProperty->update($aUserProperty);
|
||||
$oUserProperty->update( $aUserProperty );
|
||||
}
|
||||
|
||||
$aErrors = $oUserProperty->validatePassword($form['USR_NEW_PASS'], $aUserProperty['USR_LAST_UPDATE_DATE'], 0);
|
||||
if (count($aErrors) > 0) {
|
||||
$sDescription = G::LoadTranslation('ID_POLICY_ALERT').':<br /><br />';
|
||||
$aErrors = $oUserProperty->validatePassword( $form['USR_NEW_PASS'], $aUserProperty['USR_LAST_UPDATE_DATE'], 0 );
|
||||
if (count( $aErrors ) > 0) {
|
||||
$sDescription = G::LoadTranslation( 'ID_POLICY_ALERT' ) . ':<br /><br />';
|
||||
foreach ($aErrors as $sError) {
|
||||
switch ($sError) {
|
||||
case 'ID_PPP_MINIMUN_LENGTH':
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).': ' . PPP_MINIMUN_LENGTH . '<br />';
|
||||
$sDescription .= ' - ' . G::LoadTranslation( $sError ) . ': ' . PPP_MINIMUN_LENGTH . '<br />';
|
||||
break;
|
||||
case 'ID_PPP_MAXIMUN_LENGTH':
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).': ' . PPP_MAXIMUN_LENGTH . '<br />';
|
||||
$sDescription .= ' - ' . G::LoadTranslation( $sError ) . ': ' . PPP_MAXIMUN_LENGTH . '<br />';
|
||||
break;
|
||||
case 'ID_PPP_EXPIRATION_IN':
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).' ' . PPP_EXPIRATION_IN . ' ' . G::LoadTranslation('ID_DAYS') . '<br />';
|
||||
$sDescription .= ' - ' . G::LoadTranslation( $sError ) . ' ' . PPP_EXPIRATION_IN . ' ' . G::LoadTranslation( 'ID_DAYS' ) . '<br />';
|
||||
break;
|
||||
default:
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).'<br />';
|
||||
$sDescription .= ' - ' . G::LoadTranslation( $sError ) . '<br />';
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sDescription .= '<br />' . G::LoadTranslation('ID_PLEASE_CHANGE_PASSWORD_POLICY');
|
||||
G::SendMessageText($sDescription, 'warning');
|
||||
G::header('Location: ' . $_SERVER['HTTP_REFERER']);
|
||||
die;
|
||||
$sDescription .= '<br />' . G::LoadTranslation( 'ID_PLEASE_CHANGE_PASSWORD_POLICY' );
|
||||
G::SendMessageText( $sDescription, 'warning' );
|
||||
G::header( 'Location: ' . $_SERVER['HTTP_REFERER'] );
|
||||
die();
|
||||
}
|
||||
$aHistory = unserialize($aUserProperty['USR_PASSWORD_HISTORY']);
|
||||
if (!is_array($aHistory)) {
|
||||
$aHistory = array();
|
||||
$aHistory = unserialize( $aUserProperty['USR_PASSWORD_HISTORY'] );
|
||||
if (! is_array( $aHistory )) {
|
||||
$aHistory = array ();
|
||||
}
|
||||
if (!defined('PPP_PASSWORD_HISTORY')) {
|
||||
define('PPP_PASSWORD_HISTORY', 0);
|
||||
if (! defined( 'PPP_PASSWORD_HISTORY' )) {
|
||||
define( 'PPP_PASSWORD_HISTORY', 0 );
|
||||
}
|
||||
if (PPP_PASSWORD_HISTORY > 0) {
|
||||
//it's looking a password igual into aHistory array that was send for post in md5 way
|
||||
$c=0;$sw=1;
|
||||
while(count($aHistory) >= 1 && count($aHistory)>$c && $sw ){
|
||||
if(strcmp(trim($aHistory[$c]),trim($form['USR_PASSWORD'])) == 0){
|
||||
$sw=0;
|
||||
$c = 0;
|
||||
$sw = 1;
|
||||
while (count( $aHistory ) >= 1 && count( $aHistory ) > $c && $sw) {
|
||||
if (strcmp( trim( $aHistory[$c] ), trim( $form['USR_PASSWORD'] ) ) == 0) {
|
||||
$sw = 0;
|
||||
}
|
||||
$c++;
|
||||
$c ++;
|
||||
}
|
||||
if($sw == 0){
|
||||
$sDescription = G::LoadTranslation('ID_POLICY_ALERT').':<br /><br />';
|
||||
$sDescription .= ' - ' . G::LoadTranslation('PASSWORD_HISTORY').': ' . PPP_PASSWORD_HISTORY . '<br />';
|
||||
$sDescription .= '<br />' . G::LoadTranslation('ID_PLEASE_CHANGE_PASSWORD_POLICY').'';
|
||||
G::SendMessageText($sDescription, 'warning');
|
||||
G::header('Location: ' . $_SERVER['HTTP_REFERER']);
|
||||
die;
|
||||
if ($sw == 0) {
|
||||
$sDescription = G::LoadTranslation( 'ID_POLICY_ALERT' ) . ':<br /><br />';
|
||||
$sDescription .= ' - ' . G::LoadTranslation( 'PASSWORD_HISTORY' ) . ': ' . PPP_PASSWORD_HISTORY . '<br />';
|
||||
$sDescription .= '<br />' . G::LoadTranslation( 'ID_PLEASE_CHANGE_PASSWORD_POLICY' ) . '';
|
||||
G::SendMessageText( $sDescription, 'warning' );
|
||||
G::header( 'Location: ' . $_SERVER['HTTP_REFERER'] );
|
||||
die();
|
||||
}
|
||||
//
|
||||
if (count($aHistory) >= PPP_PASSWORD_HISTORY) {
|
||||
$sLastPassw=array_shift($aHistory);
|
||||
if (count( $aHistory ) >= PPP_PASSWORD_HISTORY) {
|
||||
$sLastPassw = array_shift( $aHistory );
|
||||
}
|
||||
$aHistory[] = $form['USR_PASSWORD'];
|
||||
}
|
||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date( 'Y-m-d H:i:s' );
|
||||
$aUserProperty['USR_LOGGED_NEXT_TIME'] = 1;
|
||||
$aUserProperty['USR_PASSWORD_HISTORY'] = serialize($aHistory);
|
||||
$oUserProperty->update($aUserProperty);
|
||||
$aUserProperty['USR_PASSWORD_HISTORY'] = serialize( $aHistory );
|
||||
$oUserProperty->update( $aUserProperty );
|
||||
}
|
||||
}
|
||||
$aData['USR_FIRSTNAME'] = $form['USR_FIRSTNAME'];
|
||||
$aData['USR_LASTNAME'] = $form['USR_LASTNAME'];
|
||||
$aData['USR_EMAIL'] = $form['USR_EMAIL'];
|
||||
$aData['USR_DUE_DATE'] = $form['USR_DUE_DATE'];
|
||||
$aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
if (isset($form['USR_STATUS'])) {
|
||||
$aData['USR_UPDATE_DATE'] = date( 'Y-m-d H:i:s' );
|
||||
if (isset( $form['USR_STATUS'] )) {
|
||||
$aData['USR_STATUS'] = $form['USR_STATUS'];
|
||||
}
|
||||
if (isset($form['USR_ROLE'])) {
|
||||
$RBAC->updateUser($aData, $form['USR_ROLE']);
|
||||
}
|
||||
else {
|
||||
$RBAC->updateUser($aData);
|
||||
if (isset( $form['USR_ROLE'] )) {
|
||||
$RBAC->updateUser( $aData, $form['USR_ROLE'] );
|
||||
} else {
|
||||
$RBAC->updateUser( $aData );
|
||||
}
|
||||
$aData['USR_COUNTRY'] = $form['USR_COUNTRY'];
|
||||
$aData['USR_CITY'] = $form['USR_CITY'];
|
||||
@@ -233,79 +226,72 @@ try {
|
||||
if ($form['USR_RESUME'] != '') {
|
||||
$aData['USR_RESUME'] = $form['USR_RESUME'];
|
||||
}
|
||||
if (isset($form['USR_ROLE'])) {
|
||||
if (isset( $form['USR_ROLE'] )) {
|
||||
$aData['USR_ROLE'] = $form['USR_ROLE'];
|
||||
}
|
||||
|
||||
if(isset($form['USR_REPLACED_BY'])){
|
||||
if (isset( $form['USR_REPLACED_BY'] )) {
|
||||
$aData['USR_REPLACED_BY'] = $form['USR_REPLACED_BY'];
|
||||
}
|
||||
if(isset($form['USR_AUTH_USER_DN'])){
|
||||
if (isset( $form['USR_AUTH_USER_DN'] )) {
|
||||
$aData['USR_AUTH_USER_DN'] = $form['USR_AUTH_USER_DN'];
|
||||
}
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$oUser->update($aData);
|
||||
$aExtensions = array ( "AIS", "BMP", "BW", "CDR", "CDT", "CGM", "CMX", "CPT", "DCX", "DIB",
|
||||
"EMF", "GBR", "GIF", "GIH", "ICO", "IFF", "ILBM", "JFIF", "JIF", "JPE",
|
||||
"JPEG", "JPG", "KDC", "LBM", "MAC", "PAT", "PCD", "PCT", "PCX", "PIC",
|
||||
"PICT", "PNG", "PNTG", "PIX", "PSD", "PSP", "QTI", "QTIF", "RGB", "RGBA",
|
||||
"RIF", "RLE", "SGI", "TGA", "TIF", "TIFF", "WMF", "XCF"
|
||||
$oUser->update( $aData );
|
||||
$aExtensions = array ("AIS","BMP","BW","CDR","CDT","CGM","CMX","CPT","DCX","DIB","EMF","GBR","GIF","GIH","ICO","IFF","ILBM","JFIF","JIF","JPE","JPEG","JPG","KDC","LBM","MAC","PAT","PCD","PCT","PCX","PIC","PICT","PNG","PNTG","PIX","PSD","PSP","QTI","QTIF","RGB","RGBA","RIF","RLE","SGI","TGA","TIF","TIFF","WMF","XCF"
|
||||
);
|
||||
|
||||
$sPhotoFile = $_FILES['form']['name']['USR_PHOTO'];
|
||||
$aPhotoFile = explode('.', $sPhotoFile);
|
||||
$sExtension = strtoupper ($aPhotoFile[sizeof($aPhotoFile)-1]);
|
||||
if ((strlen($sPhotoFile) > 0) && (! in_array($sExtension, $aExtensions)) ) {
|
||||
throw ( new Exception ( G::LoadTranslation( 'ID_ERROR_UPLOADING_IMAGE_TYPE' )) );
|
||||
$aPhotoFile = explode( '.', $sPhotoFile );
|
||||
$sExtension = strtoupper( $aPhotoFile[sizeof( $aPhotoFile ) - 1] );
|
||||
if ((strlen( $sPhotoFile ) > 0) && (! in_array( $sExtension, $aExtensions ))) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_ERROR_UPLOADING_IMAGE_TYPE' ) ));
|
||||
}
|
||||
if ($_FILES['form']['error']['USR_PHOTO'] != 1) {
|
||||
if ($_FILES['form']['tmp_name']['USR_PHOTO'] != '') {
|
||||
$aAux = explode('.', $_FILES['form']['name']['USR_PHOTO']);
|
||||
G::uploadFile($_FILES['form']['tmp_name']['USR_PHOTO'], PATH_IMAGES_ENVIRONMENT_USERS, $aData['USR_UID'] . '.' . $aAux[1]);
|
||||
G::resizeImage(PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.' . $aAux[1], 96, 96, PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.gif');
|
||||
$aAux = explode( '.', $_FILES['form']['name']['USR_PHOTO'] );
|
||||
G::uploadFile( $_FILES['form']['tmp_name']['USR_PHOTO'], PATH_IMAGES_ENVIRONMENT_USERS, $aData['USR_UID'] . '.' . $aAux[1] );
|
||||
G::resizeImage( PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.' . $aAux[1], 96, 96, PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.gif' );
|
||||
}
|
||||
}
|
||||
else {
|
||||
G::SendTemporalMessage ('ID_FILE_TOO_BIG', 'error');
|
||||
} else {
|
||||
G::SendTemporalMessage( 'ID_FILE_TOO_BIG', 'error' );
|
||||
}
|
||||
if ($_FILES['form']['error']['USR_RESUME'] != 1) {
|
||||
if ($_FILES['form']['tmp_name']['USR_RESUME'] != '') {
|
||||
G::uploadFile($_FILES['form']['tmp_name']['USR_RESUME'], PATH_IMAGES_ENVIRONMENT_FILES . $aData['USR_UID'] . '/', $_FILES['form']['name']['USR_RESUME']);
|
||||
G::uploadFile( $_FILES['form']['tmp_name']['USR_RESUME'], PATH_IMAGES_ENVIRONMENT_FILES . $aData['USR_UID'] . '/', $_FILES['form']['name']['USR_RESUME'] );
|
||||
}
|
||||
}
|
||||
else {
|
||||
G::SendTemporalMessage ('ID_FILE_TOO_BIG', 'error');
|
||||
} else {
|
||||
G::SendTemporalMessage( 'ID_FILE_TOO_BIG', 'error' );
|
||||
}
|
||||
}
|
||||
|
||||
if($_SESSION['USER_LOGGED'] == $form['USR_UID']){
|
||||
if ($_SESSION['USER_LOGGED'] == $form['USR_UID']) {
|
||||
/*UPDATING SESSION VARIABLES*/
|
||||
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
|
||||
$aUser = $RBAC->userObj->load( $_SESSION['USER_LOGGED'] );
|
||||
$_SESSION['USR_FULLNAME'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
|
||||
}
|
||||
|
||||
|
||||
//Save Calendar assigment
|
||||
if((isset($form['USR_CALENDAR']))){
|
||||
if ((isset( $form['USR_CALENDAR'] ))) {
|
||||
//Save Calendar ID for this user
|
||||
G::LoadClass("calendar");
|
||||
$calendarObj=new Calendar();
|
||||
$calendarObj->assignCalendarTo($aData['USR_UID'],$form['USR_CALENDAR'],'USER');
|
||||
G::LoadClass( "calendar" );
|
||||
$calendarObj = new Calendar();
|
||||
$calendarObj->assignCalendarTo( $aData['USR_UID'], $form['USR_CALENDAR'], 'USER' );
|
||||
}
|
||||
|
||||
G::header('location: users_List');
|
||||
}
|
||||
catch (Exception $e) {
|
||||
G::header( 'location: users_List' );
|
||||
} catch (Exception $e) {
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = '';
|
||||
|
||||
$aMessage = array();
|
||||
$aMessage = array ();
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publish', 'blank');
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
}
|
||||
|
||||
|
||||
@@ -20,62 +20,56 @@
|
||||
*
|
||||
* 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;
|
||||
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;
|
||||
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');
|
||||
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 = $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['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);
|
||||
$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']);
|
||||
$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'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_Edit.xml', 'display:none', $aFields, 'users_Save?USR_UID=' . $_SESSION['CURRENT_USER']);
|
||||
}
|
||||
G::RenderPage('publish');
|
||||
G::RenderPage( 'publish' );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,81 +20,79 @@
|
||||
*
|
||||
* 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 ];
|
||||
$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)) {
|
||||
|
||||
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");
|
||||
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: 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\"");
|
||||
} 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);
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,79 +20,74 @@
|
||||
*
|
||||
* 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)) {
|
||||
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");
|
||||
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: 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\"");
|
||||
} 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);
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,89 +20,89 @@
|
||||
*
|
||||
* 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 ];
|
||||
$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)) {
|
||||
|
||||
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");
|
||||
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: 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\"");
|
||||
} 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);
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user