Merge remote branch 'upstream/master'

This commit is contained in:
Julio Cesar Laura
2012-10-17 17:26:35 -04:00
36 changed files with 1831 additions and 1918 deletions

View File

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

View File

@@ -20,40 +20,35 @@
* *
* 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;
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) { if ($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';
$G_SUB_MENU = 'users'; $G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS'; $G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES'; $G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
$fields = array('AUTH_SOURCE_PROVIDER' => $_REQUEST['AUTH_SOURCE_PROVIDER']); $fields = array ('AUTH_SOURCE_PROVIDER' => $_REQUEST['AUTH_SOURCE_PROVIDER']);
$G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher(); if (file_exists( PATH_PLUGINS . $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' )) {
if (class_exists( $fields['AUTH_SOURCE_PROVIDER'] )) {
if (file_exists(PATH_PLUGINS . $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) { $G_PUBLISH->AddContent( 'xmlform', 'xmlform', $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml', '', $fields, '../authSources/authSources_Save' );
if (class_exists($fields['AUTH_SOURCE_PROVIDER'])) { } else {
$G_PUBLISH->AddContent('xmlform', 'xmlform', $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml', '', $fields, '../authSources/authSources_Save'); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => G::LoadTranslation( 'ID_AUTH_SOURCE_MISSING' )) );
} }
else { } else {
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => G::LoadTranslation('ID_AUTH_SOURCE_MISSING'))); if (file_exists( PATH_XMLFORM . 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' )) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save' );
} else {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => 'File: ' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' . ' not exists.') );
} }
} }
else { G::RenderPage( 'publish', 'blank' );
if (file_exists(PATH_XMLFORM . 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
}
else {
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => 'File: ' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' . ' not exists.'));
}
}
G::RenderPage('publish','blank');

View File

@@ -20,48 +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.
*
*/ */
global $RBAC; global $RBAC;
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) { if ($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();
} }
unset($_POST['form']['btnSave']); unset( $_POST['form']['btnSave'] );
$aCommonFields = array('AUTH_SOURCE_UID', $aCommonFields = array ('AUTH_SOURCE_UID','AUTH_SOURCE_NAME','AUTH_SOURCE_PROVIDER','AUTH_SOURCE_SERVER_NAME','AUTH_SOURCE_PORT','AUTH_SOURCE_ENABLED_TLS','AUTH_ANONYMOUS','AUTH_SOURCE_SEARCH_USER','AUTH_SOURCE_PASSWORD','AUTH_SOURCE_VERSION','AUTH_SOURCE_BASE_DN','AUTH_SOURCE_OBJECT_CLASSES','AUTH_SOURCE_ATTRIBUTES');
'AUTH_SOURCE_NAME',
'AUTH_SOURCE_PROVIDER',
'AUTH_SOURCE_SERVER_NAME',
'AUTH_SOURCE_PORT',
'AUTH_SOURCE_ENABLED_TLS',
'AUTH_ANONYMOUS',
'AUTH_SOURCE_SEARCH_USER',
'AUTH_SOURCE_PASSWORD',
'AUTH_SOURCE_VERSION',
'AUTH_SOURCE_BASE_DN',
'AUTH_SOURCE_OBJECT_CLASSES',
'AUTH_SOURCE_ATTRIBUTES');
$aFields = $aData = array(); $aFields = $aData = array ();
foreach ($_POST['form'] as $sField => $sValue) { foreach ($_POST['form'] as $sField => $sValue) {
if (in_array($sField, $aCommonFields)) { if (in_array( $sField, $aCommonFields )) {
$aFields[$sField] = $sValue; $aFields[$sField] = $sValue;
} } else {
else {
$aData[$sField] = $sValue; $aData[$sField] = $sValue;
} }
} }
$aFields['AUTH_SOURCE_DATA'] = $aData; $aFields['AUTH_SOURCE_DATA'] = $aData;
if ($aFields['AUTH_SOURCE_UID'] == '') { if ($aFields['AUTH_SOURCE_UID'] == '') {
$RBAC->createAuthSource($aFields); $RBAC->createAuthSource( $aFields );
} } else {
else { $RBAC->updateAuthSource( $aFields );
$RBAC->updateAuthSource($aFields); }
}
G::header( 'location: authSources_List' );
G::header('location: authSources_List');

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.
*
*/ */
global $RBAC; global $RBAC;
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) { if ($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';
@@ -35,5 +34,6 @@ $G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES'; $G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/authSources_SearchUsers', '', array('AUTH_SOURCE_UID' => $_GET['sUID']), '../authSources/authSources_ImportUsers'); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'authSources/authSources_SearchUsers', '', array ('AUTH_SOURCE_UID' => $_GET['sUID']), '../authSources/authSources_ImportUsers' );
G::RenderPage('publish','blank'); G::RenderPage( 'publish', 'blank' );

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.
*
*/ */
global $RBAC; global $RBAC;
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) { if ($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,13 +33,13 @@ $G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS'; $G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES'; $G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
$aAuthSourceTypes = array(array('sType' => 'char', 'sLabel' => 'char')); $aAuthSourceTypes = array (array ('sType' => 'char','sLabel' => 'char'));
$oDirectory = dir(PATH_RBAC . 'plugins' . PATH_SEP); $oDirectory = dir( PATH_RBAC . 'plugins' . PATH_SEP );
while($sObject = $oDirectory->read()) { while ($sObject = $oDirectory->read()) {
if (($sObject != '.') && ($sObject != '..') && ($sObject != '.svn') && ($sObject != 'ldap')) { if (($sObject != '.') && ($sObject != '..') && ($sObject != '.svn') && ($sObject != 'ldap')) {
if (is_file(PATH_RBAC . 'plugins' . PATH_SEP . $sObject)) { if (is_file( PATH_RBAC . 'plugins' . PATH_SEP . $sObject )) {
$sType = trim(str_replace('class.', '', str_replace('.php', '', $sObject))); $sType = trim( str_replace( 'class.', '', str_replace( '.php', '', $sObject ) ) );
$aAuthSourceTypes[] = array('sType' => $sType, 'sLabel' => $sType); $aAuthSourceTypes[] = array ('sType' => $sType,'sLabel' => $sType );
} }
} }
} }
@@ -49,6 +48,7 @@ $_DBArray['authSourceTypes'] = $aAuthSourceTypes;
$_SESSION['_DBArray'] = $_DBArray; $_SESSION['_DBArray'] = $_DBArray;
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('authSources/authSourcesListNew', true); //adding a javascript file .js $oHeadPublisher->addExtJsScript( 'authSources/authSourcesListNew', true ); //adding a javascript file .js
G::RenderPage('publish', 'extJs'); G::RenderPage( 'publish', 'extJs' );

View File

@@ -27,7 +27,6 @@ if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
G::header( 'location: ../login/login' ); G::header( 'location: ../login/login' );
die(); die();
} }
$G_MAIN_MENU = 'processmaker'; $G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users'; $G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS'; $G_ID_MENU_SELECTED = 'USERS';

View File

@@ -20,16 +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)
$G_ENABLE_BLANK_SKIN = true; return $RBAC_Response;
$G_ENABLE_BLANK_SKIN = true;
$dbc = new DBConnection; $dbc = new DBConnection();
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'pagedtable', 'paged-table', "setup/holidayList" ); $G_PUBLISH->AddContent( 'pagedtable', 'paged-table', "setup/holidayList" );
G::RenderPage( 'publish' ); G::RenderPage( 'publish' );
?>

View File

@@ -20,17 +20,16 @@
* *
* 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)
$G_ENABLE_BLANK_SKIN = true; return $RBAC_Response;
$G_ENABLE_BLANK_SKIN = true;
$dbc = new DBConnection; $dbc = new DBConnection();
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$fields['DATE'] = date('Y-m-d'); $fields['DATE'] = date( 'Y-m-d' );
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', "setup/holiday", '', $fields, "holidaySave"); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', "setup/holiday", '', $fields, "holidaySave" );
G::RenderPage( 'publish' ); G::RenderPage( 'publish' );
?>

View File

@@ -20,9 +20,7 @@
* *
* 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.
*
*/ */
$newFile = str_replace ( 'index.php', 'setup.php' , __FILE__ ) ; $newFile = str_replace( 'index.php', 'setup.php', __FILE__ );
return $newFile; return $newFile;

View File

@@ -1,106 +1,105 @@
<?php <?php
G::LoadClass ( 'jasperReports' ); G::LoadClass( 'jasperReports' );
$oJasper = new jasperReports( '192.168.0.51', 8080, 'jasperadmin', 'jasperadmin' ); $oJasper = new jasperReports( '192.168.0.51', 8080, 'jasperadmin', 'jasperadmin' );
$response = $oJasper->ws_list("/"); $response = $oJasper->ws_list( "/" );
if (is_object($response) && get_class($response) == 'SOAP_Fault') { if (is_object( $response ) && get_class( $response ) == 'SOAP_Fault') {
$errorMessage = $response->getFault()->faultstring; $errorMessage = $response->getFault()->faultstring;
} } else {
else { $folders = $oJasper->getResourceDescriptors( $response );
$folders = $oJasper->getResourceDescriptors($response); }
}
//$result = $oJasper->ws_put(); //$result = $oJasper->ws_put();
krumo ($response); krumo( $response );
//execute a report //execute a report
$currentUri = "/reports/samples/Employees";
$result = $oJasper->ws_get($currentUri);
$folders = $oJasper->getResourceDescriptors($result); $currentUri = "/reports/samples/Employees";
$result = $oJasper->ws_get( $currentUri );
if (count($folders) != 1 || $folders[0]['type'] != 'reportUnit') $folders = $oJasper->getResourceDescriptors( $result );
{
if (count( $folders ) != 1 || $folders[0]['type'] != 'reportUnit') {
echo "<H1>Invalid RU ($currentUri)</H1>"; echo "<H1>Invalid RU ($currentUri)</H1>";
echo "<pre>$result</pre>"; echo "<pre>$result</pre>";
exit(); exit();
}
$reportUnit = $folders[0];
// 2. Prepare the parameters array looking in the $_GET for params
// starting with PARAM_ ...
//
$report_params = array ();
$moveToPage = "jasper?uri=$currentUri";
foreach (array_keys( $_GET ) as $param_name) {
if (strncmp( "PARAM_", $param_name, 6 ) == 0) {
$report_params[substr( $param_name, 6 )] = $_GET[$param_name];
} }
$reportUnit = $folders[0]; // if ($param_name != "page" && $param_name != "uri") {
// $moveToPage .= "&".urlencode($param_name)."=". urlencode($_GET[$param_name]);
// }
}
// 2. Prepare the parameters array looking in the $_GET for params $formatReport = RUN_OUTPUT_FORMAT_XML;
// starting with PARAM_ ... $formatReport = RUN_OUTPUT_FORMAT_CSV;
// $formatReport = RUN_OUTPUT_FORMAT_RTF;
$formatReport = RUN_OUTPUT_FORMAT_PDF;
$formatReport = RUN_OUTPUT_FORMAT_HTML;
$moveToPage .= "&page=";
$report_params = array(); // 3. Execute the report
$output_params = array ();
$output_params[RUN_OUTPUT_FORMAT] = $formatReport;
$moveToPage = "jasper?uri=$currentUri"; if ($formatReport == RUN_OUTPUT_FORMAT_HTML) {
foreach (array_keys($_GET) AS $param_name) {
if (strncmp("PARAM_", $param_name,6) == 0) {
$report_params[substr($param_name,6)] = $_GET[$param_name];
}
// if ($param_name != "page" && $param_name != "uri") {
// $moveToPage .= "&".urlencode($param_name)."=". urlencode($_GET[$param_name]);
// }
}
$formatReport = RUN_OUTPUT_FORMAT_XML;
$formatReport = RUN_OUTPUT_FORMAT_CSV;
$formatReport = RUN_OUTPUT_FORMAT_RTF;
$formatReport = RUN_OUTPUT_FORMAT_PDF;
$formatReport = RUN_OUTPUT_FORMAT_HTML;
$moveToPage .="&page=";
// 3. Execute the report
$output_params = array();
$output_params[RUN_OUTPUT_FORMAT] = $formatReport;
if ( $formatReport == RUN_OUTPUT_FORMAT_HTML) {
//$pageReport = isset ( $_GET['page'] ) ? $_GET['page'] : 1; //$pageReport = isset ( $_GET['page'] ) ? $_GET['page'] : 1;
//$output_params[RUN_OUTPUT_PAGE] = $pageReport; //$output_params[RUN_OUTPUT_PAGE] = $pageReport;
//$output_params[RUN_OUTPUT_IMAGES_URI] = '/sysos/'. SYS_LANG. '/classic'; //$output_params[RUN_OUTPUT_IMAGES_URI] = '/sysos/'. SYS_LANG. '/classic';
} }
$result = $oJasper->ws_runReport($currentUri, $report_params, $output_params, $attachments); $result = $oJasper->ws_runReport( $currentUri, $report_params, $output_params, $attachments );
// 4. // 4.
if (is_object($result) && get_class($result) == 'SOAP_Fault') { if (is_object( $result ) && get_class( $result ) == 'SOAP_Fault') {
$errorMessage = $result->getFault()->faultstring; $errorMessage = $result->getFault()->faultstring;
echo $errorMessage; echo $errorMessage;
exit(); exit();
} }
$operationResult = $oJasper->getOperationResult($result); $operationResult = $oJasper->getOperationResult( $result );
if ($operationResult['returnCode'] != '0') { if ($operationResult['returnCode'] != '0') {
echo "Error executing the report:<br><font color=\"red\">".$operationResult['returnMessage']."</font>"; echo "Error executing the report:<br><font color=\"red\">" . $operationResult['returnMessage'] . "</font>";
exit(); exit();
} }
if (is_array($attachments)) if (is_array( $attachments )) {
{
//krumo ($attachments); //krumo ($attachments);
switch ($formatReport) {
case RUN_OUTPUT_FORMAT_PDF :
header ( "Content-type: application/pdf" );
echo( $attachments["cid:report"]);
break;
case RUN_OUTPUT_FORMAT_HTML : switch ($formatReport) {
case RUN_OUTPUT_FORMAT_PDF:
header( "Content-type: application/pdf" );
echo ($attachments["cid:report"]);
break;
case RUN_OUTPUT_FORMAT_HTML:
// 1. Save attachments.... // 1. Save attachments....
// 2. Print the report.... // 2. Print the report....
header ( "Content-type: text/html"); header( "Content-type: text/html" );
foreach (array_keys($attachments) as $key) { foreach (array_keys( $attachments ) as $key) {
if ($key != "cid:report") { if ($key != "cid:report") {
$f = fopen("images/".substr($key,4),"w"); $f = fopen( "images/" . substr( $key, 4 ), "w" );
fwrite($f, $attachments[$key]); fwrite( $f, $attachments[$key] );
fclose($f); fclose( $f );
} }
} }
@@ -108,32 +107,30 @@
$prevpage = ($pageReport > 0) ? $pageReport - 1 : 0; $prevpage = ($pageReport > 0) ? $pageReport - 1 : 0;
$nextpage = $pageReport + 1; $nextpage = $pageReport + 1;
echo "<a href=\"".$moveToPage.$prevpage."\">Prev page</a> | <a href=\"".$moveToPage.$nextpage."\">Next page</a>"; echo "<a href=\"" . $moveToPage . $prevpage . "\">Prev page</a> | <a href=\"" . $moveToPage . $nextpage . "\">Next page</a>";
echo "</center><hr>"; echo "</center><hr>";
echo $attachments["cid:report"]; echo $attachments["cid:report"];
//print_r(array_keys($attachments)); //print_r(array_keys($attachments));
break; break;
case RUN_OUTPUT_FORMAT_CSV:
case RUN_OUTPUT_FORMAT_CSV : case RUN_OUTPUT_FORMAT_XLS:
case RUN_OUTPUT_FORMAT_XLS : header( 'Content-type: application/xls' );
header ( 'Content-type: application/xls' ); header( 'Content-Disposition: attachment; filename="report.xls"' );
header ( 'Content-Disposition: attachment; filename="report.xls"'); echo ($attachments["cid:report"]);
echo( $attachments["cid:report"]);
break; break;
case RUN_OUTPUT_FORMAT_RTF:
case RUN_OUTPUT_FORMAT_RTF : header( 'Content-type: text/rtf' );
header ( 'Content-type: text/rtf' ); header( 'Content-Disposition: attachment; filename="report.rtf"' );
header ( 'Content-Disposition: attachment; filename="report.rtf"'); echo ($attachments["cid:report"]);
echo( $attachments["cid:report"]);
break; break;
default:
default :
//header ( 'Content-type: application/xls' ); //header ( 'Content-type: application/xls' );
//header ( 'Content-Disposition: attachment; filename="report.xls"'); //header ( 'Content-Disposition: attachment; filename="report.xls"');
echo( $attachments["cid:report"]); echo ($attachments["cid:report"]);
break; break;
} }
exit(); exit();
} } else
else echo "No attachment found!"; echo "No attachment found!";

View File

@@ -20,16 +20,16 @@
* *
* 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)
$G_ENABLE_BLANK_SKIN = true; return $RBAC_Response;
$G_ENABLE_BLANK_SKIN = true;
$dbc = new DBConnection; $dbc = new DBConnection();
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( "xmlform", "xmlform", "setup/language","", "" , "language_save" ); $G_PUBLISH->AddContent( "xmlform", "xmlform", "setup/language", "", "", "language_save" );
$G_PUBLISH->AddContent( "xmlform", "pagedTable", "setup/language_table","","", "../setup/languageAjax.php" ); $G_PUBLISH->AddContent( "xmlform", "pagedTable", "setup/language_table", "", "", "../setup/languageAjax.php" );
G::RenderPage( 'publish' ); G::RenderPage( 'publish' );
?> ?>
<script language="JavaScript"> <script language="JavaScript">
@@ -56,3 +56,4 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
return false; return false;
} }
</script> </script>

View File

@@ -20,32 +20,31 @@
* *
* 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.
*
*/ */
try { try {
G::LoadInclude('ajax'); G::LoadInclude( 'ajax' );
if(isset($_POST['form'])) { if (isset( $_POST['form'] )) {
$_POST = $_POST['form']; $_POST = $_POST['form'];
} }
$_POST['function'] = get_ajax_value('function'); $_POST['function'] = get_ajax_value( 'function' );
switch($_POST['function']) { switch ($_POST['function']) {
case 'savePredetermined': case 'savePredetermined':
require_once "classes/model/Translation.php"; require_once "classes/model/Translation.php";
$tranlationsList = Translation::getTranslationEnvironments(); $tranlationsList = Translation::getTranslationEnvironments();
g::pr($tranlationsList); die; g::pr( $tranlationsList );
if( isset($meta['LAN_ID']) && $meta['LAN_ID'] == $_POST['lang'] ){ die();
if (isset( $meta['LAN_ID'] ) && $meta['LAN_ID'] == $_POST['lang']) {
echo 'The Setting was saved successfully!'; echo 'The Setting was saved successfully!';
} else { } else {
echo 'Some error occured while the setting was being save, try later please.'; echo 'Some error occured while the setting was being save, try later please.';
} }
break; break;
case 'languagesList': case 'languagesList':
require_once 'classes/model/Language.php'; require_once 'classes/model/Language.php';
require_once 'classes/model/IsoCountry.php'; require_once 'classes/model/IsoCountry.php';
require_once 'classes/model/Translation.php'; require_once 'classes/model/Translation.php';
G::loadClass('configuration'); G::loadClass( 'configuration' );
$isoCountry = new isoCountry(); $isoCountry = new isoCountry();
$translationRow = new Translation(); $translationRow = new Translation();
@@ -53,52 +52,53 @@ try {
$translationsEnvList = $translationRow->getTranslationEnvironments(); $translationsEnvList = $translationRow->getTranslationEnvironments();
//print_r($translationsEnvList); die; //print_r($translationsEnvList); die;
$i = 0; $i = 0;
foreach( $translationsEnvList as $locale=>$translationRow) { foreach ($translationsEnvList as $locale => $translationRow) {
$COUNTRY_ID = $translationRow['IC_UID']; $COUNTRY_ID = $translationRow['IC_UID'];
if( $COUNTRY_ID != '' ) { if ($COUNTRY_ID != '') {
$isoCountryRecord = $isoCountry->findById(strtoupper($COUNTRY_ID)); $isoCountryRecord = $isoCountry->findById( strtoupper( $COUNTRY_ID ) );
$flag = strtolower($isoCountryRecord['IC_UID']); $flag = strtolower( $isoCountryRecord['IC_UID'] );
$countryName = $translationRow['HEADERS']['X-Poedit-Country']; $countryName = $translationRow['HEADERS']['X-Poedit-Country'];
} else { } else {
$flag = 'international'; $flag = 'international';
$countryName = G::LoadTranslation('ID_INTERNATIONAL'); $countryName = G::LoadTranslation( 'ID_INTERNATIONAL' );
} }
G::LoadClass ( 'configuration' ); G::LoadClass( 'configuration' );
$conf = new Configurations(); $conf = new Configurations();
$confCasesList = $conf->getConfiguration('casesList','todo'); $confCasesList = $conf->getConfiguration( 'casesList', 'todo' );
//echo date($confCasesList['dateformat'], '2010-01-01'); //echo date($confCasesList['dateformat'], '2010-01-01');
if( isset($confCasesList['dateformat']) ){
$datetime = explode(' ', $translationRow['DATE']);
$date = explode('-', $datetime[0]); if (isset( $confCasesList['dateformat'] )) {
if( count($datetime) == 2 ) $datetime = explode( ' ', $translationRow['DATE'] );
$time = explode(':', $datetime[1]);
if( count($date) == 3 ){ $date = explode( '-', $datetime[0] );
if( count($time) >= 2 ){ if (count( $datetime ) == 2)
$DATE = date($confCasesList['dateformat'], mktime($time[0], $time[1], 0, $date[1], $date[2], $date[0])); $time = explode( ':', $datetime[1] );
if (count( $date ) == 3) {
if (count( $time ) >= 2) {
$DATE = date( $confCasesList['dateformat'], mktime( $time[0], $time[1], 0, $date[1], $date[2], $date[0] ) );
} else { } else {
$DATE = date($confCasesList['dateformat'], mktime(0, 0, 0, $date[1], $date[2], $date[0])); $DATE = date( $confCasesList['dateformat'], mktime( 0, 0, 0, $date[1], $date[2], $date[0] ) );
} }
} else { } else {
$DATE = $translationRow['DATE']; $DATE = $translationRow['DATE'];
} }
$datetime = explode(' ', $translationRow['HEADERS']['PO-Revision-Date']); $datetime = explode( ' ', $translationRow['HEADERS']['PO-Revision-Date'] );
$date = explode('-', $datetime[0]); $date = explode( '-', $datetime[0] );
if( count($datetime) == 2 ) if (count( $datetime ) == 2)
$time = explode(':', $datetime[1]); $time = explode( ':', $datetime[1] );
if( count($date) == 3 ){ if (count( $date ) == 3) {
if( count($time) >= 2 ){ if (count( $time ) >= 2) {
$REV_DATE = date($confCasesList['dateformat'], mktime($time[0], substr($time[1],0,2), 0, $date[1], $date[2], $date[0])); $REV_DATE = date( $confCasesList['dateformat'], mktime( $time[0], substr( $time[1], 0, 2 ), 0, $date[1], $date[2], $date[0] ) );
} else { } else {
$REV_DATE = date($confCasesList['dateformat'], mktime(0, 0, 0, $date[1], $date[2], $date[0])); $REV_DATE = date( $confCasesList['dateformat'], mktime( 0, 0, 0, $date[1], $date[2], $date[0] ) );
} }
} else { } else {
$REV_DATE = $translationRow['HEADERS']['PO-Revision-Date']; $REV_DATE = $translationRow['HEADERS']['PO-Revision-Date'];
@@ -115,59 +115,58 @@ try {
$languagesList[$i]['DATE'] = $DATE; $languagesList[$i]['DATE'] = $DATE;
$languagesList[$i]['LAN_NAME'] = $translationRow['HEADERS']['X-Poedit-Language']; $languagesList[$i]['LAN_NAME'] = $translationRow['HEADERS']['X-Poedit-Language'];
$languagesList[$i]['COUNTRY_NAME'] = $countryName; $languagesList[$i]['COUNTRY_NAME'] = $countryName;
$languagesList[$i]['TRANSLATOR'] = htmlentities($translationRow['HEADERS']['Last-Translator']); $languagesList[$i]['TRANSLATOR'] = htmlentities( $translationRow['HEADERS']['Last-Translator'] );
$languagesList[$i]['REV_DATE'] = $REV_DATE; $languagesList[$i]['REV_DATE'] = $REV_DATE;
$languagesList[$i]['VERSION'] = $translationRow['HEADERS']['Project-Id-Version']; $languagesList[$i]['VERSION'] = $translationRow['HEADERS']['Project-Id-Version'];
$i++; $i ++;
} }
$translationRow = new Translation(); $translationRow = new Translation();
$response->data = $languagesList; $response->data = $languagesList;
print(G::json_encode($response)); print (G::json_encode( $response )) ;
break; break;
case 'delete': case 'delete':
include_once 'classes/model/Translation.php'; include_once 'classes/model/Translation.php';
include_once 'classes/model/Content.php'; include_once 'classes/model/Content.php';
$locale = $_POST['LOCALE']; $locale = $_POST['LOCALE'];
$trn = new Translation(); $trn = new Translation();
if( strpos($locale, Translation::$localeSeparator) ) if (strpos( $locale, Translation::$localeSeparator ))
list($LAN_ID, $IC_UID) = explode(Translation::$localeSeparator, $locale); list ($LAN_ID, $IC_UID) = explode( Translation::$localeSeparator, $locale );
else { else {
$LAN_ID = $locale; $LAN_ID = $locale;
$LAN_ID = ''; $LAN_ID = '';
} }
$oCriteria = new Criteria('workflow'); $oCriteria = new Criteria( 'workflow' );
//$oCriteria->addSelectColumn('COUNT('.ContentPeer::CON_CATEGORY.')'); //$oCriteria->addSelectColumn('COUNT('.ContentPeer::CON_CATEGORY.')');
$oCriteria->addSelectColumn(ContentPeer::CON_CATEGORY); $oCriteria->addSelectColumn( ContentPeer::CON_CATEGORY );
$oCriteria->addSelectColumn(ContentPeer::CON_VALUE); $oCriteria->addSelectColumn( ContentPeer::CON_VALUE );
$oCriteria->add(ContentPeer::CON_LANG, $locale); $oCriteria->add( ContentPeer::CON_LANG, $locale );
$oCriteria->add(ContentPeer::CON_CATEGORY, 'APP_TITLE', Criteria::EQUAL ); $oCriteria->add( ContentPeer::CON_CATEGORY, 'APP_TITLE', Criteria::EQUAL );
$oDataset = ContentPeer::doSelectRS($oCriteria); $oDataset = ContentPeer::doSelectRS( $oCriteria );
$oDataset->next(); $oDataset->next();
$oContent = new Content(); $oContent = new Content();
$aRow = $oDataset->getRow(); $aRow = $oDataset->getRow();
//THERE IS NO ANY CASE STARTED FROM THES LANGUAGE //THERE IS NO ANY CASE STARTED FROM THES LANGUAGE
if( $aRow[0] == 0 ) { //so we can delete this language if ($aRow[0] == 0) { //so we can delete this language
try{ try {
Content::removeLanguageContent($locale); Content::removeLanguageContent( $locale );
$trn->removeTranslationEnvironment($locale); $trn->removeTranslationEnvironment( $locale );
echo G::LoadTranslation('ID_LANGUAGE_DELETED_SUCCESSFULLY'); echo G::LoadTranslation( 'ID_LANGUAGE_DELETED_SUCCESSFULLY' );
} catch (Exception $e){ } catch (Exception $e) {
echo $e->getMessage(); echo $e->getMessage();
} }
} else { } else {
echo str_replace('{0}', $aRow[0], G::LoadTranslation('ID_LANGUAGE_CANT_DELETE')); echo str_replace( '{0}', $aRow[0], G::LoadTranslation( 'ID_LANGUAGE_CANT_DELETE' ) );
} }
break; break;
} }
} catch ( Exception $oException ) { } catch (Exception $oException) {
die($oException->getMessage()); die( $oException->getMessage() );
} }
?>

View File

@@ -20,19 +20,16 @@
* *
* 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.
*
*/ */
$RBAC->requirePermissions('PM_SETUP_ADVANCE'); $RBAC->requirePermissions( 'PM_SETUP_ADVANCE' );
$oHeadPublisher->addExtJsScript('setup/languages', false); //adding a javascript file .js $oHeadPublisher->addExtJsScript( 'setup/languages', false ); //adding a javascript file .js
$oHeadPublisher->addContent('setup/languages'); //adding a html file .html. $oHeadPublisher->addContent( 'setup/languages' ); //adding a html file .html.
$labels = G::getTranslations(Array(
'ID_LAN_PREDETERMINED', 'ID_LANG_INSTALL_UPDATE', 'ID_LAN_LANGUAGE', 'ID_LAN_COUNTRY', 'ID_LAN_UPDATE_DATE', $labels = G::getTranslations( Array ('ID_LAN_PREDETERMINED','ID_LANG_INSTALL_UPDATE','ID_LAN_LANGUAGE','ID_LAN_COUNTRY','ID_LAN_UPDATE_DATE','ID_LAN_REV_DATE','ID_LAN_FILE','ID_LAN_REV_DATE','ID_LAN_VERSION','ID_LAN_GRID_TITLE','ID_LAN_UPLOAD_TITLE','ID_LAN_FILE_WATER_LABEL','ID_EXPORT','ID_UPLOAD','ID_CANCEL','ID_DELETE_LANGUAGE','ID_DELETE_LANGUAGE_CONFIRM','ID_DELETE_LANGUAGE_WARNING','ID_ACTIONS','ID_LAN_LOCALE','ID_LAN_TRANSLATOR','ID_LAN_NUM_RECORDS','ID_UPLOADING_TRANSLATION_FILE'
'ID_LAN_REV_DATE', 'ID_LAN_FILE', 'ID_LAN_REV_DATE', 'ID_LAN_VERSION', 'ID_LAN_GRID_TITLE', 'ID_LAN_UPLOAD_TITLE', ) );
'ID_LAN_FILE_WATER_LABEL', 'ID_EXPORT', 'ID_UPLOAD', 'ID_CANCEL', 'ID_DELETE_LANGUAGE', 'ID_DELETE_LANGUAGE_CONFIRM',
'ID_DELETE_LANGUAGE_WARNING', 'ID_ACTIONS', 'ID_LAN_LOCALE', 'ID_LAN_TRANSLATOR', 'ID_LAN_NUM_RECORDS', 'ID_UPLOADING_TRANSLATION_FILE'
));
//$oHeadPublisher->assign('TRANSLATIONS', $labels); //$oHeadPublisher->assign('TRANSLATIONS', $labels);
G::RenderPage('publish', 'extJs'); G::RenderPage( 'publish', 'extJs' );

View File

@@ -20,25 +20,24 @@
* *
* 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.
*
*/ */
//print_r($_GET['LAN_ID']); //print_r($_GET['LAN_ID']);
require_once 'classes/model/Language.php'; require_once 'classes/model/Language.php';
require_once 'classes/model/Content.php'; require_once 'classes/model/Content.php';
$kk = new Criteria();
$kk=new Criteria(); $kk->add( ContentPeer::CON_LANG, $_GET['LAN_ID'] );
$kk->add(ContentPeer::CON_LANG, $_GET['LAN_ID']); $oDataset = ContentPeer::doSelectRS( $kk );
$oDataset=ContentPeer::doSelectRS($kk); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next(); $oDataset->next();
$aRow1 = $oDataset->getRow(); $aRow1 = $oDataset->getRow();
if(is_array($aRow1)) { if (is_array( $aRow1 )) {
$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';
@@ -47,14 +46,14 @@ if(is_array($aRow1)) {
//$aMessage['MESSAGE'] = G::LoadTranslation('CANT_DEL_LANGUAGE');//"you can't delete this language is in use"; //$aMessage['MESSAGE'] = G::LoadTranslation('CANT_DEL_LANGUAGE');//"you can't delete this language is in use";
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/showMessage', '', $aMessage ); //$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/showMessage', '', $aMessage );
//G::RenderPage('publishBlank', 'blank'); //G::RenderPage('publishBlank', 'blank');
G::SendTemporalMessage('CANT_DEL_LANGUAGE', 'error', 'labels'); G::SendTemporalMessage( 'CANT_DEL_LANGUAGE', 'error', 'labels' );
G::header('location: languages'); G::header( 'location: languages' );
}else { } else {
/*the reason why comment it was because when delete some language,we're losing some labels about this language*/ /*the reason why comment it was because when delete some language,we're losing some labels about this language*/
$oCriteria = new Criteria('workflow'); $oCriteria = new Criteria( 'workflow' );
$oCriteria->add(ContentPeer::CON_LANG, $_GET['LAN_ID']); $oCriteria->add( ContentPeer::CON_LANG, $_GET['LAN_ID'] );
ContentPeer::doDelete($oCriteria); ContentPeer::doDelete( $oCriteria );
/* /*
$oCriteria1 = new Criteria('workflow'); $oCriteria1 = new Criteria('workflow');
@@ -63,11 +62,12 @@ if(is_array($aRow1)) {
$oCriteria2->add(LanguagePeer::LAN_ID, $_GET['LAN_ID']); $oCriteria2->add(LanguagePeer::LAN_ID, $_GET['LAN_ID']);
LanguagePeer::doUpdate($oCriteria2, $oCriteria1, Propel::getConnection('workflow')); LanguagePeer::doUpdate($oCriteria2, $oCriteria1, Propel::getConnection('workflow'));
*/ */
$aLanguage['LAN_ID'] =$_GET['LAN_ID']; $aLanguage['LAN_ID'] = $_GET['LAN_ID'];
$aLanguage['LAN_ENABLED']=0; $aLanguage['LAN_ENABLED'] = 0;
$oLanguage = new Language(); $oLanguage = new Language();
$oLanguage->update($aLanguage); $oLanguage->update( $aLanguage );
G::header('Location: languages'); G::header( 'Location: languages' );
} }

View File

@@ -20,15 +20,13 @@
* *
* 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.
*
*/ */
require_once "classes/model/Language.php"; require_once "classes/model/Language.php";
if( ! isset($_GET['LOCALE']) ) if (! isset( $_GET['LOCALE'] ))
throw new Exception('Language Target ID was not set!'); throw new Exception( 'Language Target ID was not set!' );
$language = new Language(); $language = new Language();
$language->export(); $language->export();

View File

@@ -20,67 +20,72 @@
* *
* 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.
*
*/ */
require_once "classes/model/Language.php"; require_once "classes/model/Language.php";
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: G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); break; case - 1:
case -2: G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); break; G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
default: G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); break; break;
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
break;
default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
break;
} }
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
exit(0); exit( 0 );
} }
$result = new stdClass(); $result = new stdClass();
try { try {
//if the xmlform path is writeable //if the xmlform path is writeable
if( ! is_writable(PATH_XMLFORM) ) if (! is_writable( PATH_XMLFORM ))
throw new Exception(G::LoadTranslation('IMPORT_LANGUAGE_ERR_NO_WRITABLE')); throw new Exception( G::LoadTranslation( 'IMPORT_LANGUAGE_ERR_NO_WRITABLE' ) );
//if all xml files within the xmlform directory are writeable //if all xml files within the xmlform directory are writeable
if( ! G::is_rwritable(PATH_XMLFORM) ) if (! G::is_rwritable( PATH_XMLFORM ))
throw new Exception(G::LoadTranslation('IMPORT_LANGUAGE_ERR_NO_WRITABLE2')); throw new Exception( G::LoadTranslation( 'IMPORT_LANGUAGE_ERR_NO_WRITABLE2' ) );
$sMaxExecutionTime = ini_get('max_execution_time'); $sMaxExecutionTime = ini_get( 'max_execution_time' );
ini_set('max_execution_time', '0'); ini_set( 'max_execution_time', '0' );
G::LoadClass('configuration'); G::LoadClass( 'configuration' );
$languageFile = $_FILES['form']['tmp_name']['LANGUAGE_FILENAME']; $languageFile = $_FILES['form']['tmp_name']['LANGUAGE_FILENAME'];
$languageFilename = $_FILES['form']['name']['LANGUAGE_FILENAME']; $languageFilename = $_FILES['form']['name']['LANGUAGE_FILENAME'];
if (substr_compare($languageFilename, ".gz", -3, 3, true) == 0) { if (substr_compare( $languageFilename, ".gz", - 3, 3, true ) == 0) {
$zp = gzopen($languageFile, "r"); $zp = gzopen( $languageFile, "r" );
$languageFile = tempnam(__FILE__, ''); $languageFile = tempnam( __FILE__, '' );
$handle = fopen($languageFile, "w"); $handle = fopen( $languageFile, "w" );
while (!gzeof($zp)) { while (! gzeof( $zp )) {
$data = gzread($zp, 1024); $data = gzread( $zp, 1024 );
fwrite($handle, $data); fwrite( $handle, $data );
} }
gzclose($zp); gzclose( $zp );
fclose($handle); fclose( $handle );
} }
$language = new Language(); $language = new Language();
$configuration = new Configurations; $configuration = new Configurations();
$importResults = $language->import($languageFile); $importResults = $language->import( $languageFile );
G::LoadClass("wsTools"); G::LoadClass( "wsTools" );
$renegerateContent = new workspaceTools(SYS_SYS); $renegerateContent = new workspaceTools( SYS_SYS );
$messs = $renegerateContent->upgradeContent(); $messs = $renegerateContent->upgradeContent();
$result->msg = G::LoadTranslation('IMPORT_LANGUAGE_SUCCESS') . "\n"; $result->msg = G::LoadTranslation( 'IMPORT_LANGUAGE_SUCCESS' ) . "\n";
$result->msg .= "PO File num. records: " . $importResults->recordsCount . "\n"; $result->msg .= "PO File num. records: " . $importResults->recordsCount . "\n";
$result->msg .= "Success Records: " . $importResults->recordsCountSuccess . "\n"; $result->msg .= "Success Records: " . $importResults->recordsCountSuccess . "\n";
$result->msg .= "Failed Records: " . ($importResults->recordsCount-$importResults->recordsCountSuccess) . "\n"; $result->msg .= "Failed Records: " . ($importResults->recordsCount - $importResults->recordsCountSuccess) . "\n";
if( $importResults->errMsg != '' ){ if ($importResults->errMsg != '') {
$result->msg .= "Errors registered: \n" . $importResults->errMsg . "\n"; $result->msg .= "Errors registered: \n" . $importResults->errMsg . "\n";
} }
@@ -88,16 +93,11 @@ try {
$result->success = true; $result->success = true;
//saving metadata //saving metadata
$configuration->aConfig = Array( $configuration->aConfig = Array ('headers' => $importResults->headers,'language' => $importResults->lang,'import-date' => date( 'Y-m-d H:i:s' ),'user' => '','version' => '1.0'
'headers' => $importResults->headers,
'language' => $importResults->lang,
'import-date' => date('Y-m-d H:i:s'),
'user' => '',
'version' => '1.0'
); );
$configuration->saveConfig('LANGUAGE_META', $importResults->lang); $configuration->saveConfig( 'LANGUAGE_META', $importResults->lang );
ini_set('max_execution_time', $sMaxExecutionTime); ini_set( 'max_execution_time', $sMaxExecutionTime );
} catch (Exception $oError) { } catch (Exception $oError) {
$result->msg = $oError->getMessage(); $result->msg = $oError->getMessage();
@@ -106,8 +106,5 @@ try {
//G::SendTemporalMessage($oError->getMessage(), 'error', 'string'); //G::SendTemporalMessage($oError->getMessage(), 'error', 'string');
//G::header('location: languages_ImportForm'); //G::header('location: languages_ImportForm');
} }
echo G::json_encode($result); echo G::json_encode( $result );

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;
} }
} }
@@ -56,11 +54,7 @@ echo '<link rel="stylesheet" type="text/css" href="/skins/' . SYS_SKIN . '/style
$oForm->render(PATH_CORE . 'templates/xmlform.html', $scriptCode = ''); $oForm->render(PATH_CORE . 'templates/xmlform.html', $scriptCode = '');
*/ */
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/languages_ImportForm', '', '', 'languages_Import'); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/languages_ImportForm', '', '', 'languages_Import' );
G::RenderPage('publishBlank', 'blank'); G::RenderPage( 'publishBlank', 'blank' );

View File

@@ -20,24 +20,24 @@
* *
* 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;
$uid = $_SESSION['USER_LOGGED']; $uid = $_SESSION['USER_LOGGED'];
$dbc = new DBConnection; $dbc = new DBConnection();
$ses = new DBSession($dbc); $ses = new DBSession( $dbc );
G::LoadClass ( 'templateTable' ); G::LoadClass( 'templateTable' );
$query=$ses->execute('select USR_COUNTRY ,USR_CITY ,USR_LOCATION from USER where UID = "'.$uid.'"'); $query = $ses->execute( 'select USR_COUNTRY ,USR_CITY ,USR_LOCATION from USER where UID = "' . $uid . '"' );
$param=$query->read(); $param = $query->read();
$city=$param['USR_CITY']; $city = $param['USR_CITY'];
$query=$ses->execute('SELECT UID,CAPTION FROM TERRITORY WHERE TERRITORY="LOCATION" AND RELATION="'.$city.'"'); $query = $ses->execute( 'SELECT UID,CAPTION FROM TERRITORY WHERE TERRITORY="LOCATION" AND RELATION="' . $city . '"' );
/* /*
$table=new templateTable('list_template.html','DIV_LOCATIONS'); $table=new templateTable('list_template.html','DIV_LOCATIONS');
$table->formatTitleCol(0,'width="80%"'); $table->formatTitleCol(0,'width="80%"');
@@ -61,10 +61,11 @@ $table->addRowTag($r,'lastRow','','');
)); ));
*/ */
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/location', '', $param ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/location', '', $param );
//$G_PUBLISH->AddContent('template', '', '', '', $table->tpl); //$G_PUBLISH->AddContent('template', '', '', '', $table->tpl);
G::RenderPage( 'publish' ); G::RenderPage( 'publish' );
?> ?>
@@ -160,3 +161,4 @@ function ajax_function(ajax_server, funcion, parameters)
return objetus.responseText; return objetus.responseText;
} }
</script> </script>

View File

@@ -20,27 +20,26 @@
* *
* 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.
*
*/ */
G::loadClass('configuration'); G::loadClass( 'configuration' );
$oConf = new Configurations; $oConf = new Configurations();
$oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher = & headPublisher::getSingleton();
$oServerConf =& serverConf::getSingleton(); $oServerConf = & serverConf::getSingleton();
$oHeadPublisher->addExtJsScript('setup/loginSettings', true ); //adding a javascript file .js $oHeadPublisher->addExtJsScript( 'setup/loginSettings', true ); //adding a javascript file .js
$oHeadPublisher->addContent('setup/loginSettings'); //adding a html file .html. $oHeadPublisher->addContent( 'setup/loginSettings' ); //adding a html file .html.
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS','');
$forgotPasswd = isset($oConf->aConfig['login_enableForgotPassword'])? $oConf->aConfig['login_enableForgotPassword']: false;
$virtualKeyboad = isset($oConf->aConfig['login_enableVirtualKeyboard'])? $oConf->aConfig['login_enableVirtualKeyboard']: false;
$defaultLanguaje = isset($oConf->aConfig['login_defaultLanguage'])? $oConf->aConfig['login_defaultLanguage']: 'en';
$oHeadPublisher->assign('currentLang', $defaultLanguaje); $oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
$oHeadPublisher->assign('forgotPasswd', $forgotPasswd);
$oHeadPublisher->assign('virtualKeyboad',$virtualKeyboad);
G::RenderPage('publish', 'extJs'); $forgotPasswd = isset( $oConf->aConfig['login_enableForgotPassword'] ) ? $oConf->aConfig['login_enableForgotPassword'] : false;
$virtualKeyboad = isset( $oConf->aConfig['login_enableVirtualKeyboard'] ) ? $oConf->aConfig['login_enableVirtualKeyboard'] : false;
$defaultLanguaje = isset( $oConf->aConfig['login_defaultLanguage'] ) ? $oConf->aConfig['login_defaultLanguage'] : 'en';
$oHeadPublisher->assign( 'currentLang', $defaultLanguaje );
$oHeadPublisher->assign( 'forgotPasswd', $forgotPasswd );
$oHeadPublisher->assign( 'virtualKeyboad', $virtualKeyboad );
G::RenderPage( 'publish', 'extJs' );

View File

@@ -1,38 +1,39 @@
<?php <?php
$request = isset($_REQUEST['request'])? $_REQUEST['request'] : null ; $request = isset( $_REQUEST['request'] ) ? $_REQUEST['request'] : null;
switch($request){ switch ($request) {
case 'getLangList': case 'getLangList':
$Translations = G::getModel('Translation'); $Translations = G::getModel( 'Translation' );
$result = new stdClass(); $result = new stdClass();
$result->rows = Array(); $result->rows = Array ();
$langs = $Translations->getTranslationEnvironments(); $langs = $Translations->getTranslationEnvironments();
foreach($langs as $lang){ foreach ($langs as $lang) {
$result->rows[] = Array('LAN_ID'=>$lang['LOCALE'], 'LAN_NAME'=>$lang['LANGUAGE']); $result->rows[] = Array ('LAN_ID' => $lang['LOCALE'],'LAN_NAME' => $lang['LANGUAGE']
);
} }
print(G::json_encode($result)); print (G::json_encode( $result )) ;
break; break;
case 'saveSettings': case 'saveSettings':
$memcache = & PMmemcached::getSingleton(defined('SYS_SYS') ? SYS_SYS : ''); $memcache = & PMmemcached::getSingleton( defined( 'SYS_SYS' ) ? SYS_SYS : '' );
G::LoadClass('configuration'); G::LoadClass( 'configuration' );
$conf = new Configurations; $conf = new Configurations();
$conf->loadConfig($obj, 'ENVIRONMENT_SETTINGS',''); $conf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
$conf->aConfig['login_enableForgotPassword'] = isset($_REQUEST['forgotPasswd']); $conf->aConfig['login_enableForgotPassword'] = isset( $_REQUEST['forgotPasswd'] );
$conf->aConfig['login_enableVirtualKeyboard'] = isset($_REQUEST['virtualKeyboad']); $conf->aConfig['login_enableVirtualKeyboard'] = isset( $_REQUEST['virtualKeyboad'] );
$conf->aConfig['login_defaultLanguage'] = isset($_REQUEST['lang'])? $_REQUEST['lang'] : 'en'; $conf->aConfig['login_defaultLanguage'] = isset( $_REQUEST['lang'] ) ? $_REQUEST['lang'] : 'en';
$conf->saveConfig('ENVIRONMENT_SETTINGS', ''); $conf->saveConfig( 'ENVIRONMENT_SETTINGS', '' );
//remove from memcache when this value is updated/created //remove from memcache when this value is updated/created
$memcache->delete('flagForgotPassword') ; $memcache->delete( 'flagForgotPassword' );
$response->success = true; $response->success = true;
echo G::json_encode($response); echo G::json_encode( $response );
break; break;
} }

View File

@@ -20,32 +20,31 @@
* *
* 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.
*
*/ */
try { try {
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY')) switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
{ 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;
} }
$snameLogo =trim($_GET['NAMELOGO']); $snameLogo = trim( $_GET['NAMELOGO'] );
$ainfoSite = explode("/",$_SERVER["REQUEST_URI"]); $ainfoSite = explode( "/", $_SERVER["REQUEST_URI"] );
$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";
$sfileDir=$dir.PATH_SEP.$snameLogo; $sfileDir = $dir . PATH_SEP . $snameLogo;
unlink($sfileDir); unlink( $sfileDir );
//header('location: uplogo.php'); //header('location: uplogo.php');
} catch (Exception $oException) { } catch (Exception $oException) {
die($oException->getMessage()); die( $oException->getMessage() );
} }
?>

View File

@@ -20,28 +20,27 @@
* *
* 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.
*
*/ */
$RBAC->requirePermissions('PM_SETUP', 'PM_USERS'); $RBAC->requirePermissions( 'PM_SETUP', 'PM_USERS' );
$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();
if( isset($_GET['i18']) ) if (isset( $_GET['i18'] ))
$_SESSION['DEV_FLAG'] = $_SESSION['TOOLS_VIEWTYPE'] = isset($_GET['i18']); $_SESSION['DEV_FLAG'] = $_SESSION['TOOLS_VIEWTYPE'] = isset( $_GET['i18'] );
else { else {
unset($_SESSION['DEV_FLAG']); unset( $_SESSION['DEV_FLAG'] );
unset($_SESSION['TOOLS_VIEWTYPE']); unset( $_SESSION['TOOLS_VIEWTYPE'] );
} }
if( isset($_GET['s']) ) if (isset( $_GET['s'] ))
$_SESSION['ADMIN_SELECTED'] = $_GET['s']; $_SESSION['ADMIN_SELECTED'] = $_GET['s'];
else { else {
unset($_SESSION['ADMIN_SELECTED']); unset( $_SESSION['ADMIN_SELECTED'] );
} }
$G_PUBLISH->AddContent('view', 'setup/main_Load'); $G_PUBLISH->AddContent( 'view', 'setup/main_Load' );
G::RenderPage('publish'); G::RenderPage( 'publish' );

View File

@@ -1,60 +1,44 @@
<?php <?php
ob_start(); ob_start();
$request = isset($_POST['request'])? $_POST['request'] : (isset($_GET['request'])? $_GET['request'] : null); $request = isset( $_POST['request'] ) ? $_POST['request'] : (isset( $_GET['request'] ) ? $_GET['request'] : null);
switch ($request) { switch ($request) {
case 'loadMenu': case 'loadMenu':
if (!isset($_GET['menu'])) { if (! isset( $_GET['menu'] )) {
exit(0); exit( 0 );
} }
global $G_TMP_MENU; global $G_TMP_MENU;
$oMenu = new Menu(); $oMenu = new Menu();
$oMenu->load('setup'); $oMenu->load( 'setup' );
$items = array(); $items = array ();
foreach ($oMenu->Options as $i => $option) { foreach ($oMenu->Options as $i => $option) {
if ($oMenu->Types[$i] == $_GET['menu']) { if ($oMenu->Types[$i] == $_GET['menu']) {
$items[] = array( $items[] = array ('id' => $oMenu->Id[$i],'url' => ($oMenu->Options[$i] != '') ? $oMenu->Options[$i] : '#',
'id' => $oMenu->Id[$i],
'url' => ($oMenu->Options[$i] != '')? $oMenu->Options[$i] : '#',
//'onclick' => ($oMenu->JS[$i] != '')? $oMenu->JS[$i] : '', //'onclick' => ($oMenu->JS[$i] != '')? $oMenu->JS[$i] : '',
'text' => $oMenu->Labels[$i], 'text' => $oMenu->Labels[$i],
//'icon' => ($oMenu->Icons[$i] != '')? $oMenu->Icons[$i] : 'icon-pmlogo.png', //'icon' => ($oMenu->Icons[$i] != '')? $oMenu->Icons[$i] : 'icon-pmlogo.png',
//'target'=> ($oMenu->Types[$i] == 'admToolsContent')? 'admToolsContent' : '' //'target'=> ($oMenu->Types[$i] == 'admToolsContent')? 'admToolsContent' : ''
'loaded' => true, 'loaded' => true,'leaf' => true,'cls' => 'pm-tree-node','iconCls' => 'ICON_' . $oMenu->Id[$i]
'leaf' => true,
'cls' => 'pm-tree-node',
'iconCls' => 'ICON_' . $oMenu->Id[$i]
); );
} else if (in_array($oMenu->Types[$i], array('', 'admToolsContent')) && $_GET['menu'] == 'plugins') { } else if (in_array( $oMenu->Types[$i], array ('','admToolsContent'
$items[] = array( ) ) && $_GET['menu'] == 'plugins') {
'id' => $oMenu->Id[$i], $items[] = array ('id' => $oMenu->Id[$i],'url' => ($oMenu->Options[$i] != '') ? $oMenu->Options[$i] : '#',
'url' => ($oMenu->Options[$i] != '')? $oMenu->Options[$i] : '#',
//'onclick' => ($oMenu->JS[$i] != '')? $oMenu->JS[$i] : '', //'onclick' => ($oMenu->JS[$i] != '')? $oMenu->JS[$i] : '',
'text' => $oMenu->Labels[$i], 'text' => $oMenu->Labels[$i],
//'icon' => ($oMenu->Icons[$i] != '')? $oMenu->Icons[$i] : 'icon-pmlogo.png', //'icon' => ($oMenu->Icons[$i] != '')? $oMenu->Icons[$i] : 'icon-pmlogo.png',
//'target'=> ($oMenu->Types[$i] == 'admToolsContent')? 'admToolsContent' : '' //'target'=> ($oMenu->Types[$i] == 'admToolsContent')? 'admToolsContent' : ''
'loaded' => true, 'loaded' => true,'leaf' => true,'cls' => 'pm-tree-node','iconCls' => 'ICON_' . $oMenu->Id[$i]
'leaf' => true,
'cls' => 'pm-tree-node',
'iconCls' => 'ICON_'.$oMenu->Id[$i]
); );
} }
} }
if (isset($_SESSION['DEV_FLAG']) && $_SESSION['DEV_FLAG'] && $_GET['menu'] == 'settings') { if (isset( $_SESSION['DEV_FLAG'] ) && $_SESSION['DEV_FLAG'] && $_GET['menu'] == 'settings') {
unset($_SESSION['DEV_FLAG']); unset( $_SESSION['DEV_FLAG'] );
$items[] = array( $items[] = array ('id' => 'translations','url' => '../tools/main','text' => 'Translations','loaded' => true,'leaf' => true,'cls' => 'pm-tree-node','iconCls' => 'ICON_'
'id' => 'translations',
'url' => '../tools/main',
'text' => 'Translations',
'loaded' => true,
'leaf' => true,
'cls' => 'pm-tree-node',
'iconCls' => 'ICON_'
); );
} }
@@ -74,11 +58,12 @@ switch ($request) {
$itemAux = $items[$i]; $itemAux = $items[$i];
array_splice($items, $i, 1); array_splice( $items, $i, 1 );
array_unshift($items, $itemAux); array_unshift( $items, $itemAux );
} }
/////// ///////
echo G::json_encode($items); echo G::json_encode( $items );
break; break;
} }

View File

@@ -20,19 +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.
*
*/ */
$RBAC->requirePermissions("PM_SETUP", "PM_USERS"); $RBAC->requirePermissions( "PM_SETUP", "PM_USERS" );
/////// ///////
$adminSelected = null; $adminSelected = null;
if (isset($_REQUEST["s"])) { if (isset( $_REQUEST["s"] )) {
$adminSelected = $_REQUEST["s"]; $adminSelected = $_REQUEST["s"];
} } else {
else { if (isset( $_SESSION["ADMIN_SELECTED"] )) {
if (isset($_SESSION["ADMIN_SELECTED"])) {
$adminSelected = $_SESSION["ADMIN_SELECTED"]; $adminSelected = $_SESSION["ADMIN_SELECTED"];
} }
} }
@@ -43,35 +41,35 @@ $oHeadPublisher = &headPublisher::getSingleton();
global $G_TMP_MENU; global $G_TMP_MENU;
$oMenu = new Menu(); $oMenu = new Menu();
$oMenu->load("setup"); $oMenu->load( "setup" );
$items = array(); $items = array ();
$menuTypes = array_unique($oMenu->Types); $menuTypes = array_unique( $oMenu->Types );
foreach ($menuTypes as $i => $v) { foreach ($menuTypes as $i => $v) {
if ($v == "admToolsContent") { if ($v == "admToolsContent") {
unset($menuTypes[$i]); unset( $menuTypes[$i] );
break; break;
} }
} }
//sort($menuTypes); //sort($menuTypes);
$tabItems = array();
$tabItems = array ();
$i = 0; $i = 0;
foreach ($menuTypes as $menuType) { foreach ($menuTypes as $menuType) {
$tabItems[$i]->id = $menuType; $tabItems[$i]->id = $menuType;
$LABEL_TRANSLATION = G::LoadTranslation("ID_" . strtoupper($menuType)); $LABEL_TRANSLATION = G::LoadTranslation( "ID_" . strtoupper( $menuType ) );
if (substr($LABEL_TRANSLATION, 0, 2) !== "**") { if (substr( $LABEL_TRANSLATION, 0, 2 ) !== "**") {
$title = $LABEL_TRANSLATION; $title = $LABEL_TRANSLATION;
} } else {
else { $title = str_replace( "_", " ", ucwords( $menuType ) );
$title = str_replace("_", " ", ucwords($menuType));
} }
$tabItems[$i]->title = $title; $tabItems[$i]->title = $title;
$i++; $i ++;
} }
/////// ///////
@@ -80,26 +78,28 @@ $tabActive = "";
if ($adminSelected != null) { if ($adminSelected != null) {
foreach ($oMenu->Options as $i => $option) { foreach ($oMenu->Options as $i => $option) {
if ($oMenu->Id[$i] == $adminSelected) { if ($oMenu->Id[$i] == $adminSelected) {
$tabActive = (in_array($oMenu->Types[$i], array("", "admToolsContent")))? "plugins" : $oMenu->Types[$i]; $tabActive = (in_array( $oMenu->Types[$i], array ("","admToolsContent"
) )) ? "plugins" : $oMenu->Types[$i];
break; break;
} }
} }
} }
/////// ///////
$oHeadPublisher->addExtJsScript("setup/main", true); //adding a javascript file .js $oHeadPublisher->addExtJsScript( "setup/main", true ); //adding a javascript file .js
$oHeadPublisher->addContent("setup/main"); //adding a html file .html. $oHeadPublisher->addContent( "setup/main" ); //adding a html file .html.
$oHeadPublisher->assign("tabActive", $tabActive); $oHeadPublisher->assign( "tabActive", $tabActive );
$oHeadPublisher->assign("tabItems", $tabItems); $oHeadPublisher->assign( "tabItems", $tabItems );
$oHeadPublisher->assign("_item_selected", (($adminSelected != null)? $adminSelected : "")); $oHeadPublisher->assign( "_item_selected", (($adminSelected != null) ? $adminSelected : "") );
G::RenderPage("publish", "extJs"); G::RenderPage( "publish", "extJs" );
//this patch enables the load of the plugin list panel inside de main admin panel iframe //this patch enables the load of the plugin list panel inside de main admin panel iframe
if (isset($_GET["action"]) && $_GET["action"] == "pluginsList") { if (isset( $_GET["action"] ) && $_GET["action"] == "pluginsList") {
echo " echo "
<script type=\"text/javascript\"> <script type=\"text/javascript\">
document.getElementById(\"setup-frame\").src = \"pluginsList\"; document.getElementById(\"setup-frame\").src = \"pluginsList\";
</script> </script>
"; ";
} }

View File

@@ -20,42 +20,42 @@
* *
* 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.
*
*/ */
// lets display the items // lets display the items
$pluginFile = $_GET['id']; $pluginFile = $_GET['id'];
$pluginStatus = $_GET['status']; $pluginStatus = $_GET['status'];
$items = array (); $items = array ();
G::LoadClass('plugin'); G::LoadClass( 'plugin' );
//here we are enabling or disabling the plugin and all related options registered. //here we are enabling or disabling the plugin and all related options registered.
$oPluginRegistry =& PMPluginRegistry::getSingleton();
if ($handle = opendir( PATH_PLUGINS )) { $oPluginRegistry = & PMPluginRegistry::getSingleton();
while ( false !== ($file = readdir($handle))) {
if ( strpos($file, '.php', 1 ) && $file == $pluginFile) {
if ( $pluginStatus == '1' ) { if ($handle = opendir( PATH_PLUGINS )) {
while (false !== ($file = readdir( $handle ))) {
if (strpos( $file, '.php', 1 ) && $file == $pluginFile) {
if ($pluginStatus == '1') {
//print "change to disable"; //print "change to disable";
$details = $oPluginRegistry->getPluginDetails( $pluginFile ); $details = $oPluginRegistry->getPluginDetails( $pluginFile );
$oPluginRegistry->disablePlugin( $details->sNamespace ); $oPluginRegistry->disablePlugin( $details->sNamespace );
$size = file_put_contents ( PATH_DATA_SITE . 'plugin.singleton', $oPluginRegistry->serializeInstance() ); $size = file_put_contents( PATH_DATA_SITE . 'plugin.singleton', $oPluginRegistry->serializeInstance() );
print "size saved : $size <br>"; print "size saved : $size <br>";
} else { } else {
//print "change to ENABLED"; //print "change to ENABLED";
require_once ( PATH_PLUGINS . $pluginFile ); require_once (PATH_PLUGINS . $pluginFile);
$details = $oPluginRegistry->getPluginDetails( $pluginFile ); $details = $oPluginRegistry->getPluginDetails( $pluginFile );
$oPluginRegistry->enablePlugin( $details->sNamespace); $oPluginRegistry->enablePlugin( $details->sNamespace );
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins $oPluginRegistry->setupPlugins(); //get and setup enabled plugins
$size = file_put_contents ( PATH_DATA_SITE . 'plugin.singleton', $oPluginRegistry->serializeInstance() ); $size = file_put_contents( PATH_DATA_SITE . 'plugin.singleton', $oPluginRegistry->serializeInstance() );
print "size saved : $size <br>"; print "size saved : $size <br>";
} }
} }
} }
closedir($handle); closedir( $handle );
} }
//$oPluginRegistry->showArrays(); //$oPluginRegistry->showArrays();
//G::Header('location: pluginsList'); //G::Header('location: pluginsList');

View File

@@ -20,59 +20,57 @@
* *
* 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;
} }
} }
G::LoadClass('plugin'); G::LoadClass( 'plugin' );
$oPluginRegistry =& PMPluginRegistry::getSingleton(); $oPluginRegistry = & PMPluginRegistry::getSingleton();
$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';
$G_ID_SUB_MENU_SELECTED = 'PLUGINS'; $G_ID_SUB_MENU_SELECTED = 'PLUGINS';
//calculating the max upload file size;
$POST_MAX_SIZE = ini_get( 'post_max_size' );
$mul = substr( $POST_MAX_SIZE, - 1 );
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$postMaxSize = (int) $POST_MAX_SIZE * $mul;
//calculating the max upload file size; $UPLOAD_MAX_SIZE = ini_get( 'upload_max_filesize' );
$POST_MAX_SIZE = ini_get('post_max_size'); $mul = substr( $UPLOAD_MAX_SIZE, - 1 );
$mul = substr($POST_MAX_SIZE, -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;
$postMaxSize = (int)$POST_MAX_SIZE * $mul;
$UPLOAD_MAX_SIZE = ini_get('upload_max_filesize'); if ($postMaxSize < $uploadMaxSize)
$mul = substr($UPLOAD_MAX_SIZE, -1); $uploadMaxSize = $postMaxSize;
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1))); $Fields['MAX_FILE_SIZE'] = $uploadMaxSize . " (" . $UPLOAD_MAX_SIZE . ") ";
$uploadMaxSize = (int)$UPLOAD_MAX_SIZE * $mul;
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize; $G_PUBLISH = new Publisher();
$Fields['MAX_FILE_SIZE'] = $uploadMaxSize . " (" . $UPLOAD_MAX_SIZE . ") "; try {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/pluginImport', '', $Fields, 'pluginsImportFile' );
$G_PUBLISH = new Publisher; } catch (Exception $e) {
try {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/pluginImport', '',$Fields ,'pluginsImportFile' );
}
catch ( Exception $e ){
$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' );

View File

@@ -20,147 +20,150 @@
* *
* 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;
$RBAC->requirePermissions('PM_SETUP_ADVANCE'); $RBAC->requirePermissions( 'PM_SETUP_ADVANCE' );
try { try {
//load the variables //load the variables
G::LoadClass('plugin'); G::LoadClass( 'plugin' );
if ( ! isset($_FILES['form']['error']['PLUGIN_FILENAME'] ) || $_FILES['form']['error']['PLUGIN_FILENAME'] == 1 ) { if (! isset( $_FILES['form']['error']['PLUGIN_FILENAME'] ) || $_FILES['form']['error']['PLUGIN_FILENAME'] == 1) {
throw ( new Exception (G::loadTranslation('ID_ERROR_UPLOADING_PLUGIN_FILENAME') ) ); throw (new Exception( G::loadTranslation( 'ID_ERROR_UPLOADING_PLUGIN_FILENAME' ) ));
} }
//save the file //save the file
if ($_FILES['form']['error']['PLUGIN_FILENAME'] == 0) { if ($_FILES['form']['error']['PLUGIN_FILENAME'] == 0) {
$filename = $_FILES['form']['name']['PLUGIN_FILENAME']; $filename = $_FILES['form']['name']['PLUGIN_FILENAME'];
$path = PATH_DOCUMENT . 'input' . PATH_SEP ; $path = PATH_DOCUMENT . 'input' . PATH_SEP;
$tempName = $_FILES['form']['tmp_name']['PLUGIN_FILENAME']; $tempName = $_FILES['form']['tmp_name']['PLUGIN_FILENAME'];
G::uploadFile($tempName, $path, $filename ); G::uploadFile( $tempName, $path, $filename );
} }
if ( ! $_FILES['form']['type']['PLUGIN_FILENAME'] == 'application/octet-stream') { if (! $_FILES['form']['type']['PLUGIN_FILENAME'] == 'application/octet-stream') {
$pluginFilename = $_FILES['form']['type']['PLUGIN_FILENAME']; $pluginFilename = $_FILES['form']['type']['PLUGIN_FILENAME'];
throw ( new Exception ( G::loadTranslation('ID_FILES_INVALID_PLUGIN_FILENAME', SYS_LANG, array("pluginFilename"=>$pluginFilename)) )); throw (new Exception( G::loadTranslation( 'ID_FILES_INVALID_PLUGIN_FILENAME', SYS_LANG, array ("pluginFilename" => $pluginFilename
) ) ));
} }
G::LoadThirdParty( 'pear/Archive', 'Tar' );
G::LoadThirdParty( 'pear/Archive','Tar'); $tar = new Archive_Tar( $path . $filename );
$tar = new Archive_Tar ( $path. $filename); $sFileName = substr( $filename, 0, strrpos( $filename, '.' ) );
$sFileName = substr($filename,0,strrpos($filename, '.' )); $sClassName = substr( $filename, 0, strpos( $filename, '-' ) );
$sClassName = substr($filename,0,strpos($filename, '-' ));
$aFiles = $tar->listContent(); $aFiles = $tar->listContent();
$bMainFile = false; $bMainFile = false;
$bClassFile = false; $bClassFile = false;
if(!is_array($aFiles)){ if (! is_array( $aFiles )) {
throw ( new Exception (G::loadTranslation('ID_FAILED_IMPORT_PLUGINS', SYS_LANG, array("filename"=>$filename)) ) ) ; throw (new Exception( G::loadTranslation( 'ID_FAILED_IMPORT_PLUGINS', SYS_LANG, array ("filename" => $filename
) ) ));
} }
foreach ( $aFiles as $key => $val ) { foreach ($aFiles as $key => $val) {
if ( $val['filename'] == $sClassName . '.php' ) $bMainFile = true; if ($val['filename'] == $sClassName . '.php')
if ( $val['filename'] == $sClassName . PATH_SEP . 'class.' . $sClassName . '.php' ) $bClassFile = true; $bMainFile = true;
if ($val['filename'] == $sClassName . PATH_SEP . 'class.' . $sClassName . '.php')
$bClassFile = true;
} }
$oPluginRegistry =& PMPluginRegistry::getSingleton(); $oPluginRegistry = & PMPluginRegistry::getSingleton();
$pluginFile = $sClassName . '.php'; $pluginFile = $sClassName . '.php';
if ( $bMainFile && $bClassFile ) { if ($bMainFile && $bClassFile) {
$sAux = $sClassName . 'Plugin'; $sAux = $sClassName . 'Plugin';
$fVersionOld = 0.0; $fVersionOld = 0.0;
if (file_exists(PATH_PLUGINS . $pluginFile)) { if (file_exists( PATH_PLUGINS . $pluginFile )) {
if (!class_exists($sAux) && !class_exists($sClassName . 'plugin')) { if (! class_exists( $sAux ) && ! class_exists( $sClassName . 'plugin' )) {
include PATH_PLUGINS . $pluginFile; include PATH_PLUGINS . $pluginFile;
} }
if (!class_exists($sAux)) { if (! class_exists( $sAux )) {
$sAux = $sClassName . 'plugin'; $sAux = $sClassName . 'plugin';
} }
$oClass = new $sAux($sClassName); $oClass = new $sAux( $sClassName );
$fVersionOld = $oClass->iVersion; $fVersionOld = $oClass->iVersion;
unset($oClass); unset( $oClass );
} }
$res = $tar->extract ( $path ); $res = $tar->extract( $path );
$sContent = file_get_contents( $path . $pluginFile );
$sContent = file_get_contents($path . $pluginFile); $chain = preg_quote( 'extends enterprisePlugin' );
$chain = preg_quote('extends enterprisePlugin'); if (strpos( $sContent, $chain )) {
if(strpos($sContent,$chain)){ throw (new Exception( 'The plugin ' . $filename . ' is a Enterprise Edition Plugin, please install the Enterprise Plugins Manager to use this plugin.' ));
throw ( new Exception ('The plugin '.$filename.' is a Enterprise Edition Plugin, please install the Enterprise Plugins Manager to use this plugin.'));
} }
$sContent = str_ireplace($sAux, $sAux . '_', $sContent); $sContent = str_ireplace( $sAux, $sAux . '_', $sContent );
$sContent = str_ireplace('PATH_PLUGINS', "'".$path."'", $sContent); $sContent = str_ireplace( 'PATH_PLUGINS', "'" . $path . "'", $sContent );
$sContent = preg_replace("/\\\$oPluginRegistry\s*=\s*&\s*PMPluginRegistry::getSingleton\s*\(\s*\)\s*;/i", null, $sContent); $sContent = preg_replace( "/\\\$oPluginRegistry\s*=\s*&\s*PMPluginRegistry::getSingleton\s*\(\s*\)\s*;/i", null, $sContent );
$sContent = preg_replace("/\\\$oPluginRegistry->registerPlugin\s*\(\s*[\"\']" . $sClassName . "[\"\']\s*,\s*__FILE__\s*\)\s*;/i", null, $sContent); $sContent = preg_replace( "/\\\$oPluginRegistry->registerPlugin\s*\(\s*[\"\']" . $sClassName . "[\"\']\s*,\s*__FILE__\s*\)\s*;/i", null, $sContent );
//header('Content-Type: text/plain');var_dump($sClassName, $sContent);die; //header('Content-Type: text/plain');var_dump($sClassName, $sContent);die;
file_put_contents($path . $pluginFile, $sContent); file_put_contents( $path . $pluginFile, $sContent );
$sAux = $sAux . '_'; $sAux = $sAux . '_';
include ($path . $pluginFile); include ($path . $pluginFile);
$oClass = new $sAux($sClassName); $oClass = new $sAux( $sClassName );
$fVersionNew = $oClass->iVersion; $fVersionNew = $oClass->iVersion;
if (!isset($oClass->iPMVersion)) { if (! isset( $oClass->iPMVersion )) {
$oClass->iPMVersion = 0; $oClass->iPMVersion = 0;
} }
if ($oClass->iPMVersion > 0) { if ($oClass->iPMVersion > 0) {
G::LoadClass("system"); G::LoadClass( "system" );
if (System::getVersion() > 0) { if (System::getVersion() > 0) {
if ($oClass->iPMVersion > System::getVersion()) { if ($oClass->iPMVersion > System::getVersion()) {
//throw new Exception('This plugin needs version ' . $oClass->iPMVersion . ' or higher of ProcessMaker'); //throw new Exception('This plugin needs version ' . $oClass->iPMVersion . ' or higher of ProcessMaker');
} }
} }
} }
if (!isset($oClass->aDependences)) { if (! isset( $oClass->aDependences )) {
$oClass->aDependences = null; $oClass->aDependences = null;
} }
if (!empty($oClass->aDependences)) { if (! empty( $oClass->aDependences )) {
foreach ($oClass->aDependences as $aDependence) { foreach ($oClass->aDependences as $aDependence) {
if (file_exists(PATH_PLUGINS . $aDependence['sClassName'] . '.php')) { if (file_exists( PATH_PLUGINS . $aDependence['sClassName'] . '.php' )) {
require_once PATH_PLUGINS . $aDependence['sClassName'] . '.php'; require_once PATH_PLUGINS . $aDependence['sClassName'] . '.php';
if (!$oPluginRegistry->getPluginDetails($aDependence['sClassName'] . '.php')) { if (! $oPluginRegistry->getPluginDetails( $aDependence['sClassName'] . '.php' )) {
$sDependence = $aDependence['sClassName']; $sDependence = $aDependence['sClassName'];
throw new Exception( G::loadTranslation('ID_PLUGIN_DEPENDENCE_PLUGIN', SYS_LANG, array("Dependence"=>$sDependence )) ); throw new Exception( G::loadTranslation( 'ID_PLUGIN_DEPENDENCE_PLUGIN', SYS_LANG, array ("Dependence" => $sDependence
) ) );
} }
} } else {
else {
$sDependence = $aDependence['sClassName']; $sDependence = $aDependence['sClassName'];
throw new Exception( G::loadTranslation('ID_PLUGIN_DEPENDENCE_PLUGIN', SYS_LANG, array("Dependence"=>$sDependence )) ); throw new Exception( G::loadTranslation( 'ID_PLUGIN_DEPENDENCE_PLUGIN', SYS_LANG, array ("Dependence" => $sDependence
) ) );
} }
} }
} }
unset($oClass); unset( $oClass );
if ($fVersionOld > $fVersionNew) { if ($fVersionOld > $fVersionNew) {
throw new Exception(G::loadTranslation('ID_RECENT_VERSION_PLUGIN')); throw new Exception( G::loadTranslation( 'ID_RECENT_VERSION_PLUGIN' ) );
} }
$res = $tar->extract ( PATH_PLUGINS ); $res = $tar->extract( PATH_PLUGINS );
} } else {
else { throw (new Exception( G::loadTranslation( 'ID_FILE_CONTAIN_CLASS_PLUGIN', SYS_LANG, array ("filename" => $filename,"className" => $sClassName
throw ( new Exception ( G::loadTranslation('ID_FILE_CONTAIN_CLASS_PLUGIN', SYS_LANG, array("filename"=>$filename, "className"=>$sClassName )) ) ) ; ) ) ));
} }
if ( !file_exists ( PATH_PLUGINS . $sClassName . '.php' ) ) { if (! file_exists( PATH_PLUGINS . $sClassName . '.php' )) {
throw ( new Exception( G::loadTranslation('ID_FILE_PLUGIN_NOT_EXISTS', SYS_LANG, array("pluginFile"=>$pluginFile )) ) ); throw (new Exception( G::loadTranslation( 'ID_FILE_PLUGIN_NOT_EXISTS', SYS_LANG, array ("pluginFile" => $pluginFile
) ) ));
} }
require_once (PATH_PLUGINS . $pluginFile); require_once (PATH_PLUGINS . $pluginFile);
$oPluginRegistry->registerPlugin($sClassName, PATH_PLUGINS . $sClassName . ".php"); $oPluginRegistry->registerPlugin( $sClassName, PATH_PLUGINS . $sClassName . ".php" );
$size = file_put_contents(PATH_DATA_SITE . "plugin.singleton", $oPluginRegistry->serializeInstance()); $size = file_put_contents( PATH_DATA_SITE . "plugin.singleton", $oPluginRegistry->serializeInstance() );
$details = $oPluginRegistry->getPluginDetails($pluginFile); $details = $oPluginRegistry->getPluginDetails( $pluginFile );
$oPluginRegistry->installPlugin($details->sNamespace); $oPluginRegistry->installPlugin( $details->sNamespace );
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins $oPluginRegistry->setupPlugins(); //get and setup enabled plugins
$size = file_put_contents(PATH_DATA_SITE . "plugin.singleton", $oPluginRegistry->serializeInstance()); $size = file_put_contents( PATH_DATA_SITE . "plugin.singleton", $oPluginRegistry->serializeInstance() );
G::header("Location: pluginsMain"); G::header( "Location: pluginsMain" );
die; die();
} } catch (Exception $e) {
catch (Exception $e) {
$_SESSION['__PLUGIN_ERROR__'] = $e->getMessage(); $_SESSION['__PLUGIN_ERROR__'] = $e->getMessage();
G::header('Location: pluginsMain'); G::header( 'Location: pluginsMain' );
die(); die();
} }

View File

@@ -20,106 +20,95 @@
* *
* 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.
*
*/ */
$RBAC->requirePermissions('PM_SETUP_ADVANCE'); $RBAC->requirePermissions( 'PM_SETUP_ADVANCE' );
// lets display the items // lets display the items
//$items = array ( 'id' => 'char', 'title' => 'char', 'type' => 'char', 'creator' => 'char' , 'modifiedBy' => 'char', 'filename' => 'char', 'size' => 'char', 'mime' => 'char'); //$items = array ( 'id' => 'char', 'title' => 'char', 'type' => 'char', 'creator' => 'char' , 'modifiedBy' => 'char', 'filename' => 'char', 'size' => 'char', 'mime' => 'char');
$items = Array(); $items = Array ();
//***************** Plugins ************************** //***************** Plugins **************************
G::LoadClass('plugin'); G::LoadClass( 'plugin' );
//here we are loading all plugins registered //here we are loading all plugins registered
//krumo ($items); die; //krumo ($items); die;
$aPluginsPP = array(); $aPluginsPP = array ();
if (is_file(PATH_PLUGINS . 'enterprise/data/data')) { if (is_file( PATH_PLUGINS . 'enterprise/data/data' )) {
$aPlugins = unserialize(trim(file_get_contents(PATH_PLUGINS . 'enterprise/data/data'))); $aPlugins = unserialize( trim( file_get_contents( PATH_PLUGINS . 'enterprise/data/data' ) ) );
foreach ($aPlugins as $aPlugin) { foreach ($aPlugins as $aPlugin) {
$aPluginsPP[] = substr($aPlugin['sFilename'], 0, strpos($aPlugin['sFilename'], '-')) . '.php'; $aPluginsPP[] = substr( $aPlugin['sFilename'], 0, strpos( $aPlugin['sFilename'], '-' ) ) . '.php';
} }
} }
$oPluginRegistry =& PMPluginRegistry::getSingleton(); $oPluginRegistry = & PMPluginRegistry::getSingleton();
if ($handle = opendir( PATH_PLUGINS )) { if ($handle = opendir( PATH_PLUGINS )) {
while ( false !== ($file = readdir($handle))) { while (false !== ($file = readdir( $handle ))) {
if (in_array($file, $aPluginsPP)) { if (in_array( $file, $aPluginsPP )) {
continue; continue;
} }
if ( strpos($file, '.php',1) && is_file(PATH_PLUGINS . $file) ) { if (strpos( $file, '.php', 1 ) && is_file( PATH_PLUGINS . $file )) {
include_once ( PATH_PLUGINS . $file ); include_once (PATH_PLUGINS . $file);
$pluginDetail = $oPluginRegistry->getPluginDetails ( $file ); $pluginDetail = $oPluginRegistry->getPluginDetails( $file );
//print_R ($pluginDetail ); //print_R ($pluginDetail );
//die; //die;
//$status = $pluginDetail->enabled ? 'Enabled' : 'Disabled'; //$status = $pluginDetail->enabled ? 'Enabled' : 'Disabled';
if($pluginDetail==NULL) continue; //When for some reason we gen NULL plugin if ($pluginDetail == null)
$status_label = $pluginDetail->enabled ? G::LoadTranslation('ID_ENABLED') : G::LoadTranslation('ID_DISABLED'); continue; //When for some reason we gen NULL plugin
$status = $pluginDetail->enabled ? 1: 0; $status_label = $pluginDetail->enabled ? G::LoadTranslation( 'ID_ENABLED' ) : G::LoadTranslation( 'ID_DISABLED' );
if ( isset ($pluginDetail->aWorkspaces ) ) { $status = $pluginDetail->enabled ? 1 : 0;
if ( ! in_array ( SYS_SYS, $pluginDetail->aWorkspaces) ) if (isset( $pluginDetail->aWorkspaces )) {
if (! in_array( SYS_SYS, $pluginDetail->aWorkspaces ))
continue; continue;
} }
$linkEditValue = $pluginDetail->sSetupPage != '' && $pluginDetail->enabled ? G::LoadTranslation('ID_SETUP') : ' '; $linkEditValue = $pluginDetail->sSetupPage != '' && $pluginDetail->enabled ? G::LoadTranslation( 'ID_SETUP' ) : ' ';
//g::pr($pluginDetail->sSetupPage); //g::pr($pluginDetail->sSetupPage);
$setup = $pluginDetail->sSetupPage != '' && $pluginDetail->enabled ? '1' : '0'; $setup = $pluginDetail->sSetupPage != '' && $pluginDetail->enabled ? '1' : '0';
$link = 'pluginsChange?id=' . $file . '&status=' . $pluginDetail->enabled; $link = 'pluginsChange?id=' . $file . '&status=' . $pluginDetail->enabled;
$linkEdit = 'pluginsSetup?id=' . $file ; $linkEdit = 'pluginsSetup?id=' . $file;
$pluginName = $pluginDetail->sFriendlyName; $pluginName = $pluginDetail->sFriendlyName;
$pluginId = $pluginDetail->sNamespace; $pluginId = $pluginDetail->sNamespace;
$removePluginMsg = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_REMOVE_PLUGIN')); $removePluginMsg = str_replace( "\r\n", "<br>", G::LoadTranslation( 'ID_MSG_REMOVE_PLUGIN' ) );
$linkRemove = 'javascript:showMessage(\''.$removePluginMsg .'<br>'.$pluginName.' \',\''.$pluginId.'\')'; $linkRemove = 'javascript:showMessage(\'' . $removePluginMsg . '<br>' . $pluginName . ' \',\'' . $pluginId . '\')';
// $linkRemove = 'pluginsRemove?id='.$pluginId.'.php&status=1'; // $linkRemove = 'pluginsRemove?id='.$pluginId.'.php&status=1';
if ( isset ($pluginDetail) ){ if (isset( $pluginDetail )) {
if(!$pluginDetail->bPrivate){ if (! $pluginDetail->bPrivate) {
$items[] = array ( $items[] = array ('id' => (count( $items ) + 1),'namespace' => $pluginDetail->sNamespace,'title' => $pluginDetail->sFriendlyName . "\n(" . $pluginDetail->sNamespace . '.php)','className' => $pluginDetail->sNamespace,'description' => $pluginDetail->sDescription,'version' => $pluginDetail->iVersion,'setupPage' => $pluginDetail->sSetupPage,'status_label' => $status_label,'status' => $status,'setup' => $setup,
'id' => (count($items) + 1),
'namespace'=>$pluginDetail->sNamespace,
'title'=>$pluginDetail->sFriendlyName . "\n(" . $pluginDetail->sNamespace . '.php)',
'className' => $pluginDetail->sNamespace,
'description' => $pluginDetail->sDescription,
'version' => $pluginDetail->iVersion,
'setupPage' => $pluginDetail->sSetupPage,
'status_label'=> $status_label,
'status'=> $status,
'setup'=>$setup,
'sFile' => $file, 'sFile' => $file,'sStatusFile' => $pluginDetail->enabled
'sStatusFile' => $pluginDetail->enabled
); );
} }
} }
} }
} }
closedir($handle); closedir( $handle );
} }
$folders['items'] = $items; $folders['items'] = $items;
//g::pr($items); //g::pr($items);
echo G::json_encode($items); echo G::json_encode( $items );
die; die();
$_DBArray['plugins'] = $items; $_DBArray['plugins'] = $items;
$_SESSION['_DBArray'] = $_DBArray; $_SESSION['_DBArray'] = $_DBArray;
G::LoadClass( 'ArrayPeer'); G::LoadClass( 'ArrayPeer' );
$c = new Criteria ('dbarray'); $c = new Criteria( 'dbarray' );
$c->setDBArrayTable('plugins'); $c->setDBArrayTable( 'plugins' );
//$c->addAscendingOrderByColumn ('id'); //$c->addAscendingOrderByColumn ('id');
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'SETUP';
$G_SUB_MENU = 'setup';
$G_ID_SUB_MENU_SELECTED = 'PLUGINS';
$G_PUBLISH = new Publisher; $G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'SETUP';
$G_SUB_MENU = 'setup';
$G_ID_SUB_MENU_SELECTED = 'PLUGINS';
$oHeadPublisher =& headPublisher::getSingleton(); $G_PUBLISH = new Publisher();
$oHeadPublisher->addScriptFile('/jscore/setup/pluginList.js');
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/pluginList', $c ); $oHeadPublisher = & headPublisher::getSingleton();
G::RenderPage('publishBlank', 'blank'); $oHeadPublisher->addScriptFile( '/jscore/setup/pluginList.js' );
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/pluginList', $c );
G::RenderPage( 'publishBlank', 'blank' );
?>

View File

@@ -20,24 +20,18 @@
* *
* 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.
*
*/ */
$headPublisher =& headPublisher::getSingleton(); $headPublisher = & headPublisher::getSingleton();
$headPublisher->addExtJsScript('setup/pluginsMain', false); $headPublisher->addExtJsScript( 'setup/pluginsMain', false );
$headPublisher->assign("PROCESSMAKER_URL", "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN ); $headPublisher->assign( "PROCESSMAKER_URL", "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN );
$headPublisher->assign("SYS_SKIN", SYS_SKIN); $headPublisher->assign( "SYS_SKIN", SYS_SKIN );
$translations = G::getTranslations(array( $translations = G::getTranslations( array ('ID_CONFIGURE','ID_STATUS','ID_DELETE','ID_IMPORT','ID_SELECT','ID_STATUS','ID_ACTIVATE','ID_DEACTIVATE','ID_PLUGINS','ID_SELECT','ID_NO_SELECTION_WARNING','ID_MSG_REMOVE_PLUGIN','ID_TITLE','ID_VERSION','ID_STATUS','ID_TITLE','ID_VERSION','ID_DESCRIPTION','ID_STATUS','ID_PLUGIN_CANT_DELETE','ID_XPDL_IMPORT','ID_DISABLE','ID_ENABLE','ID_CONFIRM'
'ID_CONFIGURE', 'ID_STATUS', 'ID_DELETE', 'ID_IMPORT', 'ID_SELECT', ) );
'ID_STATUS', 'ID_ACTIVATE', 'ID_DEACTIVATE', 'ID_PLUGINS', $headPublisher->assign( 'TRANSLATIONS', $translations );
'ID_SELECT', 'ID_NO_SELECTION_WARNING', 'ID_MSG_REMOVE_PLUGIN', if (isset( $_SESSION['__PLUGIN_ERROR__'] )) {
'ID_TITLE', 'ID_VERSION', 'ID_STATUS', 'ID_TITLE', 'ID_VERSION', 'ID_DESCRIPTION', $headPublisher->assign( '__PLUGIN_ERROR__', $_SESSION['__PLUGIN_ERROR__'] );
'ID_STATUS', 'ID_PLUGIN_CANT_DELETE', 'ID_XPDL_IMPORT', 'ID_DISABLE', 'ID_ENABLE', 'ID_CONFIRM' unset( $_SESSION['__PLUGIN_ERROR__'] );
));
$headPublisher->assign('TRANSLATIONS', $translations);
if (isset($_SESSION['__PLUGIN_ERROR__'])) {
$headPublisher->assign('__PLUGIN_ERROR__', $_SESSION['__PLUGIN_ERROR__']);
unset($_SESSION['__PLUGIN_ERROR__']);
} }
G::RenderPage('publish', 'extJs'); G::RenderPage( 'publish', 'extJs' );

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.
*
*/ */
/* /*
@@ -39,20 +38,17 @@ switch ($RBAC->userCanAccess('PM_SETUP_ADVANCE'))
break; break;
}*/ }*/
G::LoadClass("plugin"); G::LoadClass( "plugin" );
$pluginName = $_REQUEST["pluginUid"]; $pluginName = $_REQUEST["pluginUid"];
if (file_exists(PATH_PLUGINS . $pluginName . ".php")) { if (file_exists( PATH_PLUGINS . $pluginName . ".php" )) {
$pluginRegistry = &PMPluginRegistry::getSingleton(); $pluginRegistry = &PMPluginRegistry::getSingleton();
$pluginRegistry->uninstallPlugin($pluginName); $pluginRegistry->uninstallPlugin( $pluginName );
$pluginRegistry->unSerializeInstance(file_get_contents(PATH_DATA_SITE . "plugin.singleton")); $pluginRegistry->unSerializeInstance( file_get_contents( PATH_DATA_SITE . "plugin.singleton" ) );
} }
echo $pluginName . " " . nl2br(G::LoadTranslation("ID_MSG_REMOVE_PLUGIN_SUCCESS")); echo $pluginName . " " . nl2br( G::LoadTranslation( "ID_MSG_REMOVE_PLUGIN_SUCCESS" ) );

View File

@@ -20,39 +20,38 @@
* *
* 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.
*
*/ */
$pluginFile = $_GET['id']; $pluginFile = $_GET['id'];
G::LoadClass('plugin'); G::LoadClass( 'plugin' );
$oPluginRegistry =& PMPluginRegistry::getSingleton(); $oPluginRegistry = & PMPluginRegistry::getSingleton();
$details = $oPluginRegistry->getPluginDetails( $pluginFile ); $details = $oPluginRegistry->getPluginDetails( $pluginFile );
$xmlform = isset($details->sPluginFolder) ? $details->sPluginFolder . '/' . $details->sSetupPage : ''; $xmlform = isset( $details->sPluginFolder ) ? $details->sPluginFolder . '/' . $details->sSetupPage : '';
$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';
$G_ID_SUB_MENU_SELECTED = 'PLUGINS'; $G_ID_SUB_MENU_SELECTED = 'PLUGINS';
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
try { try {
//the setup page is a special page //the setup page is a special page
if ( substr($xmlform,-4) == '.php' && file_exists ( PATH_PLUGINS . $xmlform ) ) { if (substr( $xmlform, - 4 ) == '.php' && file_exists( PATH_PLUGINS . $xmlform )) {
require_once ( PATH_PLUGINS . $xmlform ); require_once (PATH_PLUGINS . $xmlform);
die; die();
} }
//the setup page is a xmlform and using the default showform and saveform function to serialize data //the setup page is a xmlform and using the default showform and saveform function to serialize data
if ( !file_exists ( PATH_PLUGINS.$xmlform.'.xml' ) ) throw ( new Exception ('setup .xml file is not defined for this plugin') ); if (! file_exists( PATH_PLUGINS . $xmlform . '.xml' ))
throw (new Exception( 'setup .xml file is not defined for this plugin' ));
$Fields = $oPluginRegistry->getFieldsForPageSetup( $details->sNamespace ); $Fields = $oPluginRegistry->getFieldsForPageSetup( $details->sNamespace );
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $xmlform, '',$Fields ,'pluginsSetupSave?id='.$pluginFile ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', $xmlform, '', $Fields, 'pluginsSetupSave?id=' . $pluginFile );
} } catch (Exception $e) {
catch ( Exception $e ){
$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' );

View File

@@ -20,29 +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.
*
*/ */
$pluginFile = $_GET['id']; $pluginFile = $_GET['id'];
G::LoadClass('plugin'); G::LoadClass( 'plugin' );
$oPluginRegistry =& PMPluginRegistry::getSingleton(); $oPluginRegistry = & PMPluginRegistry::getSingleton();
$details = $oPluginRegistry->getPluginDetails( $pluginFile ); $details = $oPluginRegistry->getPluginDetails( $pluginFile );
try { try {
$Fields = $oPluginRegistry->updateFieldsForPageSetup( $details->sNamespace, $_POST ); $Fields = $oPluginRegistry->updateFieldsForPageSetup( $details->sNamespace, $_POST );
$str = "$Fields fields saved successfully!"; $str = "$Fields fields saved successfully!";
G::SendTemporalMessage($str, 'info', 'string', 3, 100); G::SendTemporalMessage( $str, 'info', 'string', 3, 100 );
G::Header("location: pluginsSetup?id=$pluginFile"); G::Header( "location: pluginsSetup?id=$pluginFile" );
} catch ( Exception $e ){ } catch (Exception $e) {
$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';
$G_ID_SUB_MENU_SELECTED = 'PLUGINS'; $G_ID_SUB_MENU_SELECTED = 'PLUGINS';
$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('publish'); G::RenderPage( 'publish' );
} }

View File

@@ -1,30 +1,30 @@
<?php <?php
switch($_GET['action']){ switch ($_GET['action']) {
case 'saveOption': case 'saveOption':
try { try {
G::LoadClass('serverConfiguration'); G::LoadClass( 'serverConfiguration' );
$oServerConf =& serverConf::getSingleton(); $oServerConf = & serverConf::getSingleton();
/*you can use SYS_TEMP or SYS_SYS ON HEAR_BEAT_CONF to save for each workspace*/ /*you can use SYS_TEMP or SYS_SYS ON HEAR_BEAT_CONF to save for each workspace*/
$oServerConf->unsetHeartbeatProperty('HB_BEAT_TYPE', 'HEART_BEAT_CONF'); $oServerConf->unsetHeartbeatProperty( 'HB_BEAT_TYPE', 'HEART_BEAT_CONF' );
if (isset($_POST['acceptHB'])) { if (isset( $_POST['acceptHB'] )) {
$oServerConf->setHeartbeatProperty('HB_OPTION', 1, 'HEART_BEAT_CONF'); $oServerConf->setHeartbeatProperty( 'HB_OPTION', 1, 'HEART_BEAT_CONF' );
$oServerConf->unsetHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF'); $oServerConf->unsetHeartbeatProperty( 'HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF' );
$response->enable = true; $response->enable = true;
} } else {
else { $oServerConf->setHeartbeatProperty( 'HB_OPTION', 0, 'HEART_BEAT_CONF' );
$oServerConf->setHeartbeatProperty('HB_OPTION', 0, 'HEART_BEAT_CONF'); $oServerConf->unsetHeartbeatProperty( 'HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF' );
$oServerConf->unsetHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF'); $oServerConf->setHeartbeatProperty( 'HB_BEAT_TYPE', 'endbeat', 'HEART_BEAT_CONF' );
$oServerConf->setHeartbeatProperty('HB_BEAT_TYPE', 'endbeat', 'HEART_BEAT_CONF');
$response->enable = false; $response->enable = false;
} }
$response->success = true; $response->success = true;
} catch ( Exception $e ) { } catch (Exception $e) {
$response->success = false; $response->success = false;
$response->msg = $e->getMessage(); $response->msg = $e->getMessage();
} }
echo G::json_encode($response); echo G::json_encode( $response );
break; break;
} }

View File

@@ -20,19 +20,18 @@
* *
* 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.
*
*/ */
$oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher = & headPublisher::getSingleton();
G::LoadClass('serverConfiguration'); G::LoadClass( 'serverConfiguration' );
$oServerConf =& serverConf::getSingleton(); $oServerConf = & serverConf::getSingleton();
//you can use SYS_TEMP or SYS_SYS ON HEAR_BEAT_CONF to save for each workspace //you can use SYS_TEMP or SYS_SYS ON HEAR_BEAT_CONF to save for each workspace
$sflag = $oServerConf->getHeartbeatProperty('HB_OPTION', 'HEART_BEAT_CONF'); $sflag = $oServerConf->getHeartbeatProperty( 'HB_OPTION', 'HEART_BEAT_CONF' );
$heartBeatChecked = $sflag == 1? true: false; $heartBeatChecked = $sflag == 1 ? true : false;
$oHeadPublisher->addExtJsScript('setup/processHeartBeatConfig', true ); //adding a javascript file .js $oHeadPublisher->addExtJsScript( 'setup/processHeartBeatConfig', true ); //adding a javascript file .js
$oHeadPublisher->assign('heartBeatChecked', $heartBeatChecked);
G::RenderPage('publish', 'extJs');
$oHeadPublisher->assign( 'heartBeatChecked', $heartBeatChecked );
G::RenderPage( 'publish', 'extJs' );

View File

@@ -1,35 +1,35 @@
<?php <?php
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();
} }
try { try {
G::LoadClass('serverConfiguration'); G::LoadClass( 'serverConfiguration' );
$oServerConf =& serverConf::getSingleton(); $oServerConf = & serverConf::getSingleton();
/*you can use SYS_TEMP or SYS_SYS ON HEAR_BEAT_CONF to save for each workspace*/ /*you can use SYS_TEMP or SYS_SYS ON HEAR_BEAT_CONF to save for each workspace*/
$sflag = $_POST['HB_OPTION']; $sflag = $_POST['HB_OPTION'];
$oServerConf->unsetHeartbeatProperty('HB_BEAT_TYPE','HEART_BEAT_CONF'); $oServerConf->unsetHeartbeatProperty( 'HB_BEAT_TYPE', 'HEART_BEAT_CONF' );
if($sflag){ if ($sflag) {
$oServerConf->setHeartbeatProperty('HB_OPTION',1,'HEART_BEAT_CONF'); $oServerConf->setHeartbeatProperty( 'HB_OPTION', 1, 'HEART_BEAT_CONF' );
$oServerConf->unsetHeartbeatProperty('HB_NEXT_BEAT_DATE','HEART_BEAT_CONF'); $oServerConf->unsetHeartbeatProperty( 'HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF' );
echo "active"; echo "active";
}else{ } else {
$oServerConf->setHeartbeatProperty('HB_OPTION',0,'HEART_BEAT_CONF'); $oServerConf->setHeartbeatProperty( 'HB_OPTION', 0, 'HEART_BEAT_CONF' );
$oServerConf->unsetHeartbeatProperty('HB_NEXT_BEAT_DATE','HEART_BEAT_CONF'); $oServerConf->unsetHeartbeatProperty( 'HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF' );
$oServerConf->setHeartbeatProperty('HB_BEAT_TYPE','endbeat','HEART_BEAT_CONF'); $oServerConf->setHeartbeatProperty( 'HB_BEAT_TYPE', 'endbeat', 'HEART_BEAT_CONF' );
echo "inactive"; echo "inactive";
}
}
//$oServerConf->setHeartbeatProperty('HB_OPTION',$_POST['HB_OPTION'],'HEART_BEAT_CONF'); //$oServerConf->setHeartbeatProperty('HB_OPTION',$_POST['HB_OPTION'],'HEART_BEAT_CONF');
}
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' );
} }

View File

@@ -20,93 +20,86 @@
* *
* 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.
*
*/ */
try {//ini_set('display_errors','1'); try { //ini_set('display_errors','1');
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_LOGIN')) switch ($RBAC->userCanAccess( 'PM_LOGIN' )) {
{ 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;
} }
function changeNamelogo($snameLogo)
function changeNamelogo ($snameLogo)
{ {
// The ereg_replace function has been DEPRECATED as of PHP 5.3.0. // The ereg_replace function has been DEPRECATED as of PHP 5.3.0.
// $snameLogo = ereg_replace("[áàâãª]","a",$snameLogo); // $snameLogo = ereg_replace("[áàâãª]","a",$snameLogo);
// $snameLogo = ereg_replace("[ÁÀÂÃ]","A",$snameLogo); // $snameLogo = ereg_replace("[Ã<EFBFBD>ÀÃÃ]","A",$snameLogo);
// $snameLogo = ereg_replace("[ÍÌÎ]","I",$snameLogo); // $snameLogo = ereg_replace("[Ã<EFBFBD>ÌÎ]","I",$snameLogo);
// $snameLogo = ereg_replace("[íìî]","i",$snameLogo); // $snameLogo = ereg_replace("[íìî]","i",$snameLogo);
// $snameLogo = ereg_replace("[éèê]","e",$snameLogo); // $snameLogo = ereg_replace("[éèê]","e",$snameLogo);
// $snameLogo = ereg_replace("[ÉÈÊ]","E",$snameLogo); // $snameLogo = ereg_replace("[ÉÈÊ]","E",$snameLogo);
// $snameLogo = ereg_replace("[óòôõº]","o",$snameLogo); // $snameLogo = ereg_replace("[óòôõº]","o",$snameLogo);
// $snameLogo = ereg_replace("[ÓÒÔÕ]","O",$snameLogo); // $snameLogo = ereg_replace("[ÓÒÔÕ]","O",$snameLogo);
// $snameLogo = ereg_replace("[úùû]","u",$snameLogo); // $snameLogo = ereg_replace("[úùû]","u",$snameLogo);
// $snameLogo = ereg_replace("[ÚÙÛ]","U",$snameLogo); // $snameLogo = ereg_replace("[ÚÙÛ]","U",$snameLogo);
$snameLogo = preg_replace("/[áàâãª]/", "a", $snameLogo); $snameLogo = preg_replace( "/[áàâãª]/", "a", $snameLogo );
$snameLogo = preg_replace("/[ÁÀÂÃ]/", "A", $snameLogo); $snameLogo = preg_replace( "/[Ã<EFBFBD>ÀÃÃ]/", "A", $snameLogo );
$snameLogo = preg_replace("/[ÍÌÎ]/", "I", $snameLogo); $snameLogo = preg_replace( "/[Ã<EFBFBD>ÌÎ]/", "I", $snameLogo );
$snameLogo = preg_replace("/[íìî]/", "i", $snameLogo); $snameLogo = preg_replace( "/[íìî]/", "i", $snameLogo );
$snameLogo = preg_replace("/[éèê]/", "e", $snameLogo); $snameLogo = preg_replace( "/[éèê]/", "e", $snameLogo );
$snameLogo = preg_replace("/[ÉÈÊ]/", "E", $snameLogo); $snameLogo = preg_replace( "/[ÉÈÊ]/", "E", $snameLogo );
$snameLogo = preg_replace("/[óòôõº]/", "o", $snameLogo); $snameLogo = preg_replace( "/[óòôõº]/", "o", $snameLogo );
$snameLogo = preg_replace("/[ÓÒÔÕ]/", "O", $snameLogo); $snameLogo = preg_replace( "/[ÓÒÔÕ]/", "O", $snameLogo );
$snameLogo = preg_replace("/[úùû]/", "u", $snameLogo); $snameLogo = preg_replace( "/[úùû]/", "u", $snameLogo );
$snameLogo = preg_replace("/[ÚÙÛ]/", "U", $snameLogo); $snameLogo = preg_replace( "/[ÚÙÛ]/", "U", $snameLogo );
$snameLogo = str_replace("ç","c",$snameLogo); $snameLogo = str_replace( "ç", "c", $snameLogo );
$snameLogo = str_replace("Ç","C",$snameLogo); $snameLogo = str_replace( "Ç", "C", $snameLogo );
$snameLogo = str_replace("[ñ]","n",$snameLogo); $snameLogo = str_replace( "[ñ]", "n", $snameLogo );
$snameLogo = str_replace("[Ñ]","N",$snameLogo); $snameLogo = str_replace( "[Ñ]", "N", $snameLogo );
return ($snameLogo); return ($snameLogo);
} }
$sfunction =$_GET['function']; $sfunction = $_GET['function'];
switch($sfunction){ switch ($sfunction) {
case 'replacementLogo': case 'replacementLogo':
$snameLogo=urldecode($_GET['NAMELOGO']); $snameLogo = urldecode( $_GET['NAMELOGO'] );
$snameLogo=trim($snameLogo); $snameLogo = trim( $snameLogo );
$snameLogo=changeNamelogo($snameLogo); $snameLogo = changeNamelogo( $snameLogo );
G::loadClass('configuration'); G::loadClass( 'configuration' );
$oConf = new Configurations; $oConf = new Configurations();
$aConf = Array( $aConf = Array ('WORKSPACE_LOGO_NAME' => SYS_SYS,'DEFAULT_LOGO_NAME' => $snameLogo
'WORKSPACE_LOGO_NAME' => SYS_SYS,
'DEFAULT_LOGO_NAME' => $snameLogo
); );
$oConf->aConfig = $aConf; $oConf->aConfig = $aConf;
$oConf->saveConfig('USER_LOGO_REPLACEMENT', '', '',''); $oConf->saveConfig( 'USER_LOGO_REPLACEMENT', '', '', '' );
G::SendTemporalMessage('ID_REPLACED_LOGO', 'tmp-info', 'labels'); G::SendTemporalMessage( 'ID_REPLACED_LOGO', 'tmp-info', 'labels' );
//header('location: uplogo.php'); //header('location: uplogo.php');
//G::header('location: uplogo'); //G::header('location: uplogo');
break; break;
case 'restoreLogo': case 'restoreLogo':
$snameLogo=$_GET['NAMELOGO']; $snameLogo = $_GET['NAMELOGO'];
G::loadClass('configuration'); G::loadClass( 'configuration' );
$oConf = new Configurations; $oConf = new Configurations();
$aConf = Array( $aConf = Array ('WORKSPACE_LOGO_NAME' => '','DEFAULT_LOGO_NAME' => ''
'WORKSPACE_LOGO_NAME' => '',
'DEFAULT_LOGO_NAME' => ''
); );
$oConf->aConfig = $aConf; $oConf->aConfig = $aConf;
$oConf->saveConfig('USER_LOGO_REPLACEMENT', '', '',''); $oConf->saveConfig( 'USER_LOGO_REPLACEMENT', '', '', '' );
G::SendTemporalMessage( 'ID_REPLACED_LOGO', 'tmp-info', 'labels' );
G::SendTemporalMessage('ID_REPLACED_LOGO', 'tmp-info', 'labels');
break; break;
} }
} catch (Exception $oException) {
die( $oException->getMessage() );
} }
catch (Exception $oException) {
die($oException->getMessage());
}
?>