CODE STYLE, workflow/engine/methods/setup/ PART 3 (final)

FILES:
setup.js
setup.php
setupAjax.php
showLogoFile.php
skin_Ajax.php
skinsExport.php
skinsList.php
skinsNew.php
skinsSave.php
upgrade.php
upgrade_RBAC.php
upgrade_System.php
upgrade_SystemAjax.php
uplogo.php
webServices.php
webServicesAjax.php
webServicesList.php
webServicesSetup.php
webServicesSetupSave.php
weekend.php
weekendAjax.php
workPeriod.js
workPeriod.php
workPeriodGraph.php
workPeriodSave.php
This commit is contained in:
jennylee
2012-10-17 17:21:35 -04:00
parent 4bd1ce1a41
commit 0f6644bcb0
25 changed files with 3146 additions and 3103 deletions

View File

@@ -1,13 +1,10 @@
function abc(panel, txt) { function abc(panel, txt) {
/* commonDialog ( '', 'saved' , 'saved', {}, '' ) ; /*
setTimeout ( leimnud.closure({instance:myDialog,method:function(panel){ * commonDialog ( '', 'saved' , 'saved', {}, '' ) ; setTimeout (
* leimnud.closure({instance:myDialog,method:function(panel){
myDialog.remove(); *
panel.tabLastSelected=false; * myDialog.remove(); panel.tabLastSelected=false; panel.tabSelected=1;
panel.tabSelected=1; * panel.makeTab(); },args:panel}) , 1000 );
panel.makeTab();
},args:panel}) , 1000 );
*/ */
var img = document.getElementById('workPeriodGraph'); var img = document.getElementById('workPeriodGraph');
img.src = 'workPeriodGraph?b=' + Math.random(); img.src = 'workPeriodGraph?b=' + Math.random();
@@ -17,57 +14,71 @@ function abc( panel, txt ) {
return false; return false;
} }
function showHideFilterForm( divName) function showHideFilterForm(divName) {
{
if (document.getElementById(divName).style.display === 'none') if (document.getElementById(divName).style.display === 'none')
document.getElementById(divName).style.display = ''; document.getElementById(divName).style.display = '';
else else
document.getElementById(divName).style.display = 'none'; document.getElementById(divName).style.display = 'none';
} }
function newHoliday(ev) { function newHoliday(ev) {
var coor = leimnud.dom.mouse(ev); var coor = leimnud.dom.mouse(ev);
var myPanel = new leimnud.module.panel(); var myPanel = new leimnud.module.panel();
myPanel.options = { myPanel.options = {
size:{w:500,h:200}, size : {
position:{x:coor.x-200,y:coor.y}, w : 500,
h : 200
},
position : {
x : coor.x - 200,
y : coor.y
},
title : "New Holiday", title : "New Holiday",
theme : "panel", theme : "panel",
control : { control : {
close : true, close : true,
drag : true drag : true
}, },
fx: { modal:true } fx : {
modal : true
}
}; };
myPanel.make(); myPanel.make();
var r = new leimnud.module.rpc.xmlhttp({url:"holidayNew.php"}); var r = new leimnud.module.rpc.xmlhttp({
r.callback=leimnud.closure({Function:function(rpc){ url : "holidayNew.php"
});
r.callback = leimnud.closure({
Function : function(rpc) {
myPanel.addContent(rpc.xmlhttp.responseText); myPanel.addContent(rpc.xmlhttp.responseText);
},args:r}) },
args : r
})
r.make(); r.make();
} }
function deleteHoliday(uid) { function deleteHoliday(uid) {
url = "setupAjax.php?action=deleteHoliday&uid=" + uid; url = "setupAjax.php?action=deleteHoliday&uid=" + uid;
var r = new leimnud.module.rpc.xmlhttp({url: url }); var r = new leimnud.module.rpc.xmlhttp({
r.callback=leimnud.closure({Function:function(rpc){ url : url
});
r.callback = leimnud.closure({
Function : function(rpc) {
// myPanel.addContent(rpc.xmlhttp.responseText); // myPanel.addContent(rpc.xmlhttp.responseText);
myPanel = setupPanel.panels.control; myPanel = setupPanel.panels.control;
myPanel.tabLastSelected = false; myPanel.tabLastSelected = false;
myPanel.tabSelected = 0; myPanel.tabSelected = 0;
myPanel.makeTab(); myPanel.makeTab();
},args:r}) },
args : r
})
r.make(); r.make();
// myPanel.clearContent(); // myPanel.clearContent();
// myPanel.addContent ( uid ); // myPanel.addContent ( uid );
} }

View File

@@ -20,33 +20,28 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
/** /**
* New Admin User interface * New Admin User interface
*
* @author Erik A. O. <erik@colosa.com, aortiz.erik@gmail.com> * @author Erik A. O. <erik@colosa.com, aortiz.erik@gmail.com>
* @date Apr 5th, 2010 * @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_MAIN_MENU = "processmaker";
$G_ID_MENU_SELECTED = "SETUP"; $G_ID_MENU_SELECTED = "SETUP";
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
global $G_TMP_MENU; global $G_TMP_MENU;
$oMenu = new Menu(); $oMenu = new Menu();
$oMenu->load( 'setup' ); $oMenu->load( 'setup' );
$toolItems = Array (); $toolItems = Array ();
foreach ($oMenu->Options as $i => $option) { foreach ($oMenu->Options as $i => $option) {
$toolItems[] = Array( $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'
'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'
); );
} }
@@ -68,7 +63,6 @@ if( isset($_GET['newSite']) ){
$template->assign( 'displayNewSiteTool', 'none' ); $template->assign( 'displayNewSiteTool', 'none' );
} }
foreach ($toolItems as $item) { foreach ($toolItems as $item) {
$template->newBlock( 'tool_options' ); $template->newBlock( 'tool_options' );
foreach ($item as $propertyName => $propertyValue) foreach ($item as $propertyName => $propertyValue)
@@ -85,3 +79,4 @@ if(isset($_GET['module'])){
</script> </script>
"; ";
} }

View File

@@ -20,15 +20,15 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * 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;
//$oSMTPJSON = new Services_JSON(); //$oSMTPJSON = new Services_JSON();
//$oSMTPData = $oSMTPJSON->decode(stripslashes($_POST['data'])); //$oSMTPData = $oSMTPJSON->decode(stripslashes($_POST['data']));
//$sOutput = ''; //$sOutput = '';
G::LoadClass( 'setup' ); G::LoadClass( 'setup' );
$oSMTPSetup = new Setup(new DBConnection); $oSMTPSetup = new Setup( new DBConnection() );
$action = strtolower( $_GET['action'] ); $action = strtolower( $_GET['action'] );
$data = $_GET; $data = $_GET;
@@ -38,4 +38,4 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
if ($method == $action) if ($method == $action)
$oSMTPSetup->{$action}( $_GET ); $oSMTPSetup->{$action}( $_GET );
} }
?>

View File

@@ -20,13 +20,14 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
// if (($RBAC_Response = $RBAC->userCanAccess("PM_CASES"))!=1) return $RBAC_Response; // if (($RBAC_Response = $RBAC->userCanAccess("PM_CASES"))!=1) return $RBAC_Response;
$idDecode64 = base64_decode( $_GET['id'] ); $idDecode64 = base64_decode( $_GET['id'] );
$idExploded = explode( '/', $idDecode64 ); $idExploded = explode( '/', $idDecode64 );
if ( $idExploded[0] == '' ) array_shift($idExploded); if ($idExploded[0] == '')
array_shift( $idExploded );
if ($idExploded[0] == 'plugin') { if ($idExploded[0] == 'plugin') {
//Get the Plugin Folder, always the first element //Get the Plugin Folder, always the first element
$pluginFolder = $idExploded[1]; $pluginFolder = $idExploded[1];
@@ -34,7 +35,7 @@
if (file_exists( $pluginFilename )) { if (file_exists( $pluginFilename )) {
G::streamFile( $pluginFilename ); G::streamFile( $pluginFilename );
} }
die; die();
} }
$ainfoSite = explode( "/", $_SERVER["REQUEST_URI"] ); $ainfoSite = explode( "/", $_SERVER["REQUEST_URI"] );
@@ -46,13 +47,10 @@
$dir = PATH_DATA . "sites" . PATH_SEP . str_replace( "sys", "", $ainfoSite[1] ) . PATH_SEP . "files/logos"; $dir = PATH_DATA . "sites" . PATH_SEP . str_replace( "sys", "", $ainfoSite[1] ) . PATH_SEP . "files/logos";
$imagen = $dir . PATH_SEP . $idDecode64; $imagen = $dir . PATH_SEP . $idDecode64;
if (is_file( $imagen )) {
if (is_file($imagen))
{
showLogo( $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"; $dir = PATH_HOME . "public_html/files/logos";
@@ -66,24 +64,25 @@
$dir .= PATH_SEP . $idDecode64; $dir .= PATH_SEP . $idDecode64;
copy( $dir, $newDir ); copy( $dir, $newDir );
showLogo( $newDir ); showLogo( $newDir );
die; die();
} }
function showLogo ($imagen)
function showLogo($imagen){ {
$info = @getimagesize( $imagen ); $info = @getimagesize( $imagen );
$fp = fopen( $imagen, "rb" ); $fp = fopen( $imagen, "rb" );
if ($info && $fp) { if ($info && $fp) {
header( "Content-type: {$info['mime']}" ); header( "Content-type: {$info['mime']}" );
fpassthru( $fp ); fpassthru( $fp );
exit; exit();
} else { } else {
throw new Exception( "Image format not valid" ); throw new Exception( "Image format not valid" );
} }
} }
function cpyMoreLogos($dir,$newDir){ function cpyMoreLogos ($dir, $newDir)
{
if (file_exists( $dir )) { if (file_exists( $dir )) {
if ($handle = opendir( $dir )) { if ($handle = opendir( $dir )) {
while (false !== ($file = readdir( $handle ))) { while (false !== ($file = readdir( $handle ))) {
@@ -91,14 +90,14 @@
$extention = explode( ".", $file ); $extention = explode( ".", $file );
$aImageProp = getimagesize( $dir . '/' . $file, $info ); $aImageProp = getimagesize( $dir . '/' . $file, $info );
$sfileExtention = strtoupper( $extention[count( $extention ) - 1] ); $sfileExtention = strtoupper( $extention[count( $extention ) - 1] );
if( in_array($sfileExtention, array('JPG','JPEG','PNG','GIF') ) ) { if (in_array( $sfileExtention, array ('JPG','JPEG','PNG','GIF'
) )) {
$dir1 = $dir . PATH_SEP . $file; $dir1 = $dir . PATH_SEP . $file;
$dir2 = $newDir . PATH_SEP . $file; $dir2 = $newDir . PATH_SEP . $file;
//print $dir1 ." *** ".$dir2."<br><br>"; //print $dir1 ." *** ".$dir2."<br><br>";
copy( $dir1, $dir2 ); copy( $dir1, $dir2 );
} }
} }
} }
@@ -107,10 +106,10 @@
} }
} }
die; die();
?> ?>
<script> <script>
</script> </script>

View File

@@ -14,7 +14,8 @@ if (!function_exists($_REQUEST ['action'])) {
print G::json_encode( $res ); print G::json_encode( $res );
die(); die();
} }
$restrictedFunctions=array('copy_skin_folder','addTarFolder'); $restrictedFunctions = array ('copy_skin_folder','addTarFolder'
);
if (in_array( $_REQUEST['action'], $restrictedFunctions )) { if (in_array( $_REQUEST['action'], $restrictedFunctions )) {
$res['success'] = false; $res['success'] = false;
$res['error'] = $res['message'] = 'The requested action does not exist *'; $res['error'] = $res['message'] = 'The requested action does not exist *';
@@ -22,7 +23,6 @@ if (in_array($_REQUEST ['action'],$restrictedFunctions)) {
die(); die();
} }
$functionName = $_REQUEST['action']; $functionName = $_REQUEST['action'];
$functionParams = isset( $_REQUEST['params'] ) ? $_REQUEST['params'] : array (); $functionParams = isset( $_REQUEST['params'] ) ? $_REQUEST['params'] : array ();
@@ -48,8 +48,7 @@ function skinList()
$skinList = System::getSkingList(); $skinList = System::getSkingList();
$wildcard = ''; $wildcard = '';
if(isset($_REQUEST['activeskin'])) if (isset( $_REQUEST['activeskin'] )) {
{
$wildcard = '@'; $wildcard = '@';
} }
foreach ($skinList['skins'] as $key => $value) { foreach ($skinList['skins'] as $key => $value) {
@@ -61,8 +60,7 @@ function skinList()
$value['SKIN_AUTHOR'] = $wildcard . $value['SKIN_AUTHOR']; $value['SKIN_AUTHOR'] = $wildcard . $value['SKIN_AUTHOR'];
$value['SKIN_CREATEDATE'] = $wildcard . $value['SKIN_CREATEDATE']; $value['SKIN_CREATEDATE'] = $wildcard . $value['SKIN_CREATEDATE'];
$value['SKIN_MODIFIEDDATE'] = $wildcard . $value['SKIN_MODIFIEDDATE']; $value['SKIN_MODIFIEDDATE'] = $wildcard . $value['SKIN_MODIFIEDDATE'];
} } else {
else{
$value['SKIN_STATUS'] = G::LoadTranslation( 'ID_INACTIVE' ); $value['SKIN_STATUS'] = G::LoadTranslation( 'ID_INACTIVE' );
} }
$skinListArray['skins'][] = $value; $skinListArray['skins'][] = $value;
@@ -89,6 +87,7 @@ function newSkin($baseSkin='classic')
//Should validate skin folder name here //Should validate skin folder name here
//if.... //if....
$skinName = $_REQUEST['skinName']; $skinName = $_REQUEST['skinName'];
$skinFolder = $_REQUEST['skinFolder']; $skinFolder = $_REQUEST['skinFolder'];
$skinDescription = isset( $_REQUEST['skinDescription'] ) ? $_REQUEST['skinDescription'] : ''; $skinDescription = isset( $_REQUEST['skinDescription'] ) ? $_REQUEST['skinDescription'] : '';
@@ -105,19 +104,20 @@ function newSkin($baseSkin='classic')
switch ($skinBase) { switch ($skinBase) {
//Validate skin base //Validate skin base
case 'uxmodern': case 'uxmodern':
copy_skin_folder(G::ExpandPath("skinEngine") . 'uxmodern' . PATH_SEP, PATH_CUSTOM_SKINS . copy_skin_folder( G::ExpandPath( "skinEngine" ) . 'uxmodern' . PATH_SEP, PATH_CUSTOM_SKINS . $skinFolder, array ("config.xml"
$skinFolder,array("config.xml")); ) );
$pathBase = G::ExpandPath( "skinEngine" ) . 'base' . PATH_SEP; $pathBase = G::ExpandPath( "skinEngine" ) . 'base' . PATH_SEP;
break; break;
case 'classic': case 'classic':
//Special Copy of this dir + xmlreplace //Special Copy of this dir + xmlreplace
copy_skin_folder(G::ExpandPath("skinEngine") . 'base' . PATH_SEP, PATH_CUSTOM_SKINS . copy_skin_folder( G::ExpandPath( "skinEngine" ) . 'base' . PATH_SEP, PATH_CUSTOM_SKINS . $skinFolder, array ("config.xml","baseCss"
$skinFolder,array("config.xml","baseCss")); ) );
$pathBase = G::ExpandPath( "skinEngine" ) . 'base' . PATH_SEP; $pathBase = G::ExpandPath( "skinEngine" ) . 'base' . PATH_SEP;
break; break;
default: default:
//Commmon copy/paste of a folder + xmlrepalce //Commmon copy/paste of a folder + xmlrepalce
copy_skin_folder(PATH_CUSTOM_SKINS . $skinBase, PATH_CUSTOM_SKINS . $skinFolder,array("config.xml")); copy_skin_folder( PATH_CUSTOM_SKINS . $skinBase, PATH_CUSTOM_SKINS . $skinFolder, array ("config.xml"
) );
$pathBase = PATH_CUSTOM_SKINS . $skinBase; $pathBase = PATH_CUSTOM_SKINS . $skinBase;
break; break;
} }
@@ -126,18 +126,12 @@ function newSkin($baseSkin='classic')
$configFileOriginal = $pathBase . PATH_SEP . 'config.xml'; $configFileOriginal = $pathBase . PATH_SEP . 'config.xml';
$configFileFinal = PATH_CUSTOM_SKINS . $skinFolder . PATH_SEP . 'config.xml'; $configFileFinal = PATH_CUSTOM_SKINS . $skinFolder . PATH_SEP . 'config.xml';
$xmlConfiguration = file_get_contents( $configFileOriginal ); $xmlConfiguration = file_get_contents( $configFileOriginal );
$xmlConfiguration = preg_replace('/(<id>)(.+?)(<\/id>)/i', '<id>' . G::generateUniqueID() . $xmlConfiguration = preg_replace( '/(<id>)(.+?)(<\/id>)/i', '<id>' . G::generateUniqueID() . '</id><!-- $2 -->', $xmlConfiguration );
'</id><!-- $2 -->', $xmlConfiguration); $xmlConfiguration = preg_replace( "/(<name>)(.+?)(<\/name>)/i", "<name>" . $skinName . "</name><!-- $2 -->", $xmlConfiguration );
$xmlConfiguration = preg_replace("/(<name>)(.+?)(<\/name>)/i", "<name>" . $skinName . $xmlConfiguration = preg_replace( "/(<description>)(.+?)(<\/description>)/i", "<description>" . $skinDescription . "</description><!-- $2 -->", $xmlConfiguration );
"</name><!-- $2 -->", $xmlConfiguration); $xmlConfiguration = preg_replace( "/(<author>)(.+?)(<\/author>)/i", "<author>" . $skinAuthor . "</author><!-- $2 -->", $xmlConfiguration );
$xmlConfiguration = preg_replace("/(<description>)(.+?)(<\/description>)/i", "<description>" . $xmlConfiguration = preg_replace( "/(<createDate>)(.+?)(<\/createDate>)/i", "<createDate>" . date( "Y-m-d H:i:s" ) . "</createDate><!-- $2 -->", $xmlConfiguration );
$skinDescription . "</description><!-- $2 -->", $xmlConfiguration); $xmlConfiguration = preg_replace( "/(<modifiedDate>)(.+?)(<\/modifiedDate>)/i", "<modifiedDate>" . date( "Y-m-d H:i:s" ) . "</modifiedDate><!-- $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 ); file_put_contents( $configFileFinal, $xmlConfiguration );
$response['success'] = true; $response['success'] = true;
@@ -188,7 +182,8 @@ function importSkin()
//$errors[$i]='uploadfile'; //$errors[$i]='uploadfile';
} }
$fileInfo = pathinfo( $items ); $fileInfo = pathinfo( $items );
$validType = array('tar', 'gz'); $validType = array ('tar','gz'
);
if (! in_array( $fileInfo['extension'], $validType )) { if (! in_array( $fileInfo['extension'], $validType )) {
throw (new Exception( G::LoadTranslation( 'ID_FILE_UPLOAD_INCORRECT_EXTENSION' ) )); throw (new Exception( G::LoadTranslation( 'ID_FILE_UPLOAD_INCORRECT_EXTENSION' ) ));
@@ -288,6 +283,7 @@ function exportSkin($skinToExport="")
print_r( G::json_encode( $response ) ); print_r( G::json_encode( $response ) );
} }
} }
function deleteSkin () function deleteSkin ()
{ {
try { try {
@@ -311,6 +307,7 @@ function deleteSkin()
print_r( G::json_encode( $response ) ); print_r( G::json_encode( $response ) );
} }
} }
function streamSkin () function streamSkin ()
{ {
$skinTar = $_REQUEST['file']; $skinTar = $_REQUEST['file'];
@@ -343,7 +340,8 @@ function addTarFolder($tar, $pathBase, $pluginHome)
function copy_skin_folder ($path, $dest, $exclude = array()) function copy_skin_folder ($path, $dest, $exclude = array())
{ {
$defaultExcluded=array(".",".."); $defaultExcluded = array (".",".."
);
$excludedItems = array_merge( $defaultExcluded, $exclude ); $excludedItems = array_merge( $defaultExcluded, $exclude );
if (is_dir( $path )) { if (is_dir( $path )) {
@mkdir( $dest ); @mkdir( $dest );

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* skinsExport.php * skinsExport.php
* *
@@ -20,16 +21,17 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
function copyFile ( $input, $output ) { function copyFile ($input, $output)
{
$content = file_get_contents( $input ); $content = file_get_contents( $input );
$filename = $output . PATH_SEP . basename( $input ); $filename = $output . PATH_SEP . basename( $input );
return file_put_contents( $filename, $content ); return file_put_contents( $filename, $content );
} }
function savePluginFile ( $tplName, $fileName, $fields ) { function savePluginFile ($tplName, $fileName, $fields)
{
$pluginTpl = PATH_GULLIVER_HOME . 'bin' . PATH_SEP . 'tasks' . PATH_SEP . 'templates' . PATH_SEP . $tplName . '.tpl'; $pluginTpl = PATH_GULLIVER_HOME . 'bin' . PATH_SEP . 'tasks' . PATH_SEP . 'templates' . PATH_SEP . $tplName . '.tpl';
$template = new TemplatePower( $pluginTpl ); $template = new TemplatePower( $pluginTpl );
$template->prepare(); $template->prepare();
@@ -53,9 +55,11 @@
return $iSize; return $iSize;
} }
function addTarFolder ( $tar, $pathBase,$pluginHome ) { function addTarFolder ($tar, $pathBase, $pluginHome)
{
$aux = explode( PATH_SEP, $pathBase ); $aux = explode( PATH_SEP, $pathBase );
if ( $aux[count($aux) -2 ] == '.svn' ) return; if ($aux[count( $aux ) - 2] == '.svn')
return;
if ($handle = opendir( $pathBase )) { if ($handle = opendir( $pathBase )) {
while (false !== ($file = readdir( $handle ))) { while (false !== ($file = readdir( $handle ))) {
@@ -72,8 +76,8 @@
} }
} }
function packPlugin ($pluginName, $version)
function packPlugin ( $pluginName, $version ) { {
$pathBase = PATH_DATA . 'skins' . PATH_SEP . $pluginName . PATH_SEP; $pathBase = PATH_DATA . 'skins' . PATH_SEP . $pluginName . PATH_SEP;
$pathHome = PATH_DATA . 'skins' . PATH_SEP . $pluginName; $pathHome = PATH_DATA . 'skins' . PATH_SEP . $pluginName;
@@ -103,17 +107,16 @@
} }
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_SETUP')) switch ($RBAC->userCanAccess( 'PM_SETUP' )) {
{
case - 2: case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
case - 1: case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
@@ -161,12 +164,12 @@ switch ($RBAC->userCanAccess('PM_SETUP'))
copyFile( PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'iepngfix.htc', $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 ); copyFile( PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'style.css', $pathPublic );
$aFiles = array (); $aFiles = array ();
if ($handle = opendir( $pathImages )) { if ($handle = opendir( $pathImages )) {
while (false !== ($file = readdir( $handle ))) { while (false !== ($file = readdir( $handle ))) {
if (substr( $file, 0, 1 ) != '.') { if (substr( $file, 0, 1 ) != '.') {
if ( isset($aFiles[ $file ]) ) $aFiles[$file] = 0; if (isset( $aFiles[$file] ))
$aFiles[$file] = 0;
copyFile( $pathImages . $file, $pathPublic . 'images' . PATH_SEP ); copyFile( $pathImages . $file, $pathPublic . 'images' . PATH_SEP );
} }
@@ -176,9 +179,9 @@ switch ($RBAC->userCanAccess('PM_SETUP'))
$fileTar = packPlugin( $id, $oConf->version ); $fileTar = packPlugin( $id, $oConf->version );
$bDownload = true; $bDownload = true;
G::streamFile( $fileTar, $bDownload, basename( $fileTar ) ); G::streamFile( $fileTar, $bDownload, basename( $fileTar ) );
@G::rm_dir( $pathHome ); @G::rm_dir( $pathHome );
@unlink( $fileTar ); @unlink( $fileTar );

View File

@@ -20,13 +20,12 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) { if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
//G::header('location: ../login/login'); //G::header('location: ../login/login');
die; die();
} }
$G_MAIN_MENU = 'processmaker'; $G_MAIN_MENU = 'processmaker';
@@ -34,7 +33,7 @@ $G_SUB_MENU = 'setup';
$G_ID_MENU_SELECTED = 'SETUP'; $G_ID_MENU_SELECTED = 'SETUP';
$G_ID_SUB_MENU_SELECTED = 'CALENDAR'; $G_ID_SUB_MENU_SELECTED = 'CALENDAR';
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
G::LoadClass( 'configuration' ); G::LoadClass( 'configuration' );
$c = new Configurations(); $c = new Configurations();
@@ -50,33 +49,32 @@ $oHeadPublisher->assign('SYS_SKIN', SYS_SKIN);
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() ); $oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
G::RenderPage( 'publish', 'extJs' ); G::RenderPage( 'publish', 'extJs' );
die; die();
global $RBAC; global $RBAC;
$access = $RBAC->userCanAccess( 'PM_SETUP' ); $access = $RBAC->userCanAccess( 'PM_SETUP' );
if ($access != 1) { if ($access != 1) {
switch ($access) switch ($access) {
{
case - 1: case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
case - 2: case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
default: default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
} }
// lets display the items // lets display the items
$items[] = array ( 'id' => 'char', 'title' => 'char', 'type' => 'char', 'creator' => 'char' , $items[] = array ('id' => 'char','title' => 'char','type' => 'char','creator' => 'char','modifiedBy' => 'char','filename' => 'char','size' => 'char','mime' => 'char'
'modifiedBy' => 'char', 'filename' => 'char', 'size' => 'char', 'mime' => 'char'); );
//***************** Skins ************************** //***************** Skins **************************
$aFiles = array (); $aFiles = array ();
@@ -86,20 +84,23 @@ if( $access != 1 ){
$filename = substr( $file, 0, strrpos( $file, '.' ) ); $filename = substr( $file, 0, strrpos( $file, '.' ) );
// list of no complete skins // 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 (! is_dir( PATH_SKINS . $file )) {
if (! in_array( $filename, $aFilterSkinsList ) /*&& /*/ && ! strpos( $file, '.tar', 1 )) { if (! in_array( $filename, $aFilterSkinsList ) /*&& /*/ && ! strpos( $file, '.tar', 1 )) {
if ( !isset($aFiles[ $filename ]) ) $aFiles[$filename] = 0; if (! isset( $aFiles[$filename] ))
if ( strpos($file, '.php', 1) ) $aFiles[ $filename ] += 1; $aFiles[$filename] = 0;
if ( strpos($file, '.html',1) ) $aFiles[ $filename ] += 2; 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 //now walk in the array to get the .cnf file and display properties
foreach ($aFiles as $key => $val) { foreach ($aFiles as $key => $val) {
$description = ''; $description = '';
@@ -113,20 +114,15 @@ if( $access != 1 ){
if (! is_object( $prop )) { if (! is_object( $prop )) {
@unlink( PATH_SKINS . $key . '.cnf' ); @unlink( PATH_SKINS . $key . '.cnf' );
} }
if ( isset ( $prop) && isset($prop->description) ) $description = $prop->description; if (isset( $prop ) && isset( $prop->description ))
if ( isset ( $prop) && isset($prop->version ) ) $version = $prop->version; $description = $prop->description;
if (isset( $prop ) && isset( $prop->version ))
$version = $prop->version;
} }
$linkPackValue = G::LoadTranslation( 'ID_EXPORT' ); $linkPackValue = G::LoadTranslation( 'ID_EXPORT' );
$link = 'skinsExport?id=' . $key; $link = 'skinsExport?id=' . $key;
$items[] = array ( $items[] = array ('id' => count( $items ),'name' => $key,'filename' => $key,'description' => $description,'version' => $version,'url' => $link,'linkPackValue' => $linkPackValue
'id' => count($items),
'name' => $key,
'filename' => $key,
'description' => $description,
'version' => $version,
'url' => $link,
'linkPackValue' => $linkPackValue
); );
} }
$folders['items'] = $items; $folders['items'] = $items;
@@ -145,7 +141,7 @@ if( $access != 1 ){
$G_SUB_MENU = 'setup'; $G_SUB_MENU = 'setup';
$G_ID_SUB_MENU_SELECTED = 'SKINS'; $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 );

View File

@@ -20,34 +20,33 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
$access = $RBAC->userCanAccess( 'PM_SETUP' ); $access = $RBAC->userCanAccess( 'PM_SETUP' );
if ($access != 1) { if ($access != 1) {
switch ($access) switch ($access) {
{
case - 1: case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
case - 2: case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
default: default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; 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; $dbc = new DBConnection();
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$G_MAIN_MENU = 'processmaker'; $G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'SETUP'; $G_ID_MENU_SELECTED = 'SETUP';
$G_SUB_MENU = 'setup'; $G_SUB_MENU = 'setup';

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* skinsSave.php * skinsSave.php
* *
@@ -20,11 +21,10 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
function xcopy ($pathSource, $pathTarget)
function xcopy ( $pathSource, $pathTarget ) { {
G::mk_dir( $pathTarget ); G::mk_dir( $pathTarget );
if ($handle = opendir( $pathSource )) { if ($handle = opendir( $pathSource )) {
while (false !== ($file = readdir( $handle ))) { while (false !== ($file = readdir( $handle ))) {
@@ -38,19 +38,17 @@
} }
} }
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_SETUP')) switch ($RBAC->userCanAccess( 'PM_SETUP' )) {
{
case - 2: case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
case - 1: case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
@@ -82,14 +80,9 @@ switch ($RBAC->userCanAccess('PM_SETUP'))
$pathImages = PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'images' . PATH_SEP; $pathImages = PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'images' . PATH_SEP;
G::mk_dir( $pathImages ); G::mk_dir( $pathImages );
xcopy ( xcopy( PATH_HTML . 'skins' . PATH_SEP . 'green' . PATH_SEP, PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP );
PATH_HTML . 'skins' . PATH_SEP . 'green' . PATH_SEP ,
PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP
);
xcopy ( xcopy( PATH_HTML . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'images' . PATH_SEP, PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'images' . PATH_SEP );
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' );

View File

@@ -20,27 +20,25 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
global $RBAC; global $RBAC;
$access = $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ); $access = $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' );
if ($access != 1) { if ($access != 1) {
switch ($access) switch ($access) {
{
case - 1: case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
case - 2: case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
default: default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
} }
@@ -55,8 +53,8 @@ if( $access != 1 ){
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 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;
$G_MAIN_MENU = 'processmaker'; $G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'setup'; $G_SUB_MENU = 'setup';
@@ -68,7 +66,7 @@ if( $access != 1 ){
$Fields['PM_VERSION'] = System::getVersion(); $Fields['PM_VERSION'] = System::getVersion();
$Fields['MAX_FILE_SIZE'] = $uploadMaxSize . " (" . $UPLOAD_MAX_SIZE . ") "; $Fields['MAX_FILE_SIZE'] = $uploadMaxSize . " (" . $UPLOAD_MAX_SIZE . ") ";
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/upgrade', '', $Fields, 'upgrade_System' ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/upgrade', '', $Fields, 'upgrade_System' );
G::RenderPage( 'publishBlank', 'blank' ); G::RenderPage( 'publishBlank', 'blank' );

View File

@@ -40,3 +40,4 @@ $aRequiredPermissions = array('PM_LOGIN',
'PM_FOLDERS_ADD_FOLDER', 'PM_FOLDERS_ADD_FOLDER',
'PM_FOLDERS_ADD_FILE' 'PM_FOLDERS_ADD_FILE'
); );

View File

@@ -20,7 +20,6 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
/** /**
@@ -30,17 +29,16 @@
* @date May 12th, 2010 * @date May 12th, 2010
*/ */
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_SETUP_ADVANCE')) switch ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' )) {
{
case - 2: case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
case - 1: case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
set_time_limit( 0 ); set_time_limit( 0 );
@@ -61,7 +59,7 @@ try {
$oSystem->getUpgradedFilesList(); $oSystem->getUpgradedFilesList();
$ver = $oSystem->upgrade(); $ver = $oSystem->upgrade();
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$aMessage['THEMESSAGE1'] = G::LoadTranslation( 'ID_UPGRADE_READY' ) . " <b>" . $ver[0] . "</b> " . G::LoadTranslation( 'ID_TO' ) . " <b>" . $ver[1] . "</b>"; $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['THEMESSAGE2'] = file_get_contents( $oSystem->sUpgradeFileList );
$aMessage['THEMESSAGE3'] = ''; $aMessage['THEMESSAGE3'] = '';
@@ -100,11 +98,11 @@ try {
G::RenderPage( 'publishBlank', 'blank' ); G::RenderPage( 'publishBlank', 'blank' );
G::evalJScript( 'upgradeSystem(' . count( $oSystem->aWorkspaces ) . ')' ); G::evalJScript( 'upgradeSystem(' . count( $oSystem->aWorkspaces ) . ')' );
exit( 0 ); exit( 0 );
} } catch (Exception $e) {
catch (Exception $e) { $G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage(); $aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publishBlank', 'blank' ); G::RenderPage( 'publishBlank', 'blank' );
exit( 0 ); exit( 0 );
} }

View File

@@ -20,7 +20,6 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
global $DB_ADAPTER; global $DB_ADAPTER;
global $DB_HOST; global $DB_HOST;
@@ -30,7 +29,8 @@
set_time_limit( 0 ); set_time_limit( 0 );
$id = ''; $id = '';
if ( isset($_POST['id'] ) ) $id = $_POST['id']; if (isset( $_POST['id'] ))
$id = $_POST['id'];
G::LoadClass( 'languages' ); G::LoadClass( 'languages' );
G::LoadSystem( 'database_mysql' ); G::LoadSystem( 'database_mysql' );
@@ -55,7 +55,6 @@
if ($aUpgradeData['sSchemaFile'] != '') if ($aUpgradeData['sSchemaFile'] != '')
processMasterSchemaFile( $aUpgradeData['sSchemaFile'] ); processMasterSchemaFile( $aUpgradeData['sSchemaFile'] );
//draw a gauge control indicating the progress in workspaces //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 "<table cellpadding=0><tr><td><img src='/images/ajax-loader.gif' border=0/></td><td>";
@@ -63,17 +62,17 @@
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 "<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>"; 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 ) ); file_put_contents( PATH_DATA . 'log' . PATH_SEP . "upgrade.data.bin", serialize( $aUpgradeData ) );
} } else {
else {
print "<table cellpadding=0><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td>"; print "<table cellpadding=0><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td>";
print "<div style='border-style:solid;border-width:1px; border-color: #A1C868; width:300px; height:19px;' >"; 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 "<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>"; 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 = file_get_contents( $dbFile );
$sContent = str_replace( '<?php', '', $sContent ); $sContent = str_replace( '<?php', '', $sContent );
$sContent = str_replace( '<?', '', $sContent ); $sContent = str_replace( '<?', '', $sContent );
@@ -85,7 +84,8 @@ function getDatabaseCredentials ( $dbFile ) {
return $sContent; return $sContent;
} }
function processMasterSchemaFile ( $sSchemaFile ) { function processMasterSchemaFile ($sSchemaFile)
{
global $DB_ADAPTER; global $DB_ADAPTER;
global $DB_HOST; global $DB_HOST;
global $DB_USER; global $DB_USER;
@@ -96,8 +96,7 @@ function processMasterSchemaFile ( $sSchemaFile ) {
//convert newSchema to array //convert newSchema to array
if (isset( $aUpgradeData['aNewSchema'] )) { if (isset( $aUpgradeData['aNewSchema'] )) {
$aNewSchema = $aUpgradeData['aNewSchema']; $aNewSchema = $aUpgradeData['aNewSchema'];
} } else {
else {
$aNewSchema = schemaToArray( $sSchemaFile ); $aNewSchema = schemaToArray( $sSchemaFile );
$aUpgradeData['aNewSchema'] = $aNewSchema; $aUpgradeData['aNewSchema'] = $aNewSchema;
} }
@@ -157,8 +156,8 @@ function processMasterSchemaFile ( $sSchemaFile ) {
$oDataBase->close(); $oDataBase->close();
} }
function processSchemaFile ()
function processSchemaFile( ) { {
global $DB_ADAPTER; global $DB_ADAPTER;
global $DB_HOST; global $DB_HOST;
global $DB_USER; global $DB_USER;
@@ -173,7 +172,7 @@ function processSchemaFile( ) {
if (! $oDataBase->isConnected()) { if (! $oDataBase->isConnected()) {
$oDataBase->logQuery( 'Does not exist an available connection!' ); $oDataBase->logQuery( 'Does not exist an available connection!' );
return NULL; return null;
} }
$oDataBase->iFetchType = MYSQL_NUM; $oDataBase->iFetchType = MYSQL_NUM;
@@ -181,7 +180,7 @@ function processSchemaFile( ) {
} catch (Exception $e) { } catch (Exception $e) {
$oDataBase->logQuery( $e->getmessage() ); $oDataBase->logQuery( $e->getmessage() );
return NULL; return null;
} }
//going thru all tables in current WF_ database //going thru all tables in current WF_ database
@@ -217,12 +216,14 @@ function processSchemaFile( ) {
$oDataBase->iFetchType = MYSQL_NUM; //this line is neccesary because the next fetch needs to be with MYSQL_NUM $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 //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; return $aOldSchema;
} }
//process the schema file in the patch file, and obtain an array //process the schema file in the patch file, and obtain an array
function schemaToArray($sSchemaFile) { function schemaToArray ($sSchemaFile)
{
try { try {
$aSchema = array (); $aSchema = array ();
$oXml = new DomDocument(); $oXml = new DomDocument();
@@ -249,7 +250,8 @@ function schemaToArray($sSchemaFile) {
$aPrimaryKeys[] = $oColumn->getAttribute( 'name' ); $aPrimaryKeys[] = $oColumn->getAttribute( 'name' );
} }
if ( in_array ( $parameterName, array('Field','Type','Null','Default') ) ) { if (in_array( $parameterName, array ('Field','Type','Null','Default'
) )) {
$aSchema[$sTableName][$sColumName][$parameterName] = $oParameter->getAttribute( 'value' ); $aSchema[$sTableName][$sColumName][$parameterName] = $oParameter->getAttribute( 'value' );
} }
} }
@@ -269,13 +271,13 @@ function schemaToArray($sSchemaFile) {
} }
} }
return $aSchema; return $aSchema;
} } catch (Exception $oError) {
catch (Exception $oError) {
throw $oError; throw $oError;
} }
} }
function obtainChanges($aOldSchema, $aNewSchema) { function obtainChanges ($aOldSchema, $aNewSchema)
{
//$aChanges = array('tablesToDelete' => array(), 'tablesToAdd' => array(), 'tablesToAlter' => array()); //$aChanges = array('tablesToDelete' => array(), 'tablesToAdd' => array(), 'tablesToAlter' => array());
//Tables to delete, but this is disabled //Tables to delete, but this is disabled
//foreach ($aOldSchema as $sTableName => $aColumns) { //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 //new tables to create and alter
foreach ($aNewSchema as $sTableName => $aColumns) { foreach ($aNewSchema as $sTableName => $aColumns) {
if (! isset( $aOldSchema[$sTableName] )) { if (! isset( $aOldSchema[$sTableName] )) {
$aChanges['tablesToAdd'][$sTableName] = $aColumns; $aChanges['tablesToAdd'][$sTableName] = $aColumns;
} } else {
else {
//drop old columns //drop old columns
foreach ($aOldSchema[$sTableName] as $sColumName => $aParameters) { foreach ($aOldSchema[$sTableName] as $sColumName => $aParameters) {
if (! isset( $aNewSchema[$sTableName][$sColumName] )) { if (! isset( $aNewSchema[$sTableName][$sColumName] )) {
if (! isset( $aChanges['tablesToAlter'][$sTableName] )) { if (! isset( $aChanges['tablesToAlter'][$sTableName] )) {
$aChanges['tablesToAlter'][$sTableName] = array('DROP' => array(), 'ADD' => array(), 'CHANGE' => array()); $aChanges['tablesToAlter'][$sTableName] = array ('DROP' => array (),'ADD' => array (),'CHANGE' => array ()
);
} }
$aChanges['tablesToAlter'][$sTableName]['DROP'][$sColumName] = $sColumName; $aChanges['tablesToAlter'][$sTableName]['DROP'][$sColumName] = $sColumName;
} }
@@ -310,18 +314,21 @@ function obtainChanges($aOldSchema, $aNewSchema) {
if ($sColumName != 'INDEXES') { if ($sColumName != 'INDEXES') {
if (! isset( $aOldSchema[$sTableName][$sColumName] )) { //this column doesnt exist in oldschema if (! isset( $aOldSchema[$sTableName][$sColumName] )) { //this column doesnt exist in oldschema
if (! isset( $aChanges['tablesToAlter'][$sTableName] )) { if (! isset( $aChanges['tablesToAlter'][$sTableName] )) {
$aChanges['tablesToAlter'][$sTableName] = array('DROP' => array(), 'ADD' => array(), 'CHANGE' => array()); $aChanges['tablesToAlter'][$sTableName] = array ('DROP' => array (),'ADD' => array (),'CHANGE' => array ()
);
} }
$aChanges['tablesToAlter'][$sTableName]['ADD'][$sColumName] = $aParameters; $aChanges['tablesToAlter'][$sTableName]['ADD'][$sColumName] = $aParameters;
} } else { //the column exists
else { //the column exists
$newField = $aNewSchema[$sTableName][$sColumName]; $newField = $aNewSchema[$sTableName][$sColumName];
$oldField = $aOldSchema[$sTableName][$sColumName]; $oldField = $aOldSchema[$sTableName][$sColumName];
//both are null, no change is required //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 //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'] ) && $oldField['Default'] != '')
if ( isset($newField['Default']) && !isset($oldField['Default'])) $changeDefaultAttr = true; $changeDefaultAttr = true;
if (isset( $newField['Default'] ) && ! isset( $oldField['Default'] ))
$changeDefaultAttr = true;
//both are defined and they are different. //both are defined and they are different.
if (isset( $newField['Default'] ) && isset( $oldField['Default'] )) { if (isset( $newField['Default'] ) && isset( $oldField['Default'] )) {
if ($newField['Default'] != $oldField['Default']) if ($newField['Default'] != $oldField['Default'])
@@ -331,11 +338,13 @@ function obtainChanges($aOldSchema, $aNewSchema) {
} }
//special cases //special cases
// BLOB and TEXT columns cannot have DEFAULT values. http://dev.mysql.com/doc/refman/5.0/en/blob.html // 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; $changeDefaultAttr = false;
//#1067 - Invalid default value for datetime field //#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; $changeDefaultAttr = false;
//#1067 - Invalid default value for int field //#1067 - Invalid default value for int field
@@ -343,12 +352,10 @@ function obtainChanges($aOldSchema, $aNewSchema) {
$changeDefaultAttr = false; $changeDefaultAttr = false;
//if any difference exists, then insert the difference in aChanges //if any difference exists, then insert the difference in aChanges
if ( $newField['Field'] != $oldField['Field'] || if ($newField['Field'] != $oldField['Field'] || $newField['Type'] != $oldField['Type'] || $newField['Null'] != $oldField['Null'] || $changeDefaultAttr) {
$newField['Type'] != $oldField['Type'] ||
$newField['Null'] != $oldField['Null'] ||
$changeDefaultAttr ) {
if (! isset( $aChanges['tablesToAlter'][$sTableName] )) { if (! isset( $aChanges['tablesToAlter'][$sTableName] )) {
$aChanges['tablesToAlter'][$sTableName] = array('DROP' => array(), 'ADD' => array(), 'CHANGE' => array()); $aChanges['tablesToAlter'][$sTableName] = array ('DROP' => array (),'ADD' => array (),'CHANGE' => array ()
);
} }
$aChanges['tablesToAlter'][$sTableName]['CHANGE'][$sColumName]['Field'] = $newField['Field']; $aChanges['tablesToAlter'][$sTableName]['CHANGE'][$sColumName]['Field'] = $newField['Field'];
$aChanges['tablesToAlter'][$sTableName]['CHANGE'][$sColumName]['Type'] = $newField['Type']; $aChanges['tablesToAlter'][$sTableName]['CHANGE'][$sColumName]['Type'] = $newField['Type'];
@@ -363,6 +370,7 @@ function obtainChanges($aOldSchema, $aNewSchema) {
} //only columns, no the indexes column } //only columns, no the indexes column
} //foreach $aColumns } //foreach $aColumns
//now check the indexes of table //now check the indexes of table
if (isset( $aNewSchema[$sTableName]['INDEXES'] )) { if (isset( $aNewSchema[$sTableName]['INDEXES'] )) {
foreach ($aNewSchema[$sTableName]['INDEXES'] as $indexName => $indexFields) { foreach ($aNewSchema[$sTableName]['INDEXES'] as $indexName => $indexFields) {
@@ -371,8 +379,7 @@ function obtainChanges($aOldSchema, $aNewSchema) {
$aChanges['tablesWithNewIndex'][$sTableName] = array (); $aChanges['tablesWithNewIndex'][$sTableName] = array ();
} }
$aChanges['tablesWithNewIndex'][$sTableName][$indexName] = $indexFields; $aChanges['tablesWithNewIndex'][$sTableName][$indexName] = $indexFields;
} } else {
else {
if ($aOldSchema[$sTableName]['INDEXES'][$indexName] != $indexFields) { if ($aOldSchema[$sTableName]['INDEXES'][$indexName] != $indexFields) {
if (! isset( $aChanges['tablesToAlterIndex'][$sTableName] )) { if (! isset( $aChanges['tablesToAlterIndex'][$sTableName] )) {
$aChanges['tablesToAlterIndex'][$sTableName] = array (); $aChanges['tablesToAlterIndex'][$sTableName] = array ();

View File

@@ -20,7 +20,6 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
global $RBAC; global $RBAC;
@@ -28,7 +27,7 @@
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) { if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
die; die();
} }
//calculating the max upload file size; //calculating the max upload file size;
@@ -42,7 +41,8 @@
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 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;
$Fields['MAX_FILE_SIZE'] = $uploadMaxSize . " (" . $UPLOAD_MAX_SIZE . ") "; $Fields['MAX_FILE_SIZE'] = $uploadMaxSize . " (" . $UPLOAD_MAX_SIZE . ") ";
$G_MAIN_MENU = 'processmaker'; $G_MAIN_MENU = 'processmaker';
@@ -50,7 +50,7 @@
$G_ID_MENU_SELECTED = 'SETUP'; $G_ID_MENU_SELECTED = 'SETUP';
$G_ID_SUB_MENU_SELECTED = 'LOGO'; $G_ID_SUB_MENU_SELECTED = 'LOGO';
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$oHeadPublisher = & headPublisher::getSingleton(); $oHeadPublisher = & headPublisher::getSingleton();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/uplogo', '', $Fields ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/uplogo', '', $Fields );
@@ -100,3 +100,4 @@
window.location = 'uplogo'; window.location = 'uplogo';
} }
</script> </script>

View File

@@ -20,13 +20,12 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_FACTORY' ) != 1) { if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_FACTORY' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
//G::header('location: ../login/login'); //G::header('location: ../login/login');
die; die();
} }
$G_MAIN_MENU = 'processmaker'; $G_MAIN_MENU = 'processmaker';
@@ -34,14 +33,13 @@ if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_FACTORY') !
$G_ID_MENU_SELECTED = 'SETUP'; $G_ID_MENU_SELECTED = 'SETUP';
//$G_ID_SUB_MENU_SELECTED = 'WEBSERVICES'; //$G_ID_SUB_MENU_SELECTED = 'WEBSERVICES';
if (! extension_loaded( 'soap' )) { if (! extension_loaded( 'soap' )) {
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsMessage' ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsMessage' );
G::RenderPage( "publish" ); G::RenderPage( "publish" );
} } else {
else $G_PUBLISH = new Publisher();
{
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent( 'view', 'setup/webServicesTree' ); $G_PUBLISH->AddContent( 'view', 'setup/webServicesTree' );
$G_PUBLISH->AddContent( 'smarty', 'groups/groups_usersList', '', '', array () ); $G_PUBLISH->AddContent( 'smarty', 'groups/groups_usersList', '', '', array () );
@@ -51,7 +49,6 @@ if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_FACTORY') !
$link_Edit = G::encryptlink( 'webServicesSetup' ); $link_Edit = G::encryptlink( 'webServicesSetup' );
$link_List = G::encryptlink( 'webServicesList' ); $link_List = G::encryptlink( 'webServicesList' );
?> ?>
<script> <script>
document.body.style.backgroundColor="#fff"; document.body.style.backgroundColor="#fff";

View File

@@ -20,15 +20,15 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
ini_set( "soap.wsdl_cache_enabled", "0" ); // enabling WSDL cache ini_set( "soap.wsdl_cache_enabled", "0" ); // enabling WSDL cache
G::LoadClass( 'ArrayPeer' ); G::LoadClass( 'ArrayPeer' );
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_FACTORY' ) != 1) { if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_FACTORY' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
//G::header('location: ../login/login'); //G::header('location: ../login/login');
die; die();
} }
G::LoadInclude( 'ajax' ); G::LoadInclude( 'ajax' );
@@ -53,7 +53,6 @@ switch ($_POST ['action']) {
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
} }
break; break;
case 'showDetails': case 'showDetails':
G::LoadClass( 'groups' ); G::LoadClass( 'groups' );
@@ -77,9 +76,12 @@ switch ($_POST ['action']) {
$aFields['WS_WORKSPACE'] = substr( $aAux[1], 3 ); $aFields['WS_WORKSPACE'] = substr( $aAux[1], 3 );
} }
$rows [] = array ('uid' => 'char', 'name' => 'char', 'age' => 'integer', 'balance' => 'float' ); $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' => 'http','name' => 'http'
);
$rows[] = array ('uid' => 'https','name' => 'https'
);
global $_DBArray; global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : ''); $_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
@@ -112,7 +114,6 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/webServicesDetails', '', $aFields, 'webServicesSetupSave' ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/webServicesDetails', '', $aFields, 'webServicesSetupSave' );
G::RenderPage( "publish", "raw" ); G::RenderPage( "publish", "raw" );
break; break;
case 'showUploadFilesForm': case 'showUploadFilesForm':
global $G_PUBLISH; global $G_PUBLISH;
@@ -129,7 +130,8 @@ switch ($_POST ['action']) {
G::RenderPage( 'publish', 'blank' ); G::RenderPage( 'publish', 'blank' );
} }
break; break;
}try { }
try {
global $G_PUBLISH; global $G_PUBLISH;
if (isset( $_POST['form']['ACTION'] )) { if (isset( $_POST['form']['ACTION'] )) {
$frm = $_POST['form']; $frm = $_POST['form'];
@@ -165,8 +167,10 @@ switch ($_POST ['action']) {
case "Login": case "Login":
$user = $frm["USER_ID"]; $user = $frm["USER_ID"];
$pass = $frm["PASSWORD"]; $pass = $frm["PASSWORD"];
$params = array ('userid' => $user, 'password' => $pass ); $params = array ('userid' => $user,'password' => $pass
$result = $client->__SoapCall ( 'login', array ($params ) ); );
$result = $client->__SoapCall( 'login', array ($params
) );
$_SESSION['WS_SESSION_ID'] = ''; $_SESSION['WS_SESSION_ID'] = '';
if ($result->status_code == 0) { if ($result->status_code == 0) {
$_SESSION['WS_SESSION_ID'] = $result->message; $_SESSION['WS_SESSION_ID'] = $result->message;
@@ -181,13 +185,16 @@ switch ($_POST ['action']) {
break; break;
case "ProcessList": case "ProcessList":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId ); $params = array ('sessionId' => $sessionId
);
$wsResponse = $client->__SoapCall ( 'ProcessList', array ($params ) ); $wsResponse = $client->__SoapCall( 'ProcessList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'processes' ); $result = G::PMWSCompositeResponse( $wsResponse, 'processes' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char' ); $rows[] = array ('guid' => 'char','name' => 'char'
);
if (is_array( $result )) { if (is_array( $result )) {
foreach ($result as $key => $item) { foreach ($result as $key => $item) {
@@ -212,7 +219,8 @@ switch ($_POST ['action']) {
$name = $item->name; $name = $item->name;
} }
$rows [] = array ('guid' => $guid, 'name' => $name ); $rows[] = array ('guid' => $guid,'name' => $name
);
} }
global $_DBArray; global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : ''); $_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
@@ -235,13 +243,16 @@ switch ($_POST ['action']) {
break; break;
case "RoleList": case "RoleList":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId ); $params = array ('sessionId' => $sessionId
$wsResponse = $client->__SoapCall ( 'RoleList', array ($params ) ); );
$wsResponse = $client->__SoapCall( 'RoleList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'roles' ); $result = G::PMWSCompositeResponse( $wsResponse, 'roles' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char'); $rows[] = array ('guid' => 'char','name' => 'char'
);
if (is_array( $result )) { if (is_array( $result )) {
foreach ($result as $key => $item) { foreach ($result as $key => $item) {
@@ -266,7 +277,8 @@ switch ($_POST ['action']) {
$name = $item->name; $name = $item->name;
} }
$rows [] = array ('guid' => $guid, 'name' => $name ); $rows[] = array ('guid' => $guid,'name' => $name
);
} }
global $_DBArray; global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : ''); $_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
@@ -288,15 +300,17 @@ switch ($_POST ['action']) {
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "GroupList": case "GroupList":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId ); $params = array ('sessionId' => $sessionId
$wsResponse = $client->__SoapCall ( 'GroupList', array ($params ) ); );
$wsResponse = $client->__SoapCall( 'GroupList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'groups' ); $result = G::PMWSCompositeResponse( $wsResponse, 'groups' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char' ); $rows[] = array ('guid' => 'char','name' => 'char'
);
if (is_array( $result )) { if (is_array( $result )) {
foreach ($result as $key => $item) { foreach ($result as $key => $item) {
if (isset( $item->item )) if (isset( $item->item ))
@@ -320,7 +334,8 @@ switch ($_POST ['action']) {
$name = $item->name; $name = $item->name;
} }
$rows [] = array ('guid' => $guid, 'name' => $name ); $rows[] = array ('guid' => $guid,'name' => $name
);
} }
global $_DBArray; global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : ''); $_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
@@ -342,14 +357,16 @@ switch ($_POST ['action']) {
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "CaseList": case "CaseList":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId ); $params = array ('sessionId' => $sessionId
$wsResponse = $client->__SoapCall ( 'CaseList', array ($params ) ); );
$wsResponse = $client->__SoapCall( 'CaseList', array ($params
) );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char', 'status' => 'char', 'delIndex' => 'char' ); $rows[] = array ('guid' => 'char','name' => 'char','status' => 'char','delIndex' => 'char'
);
$result = G::PMWSCompositeResponse( $wsResponse, 'cases' ); $result = G::PMWSCompositeResponse( $wsResponse, 'cases' );
@@ -388,7 +405,8 @@ switch ($_POST ['action']) {
$delIndex = $item->delIndex; $delIndex = $item->delIndex;
} }
$rows [] = array ('guid' => $guid, 'name' => $name, 'status' => $status, 'delIndex' => $delIndex ); $rows[] = array ('guid' => $guid,'name' => $name,'status' => $status,'delIndex' => $delIndex
);
} }
@@ -413,17 +431,17 @@ switch ($_POST ['action']) {
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "UnassignedCaseList": case "UnassignedCaseList":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId ); $params = array ('sessionId' => $sessionId
);
$wsResponse = $client->__SoapCall ( 'UnassignedCaseList', array ($params )); $wsResponse = $client->__SoapCall( 'UnassignedCaseList', array ($params
) );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char', 'delIndex' => 'char' ); $rows[] = array ('guid' => 'char','name' => 'char','delIndex' => 'char'
);
$result = G::PMWSCompositeResponse( $wsResponse, 'cases' ); $result = G::PMWSCompositeResponse( $wsResponse, 'cases' );
if (is_array( $result )) { if (is_array( $result )) {
@@ -454,7 +472,8 @@ switch ($_POST ['action']) {
if (isset( $item->delIndex )) if (isset( $item->delIndex ))
$delIndex = $item->delIndex; $delIndex = $item->delIndex;
} }
$rows [] = array ('guid' => $guid, 'name' => $name, 'delIndex' => $delIndex ); $rows[] = array ('guid' => $guid,'name' => $name,'delIndex' => $delIndex
);
} }
global $_DBArray; global $_DBArray;
@@ -467,8 +486,7 @@ switch ($_POST ['action']) {
$c->setDBArrayTable( 'case' ); $c->setDBArrayTable( 'case' );
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrUnassignedCaseList', $c ); $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrUnassignedCaseList', $c );
} } else if (is_object( $result )) {
else if( is_object($result) ){
$_SESSION['WS_SESSION_ID'] = ''; $_SESSION['WS_SESSION_ID'] = '';
$fields['status_code'] = $result->status_code; $fields['status_code'] = $result->status_code;
$fields['message'] = $result->message; $fields['message'] = $result->message;
@@ -478,15 +496,17 @@ switch ($_POST ['action']) {
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "UserList": case "UserList":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId ); $params = array ('sessionId' => $sessionId
$wsResponse = $client->__SoapCall ( 'UserList', array ($params ) ); );
$wsResponse = $client->__SoapCall( 'UserList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'users' ); $result = G::PMWSCompositeResponse( $wsResponse, 'users' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char' ); $rows[] = array ('guid' => 'char','name' => 'char'
);
if (is_array( $result )) { if (is_array( $result )) {
foreach ($result as $key => $item) { foreach ($result as $key => $item) {
@@ -511,10 +531,10 @@ switch ($_POST ['action']) {
$name = $item->name; $name = $item->name;
} }
$rows [] = array ('guid' => $guid, 'name' => $name ); $rows[] = array ('guid' => $guid,'name' => $name
);
} }
global $_DBArray; global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : ''); $_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
$_DBArray['user'] = $rows; $_DBArray['user'] = $rows;
@@ -535,7 +555,6 @@ switch ($_POST ['action']) {
} }
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "SendMessage": case "SendMessage":
require_once ('classes/model/Application.php'); require_once ('classes/model/Application.php');
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
@@ -558,15 +577,10 @@ switch ($_POST ['action']) {
$messageBody = "message for case: " . $caseNumber . "<br>" . $message; $messageBody = "message for case: " . $caseNumber . "<br>" . $message;
file_put_contents( $templateFile, $messageBody ); file_put_contents( $templateFile, $messageBody );
$params = array ( 'sessionId' => $sessionId, $params = array ('sessionId' => $sessionId,'caseId' => $caseId,'from' => $from,'to' => $to,'cc' => $cc,'bcc' => $bcc,'subject' => $subject,'template' => 'tempTemplate.hml'
'caseId' => $caseId, );
'from' => $from, $result = $client->__SoapCall( 'sendMessage', array ($params
'to' => $to, ) );
'cc' => $cc,
'bcc' => $bcc,
'subject' => $subject,
'template' => 'tempTemplate.hml' );
$result = $client->__SoapCall ( 'sendMessage', array ($params ) );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code; $fields['status_code'] = $result->status_code;
$fields['message'] = $result->message; $fields['message'] = $result->message;
@@ -579,7 +593,6 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "SendVariables": case "SendVariables":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$caseId = $frm["CASE_ID"]; $caseId = $frm["CASE_ID"];
@@ -594,8 +607,10 @@ switch ($_POST ['action']) {
$o->value = $frm["VALUE2"]; $o->value = $frm["VALUE2"];
array_push( $variables, $o ); array_push( $variables, $o );
$params = array ('sessionId' => $sessionId, 'caseId' => $caseId, 'variables' => $variables ); $params = array ('sessionId' => $sessionId,'caseId' => $caseId,'variables' => $variables
$result = $client->__SoapCall ( 'SendVariables', array ($params ) ); );
$result = $client->__SoapCall( 'SendVariables', array ($params
) );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code; $fields['status_code'] = $result->status_code;
$fields['message'] = $result->message; $fields['message'] = $result->message;
@@ -608,14 +623,15 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "DerivateCase": case "DerivateCase":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$caseId = $frm["CASE_ID"]; $caseId = $frm["CASE_ID"];
$delIndex = $frm["DEL_INDEX"]; $delIndex = $frm["DEL_INDEX"];
$params = array ('sessionId' => $sessionId, 'caseId' => $caseId, 'delIndex' => $delIndex ); $params = array ('sessionId' => $sessionId,'caseId' => $caseId,'delIndex' => $delIndex
$result = $client->__SoapCall ( 'RouteCase', array ($params ) ); );
$result = $client->__SoapCall( 'RouteCase', array ($params
) );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code; $fields['status_code'] = $result->status_code;
$fields['message'] = $result->message; $fields['message'] = $result->message;
@@ -628,7 +644,6 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "ReassignCase": case "ReassignCase":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$caseId = $frm["CASE_ID"]; $caseId = $frm["CASE_ID"];
@@ -636,8 +651,10 @@ switch ($_POST ['action']) {
$userIdSource = $frm['USERIDSOURCE']; $userIdSource = $frm['USERIDSOURCE'];
$userIdTarget = $frm['USERIDTARGET']; $userIdTarget = $frm['USERIDTARGET'];
$params = array ('sessionId' => $sessionId, 'caseId' => $caseId, 'delIndex' => $delIndex, 'userIdSource' => $userIdSource, 'userIdTarget' => $userIdTarget ); $params = array ('sessionId' => $sessionId,'caseId' => $caseId,'delIndex' => $delIndex,'userIdSource' => $userIdSource,'userIdTarget' => $userIdTarget
$result = $client->__SoapCall ( 'reassignCase', array ($params ) ); );
$result = $client->__SoapCall( 'reassignCase', array ($params
) );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code; $fields['status_code'] = $result->status_code;
@@ -650,9 +667,7 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "NewCaseImpersonate": case "NewCaseImpersonate":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$processId = $frm["PROCESS_ID"]; $processId = $frm["PROCESS_ID"];
@@ -664,8 +679,10 @@ switch ($_POST ['action']) {
$o->value = $aRow['VALUE']; $o->value = $aRow['VALUE'];
array_push( $variables, $o ); array_push( $variables, $o );
} }
$params = array ('sessionId' => $sessionId, 'processId' => $processId, 'userId' => $userId, 'variables' => $variables ); $params = array ('sessionId' => $sessionId,'processId' => $processId,'userId' => $userId,'variables' => $variables
$result = $client->__SoapCall ( 'NewCaseImpersonate', array ($params ) ); );
$result = $client->__SoapCall( 'NewCaseImpersonate', array ($params
) );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code; $fields['status_code'] = $result->status_code;
$fields['message'] = $result->message; $fields['message'] = $result->message;
@@ -678,7 +695,6 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "NewCase": case "NewCase":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$processId = $frm["PROCESS_ID"]; $processId = $frm["PROCESS_ID"];
@@ -691,8 +707,10 @@ switch ($_POST ['action']) {
$o->value = $aRow['VALUE']; $o->value = $aRow['VALUE'];
array_push( $variables, $o ); array_push( $variables, $o );
} }
$params = array ('sessionId' => $sessionId, 'processId' => $processId, 'taskId' => $taskId, 'variables' => $variables ); $params = array ('sessionId' => $sessionId,'processId' => $processId,'taskId' => $taskId,'variables' => $variables
$result = $client->__SoapCall ( 'NewCase', array ($params ) ); );
$result = $client->__SoapCall( 'NewCase', array ($params
) );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
@@ -710,13 +728,14 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "AssignUserToGroup": case "AssignUserToGroup":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$userId = $frm["USER_ID"]; $userId = $frm["USER_ID"];
$groupId = $frm["GROUP_ID"]; $groupId = $frm["GROUP_ID"];
$params = array ('sessionId' => $sessionId, 'userId' => $userId, 'groupId' => $groupId ); $params = array ('sessionId' => $sessionId,'userId' => $userId,'groupId' => $groupId
$result = $client->__SoapCall ( 'AssignUserToGroup', array ($params ) ); );
$result = $client->__SoapCall( 'AssignUserToGroup', array ($params
) );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code; $fields['status_code'] = $result->status_code;
$fields['message'] = $result->message; $fields['message'] = $result->message;
@@ -729,7 +748,6 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "CreateUser": case "CreateUser":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$userId = $frm["USER_ID"]; $userId = $frm["USER_ID"];
@@ -739,8 +757,10 @@ switch ($_POST ['action']) {
$role = $frm["ROLE"]; $role = $frm["ROLE"];
$password = $frm["PASSWORD"]; $password = $frm["PASSWORD"];
$params = array ('sessionId' => $sessionId, 'userId' => $userId, 'firstname' => $firstname, 'lastname' => $lastname, 'email' => $email, 'role' => $role, 'password' => $password ); $params = array ('sessionId' => $sessionId,'userId' => $userId,'firstname' => $firstname,'lastname' => $lastname,'email' => $email,'role' => $role,'password' => $password
$result = $client->__SoapCall ( 'CreateUser', array ($params ) ); );
$result = $client->__SoapCall( 'CreateUser', array ($params
) );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code; $fields['status_code'] = $result->status_code;
$fields['message'] = $result->message; $fields['message'] = $result->message;
@@ -753,15 +773,17 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "TaskList": case "TaskList":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId ); $params = array ('sessionId' => $sessionId
$wsResponse = $client->__SoapCall ( 'TaskList', array ($params ) ); );
$wsResponse = $client->__SoapCall( 'TaskList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'tasks' ); $result = G::PMWSCompositeResponse( $wsResponse, 'tasks' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char' ); $rows[] = array ('guid' => 'char','name' => 'char'
);
if (is_array( $result )) { if (is_array( $result )) {
@@ -787,7 +809,8 @@ switch ($_POST ['action']) {
$name = $item->name; $name = $item->name;
} }
$rows [] = array ('guid' => $guid, 'name' => $name ); $rows[] = array ('guid' => $guid,'name' => $name
);
} }
global $_DBArray; global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : ''); $_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
@@ -808,16 +831,18 @@ switch ($_POST ['action']) {
} }
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "TriggerList": case "TriggerList":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId ); $params = array ('sessionId' => $sessionId
);
$wsResponse = $client->__SoapCall ( 'triggerList', array ($params ) ); $wsResponse = $client->__SoapCall( 'triggerList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'triggers' ); $result = G::PMWSCompositeResponse( $wsResponse, 'triggers' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char', 'processId' => 'char' ); $rows[] = array ('guid' => 'char','name' => 'char','processId' => 'char'
);
if (is_array( $result )) { if (is_array( $result )) {
foreach ($result as $key => $item) { foreach ($result as $key => $item) {
@@ -847,7 +872,8 @@ switch ($_POST ['action']) {
if (isset( $item->processId )) if (isset( $item->processId ))
$processId = $item->processId; $processId = $item->processId;
} }
$rows [] = array ('guid' => $guid, 'name' => $name, 'processId' => $processId ); $rows[] = array ('guid' => $guid,'name' => $name,'processId' => $processId
);
} }
global $_DBArray; global $_DBArray;
@@ -882,19 +908,21 @@ switch ($_POST ['action']) {
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "InputDocumentList": case "InputDocumentList":
$caseId = $frm["CASE_ID"]; $caseId = $frm["CASE_ID"];
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId, 'caseId' => $caseId ); $params = array ('sessionId' => $sessionId,'caseId' => $caseId
);
$wsResponse = $client->__SoapCall ( 'InputDocumentList', array ($params ) ); $wsResponse = $client->__SoapCall( 'InputDocumentList', array ($params
) );
//g::pr($wsResponse); //g::pr($wsResponse);
$result = G::PMWSCompositeResponse( $wsResponse, 'documents' ); $result = G::PMWSCompositeResponse( $wsResponse, 'documents' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char', 'processId' => 'char' ); $rows[] = array ('guid' => 'char','name' => 'char','processId' => 'char'
);
if (is_array( $result )) { if (is_array( $result )) {
foreach ($result as $key => $item) { foreach ($result as $key => $item) {
@@ -954,23 +982,26 @@ switch ($_POST ['action']) {
if (isset( $item->link )) if (isset( $item->link ))
$link = $item->link; $link = $item->link;
} }
$rows [] = array ('guid' => $guid, 'filename' => $filename, 'docId' => $docId, 'version' => $version, $rows[] = array ('guid' => $guid,'filename' => $filename,'docId' => $docId,'version' => $version,'createDate' => $createDate,'createBy' => $createBy,'type' => $type,'link' => $link
'createDate' => $createDate, 'createBy' => $createBy, 'type' => $type, 'link' => $link ); );
} }
global $_DBArray; global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : ''); $_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
$_DBArray['inputDocument'] = $rows; $_DBArray['inputDocument'] = $rows;
$documentArray = array (); $documentArray = array ();
$documentArray[] = array ('guid' => 'char', 'filename' => 'char' ); $documentArray[] = array ('guid' => 'char','filename' => 'char'
);
if (isset( $_DBArray['inputDocument'] )) if (isset( $_DBArray['inputDocument'] ))
foreach ($_DBArray['inputDocument'] as $key => $val) foreach ($_DBArray['inputDocument'] as $key => $val)
if ($key != 0 && isset( $val['filename'] )) if ($key != 0 && isset( $val['filename'] ))
$documentArray[] = array ('guid' => $val['guid'], 'filename' => $val['filename'] ); $documentArray[] = array ('guid' => $val['guid'],'filename' => $val['filename']
);
if (isset( $_DBArray['outputDocument'] )) if (isset( $_DBArray['outputDocument'] ))
foreach ($_DBArray['outputDocument'] as $key => $val) foreach ($_DBArray['outputDocument'] as $key => $val)
if ($key != 0 && isset( $val['filename'] )) if ($key != 0 && isset( $val['filename'] ))
$documentArray[] = array ('guid' => $val['guid'], 'filename' => $val['filename'] ); $documentArray[] = array ('guid' => $val['guid'],'filename' => $val['filename']
);
$_DBArray['documents'] = $documentArray; $_DBArray['documents'] = $documentArray;
$_DBArray['WS_TMP_CASE_UID'] = $frm["CASE_ID"]; $_DBArray['WS_TMP_CASE_UID'] = $frm["CASE_ID"];
$_SESSION['_DBArray'] = $_DBArray; $_SESSION['_DBArray'] = $_DBArray;
@@ -989,19 +1020,20 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
} }
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "InputDocumentProcessList": case "InputDocumentProcessList":
$processId = $frm["PROCESS_ID"]; $processId = $frm["PROCESS_ID"];
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId, 'processId' => $processId ); $params = array ('sessionId' => $sessionId,'processId' => $processId
);
$wsResponse = $client->__SoapCall ( 'InputDocumentProcessList', array ($params ) ); $wsResponse = $client->__SoapCall( 'InputDocumentProcessList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'documents' ); $result = G::PMWSCompositeResponse( $wsResponse, 'documents' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char', 'description' => 'char' ); $rows[] = array ('guid' => 'char','name' => 'char','description' => 'char'
);
if (is_array( $result )) { if (is_array( $result )) {
foreach ($result as $key => $item) { foreach ($result as $key => $item) {
if (isset( $item->item )) if (isset( $item->item ))
@@ -1030,7 +1062,8 @@ switch ($_POST ['action']) {
if (isset( $item->description )) if (isset( $item->description ))
$description = $item->description; $description = $item->description;
} }
$rows [] = array ('guid' => $guid, 'name' => $name, 'description' => $description ); $rows[] = array ('guid' => $guid,'name' => $name,'description' => $description
);
} }
global $_DBArray; global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : ''); $_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
@@ -1051,19 +1084,20 @@ switch ($_POST ['action']) {
} }
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "OutputDocumentList": case "OutputDocumentList":
$caseId = $frm["CASE_ID"]; $caseId = $frm["CASE_ID"];
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId, 'caseId' => $caseId ); $params = array ('sessionId' => $sessionId,'caseId' => $caseId
);
$wsResponse = $client->__SoapCall ( 'outputDocumentList', array ($params ) ); $wsResponse = $client->__SoapCall( 'outputDocumentList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'documents' ); $result = G::PMWSCompositeResponse( $wsResponse, 'documents' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$rows = array (); $rows = array ();
$rows [] = array ('guid' => 'char', 'name' => 'char' ); $rows[] = array ('guid' => 'char','name' => 'char'
);
if (is_array( $result )) { if (is_array( $result )) {
foreach ($result as $key => $item) { foreach ($result as $key => $item) {
@@ -1123,22 +1157,25 @@ switch ($_POST ['action']) {
if (isset( $item->link )) if (isset( $item->link ))
$link = $item->link; $link = $item->link;
} }
$rows [] = array ('guid' => $guid, 'filename' => $filename, 'docId' => $docId, 'version' => $version, $rows[] = array ('guid' => $guid,'filename' => $filename,'docId' => $docId,'version' => $version,'createDate' => $createDate,'createBy' => $createBy,'type' => $type,'link' => $link
'createDate' => $createDate, 'createBy' => $createBy, 'type' => $type, 'link' => $link ); );
} }
global $_DBArray; global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : ''); $_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
$_DBArray['outputDocument'] = $rows; $_DBArray['outputDocument'] = $rows;
$documentArray = array (); $documentArray = array ();
$documentArray[] = array ('guid' => 'char', 'filename' => 'char' ); $documentArray[] = array ('guid' => 'char','filename' => 'char'
);
if (isset( $_DBArray['inputDocument'] )) if (isset( $_DBArray['inputDocument'] ))
foreach ($_DBArray['inputDocument'] as $key => $val) foreach ($_DBArray['inputDocument'] as $key => $val)
if ($key != 0 && isset( $val['filename'] )) if ($key != 0 && isset( $val['filename'] ))
$documentArray[] = array ('guid' => $val['guid'], 'filename' => $val['filename'] ); $documentArray[] = array ('guid' => $val['guid'],'filename' => $val['filename']
);
if (isset( $_DBArray['outputDocument'] )) if (isset( $_DBArray['outputDocument'] ))
foreach ($_DBArray['outputDocument'] as $key => $val) foreach ($_DBArray['outputDocument'] as $key => $val)
if ($key != 0 && isset( $val['filename'] )) if ($key != 0 && isset( $val['filename'] ))
$documentArray[] = array ('guid' => $val['guid'], 'filename' => $val['filename'] ); $documentArray[] = array ('guid' => $val['guid'],'filename' => $val['filename']
);
$_DBArray['documents'] = $documentArray; $_DBArray['documents'] = $documentArray;
$_SESSION['_DBArray'] = $_DBArray; $_SESSION['_DBArray'] = $_DBArray;
@@ -1162,8 +1199,10 @@ case "removeUserFromGroup" :
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$userId = $frm["USER_ID"]; $userId = $frm["USER_ID"];
$groupId = $frm["GROUP_ID"]; $groupId = $frm["GROUP_ID"];
$params = array ('sessionId' => $sessionId, 'userId' => $userId, 'groupId' => $groupId ); $params = array ('sessionId' => $sessionId,'userId' => $userId,'groupId' => $groupId
$result = $client->__SoapCall ( 'removeUserFromGroup', array ($params ) ); );
$result = $client->__SoapCall( 'removeUserFromGroup', array ($params
) );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code; $fields['status_code'] = $result->status_code;
$fields['message'] = $result->message; $fields['message'] = $result->message;
@@ -1179,8 +1218,10 @@ case "removeUserFromGroup" :
case "RemoveDocument": case "RemoveDocument":
$appDocUid = $frm["APP_DOC_UID"]; $appDocUid = $frm["APP_DOC_UID"];
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId, 'appDocUid' => $appDocUid ); $params = array ('sessionId' => $sessionId,'appDocUid' => $appDocUid
$result = $client->__SoapCall ( 'RemoveDocument', array ($params ) ); );
$result = $client->__SoapCall( 'RemoveDocument', array ($params
) );
$fields['status_code'] = $result->status_code; $fields['status_code'] = $result->status_code;
$fields['message'] = $result->message; $fields['message'] = $result->message;
$fields['time_stamp'] = $result->timestamp; $fields['time_stamp'] = $result->timestamp;
@@ -1193,43 +1234,54 @@ case "removeUserFromGroup" :
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "TaskCase": case "TaskCase":
$sessionId = $frm["SESSION_ID"]; $sessionId = $frm["SESSION_ID"];
$caseId = $frm["CASE_ID"]; $caseId = $frm["CASE_ID"];
$params = array ('sessionId' => $sessionId, 'caseId' => $caseId ); $params = array ('sessionId' => $sessionId,'caseId' => $caseId
$wsResponse = $client->__SoapCall ( 'TaskCase', array ($params ) ); );
$wsResponse = $client->__SoapCall( 'TaskCase', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'taskCases' ); $result = G::PMWSCompositeResponse( $wsResponse, 'taskCases' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char' ); $rows[] = array ('guid' => 'char','name' => 'char'
);
if (is_array( $result )) { if (is_array( $result )) {
foreach ($result as $key => $item) { foreach ($result as $key => $item) {
if (isset( $item->item )) if (isset( $item->item ))
foreach ($item->item as $index => $val) { foreach ($item->item as $index => $val) {
if ($val->key == 'guid') if ($val->key == 'guid') {
$guid = $val->value; $guid = $val->value;
if ($val->key == 'name') }
if ($val->key == 'name') {
$name = $val->value; $name = $val->value;
} }
}
else if (is_array( $item )) else if (is_array( $item ))
foreach ($item as $index => $val) { foreach ($item as $index => $val) {
if ($val->key == 'guid') if ($val->key == 'guid')
$guid = $val->value; $guid = $val->value;
if ($val->key == 'name') }
if ($val->key == 'name') {
$name = $val->value; $name = $val->value;
} }
else { }
if (isset ( $item->guid )) else
{
if (isset( $item->guid )) {
$guid = $item->guid; $guid = $item->guid;
if (isset ( $item->name )) }
if (isset( $item->name )) {
$name = $item->name; $name = $item->name;
} }
}
$rows [] = array ('guid' => $guid, 'name' => $name ); $rows[] = array ('guid' => $guid,'name' => $name
);
} }
global $_DBArray; global $_DBArray;
@@ -1242,7 +1294,9 @@ case "removeUserFromGroup" :
$c->setDBArrayTable( 'taskCases' ); $c->setDBArrayTable( 'taskCases' );
$c->addAscendingOrderByColumn( 'name' ); $c->addAscendingOrderByColumn( 'name' );
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrTaskCase', $c ); $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrTaskCase', $c );
} else if ( is_object($result) ){ } else
if (is_object( $result )) {
$_SESSION['WS_SESSION_ID'] = ''; $_SESSION['WS_SESSION_ID'] = '';
$fields['status_code'] = $result->status_code; $fields['status_code'] = $result->status_code;
$fields['message'] = $result->message; $fields['message'] = $result->message;
@@ -1252,8 +1306,9 @@ case "removeUserFromGroup" :
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; break;
case "wsSendFiles": case "wsSendFiles":
if (isset( $_FILES['form'] )) { if (isset( $_FILES['form'] )) {
foreach ($_FILES['form']['name'] as $sFieldName => $vValue) { foreach ($_FILES['form']['name'] as $sFieldName => $vValue) {
if ($_FILES['form']['error'][$sFieldName] == 0) { if ($_FILES['form']['error'][$sFieldName] == 0) {
@@ -1268,7 +1323,6 @@ case "removeUserFromGroup" :
$_POST['form']['INPUT_DOCUMENT'] = ''; $_POST['form']['INPUT_DOCUMENT'] = '';
} }
if (isset( $_SESSION['_DBArray']['inputDocument'] )) { if (isset( $_SESSION['_DBArray']['inputDocument'] )) {
foreach ($_SESSION['_DBArray']['inputDocument'] as $inputDocument) { foreach ($_SESSION['_DBArray']['inputDocument'] as $inputDocument) {
if ($inputDocument['guid'] == $_POST['form']['INPUT_DOCUMENT']) { if ($inputDocument['guid'] == $_POST['form']['INPUT_DOCUMENT']) {
@@ -1285,24 +1339,17 @@ case "removeUserFromGroup" :
$app_uid = $_SESSION['_DBArray']['WS_TMP_CASE_UID']; $app_uid = $_SESSION['_DBArray']['WS_TMP_CASE_UID'];
$del_index = 1; $del_index = 1;
function sendFile($FILENAME, $USR_UID, $APP_UID, $DEL_INDEX = 1, $DOC_UID = NULL, $title = NULL, $comment = NULL) { function sendFile ($FILENAME, $USR_UID, $APP_UID, $DEL_INDEX = 1, $DOC_UID = null, $title = null, $comment = null)
{
$defaultEndpoint = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/classic/services/upload'; $defaultEndpoint = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/classic/services/upload';
$upload = isset( $_SESSION['END_POINT'] ) ? $_SESSION['END_POINT'] : $defaultEndpoint; $upload = isset( $_SESSION['END_POINT'] ) ? $_SESSION['END_POINT'] : $defaultEndpoint;
$DOC_UID = ($DOC_UID != NULL) ? $DOC_UID : - 1; $DOC_UID = ($DOC_UID != null) ? $DOC_UID : - 1;
$APP_DOC_TYPE = ($DOC_UID == - 1) ? 'ATTACHED' : 'INPUT'; $APP_DOC_TYPE = ($DOC_UID == - 1) ? 'ATTACHED' : 'INPUT';
$title = ($title != NULL) ? $title : $FILENAME; $title = ($title != null) ? $title : $FILENAME;
$comment = ($comment != NULL) ? $comment : ''; $comment = ($comment != null) ? $comment : '';
$params = array ( $params = array ('ATTACH_FILE' => "@$FILENAME",'APPLICATION' => $APP_UID,'INDEX' => $DEL_INDEX,'USR_UID' => $USR_UID,'DOC_UID' => $DOC_UID,'APP_DOC_TYPE' => $APP_DOC_TYPE,'TITLE' => $title,'COMMENT' => $comment
'ATTACH_FILE' => "@$FILENAME",
'APPLICATION' => $APP_UID,
'INDEX' => $DEL_INDEX,
'USR_UID' => $USR_UID,
'DOC_UID' => $DOC_UID,
'APP_DOC_TYPE' => $APP_DOC_TYPE,
'TITLE' => $title,
'COMMENT' => $comment
); );
$ch = curl_init(); $ch = curl_init();
@@ -1331,12 +1378,15 @@ case "removeUserFromGroup" :
die(); die();
break; break;
default: default:
print_r( $_POST ); print_r( $_POST );
} }
} }
global $_DBArray;
global $_DBArray;
} catch (Exception $e) { } catch (Exception $e) {
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $e->getMessage(); $aMessage['MESSAGE'] = $e->getMessage();

View File

@@ -20,17 +20,17 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_FACTORY' ) != 1) { if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_FACTORY' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
//G::header('location: ../login/login'); //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 = new Publisher();
$G_PUBLISH->AddContent( 'view', 'setup/webServicesTree' ); $G_PUBLISH->AddContent( 'view', 'setup/webServicesTree' );
G::RenderPage( "publish-raw", "raw" ); G::RenderPage( "publish-raw", "raw" );
?>

View File

@@ -20,9 +20,9 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * 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' );
@@ -32,12 +32,10 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Respons
if (! isset( $_SESSION['END_POINT'] )) { if (! isset( $_SESSION['END_POINT'] )) {
$aFields['WS_HOST'] = $_SERVER['HTTP_HOST']; $aFields['WS_HOST'] = $_SERVER['HTTP_HOST'];
$aFields['WS_WORKSPACE'] = SYS_SYS; $aFields['WS_WORKSPACE'] = SYS_SYS;
} } else {
else {
if (strpos( $_SESSION['END_POINT'], 'https' ) !== false) { if (strpos( $_SESSION['END_POINT'], 'https' ) !== false) {
preg_match( '@^(?:https://)?([^/]+)@i', $_SESSION['END_POINT'], $coincidencias ); preg_match( '@^(?:https://)?([^/]+)@i', $_SESSION['END_POINT'], $coincidencias );
} } else {
else {
preg_match( '@^(?:http://)?([^/]+)@i', $_SESSION['END_POINT'], $coincidencias ); preg_match( '@^(?:http://)?([^/]+)@i', $_SESSION['END_POINT'], $coincidencias );
} }
$aAux = explode( ':', $coincidencias[1] ); $aAux = explode( ':', $coincidencias[1] );
@@ -48,9 +46,12 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Respons
$aFields['WS_WORKSPACE'] = substr( $aAux[1], 3 ); $aFields['WS_WORKSPACE'] = substr( $aAux[1], 3 );
} }
$rows[] = array ( 'uid' => 'char', 'name' => 'char', 'age' => 'integer', 'balance' => 'float' ); $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' => 'http','name' => 'http'
);
$rows[] = array ('uid' => 'https','name' => 'https'
);
$_DBArray['protocol'] = $rows; $_DBArray['protocol'] = $rows;
$_SESSION['_DBArray'] = $_DBArray; $_SESSION['_DBArray'] = $_DBArray;
@@ -60,4 +61,3 @@ $_SESSION['_DBArray'] = $_DBArray;
G::RenderPage( "publish", "raw" ); G::RenderPage( "publish", "raw" );
?>

View File

@@ -1,22 +1,16 @@
<?php <?php
unset( $_SESSION['WS_SESSION_ID'] ); unset( $_SESSION['WS_SESSION_ID'] );
if($_POST['form']['WS_PROTOCOL']!='' && $_POST['form']['WS_WORKSPACE']!='') if ($_POST['form']['WS_PROTOCOL'] != '' && $_POST['form']['WS_WORKSPACE'] != '') {
{ if ($_POST['form']['WS_PORT'] != '') {
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'; $_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' ); G::header( 'location: webServices?x=1' );
} } else {
else $_SESSION['END_POINT'] = $_POST['form']['WS_PROTOCOL'] . '://' . $_POST['form']['WS_HOST'] . '/sys' . $_POST['form']['WS_WORKSPACE'] . '/en/classic/services/wsdl2';
{ $_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' ); G::header( 'location: webServices?x=1' );
} }
$_SESSION['WS_WORKSPACE'] = $_POST['form']['WS_WORKSPACE']; $_SESSION['WS_WORKSPACE'] = $_POST['form']['WS_WORKSPACE'];
} } else {
else
{
G::header( 'location: webServices?x=0' ); G::header( 'location: webServices?x=0' );
} }
?>

View File

@@ -20,31 +20,34 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * 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::LoadInclude( 'ajax' ); 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[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['es'] = array ("Domingo?","Lunes?","Martes?","Miércoles?","Jueves?","Viernes?","Sábado?"
$ARR_WEEKDAYS['fa'] = array('یکشنبه','دوشنبه','سه شنبه','چهارشنبه','پنجشنبه ','جمعه','آدینه'); );
$ARR_WEEKDAYS['en'] = array ("Sunday?","Monday?","Tuesday?","Wednesday?","Thursday?","Friday?","Saturday?"
);
$ARR_WEEKDAYS['fa'] = array ('یکشنبه','دوشنبه','سه شنبه','چهارشنبه','پنجشنبه ','جمعه','آدینه'
);
$dbc = new DBConnection; $dbc = new DBConnection();
$ses = new DBSession( $dbc ); $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 (); $config = array ();
for($id=0;$id<7;$id++) for ($id = 0; $id < 7; $id ++) {
{
$res = $ses->execute( " SELECT * FROM LEXICO WHERE LEX_KEY = '" . $ARR_WEEKDAYS[0][$id] . "' AND LEX_TOPIC ='HOLIDAY' " ); $res = $ses->execute( " SELECT * FROM LEXICO WHERE LEX_KEY = '" . $ARR_WEEKDAYS[0][$id] . "' AND LEX_TOPIC ='HOLIDAY' " );
$res = $res->read(); $res = $res->read();
$config[$ARR_WEEKDAYS[0][$id]] = $res['LEX_VALUE']; $config[$ARR_WEEKDAYS[0][$id]] = $res['LEX_VALUE'];
} }
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/weekend', '', $config, '' ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/weekend', '', $config, '' );
G::RenderPage( 'publish' ); G::RenderPage( 'publish' );
?> ?>

View File

@@ -20,9 +20,9 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * 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::ForceLogin( 'WF_PROCESS' );
G::LoadInclude( 'ajax' ); G::LoadInclude( 'ajax' );
@@ -36,14 +36,15 @@ $G_ID_MENU_SELECTED = "SETUP";
$G_ID_SUB_MENU_SELECTED = "ENVIRONMENT"; $G_ID_SUB_MENU_SELECTED = "ENVIRONMENT";
$G_ID_THIRD_MENU_SELECTED = "WEEKEND"; $G_ID_THIRD_MENU_SELECTED = "WEEKEND";
$dbc = new DBConnection; $dbc = new DBConnection();
$ses = new DBSession( $dbc ); $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' ) ); $funcion = strtolower( get_ajax_value( 'function' ) );
$funcions = get_defined_functions(); $funcions = get_defined_functions();
if (in_array($funcion,$funcions['user'])) eval($funcion.'();'); if (in_array( $funcion, $funcions['user'] ))
eval( $funcion . '();' );
function setDays () function setDays ()
{ {
@@ -54,6 +55,7 @@ function setDays()
for ($r = 1; $r < sizeof( $days ); $r ++) for ($r = 1; $r < sizeof( $days ); $r ++)
setDay( $days[$r], $values[$r] ); setDay( $days[$r], $values[$r] );
} }
function setDay ($day, $dayValue) function setDay ($day, $dayValue)
{ {
global $ses; global $ses;
@@ -67,4 +69,4 @@ function setDay($day,$dayValue)
$res = $res->read(); $res = $res->read();
echo ($res['LEX_VALUE'] == '1') ? 'true' : 'false'; echo ($res['LEX_VALUE'] == '1') ? 'true' : 'false';
} }
?>

View File

@@ -1,13 +1,10 @@
function abc(panel, txt) { function abc(panel, txt) {
/* commonDialog ( '', 'saved' , 'saved', {}, '' ) ; /*
setTimeout ( leimnud.closure({instance:myDialog,method:function(panel){ * commonDialog ( '', 'saved' , 'saved', {}, '' ) ; setTimeout (
* leimnud.closure({instance:myDialog,method:function(panel){
myDialog.remove(); *
panel.tabLastSelected=false; * myDialog.remove(); panel.tabLastSelected=false; panel.tabSelected=1;
panel.tabSelected=1; * panel.makeTab(); },args:panel}) , 1000 );
panel.makeTab();
},args:panel}) , 1000 );
*/ */
var img = document.getElementById('workPeriodGraph'); var img = document.getElementById('workPeriodGraph');
img.src = 'workPeriodGraph?b=' + Math.random(); img.src = 'workPeriodGraph?b=' + Math.random();
@@ -17,4 +14,3 @@ function abc( panel, txt ) {
return false; return false;
} }

View File

@@ -20,14 +20,14 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * 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_ENABLE_BLANK_SKIN = true; $G_ENABLE_BLANK_SKIN = true;
G::LoadClass( "workPeriod" ); G::LoadClass( "workPeriod" );
$dbc = new DBConnection; $dbc = new DBConnection();
$ses = new DBSession( $dbc ); $ses = new DBSession( $dbc );
$obj = new workPeriod( $dbc ); $obj = new workPeriod( $dbc );
@@ -41,9 +41,9 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
$row['FRIDAY'] = $row['noWorkingDays'][5]; $row['FRIDAY'] = $row['noWorkingDays'][5];
$row['SATURDAY'] = $row['noWorkingDays'][6]; $row['SATURDAY'] = $row['noWorkingDays'][6];
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( "image", "image", "workPeriodGraph" ); $G_PUBLISH->AddContent( "image", "image", "workPeriodGraph" );
$G_PUBLISH->AddContent( "xmlform", "xmlform", "setup/workPeriod", "", $row, "workPeriodSave" ); $G_PUBLISH->AddContent( "xmlform", "xmlform", "setup/workPeriod", "", $row, "workPeriodSave" );
G::RenderPage( 'publish' ); G::RenderPage( 'publish' );
?>

View File

@@ -20,14 +20,14 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * 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;
Header( "Content-type: image/jpeg" ); Header( "Content-type: image/jpeg" );
G::LoadClass( "workPeriod" ); G::LoadClass( "workPeriod" );
$dbc = new DBConnection; $dbc = new DBConnection();
$ses = new DBSession( $dbc ); $ses = new DBSession( $dbc );
$obj = new workPeriod( $dbc ); $obj = new workPeriod( $dbc );
@@ -60,8 +60,8 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
ImageFilledRectangle( $im, 0, 0, $width - 1, $height - 1, $bgcolor ); ImageFilledRectangle( $im, 0, 0, $width - 1, $height - 1, $bgcolor );
ImageRectangle( $im, 0, 0, $width - 1, $height - 1, $black ); ImageRectangle( $im, 0, 0, $width - 1, $height - 1, $black );
$x = 10;
$x = 10; $y = 20; $y = 20;
$x1 = 78; $x1 = 78;
$x2 = $x1 + 2 * 6; $x2 = $x1 + 2 * 6;
@@ -81,7 +81,8 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
$color = $orange; $color = $orange;
else else
$color = $white; $color = $white;
if ( isset ( $noWorkingDays[ $day ]) && $noWorkingDays[ $day ] ) $color = $white; if (isset( $noWorkingDays[$day] ) && $noWorkingDays[$day])
$color = $white;
ImageFillToBorder( $im, $x1 + $i * 4 + 1, $y + 1, $plomo, $color ); ImageFillToBorder( $im, $x1 + $i * 4 + 1, $y + 1, $plomo, $color );
} }
@@ -98,5 +99,6 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
} }
//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 );
?>

View File

@@ -20,9 +20,9 @@
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * 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::LoadClass( "workPeriod" ); G::LoadClass( "workPeriod" );
$frm = $_POST['form']; $frm = $_POST['form'];
@@ -39,5 +39,5 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
$obj->Save( $frm['initPeriod1'], $frm['endPeriod1'], $frm['initPeriod2'], $frm['endPeriod2'], $noWorkingDays ); $obj->Save( $frm['initPeriod1'], $frm['endPeriod1'], $frm['initPeriod2'], $frm['endPeriod2'], $noWorkingDays );
print "ok"; print "ok";
die; die();
?>