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

@@ -1,51 +1,50 @@
<?php <?php
/** /**
* authSources_List.php * authSources_List.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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 =& headPublisher::getSingleton(); $oHeadPublisher->addExtJsScript( 'authSources/authSourcesList', false ); //adding a javascript file .js
$oHeadPublisher->addExtJsScript('authSources/authSourcesList', false); //adding a javascript file .js $oHeadPublisher->addContent( 'authSources/authSourcesList' ); //adding a html file .html.
$oHeadPublisher->addContent('authSources/authSourcesList'); //adding a html file .html. $oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
$oHeadPublisher->assign('FORMATS',$c->getFormats()); $oHeadPublisher->assign( 'CONFIG', $Config );
$oHeadPublisher->assign('CONFIG', $Config); G::RenderPage( 'publish', 'extJs' );
G::RenderPage('publish', 'extJs');
?>

View File

@@ -1,59 +1,54 @@
<?php <?php
/** /**
* authSources_New.php * authSources_New.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.23 * Copyright (C) 2004 - 2011 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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 {
else { $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => 'File: ' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' . ' not exists.') );
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'); }
} G::RenderPage( 'publish', 'blank' );
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

@@ -1,67 +1,53 @@
<?php <?php
/** /**
* authSources_Save.php * authSources_Save.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc. * Copyright (C) 2004 - 2008 Colosa Inc.
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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','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');
$aCommonFields = array('AUTH_SOURCE_UID',
'AUTH_SOURCE_NAME', $aFields = $aData = array ();
'AUTH_SOURCE_PROVIDER', foreach ($_POST['form'] as $sField => $sValue) {
'AUTH_SOURCE_SERVER_NAME', if (in_array( $sField, $aCommonFields )) {
'AUTH_SOURCE_PORT', $aFields[$sField] = $sValue;
'AUTH_SOURCE_ENABLED_TLS', } else {
'AUTH_ANONYMOUS', $aData[$sField] = $sValue;
'AUTH_SOURCE_SEARCH_USER', }
'AUTH_SOURCE_PASSWORD', }
'AUTH_SOURCE_VERSION', $aFields['AUTH_SOURCE_DATA'] = $aData;
'AUTH_SOURCE_BASE_DN',
'AUTH_SOURCE_OBJECT_CLASSES', if ($aFields['AUTH_SOURCE_UID'] == '') {
'AUTH_SOURCE_ATTRIBUTES'); $RBAC->createAuthSource( $aFields );
} else {
$aFields = $aData = array(); $RBAC->updateAuthSource( $aFields );
foreach ($_POST['form'] as $sField => $sValue) { }
if (in_array($sField, $aCommonFields)) {
$aFields[$sField] = $sValue; G::header( 'location: authSources_List' );
}
else {
$aData[$sField] = $sValue;
}
}
$aFields['AUTH_SOURCE_DATA'] = $aData;
if ($aFields['AUTH_SOURCE_UID'] == '') {
$RBAC->createAuthSource($aFields);
}
else {
$RBAC->updateAuthSource($aFields);
}
G::header('location: authSources_List');

View File

@@ -1,39 +1,39 @@
<?php <?php
/** /**
* authSources_SearchUsers.php * authSources_SearchUsers.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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';
$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

@@ -1,54 +1,54 @@
<?php <?php
/** /**
* authSources_SelectType.php * authSources_SelectType.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.23 * Copyright (C) 2004 - 2011 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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';
$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); }
} }
} }
} global $_DBArray;
global $_DBArray; $_DBArray['authSourceTypes'] = $aAuthSourceTypes;
$_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

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* holiday.php * holiday.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -12,24 +12,23 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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;
$G_PUBLISH = new Publisher; $dbc = new DBConnection();
$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

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* holidayNew.php * holidayNew.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -12,25 +12,24 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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;
$G_PUBLISH = new Publisher; $dbc = new DBConnection();
$G_PUBLISH = new Publisher();
$fields['DATE'] = date('Y-m-d');
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', "setup/holiday", '', $fields, "holidaySave"); $fields['DATE'] = date( 'Y-m-d' );
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', "setup/holiday", '', $fields, "holidaySave" );
G::RenderPage( 'publish' );
G::RenderPage( 'publish' );
?>

View File

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* index.php * index.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -12,17 +12,15 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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,139 +1,136 @@
<?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
$currentUri = "/reports/samples/Employees";
$result = $oJasper->ws_get($currentUri);
$folders = $oJasper->getResourceDescriptors($result); //execute a report
if (count($folders) != 1 || $folders[0]['type'] != 'reportUnit')
{
echo "<H1>Invalid RU ($currentUri)</H1>";
echo "<pre>$result</pre>";
exit();
}
$reportUnit = $folders[0];
$currentUri = "/reports/samples/Employees";
// 2. Prepare the parameters array looking in the $_GET for params $result = $oJasper->ws_get( $currentUri );
// starting with PARAM_ ...
// $folders = $oJasper->getResourceDescriptors( $result );
$report_params = array(); if (count( $folders ) != 1 || $folders[0]['type'] != 'reportUnit') {
echo "<H1>Invalid RU ($currentUri)</H1>";
$moveToPage = "jasper?uri=$currentUri"; echo "<pre>$result</pre>";
exit();
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];
// 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];
} }
// if ($param_name != "page" && $param_name != "uri") { // if ($param_name != "page" && $param_name != "uri") {
// $moveToPage .= "&".urlencode($param_name)."=". urlencode($_GET[$param_name]); // $moveToPage .= "&".urlencode($param_name)."=". urlencode($_GET[$param_name]);
// } // }
} }
$formatReport = RUN_OUTPUT_FORMAT_XML; $formatReport = RUN_OUTPUT_FORMAT_XML;
$formatReport = RUN_OUTPUT_FORMAT_CSV; $formatReport = RUN_OUTPUT_FORMAT_CSV;
$formatReport = RUN_OUTPUT_FORMAT_RTF; $formatReport = RUN_OUTPUT_FORMAT_RTF;
$formatReport = RUN_OUTPUT_FORMAT_PDF; $formatReport = RUN_OUTPUT_FORMAT_PDF;
$formatReport = RUN_OUTPUT_FORMAT_HTML; $formatReport = RUN_OUTPUT_FORMAT_HTML;
$moveToPage .="&page="; $moveToPage .= "&page=";
// 3. Execute the report // 3. Execute the report
$output_params = array(); $output_params = array ();
$output_params[RUN_OUTPUT_FORMAT] = $formatReport; $output_params[RUN_OUTPUT_FORMAT] = $formatReport;
if ( $formatReport == RUN_OUTPUT_FORMAT_HTML) { 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 :
// 1. Save attachments....
// 2. Print the report....
header ( "Content-type: text/html");
foreach (array_keys($attachments) as $key) {
if ($key != "cid:report") {
$f = fopen("images/".substr($key,4),"w");
fwrite($f, $attachments[$key]);
fclose($f);
}
}
echo "<center>";
$prevpage = ($pageReport > 0) ? $pageReport - 1 : 0;
$nextpage = $pageReport + 1;
echo "<a href=\"".$moveToPage.$prevpage."\">Prev page</a> | <a href=\"".$moveToPage.$nextpage."\">Next page</a>";
echo "</center><hr>";
echo $attachments["cid:report"];
//print_r(array_keys($attachments));
break;
case RUN_OUTPUT_FORMAT_CSV :
case RUN_OUTPUT_FORMAT_XLS :
header ( 'Content-type: application/xls' );
header ( 'Content-Disposition: attachment; filename="report.xls"');
echo( $attachments["cid:report"]);
break;
case RUN_OUTPUT_FORMAT_RTF : switch ($formatReport) {
header ( 'Content-type: text/rtf' ); case RUN_OUTPUT_FORMAT_PDF:
header ( 'Content-Disposition: attachment; filename="report.rtf"'); header( "Content-type: application/pdf" );
echo( $attachments["cid:report"]); echo ($attachments["cid:report"]);
break; break;
case RUN_OUTPUT_FORMAT_HTML:
// 1. Save attachments....
// 2. Print the report....
header( "Content-type: text/html" );
foreach (array_keys( $attachments ) as $key) {
if ($key != "cid:report") {
$f = fopen( "images/" . substr( $key, 4 ), "w" );
fwrite( $f, $attachments[$key] );
fclose( $f );
}
}
echo "<center>";
$prevpage = ($pageReport > 0) ? $pageReport - 1 : 0;
$nextpage = $pageReport + 1;
echo "<a href=\"" . $moveToPage . $prevpage . "\">Prev page</a> | <a href=\"" . $moveToPage . $nextpage . "\">Next page</a>";
echo "</center><hr>";
echo $attachments["cid:report"];
//print_r(array_keys($attachments));
break;
case RUN_OUTPUT_FORMAT_CSV:
case RUN_OUTPUT_FORMAT_XLS:
header( 'Content-type: application/xls' );
header( 'Content-Disposition: attachment; filename="report.xls"' );
echo ($attachments["cid:report"]);
break;
case RUN_OUTPUT_FORMAT_RTF:
header( 'Content-type: text/rtf' );
header( 'Content-Disposition: attachment; filename="report.rtf"' );
echo ($attachments["cid:report"]);
break;
default:
//header ( 'Content-type: application/xls' );
//header ( 'Content-Disposition: attachment; filename="report.xls"');
echo ($attachments["cid:report"]);
break;
}
exit();
} else
echo "No attachment found!";
default :
//header ( 'Content-type: application/xls' );
//header ( 'Content-Disposition: attachment; filename="report.xls"');
echo( $attachments["cid:report"]);
break;
}
exit();
}
else echo "No attachment found!";

View File

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* language.php * language.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -12,33 +12,33 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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">
function btnClick(myForm) { function btnClick(myForm) {
DESCRIPTION = myForm.elements ["form[LEX_VALUE]"]; DESCRIPTION = myForm.elements ["form[LEX_VALUE]"];
if((DESCRIPTION.value == "")) if((DESCRIPTION.value == ""))
{ {
alert ("<?php echo G::LoadTranslation("ID_MSG_ERROR_LANGUAGE_DESCRIPTION")?>"); alert ("<?php echo G::LoadTranslation("ID_MSG_ERROR_LANGUAGE_DESCRIPTION")?>");
DESCRIPTION.focus(); DESCRIPTION.focus();
@@ -56,3 +56,4 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
return false; return false;
} }
</script> </script>

View File

@@ -1,173 +1,172 @@
<?php <?php
/** /**
* language_Ajax.php * language_Ajax.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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 );
g::pr($tranlationsList); die; die();
if( isset($meta['LAN_ID']) && $meta['LAN_ID'] == $_POST['lang'] ){ 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(); $response = new stdClass();
$response = new stdClass(); $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']) ){ if (isset( $confCasesList['dateformat'] )) {
$datetime = explode(' ', $translationRow['DATE']); $datetime = explode( ' ', $translationRow['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) {
$DATE = date($confCasesList['dateformat'], mktime($time[0], $time[1], 0, $date[1], $date[2], $date[0])); $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'];
} }
} else { } else {
$DATE = $translationRow['DATE']; $DATE = $translationRow['DATE'];
$REV_DATE = $translationRow['HEADERS']['PO-Revision-Date']; $REV_DATE = $translationRow['HEADERS']['PO-Revision-Date'];
} }
$languagesList[$i]['LAN_ID'] = $translationRow['LAN_ID']; $languagesList[$i]['LAN_ID'] = $translationRow['LAN_ID'];
$languagesList[$i]['LOCALE'] = $translationRow['LOCALE']; $languagesList[$i]['LOCALE'] = $translationRow['LOCALE'];
$languagesList[$i]['LAN_FLAG'] = $flag; $languagesList[$i]['LAN_FLAG'] = $flag;
$languagesList[$i]['NUM_RECORDS'] = $translationRow['NUM_RECORDS']; $languagesList[$i]['NUM_RECORDS'] = $translationRow['NUM_RECORDS'];
$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

@@ -1,38 +1,35 @@
<?php <?php
/** /**
* languages.php * languages.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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( $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_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', //$oHeadPublisher->assign('TRANSLATIONS', $labels);
'ID_DELETE_LANGUAGE_WARNING', 'ID_ACTIONS', 'ID_LAN_LOCALE', 'ID_LAN_TRANSLATOR', 'ID_LAN_NUM_RECORDS', 'ID_UPLOADING_TRANSLATION_FILE' G::RenderPage( 'publish', 'extJs' );
));
//$oHeadPublisher->assign('TRANSLATIONS', $labels);
G::RenderPage('publish', 'extJs');

View File

@@ -1,73 +1,73 @@
<?php <?php
/** /**
* languages_Delete.php * languages_Delete.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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'; $G_ID_SUB_MENU_SELECTED = 'LANGUAGES';
$G_ID_SUB_MENU_SELECTED = 'LANGUAGES';
//$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'); $oCriteria1->add(LanguagePeer::LAN_ENABLED, 0);
$oCriteria1->add(LanguagePeer::LAN_ENABLED, 0); $oCriteria2 = new Criteria('workflow');
$oCriteria2 = new Criteria('workflow'); $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

@@ -12,23 +12,21 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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

@@ -1,113 +1,110 @@
<?php <?php
/** /**
* languages_Import.php * languages_Import.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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:
case -1: G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); break; G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
case -2: G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); break; break;
default: G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); break; case - 2:
} G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header('location: ../login/login'); break;
exit(0); default:
} G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
break;
$result = new stdClass(); }
G::header( 'location: ../login/login' );
try { exit( 0 );
//if the xmlform path is writeable }
if( ! is_writable(PATH_XMLFORM) )
throw new Exception(G::LoadTranslation('IMPORT_LANGUAGE_ERR_NO_WRITABLE')); $result = new stdClass();
//if all xml files within the xmlform directory are writeable try {
if( ! G::is_rwritable(PATH_XMLFORM) ) //if the xmlform path is writeable
throw new Exception(G::LoadTranslation('IMPORT_LANGUAGE_ERR_NO_WRITABLE2')); if (! is_writable( PATH_XMLFORM ))
throw new Exception( G::LoadTranslation( 'IMPORT_LANGUAGE_ERR_NO_WRITABLE' ) );
$sMaxExecutionTime = ini_get('max_execution_time');
ini_set('max_execution_time', '0'); //if all xml files within the xmlform directory are writeable
G::LoadClass('configuration'); if (! G::is_rwritable( PATH_XMLFORM ))
throw new Exception( G::LoadTranslation( 'IMPORT_LANGUAGE_ERR_NO_WRITABLE2' ) );
$languageFile = $_FILES['form']['tmp_name']['LANGUAGE_FILENAME'];
$languageFilename = $_FILES['form']['name']['LANGUAGE_FILENAME']; $sMaxExecutionTime = ini_get( 'max_execution_time' );
ini_set( 'max_execution_time', '0' );
if (substr_compare($languageFilename, ".gz", -3, 3, true) == 0) { G::LoadClass( 'configuration' );
$zp = gzopen($languageFile, "r");
$languageFile = tempnam(__FILE__, ''); $languageFile = $_FILES['form']['tmp_name']['LANGUAGE_FILENAME'];
$handle = fopen($languageFile, "w"); $languageFilename = $_FILES['form']['name']['LANGUAGE_FILENAME'];
while (!gzeof($zp)) {
$data = gzread($zp, 1024); if (substr_compare( $languageFilename, ".gz", - 3, 3, true ) == 0) {
fwrite($handle, $data); $zp = gzopen( $languageFile, "r" );
} $languageFile = tempnam( __FILE__, '' );
gzclose($zp); $handle = fopen( $languageFile, "w" );
fclose($handle); while (! gzeof( $zp )) {
} $data = gzread( $zp, 1024 );
fwrite( $handle, $data );
$language = new Language(); }
$configuration = new Configurations; gzclose( $zp );
$importResults = $language->import($languageFile); fclose( $handle );
}
G::LoadClass("wsTools");
$renegerateContent = new workspaceTools(SYS_SYS); $language = new Language();
$messs = $renegerateContent->upgradeContent(); $configuration = new Configurations();
$importResults = $language->import( $languageFile );
$result->msg = G::LoadTranslation('IMPORT_LANGUAGE_SUCCESS') . "\n";
$result->msg .= "PO File num. records: " . $importResults->recordsCount . "\n"; G::LoadClass( "wsTools" );
$result->msg .= "Success Records: " . $importResults->recordsCountSuccess . "\n"; $renegerateContent = new workspaceTools( SYS_SYS );
$result->msg .= "Failed Records: " . ($importResults->recordsCount-$importResults->recordsCountSuccess) . "\n"; $messs = $renegerateContent->upgradeContent();
if( $importResults->errMsg != '' ){ $result->msg = G::LoadTranslation( 'IMPORT_LANGUAGE_SUCCESS' ) . "\n";
$result->msg .= "Errors registered: \n" . $importResults->errMsg . "\n"; $result->msg .= "PO File num. records: " . $importResults->recordsCount . "\n";
} $result->msg .= "Success Records: " . $importResults->recordsCountSuccess . "\n";
$result->msg .= "Failed Records: " . ($importResults->recordsCount - $importResults->recordsCountSuccess) . "\n";
//$result->msg = htmlentities($result->msg);
$result->success = true; if ($importResults->errMsg != '') {
$result->msg .= "Errors registered: \n" . $importResults->errMsg . "\n";
//saving metadata }
$configuration->aConfig = Array(
'headers' => $importResults->headers, //$result->msg = htmlentities($result->msg);
'language' => $importResults->lang, $result->success = true;
'import-date' => date('Y-m-d H:i:s'),
'user' => '', //saving metadata
'version' => '1.0' $configuration->aConfig = Array ('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();
//print_r($oError->getTrace()); //print_r($oError->getTrace());
$result->success = false; $result->success = false;
//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

@@ -1,66 +1,60 @@
<?php <?php
/** /**
* languages_ImportForm.php * languages_ImportForm.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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:
{ G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
case -1: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; case - 2:
break; G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
case -2: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; default:
break; G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
default: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; }
break; }
} $G_MAIN_MENU = 'processmaker';
} $G_SUB_MENU = 'setup';
$G_MAIN_MENU = 'processmaker'; $G_ID_MENU_SELECTED = 'SETUP';
$G_SUB_MENU = 'setup'; $G_ID_SUB_MENU_SELECTED = 'LANGUAGES';
$G_ID_MENU_SELECTED = 'SETUP';
$G_ID_SUB_MENU_SELECTED = 'LANGUAGES'; /*
$oForm = new Form('setup/languages_ImportForm', '', SYS_LANG);
/* $oForm->action = 'languages_Import';
$oForm = new Form('setup/languages_ImportForm', '', SYS_LANG); echo '<link rel="stylesheet" type="text/css" href="/skins/' . SYS_SKIN . '/style.css"/>' .
$oForm->action = 'languages_Import'; $oForm->render(PATH_CORE . 'templates/xmlform.html', $scriptCode = '');
echo '<link rel="stylesheet" type="text/css" href="/skins/' . SYS_SKIN . '/style.css"/>' . */
$oForm->render(PATH_CORE . 'templates/xmlform.html', $scriptCode = '');
*/ $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/languages_ImportForm', '', '', 'languages_Import' );
$G_PUBLISH = new Publisher; G::RenderPage( 'publishBlank', 'blank' );
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/languages_ImportForm', '', '', 'languages_Import');
G::RenderPage('publishBlank', 'blank');

View File

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* location.php * location.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -12,39 +12,39 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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%"');
$table->formatTitleCol(1,'align="center"'); $table->formatTitleCol(1,'align="center"');
$table->formatCol(0,'width="80%" '); $table->formatCol(0,'width="80%" ');
$table->formatCol(1,'align="center"'); $table->formatCol(1,'align="center"');
$table->addTitle(array(G::LoadTranslation('ID_LOCATION'),'')); $table->addTitle(array(G::LoadTranslation('ID_LOCATION'),''));
for($r=0;$r<$query->count();$r++) for($r=0;$r<$query->count();$r++)
{ {
@@ -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

@@ -12,35 +12,34 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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','');
$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; $forgotPasswd = isset( $oConf->aConfig['login_enableForgotPassword'] ) ? $oConf->aConfig['login_enableForgotPassword'] : false;
$defaultLanguaje = isset($oConf->aConfig['login_defaultLanguage'])? $oConf->aConfig['login_defaultLanguage']: 'en'; $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( 'currentLang', $defaultLanguaje );
$oHeadPublisher->assign('forgotPasswd', $forgotPasswd); $oHeadPublisher->assign( 'forgotPasswd', $forgotPasswd );
$oHeadPublisher->assign('virtualKeyboad',$virtualKeyboad); $oHeadPublisher->assign( 'virtualKeyboad', $virtualKeyboad );
G::RenderPage('publish', 'extJs'); 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){
case 'getLangList':
$Translations = G::getModel('Translation'); switch ($request) {
$result = new stdClass(); case 'getLangList':
$result->rows = Array();
$langs = $Translations->getTranslationEnvironments();
foreach($langs as $lang){
$result->rows[] = Array('LAN_ID'=>$lang['LOCALE'], 'LAN_NAME'=>$lang['LANGUAGE']);
}
print(G::json_encode($result));
break;
$Translations = G::getModel( 'Translation' );
$result = new stdClass();
$result->rows = Array ();
$langs = $Translations->getTranslationEnvironments();
foreach ($langs as $lang) {
$result->rows[] = Array ('LAN_ID' => $lang['LOCALE'],'LAN_NAME' => $lang['LANGUAGE']
);
}
print (G::json_encode( $result )) ;
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

@@ -1,5 +1,5 @@
<?php <?php
/** /**
* logo_Delete.php * logo_Delete.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
@@ -12,40 +12,39 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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'] );
$ainfoSite = explode( "/", $_SERVER["REQUEST_URI"] );
$dir = PATH_DATA . "sites" . PATH_SEP . str_replace( "sys", "", $ainfoSite[1] ) . PATH_SEP . "files/logos";
$sfileDir = $dir . PATH_SEP . $snameLogo;
unlink( $sfileDir );
//header('location: uplogo.php');
$snameLogo =trim($_GET['NAMELOGO']);
$ainfoSite = explode("/",$_SERVER["REQUEST_URI"]);
$dir=PATH_DATA."sites".PATH_SEP.str_replace("sys","",$ainfoSite[1]).PATH_SEP."files/logos";
$sfileDir=$dir.PATH_SEP.$snameLogo;
unlink($sfileDir);
//header('location: uplogo.php');
} catch (Exception $oException) { } catch (Exception $oException) {
die($oException->getMessage()); die( $oException->getMessage() );
} }
?>

View File

@@ -12,36 +12,35 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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,84 +1,69 @@
<?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;
$oMenu = new Menu();
$oMenu->load('setup');
$items = array();
foreach ($oMenu->Options as $i => $option) {
if ($oMenu->Types[$i] == $_GET['menu']) {
$items[] = array(
'id' => $oMenu->Id[$i],
'url' => ($oMenu->Options[$i] != '')? $oMenu->Options[$i] : '#',
//'onclick' => ($oMenu->JS[$i] != '')? $oMenu->JS[$i] : '',
'text' => $oMenu->Labels[$i],
//'icon' => ($oMenu->Icons[$i] != '')? $oMenu->Icons[$i] : 'icon-pmlogo.png',
//'target'=> ($oMenu->Types[$i] == 'admToolsContent')? 'admToolsContent' : ''
'loaded' => true,
'leaf' => true,
'cls' => 'pm-tree-node',
'iconCls' => 'ICON_' . $oMenu->Id[$i]
);
} else if (in_array($oMenu->Types[$i], array('', 'admToolsContent')) && $_GET['menu'] == 'plugins') {
$items[] = array(
'id' => $oMenu->Id[$i],
'url' => ($oMenu->Options[$i] != '')? $oMenu->Options[$i] : '#',
//'onclick' => ($oMenu->JS[$i] != '')? $oMenu->JS[$i] : '',
'text' => $oMenu->Labels[$i],
//'icon' => ($oMenu->Icons[$i] != '')? $oMenu->Icons[$i] : 'icon-pmlogo.png',
//'target'=> ($oMenu->Types[$i] == 'admToolsContent')? 'admToolsContent' : ''
'loaded' => true,
'leaf' => true,
'cls' => 'pm-tree-node',
'iconCls' => 'ICON_'.$oMenu->Id[$i]
);
}
}
if (isset($_SESSION['DEV_FLAG']) && $_SESSION['DEV_FLAG'] && $_GET['menu'] == 'settings') {
unset($_SESSION['DEV_FLAG']);
$items[] = array(
'id' => 'translations',
'url' => '../tools/main',
'text' => 'Translations',
'loaded' => true,
'leaf' => true,
'cls' => 'pm-tree-node',
'iconCls' => 'ICON_'
);
}
$x = ob_get_contents();
ob_end_clean();
///////
if ($_GET["menu"] == "plugins") {
$i = 0;
foreach ($items as $index => $value) {
if ($items[$index]["id"] == "PMENTERPRISE") {
$i = $index;
break;
} }
}
global $G_TMP_MENU;
$itemAux = $items[$i];
$oMenu = new Menu();
array_splice($items, $i, 1); $oMenu->load( 'setup' );
array_unshift($items, $itemAux); $items = array ();
}
foreach ($oMenu->Options as $i => $option) {
/////// if ($oMenu->Types[$i] == $_GET['menu']) {
echo G::json_encode($items); $items[] = array ('id' => $oMenu->Id[$i],'url' => ($oMenu->Options[$i] != '') ? $oMenu->Options[$i] : '#',
break; //'onclick' => ($oMenu->JS[$i] != '')? $oMenu->JS[$i] : '',
} 'text' => $oMenu->Labels[$i],
//'icon' => ($oMenu->Icons[$i] != '')? $oMenu->Icons[$i] : 'icon-pmlogo.png',
//'target'=> ($oMenu->Types[$i] == 'admToolsContent')? 'admToolsContent' : ''
'loaded' => true,'leaf' => true,'cls' => 'pm-tree-node','iconCls' => 'ICON_' . $oMenu->Id[$i]
);
} else if (in_array( $oMenu->Types[$i], array ('','admToolsContent'
) ) && $_GET['menu'] == 'plugins') {
$items[] = array ('id' => $oMenu->Id[$i],'url' => ($oMenu->Options[$i] != '') ? $oMenu->Options[$i] : '#',
//'onclick' => ($oMenu->JS[$i] != '')? $oMenu->JS[$i] : '',
'text' => $oMenu->Labels[$i],
//'icon' => ($oMenu->Icons[$i] != '')? $oMenu->Icons[$i] : 'icon-pmlogo.png',
//'target'=> ($oMenu->Types[$i] == 'admToolsContent')? 'admToolsContent' : ''
'loaded' => true,'leaf' => true,'cls' => 'pm-tree-node','iconCls' => 'ICON_' . $oMenu->Id[$i]
);
}
}
if (isset( $_SESSION['DEV_FLAG'] ) && $_SESSION['DEV_FLAG'] && $_GET['menu'] == 'settings') {
unset( $_SESSION['DEV_FLAG'] );
$items[] = array ('id' => 'translations','url' => '../tools/main','text' => 'Translations','loaded' => true,'leaf' => true,'cls' => 'pm-tree-node','iconCls' => 'ICON_'
);
}
$x = ob_get_contents();
ob_end_clean();
///////
if ($_GET["menu"] == "plugins") {
$i = 0;
foreach ($items as $index => $value) {
if ($items[$index]["id"] == "PMENTERPRISE") {
$i = $index;
break;
}
}
$itemAux = $items[$i];
array_splice( $items, $i, 1 );
array_unshift( $items, $itemAux );
}
///////
echo G::json_encode( $items );
break;
}

View File

@@ -1,105 +1,105 @@
<?php <?php
/** /**
* main.php Cases List main processor * main.php Cases List main processor
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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 {
} if (isset( $_SESSION["ADMIN_SELECTED"] )) {
else { $adminSelected = $_SESSION["ADMIN_SELECTED"];
if (isset($_SESSION["ADMIN_SELECTED"])) { }
$adminSelected = $_SESSION["ADMIN_SELECTED"]; }
}
} ///////
$oHeadPublisher = &headPublisher::getSingleton();
///////
$oHeadPublisher = &headPublisher::getSingleton(); global $G_TMP_MENU;
global $G_TMP_MENU; $oMenu = new Menu();
$oMenu->load( "setup" );
$oMenu = new Menu(); $items = array ();
$oMenu->load("setup");
$items = array(); $menuTypes = array_unique( $oMenu->Types );
foreach ($menuTypes as $i => $v) {
$menuTypes = array_unique($oMenu->Types); if ($v == "admToolsContent") {
foreach ($menuTypes as $i => $v) { unset( $menuTypes[$i] );
if ($v == "admToolsContent") { break;
unset($menuTypes[$i]); }
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 {
} $title = str_replace( "_", " ", ucwords( $menuType ) );
else { }
$title = str_replace("_", " ", ucwords($menuType));
} $tabItems[$i]->title = $title;
$i ++;
$tabItems[$i]->title = $title; }
$i++;
} ///////
$tabActive = "";
///////
$tabActive = ""; if ($adminSelected != null) {
foreach ($oMenu->Options as $i => $option) {
if ($adminSelected != null) { if ($oMenu->Id[$i] == $adminSelected) {
foreach ($oMenu->Options as $i => $option) { $tabActive = (in_array( $oMenu->Types[$i], array ("","admToolsContent"
if ($oMenu->Id[$i] == $adminSelected) { ) )) ? "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

@@ -12,50 +12,50 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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 ($handle = opendir( PATH_PLUGINS )) {
while (false !== ($file = readdir( $handle ))) {
if ( $pluginStatus == '1' ) { if (strpos( $file, '.php', 1 ) && $file == $pluginFile) {
//print "change to disable";
$details = $oPluginRegistry->getPluginDetails( $pluginFile ); if ($pluginStatus == '1') {
$oPluginRegistry->disablePlugin( $details->sNamespace ); //print "change to disable";
$size = file_put_contents ( PATH_DATA_SITE . 'plugin.singleton', $oPluginRegistry->serializeInstance() ); $details = $oPluginRegistry->getPluginDetails( $pluginFile );
print "size saved : $size <br>"; $oPluginRegistry->disablePlugin( $details->sNamespace );
} else { $size = file_put_contents( PATH_DATA_SITE . 'plugin.singleton', $oPluginRegistry->serializeInstance() );
//print "change to ENABLED"; print "size saved : $size <br>";
require_once ( PATH_PLUGINS . $pluginFile ); } else {
$details = $oPluginRegistry->getPluginDetails( $pluginFile ); //print "change to ENABLED";
$oPluginRegistry->enablePlugin( $details->sNamespace); require_once (PATH_PLUGINS . $pluginFile);
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins $details = $oPluginRegistry->getPluginDetails( $pluginFile );
$size = file_put_contents ( PATH_DATA_SITE . 'plugin.singleton', $oPluginRegistry->serializeInstance() ); $oPluginRegistry->enablePlugin( $details->sNamespace );
print "size saved : $size <br>"; $oPluginRegistry->setupPlugins(); //get and setup enabled plugins
$size = file_put_contents( PATH_DATA_SITE . 'plugin.singleton', $oPluginRegistry->serializeInstance() );
print "size saved : $size <br>";
}
} }
}
} }
closedir($handle); closedir( $handle );
} }
//$oPluginRegistry->showArrays(); //$oPluginRegistry->showArrays();
//G::Header('location: pluginsList'); //G::Header('location: pluginsList');

View File

@@ -1,78 +1,76 @@
<?php <?php
/** /**
* pluginsImport.php * pluginsImport.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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:
{ G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
case -1: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; case - 2:
break; G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
case -2: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; default:
break; G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
default: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; }
break; }
} G::LoadClass( 'plugin' );
}
G::LoadClass('plugin'); $oPluginRegistry = & PMPluginRegistry::getSingleton();
$G_MAIN_MENU = 'processmaker';
$oPluginRegistry =& PMPluginRegistry::getSingleton(); $G_ID_MENU_SELECTED = 'SETUP';
$G_MAIN_MENU = 'processmaker'; $G_SUB_MENU = 'setup';
$G_ID_MENU_SELECTED = 'SETUP'; $G_ID_SUB_MENU_SELECTED = 'PLUGINS';
$G_SUB_MENU = 'setup';
$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 );
//calculating the max upload file size; $mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$POST_MAX_SIZE = ini_get('post_max_size'); $postMaxSize = (int) $POST_MAX_SIZE * $mul;
$mul = substr($POST_MAX_SIZE, -1);
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1))); $UPLOAD_MAX_SIZE = ini_get( 'upload_max_filesize' );
$postMaxSize = (int)$POST_MAX_SIZE * $mul; $mul = substr( $UPLOAD_MAX_SIZE, - 1 );
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$UPLOAD_MAX_SIZE = ini_get('upload_max_filesize'); $uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
$mul = substr($UPLOAD_MAX_SIZE, -1);
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1))); if ($postMaxSize < $uploadMaxSize)
$uploadMaxSize = (int)$UPLOAD_MAX_SIZE * $mul; $uploadMaxSize = $postMaxSize;
$Fields['MAX_FILE_SIZE'] = $uploadMaxSize . " (" . $UPLOAD_MAX_SIZE . ") ";
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
$Fields['MAX_FILE_SIZE'] = $uploadMaxSize . " (" . $UPLOAD_MAX_SIZE . ") "; $G_PUBLISH = new Publisher();
try {
$G_PUBLISH = new Publisher; $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/pluginImport', '', $Fields, 'pluginsImportFile' );
try { } catch (Exception $e) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/pluginImport', '',$Fields ,'pluginsImportFile' ); $aMessage['MESSAGE'] = $e->getMessage();
} $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
catch ( Exception $e ){ }
$aMessage['MESSAGE'] = $e->getMessage(); G::RenderPage( 'publishBlank', 'blank' );
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
}
G::RenderPage('publishBlank', 'blank');

View File

@@ -1,166 +1,169 @@
<?php <?php
/** /**
* processes_ImportFile.php * processes_ImportFile.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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(); }
$pluginFile = $sClassName . '.php';
$oPluginRegistry = & PMPluginRegistry::getSingleton();
if ( $bMainFile && $bClassFile ) { $pluginFile = $sClassName . '.php';
$sAux = $sClassName . 'Plugin';
$fVersionOld = 0.0; if ($bMainFile && $bClassFile) {
if (file_exists(PATH_PLUGINS . $pluginFile)) { $sAux = $sClassName . 'Plugin';
if (!class_exists($sAux) && !class_exists($sClassName . 'plugin')) { $fVersionOld = 0.0;
include PATH_PLUGINS . $pluginFile; if (file_exists( PATH_PLUGINS . $pluginFile )) {
} if (! class_exists( $sAux ) && ! class_exists( $sClassName . 'plugin' )) {
if (!class_exists($sAux)) { include PATH_PLUGINS . $pluginFile;
$sAux = $sClassName . 'plugin'; }
} if (! class_exists( $sAux )) {
$oClass = new $sAux($sClassName); $sAux = $sClassName . 'plugin';
$fVersionOld = $oClass->iVersion; }
unset($oClass); $oClass = new $sAux( $sClassName );
} $fVersionOld = $oClass->iVersion;
$res = $tar->extract ( $path ); unset( $oClass );
}
$res = $tar->extract( $path );
$sContent = file_get_contents($path . $pluginFile);
$chain = preg_quote('extends enterprisePlugin'); $sContent = file_get_contents( $path . $pluginFile );
if(strpos($sContent,$chain)){ $chain = preg_quote( 'extends enterprisePlugin' );
throw ( new Exception ('The plugin '.$filename.' is a Enterprise Edition Plugin, please install the Enterprise Plugins Manager to use this plugin.')); 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.' ));
$sContent = str_ireplace($sAux, $sAux . '_', $sContent); }
$sContent = str_ireplace('PATH_PLUGINS', "'".$path."'", $sContent); $sContent = str_ireplace( $sAux, $sAux . '_', $sContent );
$sContent = preg_replace("/\\\$oPluginRegistry\s*=\s*&\s*PMPluginRegistry::getSingleton\s*\(\s*\)\s*;/i", null, $sContent); $sContent = str_ireplace( 'PATH_PLUGINS', "'" . $path . "'", $sContent );
$sContent = preg_replace("/\\\$oPluginRegistry->registerPlugin\s*\(\s*[\"\']" . $sClassName . "[\"\']\s*,\s*__FILE__\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 );
//header('Content-Type: text/plain');var_dump($sClassName, $sContent);die;
file_put_contents($path . $pluginFile, $sContent); //header('Content-Type: text/plain');var_dump($sClassName, $sContent);die;
file_put_contents( $path . $pluginFile, $sContent );
$sAux = $sAux . '_';
$sAux = $sAux . '_';
include ($path . $pluginFile);
include ($path . $pluginFile);
$oClass = new $sAux($sClassName);
$fVersionNew = $oClass->iVersion; $oClass = new $sAux( $sClassName );
if (!isset($oClass->iPMVersion)) { $fVersionNew = $oClass->iVersion;
$oClass->iPMVersion = 0; if (! isset( $oClass->iPMVersion )) {
} $oClass->iPMVersion = 0;
if ($oClass->iPMVersion > 0) { }
G::LoadClass("system"); if ($oClass->iPMVersion > 0) {
if (System::getVersion() > 0) { G::LoadClass( "system" );
if ($oClass->iPMVersion > System::getVersion()) { if (System::getVersion() > 0) {
//throw new Exception('This plugin needs version ' . $oClass->iPMVersion . ' or higher of ProcessMaker'); if ($oClass->iPMVersion > System::getVersion()) {
} //throw new Exception('This plugin needs version ' . $oClass->iPMVersion . ' or higher of ProcessMaker');
} }
} }
if (!isset($oClass->aDependences)) { }
$oClass->aDependences = null; if (! isset( $oClass->aDependences )) {
} $oClass->aDependences = null;
if (!empty($oClass->aDependences)) { }
foreach ($oClass->aDependences as $aDependence) { if (! empty( $oClass->aDependences )) {
if (file_exists(PATH_PLUGINS . $aDependence['sClassName'] . '.php')) { foreach ($oClass->aDependences as $aDependence) {
require_once PATH_PLUGINS . $aDependence['sClassName'] . '.php'; if (file_exists( PATH_PLUGINS . $aDependence['sClassName'] . '.php' )) {
if (!$oPluginRegistry->getPluginDetails($aDependence['sClassName'] . '.php')) { require_once PATH_PLUGINS . $aDependence['sClassName'] . '.php';
$sDependence = $aDependence['sClassName']; if (! $oPluginRegistry->getPluginDetails( $aDependence['sClassName'] . '.php' )) {
throw new Exception( G::loadTranslation('ID_PLUGIN_DEPENDENCE_PLUGIN', SYS_LANG, array("Dependence"=>$sDependence )) ); $sDependence = $aDependence['sClassName'];
} throw new Exception( G::loadTranslation( 'ID_PLUGIN_DEPENDENCE_PLUGIN', SYS_LANG, array ("Dependence" => $sDependence
} ) ) );
else { }
$sDependence = $aDependence['sClassName']; } else {
throw new Exception( G::loadTranslation('ID_PLUGIN_DEPENDENCE_PLUGIN', SYS_LANG, array("Dependence"=>$sDependence )) ); $sDependence = $aDependence['sClassName'];
} throw new Exception( G::loadTranslation( 'ID_PLUGIN_DEPENDENCE_PLUGIN', SYS_LANG, array ("Dependence" => $sDependence
} ) ) );
} }
unset($oClass); }
if ($fVersionOld > $fVersionNew) { }
throw new Exception(G::loadTranslation('ID_RECENT_VERSION_PLUGIN')); unset( $oClass );
} if ($fVersionOld > $fVersionNew) {
$res = $tar->extract ( PATH_PLUGINS ); throw new Exception( G::loadTranslation( 'ID_RECENT_VERSION_PLUGIN' ) );
} }
else { $res = $tar->extract( PATH_PLUGINS );
throw ( new Exception ( G::loadTranslation('ID_FILE_CONTAIN_CLASS_PLUGIN', SYS_LANG, array("filename"=>$filename, "className"=>$sClassName )) ) ) ; } else {
} throw (new Exception( G::loadTranslation( 'ID_FILE_CONTAIN_CLASS_PLUGIN', SYS_LANG, array ("filename" => $filename,"className" => $sClassName
) ) ));
if ( !file_exists ( PATH_PLUGINS . $sClassName . '.php' ) ) { }
throw ( new Exception( G::loadTranslation('ID_FILE_PLUGIN_NOT_EXISTS', SYS_LANG, array("pluginFile"=>$pluginFile )) ) );
} if (! file_exists( PATH_PLUGINS . $sClassName . '.php' )) {
throw (new Exception( G::loadTranslation( 'ID_FILE_PLUGIN_NOT_EXISTS', SYS_LANG, array ("pluginFile" => $pluginFile
require_once (PATH_PLUGINS . $pluginFile); ) ) ));
}
$oPluginRegistry->registerPlugin($sClassName, PATH_PLUGINS . $sClassName . ".php");
$size = file_put_contents(PATH_DATA_SITE . "plugin.singleton", $oPluginRegistry->serializeInstance()); require_once (PATH_PLUGINS . $pluginFile);
$details = $oPluginRegistry->getPluginDetails($pluginFile); $oPluginRegistry->registerPlugin( $sClassName, PATH_PLUGINS . $sClassName . ".php" );
$size = file_put_contents( PATH_DATA_SITE . "plugin.singleton", $oPluginRegistry->serializeInstance() );
$oPluginRegistry->installPlugin($details->sNamespace);
$details = $oPluginRegistry->getPluginDetails( $pluginFile );
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins
$size = file_put_contents(PATH_DATA_SITE . "plugin.singleton", $oPluginRegistry->serializeInstance()); $oPluginRegistry->installPlugin( $details->sNamespace );
G::header("Location: pluginsMain"); $oPluginRegistry->setupPlugins(); //get and setup enabled plugins
die; $size = file_put_contents( PATH_DATA_SITE . "plugin.singleton", $oPluginRegistry->serializeInstance() );
}
catch (Exception $e) { G::header( "Location: pluginsMain" );
$_SESSION['__PLUGIN_ERROR__'] = $e->getMessage(); die();
G::header('Location: pluginsMain'); } catch (Exception $e) {
die(); $_SESSION['__PLUGIN_ERROR__'] = $e->getMessage();
} G::header( 'Location: pluginsMain' );
die();
}

View File

@@ -1,125 +1,114 @@
<?php <?php
/** /**
* pluginsList.php * pluginsList.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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)
if($pluginDetail==NULL) continue; //When for some reason we gen NULL plugin continue; //When for some reason we gen NULL plugin
$status_label = $pluginDetail->enabled ? G::LoadTranslation('ID_ENABLED') : G::LoadTranslation('ID_DISABLED'); $status_label = $pluginDetail->enabled ? G::LoadTranslation( 'ID_ENABLED' ) : G::LoadTranslation( 'ID_DISABLED' );
$status = $pluginDetail->enabled ? 1: 0; $status = $pluginDetail->enabled ? 1 : 0;
if ( isset ($pluginDetail->aWorkspaces ) ) { if (isset( $pluginDetail->aWorkspaces )) {
if ( ! in_array ( SYS_SYS, $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, 'sFile' => $file,'sStatusFile' => $pluginDetail->enabled
'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, closedir( $handle );
'setup'=>$setup, }
'sFile' => $file, $folders['items'] = $items;
'sStatusFile' => $pluginDetail->enabled //g::pr($items);
); echo G::json_encode( $items );
} die();
} $_DBArray['plugins'] = $items;
$_SESSION['_DBArray'] = $_DBArray;
}
} G::LoadClass( 'ArrayPeer' );
closedir($handle); $c = new Criteria( 'dbarray' );
} $c->setDBArrayTable( 'plugins' );
//$c->addAscendingOrderByColumn ('id');
$folders['items'] = $items;
//g::pr($items);
echo G::json_encode($items); $G_MAIN_MENU = 'processmaker';
die; $G_ID_MENU_SELECTED = 'SETUP';
$_DBArray['plugins'] = $items; $G_SUB_MENU = 'setup';
$_SESSION['_DBArray'] = $_DBArray; $G_ID_SUB_MENU_SELECTED = 'PLUGINS';
G::LoadClass( 'ArrayPeer'); $G_PUBLISH = new Publisher();
$c = new Criteria ('dbarray');
$c->setDBArrayTable('plugins'); $oHeadPublisher = & headPublisher::getSingleton();
//$c->addAscendingOrderByColumn ('id'); $oHeadPublisher->addScriptFile( '/jscore/setup/pluginList.js' );
$G_MAIN_MENU = 'processmaker'; $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/pluginList', $c );
$G_ID_MENU_SELECTED = 'SETUP'; G::RenderPage( 'publishBlank', 'blank' );
$G_SUB_MENU = 'setup';
$G_ID_SUB_MENU_SELECTED = 'PLUGINS';
$G_PUBLISH = new Publisher;
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptFile('/jscore/setup/pluginList.js');
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/pluginList', $c );
G::RenderPage('publishBlank', 'blank');
?>

View File

@@ -12,32 +12,26 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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

@@ -12,15 +12,14 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* pluginsSetup.php * pluginsSetup.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -12,47 +12,46 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* pluginsSetupSave.php * pluginsSetupSave.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -12,37 +12,36 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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

@@ -1,38 +1,37 @@
<?php <?php
/** /**
* main.php Cases List main processor * main.php Cases List main processor
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2010 Colosa Inc.23 * Copyright (C) 2004 - 2010 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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); $oHeadPublisher->assign( 'heartBeatChecked', $heartBeatChecked );
G::RenderPage('publish', 'extJs'); 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

@@ -12,101 +12,94 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * 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)
{
// 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("[ÍÌÎ]","I",$snameLogo);
// $snameLogo = ereg_replace("[íìî]","i",$snameLogo);
// $snameLogo = ereg_replace("[éèê]","e",$snameLogo);
// $snameLogo = ereg_replace("[ÉÈÊ]","E",$snameLogo);
// $snameLogo = ereg_replace("[óòôõº]","o",$snameLogo);
// $snameLogo = ereg_replace("[ÓÒÔÕ]","O",$snameLogo);
// $snameLogo = ereg_replace("[úùû]","u",$snameLogo);
// $snameLogo = ereg_replace("[ÚÙÛ]","U",$snameLogo);
$snameLogo = preg_replace("/[áàâãª]/", "a", $snameLogo);
$snameLogo = preg_replace("/[ÁÀÂÃ]/", "A", $snameLogo);
$snameLogo = preg_replace("/[ÍÌÎ]/", "I", $snameLogo);
$snameLogo = preg_replace("/[íìî]/", "i", $snameLogo);
$snameLogo = preg_replace("/[éèê]/", "e", $snameLogo);
$snameLogo = preg_replace("/[ÉÈÊ]/", "E", $snameLogo);
$snameLogo = preg_replace("/[óòôõº]/", "o", $snameLogo);
$snameLogo = preg_replace("/[ÓÒÔÕ]/", "O", $snameLogo);
$snameLogo = preg_replace("/[úùû]/", "u", $snameLogo);
$snameLogo = preg_replace("/[ÚÙÛ]/", "U", $snameLogo);
$snameLogo = str_replace("ç","c",$snameLogo);
$snameLogo = str_replace("Ç","C",$snameLogo);
$snameLogo = str_replace("[ñ]","n",$snameLogo);
$snameLogo = str_replace("[Ñ]","N",$snameLogo);
return ($snameLogo);
}
$sfunction =$_GET['function']; function changeNamelogo ($snameLogo)
switch($sfunction){ {
case 'replacementLogo': // The ereg_replace function has been DEPRECATED as of PHP 5.3.0.
$snameLogo=urldecode($_GET['NAMELOGO']); // $snameLogo = ereg_replace("[áàâãª]","a",$snameLogo);
$snameLogo=trim($snameLogo); // $snameLogo = ereg_replace("[Ã<>ÀÃÃ]","A",$snameLogo);
$snameLogo=changeNamelogo($snameLogo); // $snameLogo = ereg_replace("[Ã<>ÌÎ]","I",$snameLogo);
G::loadClass('configuration'); // $snameLogo = ereg_replace("[íìî]","i",$snameLogo);
$oConf = new Configurations; // $snameLogo = ereg_replace("[éèê]","e",$snameLogo);
$aConf = Array( // $snameLogo = ereg_replace("[ÉÈÊ]","E",$snameLogo);
'WORKSPACE_LOGO_NAME' => SYS_SYS, // $snameLogo = ereg_replace("[óòôõº]","o",$snameLogo);
'DEFAULT_LOGO_NAME' => $snameLogo // $snameLogo = ereg_replace("[ÓÒÔÕ]","O",$snameLogo);
); // $snameLogo = ereg_replace("[úùû]","u",$snameLogo);
// $snameLogo = ereg_replace("[ÚÙÛ]","U",$snameLogo);
$oConf->aConfig = $aConf; $snameLogo = preg_replace( "/[áàâãª]/", "a", $snameLogo );
$oConf->saveConfig('USER_LOGO_REPLACEMENT', '', '',''); $snameLogo = preg_replace( "/[Ã<>ÀÃÃ]/", "A", $snameLogo );
$snameLogo = preg_replace( "/[Ã<>ÌÎ]/", "I", $snameLogo );
G::SendTemporalMessage('ID_REPLACED_LOGO', 'tmp-info', 'labels'); $snameLogo = preg_replace( "/[íìî]/", "i", $snameLogo );
//header('location: uplogo.php'); $snameLogo = preg_replace( "/[éèê]/", "e", $snameLogo );
//G::header('location: uplogo'); $snameLogo = preg_replace( "/[ÉÈÊ]/", "E", $snameLogo );
break; $snameLogo = preg_replace( "/[óòôõº]/", "o", $snameLogo );
case 'restoreLogo': $snameLogo = preg_replace( "/[ÓÒÔÕ]/", "O", $snameLogo );
$snameLogo=$_GET['NAMELOGO']; $snameLogo = preg_replace( "/[úùû]/", "u", $snameLogo );
G::loadClass('configuration'); $snameLogo = preg_replace( "/[ÚÙÛ]/", "U", $snameLogo );
$oConf = new Configurations; $snameLogo = str_replace( "ç", "c", $snameLogo );
$aConf = Array( $snameLogo = str_replace( "Ç", "C", $snameLogo );
'WORKSPACE_LOGO_NAME' => '', $snameLogo = str_replace( "[ñ]", "n", $snameLogo );
'DEFAULT_LOGO_NAME' => '' $snameLogo = str_replace( "[Ñ]", "N", $snameLogo );
); return ($snameLogo);
}
$oConf->aConfig = $aConf;
$oConf->saveConfig('USER_LOGO_REPLACEMENT', '', '','');
G::SendTemporalMessage('ID_REPLACED_LOGO', 'tmp-info', 'labels');
break;
} $sfunction = $_GET['function'];
switch ($sfunction) {
case 'replacementLogo':
$snameLogo = urldecode( $_GET['NAMELOGO'] );
$snameLogo = trim( $snameLogo );
$snameLogo = changeNamelogo( $snameLogo );
G::loadClass( 'configuration' );
$oConf = new Configurations();
$aConf = Array ('WORKSPACE_LOGO_NAME' => SYS_SYS,'DEFAULT_LOGO_NAME' => $snameLogo
);
$oConf->aConfig = $aConf;
$oConf->saveConfig( 'USER_LOGO_REPLACEMENT', '', '', '' );
G::SendTemporalMessage( 'ID_REPLACED_LOGO', 'tmp-info', 'labels' );
//header('location: uplogo.php');
//G::header('location: uplogo');
break;
case 'restoreLogo':
$snameLogo = $_GET['NAMELOGO'];
G::loadClass( 'configuration' );
$oConf = new Configurations();
$aConf = Array ('WORKSPACE_LOGO_NAME' => '','DEFAULT_LOGO_NAME' => ''
);
$oConf->aConfig = $aConf;
$oConf->saveConfig( 'USER_LOGO_REPLACEMENT', '', '', '' );
G::SendTemporalMessage( 'ID_REPLACED_LOGO', 'tmp-info', 'labels' );
break;
}
} catch (Exception $oException) {
die( $oException->getMessage() );
} }
catch (Exception $oException) {
die($oException->getMessage());
}
?>