CODE STYLE, workflow/engine/methods/setup/ PART 1
FILES: appCacheViewAjax.php appCacheViewConf.php appearance.php calendarDelete.php calendarEdit.php calendarList.php calendarSave.php calendarValidate.php calendar_Ajax.php clearCompiled.php clearCompiledAjax.php connectionDB.php connectionWS.php cron.php cronAjax.php customFunctions.php debug.php deleteSessions.php emailSystemCron.php emailSystemSpool.php emailSystemTest.php emails.php emails_Ajax.php emails_Save.php environmentSettings.php environmentSettingsAjax.php
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,37 +1,39 @@
|
||||
<?php
|
||||
<?php
|
||||
// header('Pragma: no-cache');
|
||||
// header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
//$oHeadPublisher->setExtSkin( 'xtheme-blue');
|
||||
|
||||
$oHeadPublisher->addExtJsScript('setup/appCacheViewConf', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('setup/appCacheViewConf'); //adding a html file .html.
|
||||
|
||||
require_once('classes/model/AppCacheView.php');
|
||||
G::loadClass('configuration');
|
||||
$oConf = new Configurations;
|
||||
$oConf->loadConfig($x, 'APP_CACHE_VIEW_ENGINE','','','','');
|
||||
|
||||
//first check about APP_CACHE_VIEW is enabled or not,
|
||||
if ( isset($oConf->aConfig['LANG']) && isset($oConf->aConfig['STATUS']) && $oConf->aConfig['STATUS'] == 'active'){
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
//$oHeadPublisher->setExtSkin( 'xtheme-blue');
|
||||
|
||||
|
||||
$oHeadPublisher->addExtJsScript( 'setup/appCacheViewConf', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'setup/appCacheViewConf' ); //adding a html file .html.
|
||||
|
||||
|
||||
require_once ('classes/model/AppCacheView.php');
|
||||
G::loadClass( 'configuration' );
|
||||
$oConf = new Configurations();
|
||||
$oConf->loadConfig( $x, 'APP_CACHE_VIEW_ENGINE', '', '', '', '' );
|
||||
|
||||
//first check about APP_CACHE_VIEW is enabled or not,
|
||||
if (isset( $oConf->aConfig['LANG'] ) && isset( $oConf->aConfig['STATUS'] ) && $oConf->aConfig['STATUS'] == 'active') {
|
||||
$appCacheViewEnabled = true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$appCacheViewEnabled = false;
|
||||
}
|
||||
$lang = isset($oConf->aConfig['LANG']) ? $oConf->aConfig['LANG'] : 'en';
|
||||
|
||||
//$oHeadPublisher->assign('appCacheViewEnabled', $appCacheViewEnabled);
|
||||
}
|
||||
$lang = isset( $oConf->aConfig['LANG'] ) ? $oConf->aConfig['LANG'] : 'en';
|
||||
|
||||
$labels = G::getTranslations(Array(
|
||||
'ID_PROCESSING', 'ID_CACHE_LANGUAGE', 'ID_CACHE_HOST', 'ID_CACHE_USER', 'ID_CACHE_PASSWORD',
|
||||
'ID_CACHE_TITLE_INFO', 'ID_CACHE_SUBTITLE_REBUILD', 'ID_CACHE_BTN_BUILD',
|
||||
'ID_CACHE_BUILDING', 'ID_CACHE_SUBTITLE_SETUP_DB', 'ID_CACHE_BTN_SETUP_PASSWRD', 'ID_CACHE_SUBTITLE_SETUP_SESSION', 'ID_CACHE_BTN_SETUP_SESSION'
|
||||
));
|
||||
// $oHeadPublisher->assign('TRANSLATIONS', $labels);
|
||||
// $TRANSLATIONS->ID_PROCESSING = G::LoadTranslation('ID_PROCESSING');
|
||||
// $oHeadPublisher->assign( 'TRANSLATIONS', $TRANSLATIONS); //translations
|
||||
$oHeadPublisher->assign( 'currentLang', $lang); //current language
|
||||
//$oHeadPublisher->assign('appCacheViewEnabled', $appCacheViewEnabled);
|
||||
|
||||
|
||||
$labels = G::getTranslations( Array ('ID_PROCESSING','ID_CACHE_LANGUAGE','ID_CACHE_HOST','ID_CACHE_USER','ID_CACHE_PASSWORD','ID_CACHE_TITLE_INFO','ID_CACHE_SUBTITLE_REBUILD','ID_CACHE_BTN_BUILD','ID_CACHE_BUILDING','ID_CACHE_SUBTITLE_SETUP_DB','ID_CACHE_BTN_SETUP_PASSWRD','ID_CACHE_SUBTITLE_SETUP_SESSION','ID_CACHE_BTN_SETUP_SESSION'
|
||||
) );
|
||||
// $oHeadPublisher->assign('TRANSLATIONS', $labels);
|
||||
// $TRANSLATIONS->ID_PROCESSING = G::LoadTranslation('ID_PROCESSING');
|
||||
// $oHeadPublisher->assign( 'TRANSLATIONS', $TRANSLATIONS); //translations
|
||||
$oHeadPublisher->assign( 'currentLang', $lang ); //current language
|
||||
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* appearance.php
|
||||
*
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
@@ -12,24 +12,24 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
|
||||
$G_ENABLE_BLANK_SKIN = true;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
|
||||
return $RBAC_Response;
|
||||
$G_ENABLE_BLANK_SKIN = true;
|
||||
|
||||
$dbc = new DBConnection;
|
||||
$dbc = new DBConnection();
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent("content", "setup/company_template");
|
||||
G::RenderPage( 'publish' );
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( "content", "setup/company_template" );
|
||||
G::RenderPage( 'publish' );
|
||||
?>company logo
|
||||
|
||||
<script language="JavaScript">
|
||||
@@ -38,8 +38,11 @@ window.onload = new Function("myOnLoad()");
|
||||
function myOnLoad()
|
||||
{
|
||||
<?php if ($var == 'change') { ?>
|
||||
location.reload();
|
||||
<?php } ?>
|
||||
location.reload();
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
}
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
<?php
|
||||
try {
|
||||
<?php
|
||||
try {
|
||||
|
||||
$CalendarUid = $_GET['id'];
|
||||
|
||||
G::LoadClass( 'calendar' );
|
||||
$calendarObj = new calendar();
|
||||
$calendarObj->deleteCalendar( $CalendarUid );
|
||||
|
||||
G::LoadClass('calendar');
|
||||
$calendarObj=new calendar();
|
||||
$calendarObj->deleteCalendar($CalendarUid);
|
||||
G::Header( 'location: calendarList' );
|
||||
|
||||
G::Header('location: calendarList');
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
$G_PUBLISH = new Publisher;
|
||||
} catch (Exception $e) {
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,60 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* calendarEdit.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1){
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
//G::header('location: ../login/login');
|
||||
die;
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CALENDAR';
|
||||
|
||||
$CalendarUid = str_replace ( '"', '', isset ( $_GET ['id'] ) ? $_GET ['id'] : G::GenerateUniqueID () );
|
||||
//TODO: Add validation before save for all fields
|
||||
G::LoadClass ( 'calendar' );
|
||||
$calendarObj = new calendar ( );
|
||||
if ((isset ( $_GET ['id'] )) && ($_GET ['id'] != "")) {
|
||||
$fields = $calendarObj->getCalendarInfoE ( $CalendarUid );
|
||||
$fields ['OLD_NAME'] = $fields['CALENDAR_NAME'];
|
||||
}
|
||||
|
||||
if (! (isset ( $fields ['CALENDAR_UID'] ))) { //For a new Calendar
|
||||
$fields ['CALENDAR_UID'] = $CalendarUid;
|
||||
$fields ['OLD_NAME'] = '';
|
||||
//Default Business Hour
|
||||
$fields ['BUSINESS_DAY'] [1] ['CALENDAR_BUSINESS_DAY'] = 7;
|
||||
$fields ['BUSINESS_DAY'] [1] ['CALENDAR_BUSINESS_START'] = "09:00";
|
||||
$fields ['BUSINESS_DAY'] [1] ['CALENDAR_BUSINESS_END'] = "17:00";
|
||||
}
|
||||
if ((isset ( $_GET ['cp'] )) && ($_GET ['cp'] == 1)) { // Copy Calendar
|
||||
$fields ['CALENDAR_UID'] = G::GenerateUniqueID ();
|
||||
$fields ['CALENDAR_NAME'] = G::LoadTranslation ( "ID_COPY_OF" ) . " " . $fields ['CALENDAR_NAME'];
|
||||
}
|
||||
$G_PUBLISH = new Publisher ( );
|
||||
$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'setup/calendarEdit', '', $fields, 'calendarSave' );
|
||||
G::RenderPage ( 'publishBlank', 'blank' );
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* calendarEdit.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
//G::header('location: ../login/login');
|
||||
die();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CALENDAR';
|
||||
|
||||
$CalendarUid = str_replace( '"', '', isset( $_GET['id'] ) ? $_GET['id'] : G::GenerateUniqueID() );
|
||||
//TODO: Add validation before save for all fields
|
||||
G::LoadClass( 'calendar' );
|
||||
$calendarObj = new calendar();
|
||||
if ((isset( $_GET['id'] )) && ($_GET['id'] != "")) {
|
||||
$fields = $calendarObj->getCalendarInfoE( $CalendarUid );
|
||||
$fields['OLD_NAME'] = $fields['CALENDAR_NAME'];
|
||||
}
|
||||
|
||||
if (! (isset( $fields['CALENDAR_UID'] ))) { //For a new Calendar
|
||||
$fields['CALENDAR_UID'] = $CalendarUid;
|
||||
$fields['OLD_NAME'] = '';
|
||||
//Default Business Hour
|
||||
$fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_DAY'] = 7;
|
||||
$fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_START'] = "09:00";
|
||||
$fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_END'] = "17:00";
|
||||
}
|
||||
if ((isset( $_GET['cp'] )) && ($_GET['cp'] == 1)) { // Copy Calendar
|
||||
$fields['CALENDAR_UID'] = G::GenerateUniqueID();
|
||||
$fields['CALENDAR_NAME'] = G::LoadTranslation( "ID_COPY_OF" ) . " " . $fields['CALENDAR_NAME'];
|
||||
}
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/calendarEdit', '', $fields, 'calendarSave' );
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
|
||||
|
||||
@@ -1,51 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* calendarList.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1){
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
//G::header('location: ../login/login');
|
||||
die;
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CALENDAR';
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
|
||||
G::LoadClass('configuration');
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration('calendarList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('setup/calendarList', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('setup/calendarList'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('CONFIG', $Config);
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* calendarList.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
//G::header('location: ../login/login');
|
||||
die();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CALENDAR';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
G::LoadClass( 'configuration' );
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration( 'calendarList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'setup/calendarList', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'setup/calendarList' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'CONFIG', $Config );
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* calendarSave.php
|
||||
*
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
@@ -12,43 +12,41 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
switch ($RBAC->userCanAccess('PM_SETUP_ADVANCE'))
|
||||
{
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
case -1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
switch ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
try {
|
||||
$form = $_POST['form'];
|
||||
|
||||
G::LoadClass('calendar');
|
||||
$calendarObj=new calendar();
|
||||
$calendarObj->saveCalendarInfo($form);
|
||||
try {
|
||||
$form = $_POST['form'];
|
||||
|
||||
G::Header('location: calendarList');
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
$G_PUBLISH = new Publisher;
|
||||
G::LoadClass( 'calendar' );
|
||||
$calendarObj = new calendar();
|
||||
$calendarObj->saveCalendarInfo( $form );
|
||||
|
||||
G::Header( 'location: calendarList' );
|
||||
|
||||
} catch (Exception $e) {
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,68 +12,66 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
// validating the fields of the Calendar Edit form.
|
||||
// checking permissions
|
||||
switch ($RBAC->userCanAccess('PM_SETUP_ADVANCE'))
|
||||
{
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
case -1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
switch ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
// validating the fields
|
||||
$message = array();
|
||||
$oldName = isset($_POST['oldName'])?$_POST['oldName']:'';
|
||||
$message = array ();
|
||||
$oldName = isset( $_POST['oldName'] ) ? $_POST['oldName'] : '';
|
||||
|
||||
switch ($_POST['action']){
|
||||
case 'calendarName':
|
||||
require_once ('classes/model/CalendarDefinition.php');
|
||||
$oCalendar = new CalendarDefinition();
|
||||
$aCalendars = $oCalendar->getCalendarList(false,true);
|
||||
// var_dump($_POST['name']);
|
||||
// var_dump($aCalendars);
|
||||
//$count = 0;
|
||||
$aCalendarDefinitions = end($aCalendars);
|
||||
// var_dump($aCalendarDefinitions);
|
||||
foreach($aCalendarDefinitions as $aDefinitions) {
|
||||
if (trim($_POST['name'])==''){
|
||||
$validated = false;
|
||||
$message = G::loadTranslation('ID_CALENDAR_INVALID_NAME');
|
||||
switch ($_POST['action']) {
|
||||
case 'calendarName':
|
||||
require_once ('classes/model/CalendarDefinition.php');
|
||||
$oCalendar = new CalendarDefinition();
|
||||
$aCalendars = $oCalendar->getCalendarList( false, true );
|
||||
// var_dump($_POST['name']);
|
||||
// var_dump($aCalendars);
|
||||
//$count = 0;
|
||||
$aCalendarDefinitions = end( $aCalendars );
|
||||
// var_dump($aCalendarDefinitions);
|
||||
foreach ($aCalendarDefinitions as $aDefinitions) {
|
||||
if (trim( $_POST['name'] ) == '') {
|
||||
$validated = false;
|
||||
$message = G::loadTranslation( 'ID_CALENDAR_INVALID_NAME' );
|
||||
break;
|
||||
}
|
||||
if ($aDefinitions['CALENDAR_NAME'] != $_POST['name']) {
|
||||
$validated = true;
|
||||
} else {
|
||||
if ($aDefinitions['CALENDAR_NAME'] != $oldName) {
|
||||
$validated = false;
|
||||
$message = G::loadTranslation( 'ID_CALENDAR_INVALID_NAME' );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if ($aDefinitions['CALENDAR_NAME']!=$_POST['name']){
|
||||
$validated = true;
|
||||
} else {
|
||||
if ($aDefinitions['CALENDAR_NAME']!=$oldName) {
|
||||
case 'calendarDates':
|
||||
$validated = false;
|
||||
$message = G::loadTranslation('ID_CALENDAR_INVALID_NAME');
|
||||
$message = G::loadTranslation( 'ID_CALENDAR_INVALID_WORK_DATES' );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'calendarDates':
|
||||
$validated = false;
|
||||
$message = G::loadTranslation('ID_CALENDAR_INVALID_WORK_DATES');
|
||||
break;
|
||||
}
|
||||
if (!$validated){
|
||||
if (! $validated) {
|
||||
echo ($message);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,91 +12,89 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1){
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
//G::header('location: ../login/login');
|
||||
die;
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
//G::header('location: ../login/login');
|
||||
die();
|
||||
}
|
||||
$_POST['action'] = $_REQUEST['action'];
|
||||
|
||||
switch ($_POST['action'])
|
||||
{
|
||||
case 'calendarList':
|
||||
G::LoadClass('configuration');
|
||||
G::LoadClass('calendar');
|
||||
|
||||
$co = new Configurations();
|
||||
$config = $co->getConfiguration('calendarList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
|
||||
$limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
|
||||
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
|
||||
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size;
|
||||
$filter = isset($_REQUEST['textFilter']) ? $_REQUEST['textFilter'] : '';
|
||||
|
||||
$calendar = new calendar();
|
||||
$CRI = $calendar->getCalendarCriterias($filter, $start, $limit);
|
||||
|
||||
$aUsers = $calendar->getAllCounterByCalendar('USER');
|
||||
$aTasks = $calendar->getAllCounterByCalendar('TASK');
|
||||
$aProcess = $calendar->getAllCounterByCalendar('PROCESS');
|
||||
|
||||
$total_cals = CalendarDefinitionPeer::doCount($CRI['COUNTER']);
|
||||
|
||||
$oDataSet = CalendarDefinitionPeer::doSelectRS($CRI['LIST']);
|
||||
$oDataSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$aCals = array();
|
||||
while ($oDataSet->next()){
|
||||
$aCals[] = $oDataSet->getRow();
|
||||
$index = sizeof($aCals)-1;
|
||||
$aCals[$index]['TOTAL_USERS'] = isset($aUsers[$aCals[$index]['CALENDAR_UID']])? $aUsers[$aCals[$index]['CALENDAR_UID']]: 0;
|
||||
$aCals[$index]['TOTAL_TASKS'] = isset($aTasks[$aCals[$index]['CALENDAR_UID']])? $aTasks[$aCals[$index]['CALENDAR_UID']]: 0;
|
||||
$aCals[$index]['TOTAL_PROCESS'] = isset($aProcess[$aCals[$index]['CALENDAR_UID']])? $aProcess[$aCals[$index]['CALENDAR_UID']]: 0;
|
||||
}
|
||||
echo '{cals: '.G::json_encode($aCals).', total_cals: '.$total_cals.'}';
|
||||
break;
|
||||
case 'updatePageSize':
|
||||
G::LoadClass('configuration');
|
||||
$c = new Configurations();
|
||||
$arr['pageSize'] = $_REQUEST['size'];
|
||||
$arr['dateSave'] = date('Y-m-d H:i:s');
|
||||
$config = Array();
|
||||
$config[] = $arr;
|
||||
$c->aConfig = $config;
|
||||
$c->saveConfig('calendarList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
echo '{success: true}';
|
||||
break;
|
||||
case 'canDeleteCalendar':
|
||||
$cal_uid = $_POST['CAL_UID'];
|
||||
G::LoadClass('calendar');
|
||||
$cal = new calendar();
|
||||
$total = 0;
|
||||
$u = $cal->getAllCounterByCalendar('USER');
|
||||
$t_u = isset($u[$cal_uid]) ? $u[$cal_uid]: 0;
|
||||
$t = $cal->getAllCounterByCalendar('TASK');
|
||||
$t_t = isset($t[$cal_uid]) ? $t[$cal_uid]: 0;
|
||||
$p = $cal->getAllCounterByCalendar('PROCESS');
|
||||
$t_p = isset($p[$cal_uid]) ? $p[$cal_uid]: 0;
|
||||
$total = $t_u + $t_t + $t_p;
|
||||
$response = ($total==0)? 'true': 'false';
|
||||
echo '{success: '.$response.'}';
|
||||
break;
|
||||
case 'deleteCalendar':
|
||||
$CalendarUid = $_POST['CAL_UID'];
|
||||
G::LoadClass('calendar');
|
||||
$calendarObj=new calendar();
|
||||
$calendarObj->deleteCalendar($CalendarUid);
|
||||
echo '{success: true}';
|
||||
break;
|
||||
switch ($_POST['action']) {
|
||||
case 'calendarList':
|
||||
G::LoadClass( 'configuration' );
|
||||
G::LoadClass( 'calendar' );
|
||||
|
||||
$co = new Configurations();
|
||||
$config = $co->getConfiguration( 'calendarList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
|
||||
$limit_size = isset( $config['pageSize'] ) ? $config['pageSize'] : 20;
|
||||
$start = isset( $_REQUEST['start'] ) ? $_REQUEST['start'] : 0;
|
||||
$limit = isset( $_REQUEST['limit'] ) ? $_REQUEST['limit'] : $limit_size;
|
||||
$filter = isset( $_REQUEST['textFilter'] ) ? $_REQUEST['textFilter'] : '';
|
||||
|
||||
$calendar = new calendar();
|
||||
$CRI = $calendar->getCalendarCriterias( $filter, $start, $limit );
|
||||
|
||||
$aUsers = $calendar->getAllCounterByCalendar( 'USER' );
|
||||
$aTasks = $calendar->getAllCounterByCalendar( 'TASK' );
|
||||
$aProcess = $calendar->getAllCounterByCalendar( 'PROCESS' );
|
||||
|
||||
$total_cals = CalendarDefinitionPeer::doCount( $CRI['COUNTER'] );
|
||||
|
||||
$oDataSet = CalendarDefinitionPeer::doSelectRS( $CRI['LIST'] );
|
||||
$oDataSet->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$aCals = array ();
|
||||
while ($oDataSet->next()) {
|
||||
$aCals[] = $oDataSet->getRow();
|
||||
$index = sizeof( $aCals ) - 1;
|
||||
$aCals[$index]['TOTAL_USERS'] = isset( $aUsers[$aCals[$index]['CALENDAR_UID']] ) ? $aUsers[$aCals[$index]['CALENDAR_UID']] : 0;
|
||||
$aCals[$index]['TOTAL_TASKS'] = isset( $aTasks[$aCals[$index]['CALENDAR_UID']] ) ? $aTasks[$aCals[$index]['CALENDAR_UID']] : 0;
|
||||
$aCals[$index]['TOTAL_PROCESS'] = isset( $aProcess[$aCals[$index]['CALENDAR_UID']] ) ? $aProcess[$aCals[$index]['CALENDAR_UID']] : 0;
|
||||
}
|
||||
echo '{cals: ' . G::json_encode( $aCals ) . ', total_cals: ' . $total_cals . '}';
|
||||
break;
|
||||
case 'updatePageSize':
|
||||
G::LoadClass( 'configuration' );
|
||||
$c = new Configurations();
|
||||
$arr['pageSize'] = $_REQUEST['size'];
|
||||
$arr['dateSave'] = date( 'Y-m-d H:i:s' );
|
||||
$config = Array ();
|
||||
$config[] = $arr;
|
||||
$c->aConfig = $config;
|
||||
$c->saveConfig( 'calendarList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
echo '{success: true}';
|
||||
break;
|
||||
case 'canDeleteCalendar':
|
||||
$cal_uid = $_POST['CAL_UID'];
|
||||
G::LoadClass( 'calendar' );
|
||||
$cal = new calendar();
|
||||
$total = 0;
|
||||
$u = $cal->getAllCounterByCalendar( 'USER' );
|
||||
$t_u = isset( $u[$cal_uid] ) ? $u[$cal_uid] : 0;
|
||||
$t = $cal->getAllCounterByCalendar( 'TASK' );
|
||||
$t_t = isset( $t[$cal_uid] ) ? $t[$cal_uid] : 0;
|
||||
$p = $cal->getAllCounterByCalendar( 'PROCESS' );
|
||||
$t_p = isset( $p[$cal_uid] ) ? $p[$cal_uid] : 0;
|
||||
$total = $t_u + $t_t + $t_p;
|
||||
$response = ($total == 0) ? 'true' : 'false';
|
||||
echo '{success: ' . $response . '}';
|
||||
break;
|
||||
case 'deleteCalendar':
|
||||
$CalendarUid = $_POST['CAL_UID'];
|
||||
G::LoadClass( 'calendar' );
|
||||
$calendarObj = new calendar();
|
||||
$calendarObj->deleteCalendar( $CalendarUid );
|
||||
echo '{success: true}';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* class.g.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('setup/clearCompiled', true ); //adding a javascript file .js
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
<?php
|
||||
/**
|
||||
* class.g.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'setup/clearCompiled', true ); //adding a javascript file .js
|
||||
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
|
||||
@@ -1,30 +1,29 @@
|
||||
<?php
|
||||
try {
|
||||
if (isset($_POST['javascriptCache']) || isset($_POST['metadataCache']) || isset($_POST['htmlCache'])) {
|
||||
|
||||
if (isset($_POST['javascriptCache'])) {
|
||||
G::rm_dir(PATH_C . 'ExtJs');
|
||||
$response->javascript = true;
|
||||
}
|
||||
if (isset( $_POST['javascriptCache'] ) || isset( $_POST['metadataCache'] ) || isset( $_POST['htmlCache'] )) {
|
||||
|
||||
if (isset($_POST['metadataCache'])) {
|
||||
G::rm_dir(PATH_C . 'xmlform');
|
||||
$response->xmlform = true;
|
||||
}
|
||||
if (isset( $_POST['javascriptCache'] )) {
|
||||
G::rm_dir( PATH_C . 'ExtJs' );
|
||||
$response->javascript = true;
|
||||
}
|
||||
|
||||
if (isset($_POST['htmlCache'])) {
|
||||
G::rm_dir(PATH_C . 'smarty');
|
||||
$response->smarty = true;
|
||||
if (isset( $_POST['metadataCache'] )) {
|
||||
G::rm_dir( PATH_C . 'xmlform' );
|
||||
$response->xmlform = true;
|
||||
}
|
||||
|
||||
if (isset( $_POST['htmlCache'] )) {
|
||||
G::rm_dir( PATH_C . 'smarty' );
|
||||
$response->smarty = true;
|
||||
}
|
||||
|
||||
$response->success = true;
|
||||
} else {
|
||||
$response->success = false;
|
||||
}
|
||||
|
||||
$response->success = true;
|
||||
}
|
||||
else{
|
||||
} catch (Exception $e) {
|
||||
$response->success = false;
|
||||
}
|
||||
$response->message = $e->getMessage();
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$response->success = false;
|
||||
$response->message = $e->getMessage();
|
||||
}
|
||||
echo G::json_encode($response);
|
||||
echo G::json_encode( $response );
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* connectionDB.php
|
||||
*
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
@@ -12,21 +12,21 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
|
||||
$G_ENABLE_BLANK_SKIN = true;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
|
||||
return $RBAC_Response;
|
||||
$G_ENABLE_BLANK_SKIN = true;
|
||||
|
||||
$dbc = new DBConnection();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( "xmlform", "pagedTable", "setup/connection_db", "", "", "" );
|
||||
G::RenderPage( 'publish' );
|
||||
|
||||
$dbc = new DBConnection;
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent( "xmlform", "pagedTable", "setup/connection_db","","", "" );
|
||||
G::RenderPage( 'publish' );
|
||||
?>
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* connectionWS.php
|
||||
*
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
@@ -12,21 +12,21 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
|
||||
$G_ENABLE_BLANK_SKIN = true;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
|
||||
return $RBAC_Response;
|
||||
$G_ENABLE_BLANK_SKIN = true;
|
||||
|
||||
$dbc = new DBConnection();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( "xmlform", "pagedTable", "setup/connection_ws", "", "", "" );
|
||||
G::RenderPage( 'publish' );
|
||||
|
||||
$dbc = new DBConnection;
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent( "xmlform", "pagedTable", "setup/connection_ws","","", "" );
|
||||
G::RenderPage( 'publish' );
|
||||
?>
|
||||
@@ -1,31 +1,27 @@
|
||||
<?php
|
||||
G::LoadClass("system");
|
||||
G::LoadClass("wsTools");
|
||||
G::LoadClass("configuration");
|
||||
G::LoadClass( "system" );
|
||||
G::LoadClass( "wsTools" );
|
||||
G::LoadClass( "configuration" );
|
||||
|
||||
global $RBAC;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ($RBAC->userCanAccess("PM_SETUP_ADVANCE") != 1) {
|
||||
G::SendTemporalMessage("ID_USER_HAVENT_RIGHTS_PAGE", "error", "labels");
|
||||
exit(0);
|
||||
if ($RBAC->userCanAccess( "PM_SETUP_ADVANCE" ) != 1) {
|
||||
G::SendTemporalMessage( "ID_USER_HAVENT_RIGHTS_PAGE", "error", "labels" );
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
//Cron status
|
||||
$bCronIsRunning = false;
|
||||
$sLastExecution = null;
|
||||
$processcTimeProcess = 0;
|
||||
$processcTimeStart = 0;
|
||||
$processcTimeStart = 0;
|
||||
|
||||
if (file_exists(PATH_DATA . "cron")) {
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$bCronIsRunning = (boolean)($arrayCron["bCronIsRunning"]);
|
||||
if (file_exists( PATH_DATA . "cron" )) {
|
||||
$arrayCron = unserialize( trim( @file_get_contents( PATH_DATA . "cron" ) ) );
|
||||
$bCronIsRunning = (boolean) ($arrayCron["bCronIsRunning"]);
|
||||
$sLastExecution = $arrayCron["sLastExecution"];
|
||||
$processcTimeProcess = (isset($arrayCron["processcTimeProcess"]))? intval($arrayCron["processcTimeProcess"]) : 10;
|
||||
$processcTimeStart = (isset($arrayCron["processcTimeStart"]))? $arrayCron["processcTimeStart"] : 0;
|
||||
$processcTimeProcess = (isset( $arrayCron["processcTimeProcess"] )) ? intval( $arrayCron["processcTimeProcess"] ) : 10;
|
||||
$processcTimeStart = (isset( $arrayCron["processcTimeStart"] )) ? $arrayCron["processcTimeStart"] : 0;
|
||||
}
|
||||
|
||||
if ($bCronIsRunning && $processcTimeStart != 0) {
|
||||
@@ -37,54 +33,55 @@ if ($bCronIsRunning && $processcTimeStart != 0) {
|
||||
|
||||
//Data
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration("cronList", "pageSize", null, $_SESSION["USER_LOGGED"]);
|
||||
$configPage = $c->getConfiguration( "cronList", "pageSize", null, $_SESSION["USER_LOGGED"] );
|
||||
|
||||
$config = array();
|
||||
$config["pageSize"] = (isset($configPage["pageSize"]))? $configPage["pageSize"] : 20;
|
||||
$config = array ();
|
||||
$config["pageSize"] = (isset( $configPage["pageSize"] )) ? $configPage["pageSize"] : 20;
|
||||
|
||||
$cronInfo = array();
|
||||
$fileLog = PATH_DATA . "log" . PATH_SEP . "cron.log";
|
||||
$fileLogSize = (file_exists($fileLog))? number_format(filesize($fileLog) * (1 / 1024) * (1 / 1024), 4, ".", "") : 0;
|
||||
$cronInfo = array ();
|
||||
$fileLog = PATH_DATA . "log" . PATH_SEP . "cron.log";
|
||||
$fileLogSize = (file_exists( $fileLog )) ? number_format( filesize( $fileLog ) * (1 / 1024) * (1 / 1024), 4, ".", "" ) : 0;
|
||||
|
||||
$cronInfo["status"] = G::LoadTranslation((($bCronIsRunning)? "ID_CRON_STATUS_ACTIVE" : "ID_CRON_STATUS_INACTIVE"));
|
||||
$cronInfo["lastExecution"] = (!empty($sLastExecution))? $sLastExecution : "";
|
||||
$cronInfo["status"] = G::LoadTranslation( (($bCronIsRunning) ? "ID_CRON_STATUS_ACTIVE" : "ID_CRON_STATUS_INACTIVE") );
|
||||
$cronInfo["lastExecution"] = (! empty( $sLastExecution )) ? $sLastExecution : "";
|
||||
$cronInfo["fileLogName"] = "cron.log";
|
||||
$cronInfo["fileLogSize"] = $fileLogSize;
|
||||
$cronInfo["fileLogPath"] = $fileLog;
|
||||
|
||||
|
||||
//Workspaces
|
||||
$workspaces = System::listWorkspaces();
|
||||
$arrayAux = array();
|
||||
$arrayAux = array ();
|
||||
|
||||
foreach ($workspaces as $index => $workspace) {
|
||||
$arrayAux[] = $workspace->name;
|
||||
}
|
||||
|
||||
sort($arrayAux);
|
||||
sort( $arrayAux );
|
||||
|
||||
$arrayWorkspace = array();
|
||||
$arrayWorkspace = array ();
|
||||
|
||||
foreach ($arrayAux as $index => $value) {
|
||||
$arrayWorkspace[] = array($value, $value);
|
||||
$arrayWorkspace[] = array ($value,$value
|
||||
);
|
||||
}
|
||||
|
||||
array_unshift($arrayWorkspace, array("ALL", G::LoadTranslation("ID_ALL_WORKSPACES")));
|
||||
array_unshift( $arrayWorkspace, array ("ALL",G::LoadTranslation( "ID_ALL_WORKSPACES" )
|
||||
) );
|
||||
|
||||
//Status
|
||||
$arrayStatus = array(
|
||||
array("ALL", G::LoadTranslation("ID_ALL")),
|
||||
array("COMPLETED", G::LoadTranslation("COMPLETED")),
|
||||
array("FAILED", G::LoadTranslation("ID_FAILED"))
|
||||
$arrayStatus = array (array ("ALL",G::LoadTranslation( "ID_ALL" )
|
||||
),array ("COMPLETED",G::LoadTranslation( "COMPLETED" )
|
||||
),array ("FAILED",G::LoadTranslation( "ID_FAILED" )
|
||||
)
|
||||
);
|
||||
|
||||
$oHeadPublisher = &headPublisher::getSingleton();
|
||||
$oHeadPublisher->addContent("setup/cron"); //Adding a html file .html
|
||||
$oHeadPublisher->addExtJsScript("setup/cron", false); //Adding a javascript file .js
|
||||
$oHeadPublisher->assign("CONFIG", $config);
|
||||
$oHeadPublisher->assign("CRON", $cronInfo);
|
||||
$oHeadPublisher->assign("WORKSPACE", $arrayWorkspace);
|
||||
$oHeadPublisher->assign("STATUS", $arrayStatus);
|
||||
$oHeadPublisher->addContent( "setup/cron" ); //Adding a html file .html
|
||||
$oHeadPublisher->addExtJsScript( "setup/cron", false ); //Adding a javascript file .js
|
||||
$oHeadPublisher->assign( "CONFIG", $config );
|
||||
$oHeadPublisher->assign( "CRON", $cronInfo );
|
||||
$oHeadPublisher->assign( "WORKSPACE", $arrayWorkspace );
|
||||
$oHeadPublisher->assign( "STATUS", $arrayStatus );
|
||||
|
||||
G::RenderPage("publish", "extJs");
|
||||
G::RenderPage( "publish", "extJs" );
|
||||
|
||||
|
||||
@@ -1,39 +1,33 @@
|
||||
<?php
|
||||
function mktimeDate($date)
|
||||
{
|
||||
$arrayAux = getdate(strtotime($date));
|
||||
|
||||
$mktDate = mktime(
|
||||
$arrayAux["hours"],
|
||||
$arrayAux["minutes"],
|
||||
$arrayAux["seconds"],
|
||||
$arrayAux["mon"],
|
||||
$arrayAux["mday"],
|
||||
$arrayAux["year"]
|
||||
);
|
||||
function mktimeDate ($date)
|
||||
{
|
||||
$arrayAux = getdate( strtotime( $date ) );
|
||||
|
||||
$mktDate = mktime( $arrayAux["hours"], $arrayAux["minutes"], $arrayAux["seconds"], $arrayAux["mon"], $arrayAux["mday"], $arrayAux["year"] );
|
||||
|
||||
return $mktDate;
|
||||
}
|
||||
|
||||
function cronArraySet($str, $filter)
|
||||
function cronArraySet ($str, $filter)
|
||||
{
|
||||
$arrayAux = explode("|", $str);
|
||||
$arrayAux = explode( "|", $str );
|
||||
|
||||
$date = "";
|
||||
$workspace = "";
|
||||
$action = "";
|
||||
$status = "";
|
||||
$description = trim($arrayAux[0]);
|
||||
$date = "";
|
||||
$workspace = "";
|
||||
$action = "";
|
||||
$status = "";
|
||||
$description = trim( $arrayAux[0] );
|
||||
|
||||
if (count($arrayAux) > 1) {
|
||||
$date = (isset($arrayAux[0]))? trim($arrayAux[0]) : "";
|
||||
$workspace = (isset($arrayAux[1]))? trim($arrayAux[1]) : "";
|
||||
$action = (isset($arrayAux[2]))? trim($arrayAux[2]) : "";
|
||||
$status = (isset($arrayAux[3]))? trim($arrayAux[3]) : "";
|
||||
$description = (isset($arrayAux[4]))? trim($arrayAux[4]) : "";
|
||||
if (count( $arrayAux ) > 1) {
|
||||
$date = (isset( $arrayAux[0] )) ? trim( $arrayAux[0] ) : "";
|
||||
$workspace = (isset( $arrayAux[1] )) ? trim( $arrayAux[1] ) : "";
|
||||
$action = (isset( $arrayAux[2] )) ? trim( $arrayAux[2] ) : "";
|
||||
$status = (isset( $arrayAux[3] )) ? trim( $arrayAux[3] ) : "";
|
||||
$description = (isset( $arrayAux[4] )) ? trim( $arrayAux[4] ) : "";
|
||||
}
|
||||
|
||||
$mktDate = (!empty($date))? mktimeDate($date) : 0;
|
||||
$mktDate = (! empty( $date )) ? mktimeDate( $date ) : 0;
|
||||
|
||||
//Filter
|
||||
$sw = 1;
|
||||
@@ -57,68 +51,63 @@ function cronArraySet($str, $filter)
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($filter["dateFrom"]) && $mktDate > 0) {
|
||||
if (!(mktimeDate($filter["dateFrom"]) <= $mktDate)) {
|
||||
if (! empty( $filter["dateFrom"] ) && $mktDate > 0) {
|
||||
if (! (mktimeDate( $filter["dateFrom"] ) <= $mktDate)) {
|
||||
$sw = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($filter["dateTo"]) && $mktDate > 0) {
|
||||
if (!($mktDate <= mktimeDate($filter["dateTo"] . " 23:59:59"))) {
|
||||
if (! empty( $filter["dateTo"] ) && $mktDate > 0) {
|
||||
if (! ($mktDate <= mktimeDate( $filter["dateTo"] . " 23:59:59" ))) {
|
||||
$sw = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$arrayData = array();
|
||||
$arrayData = array ();
|
||||
|
||||
if ($sw == 1) {
|
||||
$arrayData = array(
|
||||
"DATE" => $date,
|
||||
"WORKSPACE" => $workspace,
|
||||
"ACTION" => $action,
|
||||
"STATUS" => $status,
|
||||
"DESCRIPTION" => $description
|
||||
$arrayData = array ("DATE" => $date,"WORKSPACE" => $workspace,"ACTION" => $action,"STATUS" => $status,"DESCRIPTION" => $description
|
||||
);
|
||||
}
|
||||
|
||||
return $arrayData;
|
||||
}
|
||||
|
||||
function cronDataGet($filter, $r, $i)
|
||||
function cronDataGet ($filter, $r, $i)
|
||||
{
|
||||
$r = $r + 1; //+ 1, to determine the next page
|
||||
$i = $i + 1;
|
||||
|
||||
$arrayData = array();
|
||||
$arrayData = array ();
|
||||
$strAux = null;
|
||||
$numRec = 0;
|
||||
$cont = 0;
|
||||
|
||||
$file = PATH_DATA . "log" . PATH_SEP . "cron.log";
|
||||
|
||||
if (file_exists($file)) {
|
||||
$fh = fopen($file, "r");
|
||||
if (file_exists( $file )) {
|
||||
$fh = fopen( $file, "r" );
|
||||
|
||||
for($pos = 0; fseek($fh, $pos, SEEK_END) !== -1; $pos--) {
|
||||
$char = fgetc($fh);
|
||||
for ($pos = 0; fseek( $fh, $pos, SEEK_END ) !== - 1; $pos --) {
|
||||
$char = fgetc( $fh );
|
||||
|
||||
if ($char == "\n") {
|
||||
$strAux = trim($strAux);
|
||||
$strAux = trim( $strAux );
|
||||
|
||||
if (!empty($strAux)) {
|
||||
$arrayAux = cronArraySet($strAux, $filter);
|
||||
if (! empty( $strAux )) {
|
||||
$arrayAux = cronArraySet( $strAux, $filter );
|
||||
|
||||
if (count($arrayAux) > 0) {
|
||||
if (count( $arrayAux ) > 0) {
|
||||
$cont = $cont + 1;
|
||||
|
||||
if ($cont >= $i && count($arrayData) + 1 <= $r) {
|
||||
if ($cont >= $i && count( $arrayData ) + 1 <= $r) {
|
||||
$arrayData[] = $arrayAux;
|
||||
$numRec = $cont;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($arrayData) == $r) {
|
||||
if (count( $arrayData ) == $r) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -129,74 +118,67 @@ function cronDataGet($filter, $r, $i)
|
||||
$strAux = $char . $strAux;
|
||||
}
|
||||
|
||||
$strAux = trim($strAux);
|
||||
$strAux = trim( $strAux );
|
||||
|
||||
if (!empty($strAux)) {
|
||||
$arrayAux = cronArraySet($strAux, $filter);
|
||||
if (! empty( $strAux )) {
|
||||
$arrayAux = cronArraySet( $strAux, $filter );
|
||||
|
||||
if (count($arrayAux) > 0) {
|
||||
if (count( $arrayAux ) > 0) {
|
||||
$cont = $cont + 1;
|
||||
|
||||
if ($cont >= $i && count($arrayData) + 1 <= $r) {
|
||||
if ($cont >= $i && count( $arrayData ) + 1 <= $r) {
|
||||
$arrayData[] = $arrayAux;
|
||||
$numRec = $cont;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose($fh);
|
||||
fclose( $fh );
|
||||
}
|
||||
|
||||
//Delete element
|
||||
$r = $r - 1;
|
||||
|
||||
if (count($arrayData) > $r) {
|
||||
$arrayAux = array_pop($arrayData);
|
||||
if (count( $arrayData ) > $r) {
|
||||
$arrayAux = array_pop( $arrayData );
|
||||
}
|
||||
|
||||
return array($numRec, $arrayData);
|
||||
return array ($numRec,$arrayData
|
||||
);
|
||||
}
|
||||
|
||||
$option = (isset( $_REQUEST["option"] )) ? $_REQUEST["option"] : null;
|
||||
|
||||
|
||||
|
||||
|
||||
$option = (isset($_REQUEST["option"]))? $_REQUEST["option"] : null;
|
||||
|
||||
$response = array();
|
||||
$response = array ();
|
||||
|
||||
switch ($option) {
|
||||
case "LST":
|
||||
$pageSize = $_REQUEST["pageSize"];
|
||||
$pageSize = $_REQUEST["pageSize"];
|
||||
$workspace = $_REQUEST["workspace"];
|
||||
$status = $_REQUEST["status"];
|
||||
$dateFrom = $_REQUEST["dateFrom"];
|
||||
$dateTo = $_REQUEST["dateTo"];
|
||||
$status = $_REQUEST["status"];
|
||||
$dateFrom = $_REQUEST["dateFrom"];
|
||||
$dateTo = $_REQUEST["dateTo"];
|
||||
|
||||
$arrayFilter = array(
|
||||
"workspace" => $workspace,
|
||||
"status" => $status,
|
||||
"dateFrom" => str_replace("T00:00:00", null, $dateFrom),
|
||||
"dateTo" => str_replace("T00:00:00", null, $dateTo)
|
||||
$arrayFilter = array ("workspace" => $workspace,"status" => $status,"dateFrom" => str_replace( "T00:00:00", null, $dateFrom ),"dateTo" => str_replace( "T00:00:00", null, $dateTo )
|
||||
);
|
||||
|
||||
$limit = isset($_REQUEST["limit"])? $_REQUEST["limit"] : $pageSize;
|
||||
$start = isset($_REQUEST["start"])? $_REQUEST["start"] : 0;
|
||||
$limit = isset( $_REQUEST["limit"] ) ? $_REQUEST["limit"] : $pageSize;
|
||||
$start = isset( $_REQUEST["start"] ) ? $_REQUEST["start"] : 0;
|
||||
|
||||
list($numRec, $data) = cronDataGet($arrayFilter, $limit, $start);
|
||||
list ($numRec, $data) = cronDataGet( $arrayFilter, $limit, $start );
|
||||
|
||||
$response = array("success" => true, "resultTotal" => $numRec, "resultRoot" => $data);
|
||||
$response = array ("success" => true,"resultTotal" => $numRec,"resultRoot" => $data
|
||||
);
|
||||
break;
|
||||
|
||||
case "EMPTY":
|
||||
$status = 1;
|
||||
|
||||
try {
|
||||
$file = PATH_DATA . "log" . PATH_SEP . "cron.log";
|
||||
|
||||
if (file_exists($file)) {
|
||||
if (file_exists( $file )) {
|
||||
//file_put_contents($file, null);
|
||||
unlink($file);
|
||||
unlink( $file );
|
||||
}
|
||||
|
||||
$response["status"] = "OK";
|
||||
@@ -211,5 +193,5 @@ switch ($option) {
|
||||
break;
|
||||
}
|
||||
|
||||
echo G::json_encode($response);
|
||||
echo G::json_encode( $response );
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* customFunctions.php
|
||||
*
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
@@ -12,22 +12,22 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
|
||||
$G_ENABLE_BLANK_SKIN = true;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
|
||||
return $RBAC_Response;
|
||||
$G_ENABLE_BLANK_SKIN = true;
|
||||
|
||||
$dbc = new DBConnection;
|
||||
$dbc = new DBConnection();
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'table', 'paged-table2', 'setup/Custom_Functions', '', '', '' );
|
||||
G::RenderPage( 'publish-treeview' );
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('table', 'paged-table2', 'setup/Custom_Functions', '', '', '');
|
||||
G::RenderPage( 'publish-treeview' );
|
||||
?>
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* debug.php
|
||||
*
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
@@ -12,29 +12,28 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
|
||||
$G_ENABLE_BLANK_SKIN = true;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
|
||||
return $RBAC_Response;
|
||||
$G_ENABLE_BLANK_SKIN = true;
|
||||
|
||||
$dbc = new DBConnection;
|
||||
$G_PUBLISH = new Publisher;
|
||||
$dbc = new DBConnection();
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
G::LoadClass ( 'lexico' );
|
||||
$lex = new Lexico( $dbc );
|
||||
$Fields['SESSION_PC'] = $lex->getFluidValue ( 'SESSION_PC', 'Y' );
|
||||
$Fields['SESSION_BROWSER'] = $lex->getFluidValue ( 'SESSION_BROWSER', 'Y' );
|
||||
G::LoadClass( 'lexico' );
|
||||
$lex = new Lexico( $dbc );
|
||||
$Fields['SESSION_PC'] = $lex->getFluidValue( 'SESSION_PC', 'Y' );
|
||||
$Fields['SESSION_BROWSER'] = $lex->getFluidValue( 'SESSION_BROWSER', 'Y' );
|
||||
|
||||
$G_PUBLISH->AddContent( "xmlform", "xmlform", "setup/session","", $Fields , "session2" );
|
||||
$G_PUBLISH->AddContent( "xmlform", "xmlform", "setup/session", "", $Fields, "session2" );
|
||||
|
||||
G::RenderPage( 'publish-treeview' );
|
||||
G::RenderPage( 'publish-treeview' );
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,55 +1,56 @@
|
||||
<?php
|
||||
function getAllFiles($directory, $recursive = true ) {
|
||||
$result = array();
|
||||
$handle = opendir($directory);
|
||||
while ($datei = readdir($handle))
|
||||
{
|
||||
if (($datei != '.') && ($datei != '..'))
|
||||
{
|
||||
$file = $directory.$datei;
|
||||
if (is_dir($file)) {
|
||||
|
||||
function getAllFiles ($directory, $recursive = true)
|
||||
{
|
||||
$result = array ();
|
||||
$handle = opendir( $directory );
|
||||
while ($datei = readdir( $handle )) {
|
||||
if (($datei != '.') && ($datei != '..')) {
|
||||
$file = $directory . $datei;
|
||||
if (is_dir( $file )) {
|
||||
if ($recursive) {
|
||||
$result = array_merge($result, getAllFiles($file.'/'));
|
||||
$result = array_merge( $result, getAllFiles( $file . '/' ) );
|
||||
}
|
||||
} else {
|
||||
$result[] = $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
closedir( $handle );
|
||||
return $result;
|
||||
}
|
||||
|
||||
function getFilesTimestamp($directory, $recursive = true) {
|
||||
$allFiles = getAllFiles($directory, $recursive);
|
||||
function getFilesTimestamp ($directory, $recursive = true)
|
||||
{
|
||||
$allFiles = getAllFiles( $directory, $recursive );
|
||||
$fileArray = array ();
|
||||
foreach ($allFiles as $val) {
|
||||
$timeResult['file'] = $val;
|
||||
$timeResult['timestamp'] = filemtime($val);
|
||||
$timeResult['file'] = $val;
|
||||
$timeResult['timestamp'] = filemtime( $val );
|
||||
$fileArray[] = $timeResult;
|
||||
}
|
||||
return $fileArray;
|
||||
}
|
||||
|
||||
$currentTime = strtotime("now");
|
||||
$timeDifference = 72*60*60;
|
||||
$currentTime = strtotime( "now" );
|
||||
$timeDifference = 72 * 60 * 60;
|
||||
$limitTime = $currentTime - $timeDifference;
|
||||
$sessionsPath = PATH_DATA.'session'.PATH_SEP;
|
||||
$filesResult = getFilesTimestamp($sessionsPath);
|
||||
$sessionsPath = PATH_DATA . 'session' . PATH_SEP;
|
||||
$filesResult = getFilesTimestamp( $sessionsPath );
|
||||
$count = 0;
|
||||
|
||||
foreach ($filesResult as $file){
|
||||
if ( $file['timestamp'] < $limitTime ){
|
||||
unlink ($file['file']);
|
||||
$count++;
|
||||
}
|
||||
foreach ($filesResult as $file) {
|
||||
if ($file['timestamp'] < $limitTime) {
|
||||
unlink( $file['file'] );
|
||||
$count ++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($count>0) {
|
||||
$response['message'] = G::loadTranslation('ID_REMOVED_SESSION_FILES');
|
||||
if ($count > 0) {
|
||||
$response['message'] = G::loadTranslation( 'ID_REMOVED_SESSION_FILES' );
|
||||
} else {
|
||||
$response['message'] = G::loadTranslation('ID_NO_OLDER_SESSION_FILES');
|
||||
$response['message'] = G::loadTranslation( 'ID_NO_OLDER_SESSION_FILES' );
|
||||
}
|
||||
|
||||
echo $response['message'];
|
||||
?>
|
||||
|
||||
|
||||
@@ -12,32 +12,30 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_ID_SUB_MENU_SELECTED = 'MAILSYSTEM';
|
||||
|
||||
G::LoadClass( 'package' );
|
||||
G::LoadClass( 'smtp' );
|
||||
G::LoadClass( 'spool' );
|
||||
|
||||
G::LoadClass('package');
|
||||
G::LoadClass('smtp');
|
||||
G::LoadClass('spool');
|
||||
|
||||
$run = new spoolRun();
|
||||
unset($run);
|
||||
$run = new spoolRun();
|
||||
unset( $run );
|
||||
|
||||
$Fields['MESSAGE'] = 'Hello world, this is my first email ... ';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $Fields, '' );
|
||||
G::RenderPage( 'publish' );
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $Fields, '');
|
||||
G::RenderPage('publish');
|
||||
|
||||
@@ -12,57 +12,52 @@
|
||||
* @category web_mail
|
||||
* @subpackage spool
|
||||
* @filesource
|
||||
* @version
|
||||
*
|
||||
* @file tom_spool.php
|
||||
* @version @file tom_spool.php
|
||||
*
|
||||
*/
|
||||
|
||||
if( isset ( $_POST['form']) )
|
||||
{
|
||||
$frm = "{$_POST['form']}";
|
||||
if (isset( $_POST['form'] )) {
|
||||
$frm = "{$_POST['form']}";
|
||||
|
||||
G::LoadClass('insert');
|
||||
G::LoadClass( 'insert' );
|
||||
|
||||
$db_spool = array();
|
||||
|
||||
$db_spool['msg_uid'] = 'msg_uid';
|
||||
$db_spool['app_uid'] = 'app_uid';
|
||||
$db_spool['del_index'] = 99; // random number
|
||||
$db_spool['app_msg_type'] = 'email message';
|
||||
$db_spool['app_msg_subject'] = 'subject field'; //"{$frm['subject']}";
|
||||
$db_spool['app_msg_from'] = '"ian armstrong" <ian@colosa.com>';//"{$frm['from_email']}";
|
||||
$db_spool['app_msg_to'] = '<ika@openmail.cc>'; //"{$frm['to_email']}";
|
||||
$db_spool['app_msg_body'] = 'body field'; //"{$frm['body']}";
|
||||
$db_spool['app_msg_date'] = time();
|
||||
$db_spool['app_msg_cc'] = '<ian@openmail.cc>';
|
||||
$db_spool['app_msg_bcc'] = '<ian.k.armstrong@gmail.com>';
|
||||
$db_spool['app_msg_template'] = "/path/to/template";
|
||||
$db_spool['app_msg_status'] = "pending";
|
||||
$db_spool = array ();
|
||||
|
||||
$db_spool['app_msg_attach'] = serialize(array('attachment_1','attachment_2'));
|
||||
$db_spool['msg_uid'] = 'msg_uid';
|
||||
$db_spool['app_uid'] = 'app_uid';
|
||||
$db_spool['del_index'] = 99; // random number
|
||||
$db_spool['app_msg_type'] = 'email message';
|
||||
$db_spool['app_msg_subject'] = 'subject field'; //"{$frm['subject']}";
|
||||
$db_spool['app_msg_from'] = '"ian armstrong" <ian@colosa.com>'; //"{$frm['from_email']}";
|
||||
$db_spool['app_msg_to'] = '<ika@openmail.cc>'; //"{$frm['to_email']}";
|
||||
$db_spool['app_msg_body'] = 'body field'; //"{$frm['body']}";
|
||||
$db_spool['app_msg_date'] = time();
|
||||
$db_spool['app_msg_cc'] = '<ian@openmail.cc>';
|
||||
$db_spool['app_msg_bcc'] = '<ian.k.armstrong@gmail.com>';
|
||||
$db_spool['app_msg_template'] = "/path/to/template";
|
||||
$db_spool['app_msg_status'] = "pending";
|
||||
|
||||
/*
|
||||
if(isset($frm['attachments']) && count($frm['attachments']) >0 )
|
||||
{
|
||||
foreach($frm['attachments'] as $attchment)
|
||||
{
|
||||
$db_spool['app_msg_attach'][] = "$attchment";
|
||||
$db_spool['app_msg_attach'] = serialize( array ('attachment_1','attachment_2'
|
||||
) );
|
||||
|
||||
}
|
||||
/*
|
||||
if(isset($frm['attachments']) && count($frm['attachments']) >0 )
|
||||
{
|
||||
foreach($frm['attachments'] as $attchment)
|
||||
{
|
||||
$db_spool['app_msg_attach'][] = "$attchment";
|
||||
}
|
||||
}*/
|
||||
|
||||
}*/
|
||||
$insert = new insert( $db_spool );
|
||||
$status = $insert->returnStatus();
|
||||
unset( $insert );
|
||||
|
||||
$insert = new insert($db_spool);
|
||||
$status = $insert->returnStatus();
|
||||
unset($insert);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$Fields['MESSAGE'] = $status;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $Fields, 'emailSystemSpool' );
|
||||
G::RenderPage( 'publish' );
|
||||
|
||||
$Fields['MESSAGE'] = $status;
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $Fields, 'emailSystemSpool');
|
||||
G::RenderPage('publish');
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -12,34 +12,32 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_FACTORY'))
|
||||
{
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
case -1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_ID_SUB_MENU_SELECTED = 'MAILSYSTEM';
|
||||
|
||||
$Fields['domain'] = 'colosa.com';
|
||||
@@ -49,7 +47,7 @@ $Fields['from_email'] = 'ian@colosa.com';
|
||||
$Fields['subject'] = 'Test email';
|
||||
$Fields['body'] = 'Hello world, this is my first email ... ';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/emailSetupTest', '', $Fields, 'emailSystemSpool' );
|
||||
G::RenderPage( 'publish' );
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/emailSetupTest', '', $Fields, 'emailSystemSpool');
|
||||
G::RenderPage('publish');
|
||||
@@ -12,70 +12,73 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
global $RBAC;
|
||||
if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_FACTORY') != 1){
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
//G::header('location: ../login/login');
|
||||
die;
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_FACTORY' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
//G::header('location: ../login/login');
|
||||
die();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_ID_SUB_MENU_SELECTED = 'EMAILS';
|
||||
|
||||
require_once 'classes/model/Configuration.php';
|
||||
$oConfiguration = new Configuration();
|
||||
$sDelimiter = DBAdapter::getStringDelimiter();
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(ConfigurationPeer::CFG_UID, 'Emails');
|
||||
$oCriteria->add(ConfigurationPeer::OBJ_UID, '');
|
||||
$oCriteria->add(ConfigurationPeer::PRO_UID, '');
|
||||
$oCriteria->add(ConfigurationPeer::USR_UID, '');
|
||||
$oCriteria->add(ConfigurationPeer::APP_UID, '');
|
||||
$sDelimiter = DBAdapter::getStringDelimiter();
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( ConfigurationPeer::CFG_UID, 'Emails' );
|
||||
$oCriteria->add( ConfigurationPeer::OBJ_UID, '' );
|
||||
$oCriteria->add( ConfigurationPeer::PRO_UID, '' );
|
||||
$oCriteria->add( ConfigurationPeer::USR_UID, '' );
|
||||
$oCriteria->add( ConfigurationPeer::APP_UID, '' );
|
||||
|
||||
if (ConfigurationPeer::doCount($oCriteria) == 0) {
|
||||
$oConfiguration->create(array('CFG_UID' => 'Emails', 'OBJ_UID' => '', 'CFG_VALUE' => '', 'PRO_UID' => '', 'USR_UID' => '', 'APP_UID' => '', 'MESS_RAUTH' => ''));
|
||||
$aFields = array();
|
||||
}
|
||||
else {
|
||||
$aFields = $oConfiguration->load('Emails', '', '', '', '');
|
||||
if (trim($aFields['CFG_VALUE']) != '') {
|
||||
$aFields = unserialize($aFields['CFG_VALUE']);
|
||||
}
|
||||
else {
|
||||
$aFields = array();
|
||||
}
|
||||
if (ConfigurationPeer::doCount( $oCriteria ) == 0) {
|
||||
$oConfiguration->create( array ('CFG_UID' => 'Emails','OBJ_UID' => '','CFG_VALUE' => '','PRO_UID' => '','USR_UID' => '','APP_UID' => '','MESS_RAUTH' => ''
|
||||
) );
|
||||
$aFields = array ();
|
||||
} else {
|
||||
$aFields = $oConfiguration->load( 'Emails', '', '', '', '' );
|
||||
if (trim( $aFields['CFG_VALUE'] ) != '') {
|
||||
$aFields = unserialize( $aFields['CFG_VALUE'] );
|
||||
} else {
|
||||
$aFields = array ();
|
||||
}
|
||||
}
|
||||
|
||||
$aFields['SMTPSecure'] = (isset($aFields['SMTPSecure']) && $aFields['SMTPSecure'] != '')? $aFields['SMTPSecure'] : 'none';
|
||||
$aFields['SMTPSecure'] = (isset( $aFields['SMTPSecure'] ) && $aFields['SMTPSecure'] != '') ? $aFields['SMTPSecure'] : 'none';
|
||||
|
||||
$rows[] = array ( 'uid' => 'char', 'name' => 'char', 'age' => 'integer', 'balance' => 'float' );
|
||||
$rows[] = array ( 'uid' => 'PHPMAILER', 'name' => 'SMTP (PHPMailer)' );
|
||||
$rows[] = array ('uid' => 'char','name' => 'char','age' => 'integer','balance' => 'float'
|
||||
);
|
||||
$rows[] = array ('uid' => 'PHPMAILER','name' => 'SMTP (PHPMailer)'
|
||||
);
|
||||
// ending OpenMail support
|
||||
// $rows[] = array ( 'uid' => 'OPENMAIL', 'name' => 'SMTP (OpenMail)' );
|
||||
$rows[] = array ( 'uid' => 'MAIL', 'name' => 'Mail (PHP)' );
|
||||
$rows[] = array ('uid' => 'MAIL','name' => 'Mail (PHP)'
|
||||
);
|
||||
|
||||
$_DBArray['mails'] = $rows;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
|
||||
$trn = G::getTranslations(Array('ID_SUCESS', 'ID_FAIL', ''));
|
||||
$trn = G::getTranslations( Array ('ID_SUCESS','ID_FAIL',''
|
||||
) );
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptCode('var TRANSLATIONS='.G::json_encode($trn).';');
|
||||
$oHeadPublisher->addScriptFile('/jscore/setup/emails.js');
|
||||
$oHeadPublisher->addScriptCode( 'var TRANSLATIONS=' . G::json_encode( $trn ) . ';' );
|
||||
$oHeadPublisher->addScriptFile( '/jscore/setup/emails.js' );
|
||||
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/emails', '', $aFields, 'emails_Save' );
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/emails', '', $aFields, 'emails_Save');
|
||||
G::RenderPage('publishBlank', 'blank');
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,60 +12,54 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once 'classes/model/Configuration.php';
|
||||
$oConfiguration = new Configuration();
|
||||
$aFields['MESS_ENABLED'] = isset($_POST['form']['MESS_ENABLED']) ? $_POST['form']['MESS_ENABLED'] : '';
|
||||
$aFields['MESS_ENGINE'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_ENGINE']: '';
|
||||
$aFields['MESS_SERVER'] = isset($_POST['form']['MESS_ENABLED']) ?trim($_POST['form']['MESS_SERVER']): '';
|
||||
$aFields['MESS_RAUTH'] = isset($_POST['form']['MESS_ENABLED']) ?isset($_POST['form']['MESS_RAUTH']) ? $_POST['form']['MESS_RAUTH'] : '': '';
|
||||
$aFields['MESS_PORT'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_PORT']: '';
|
||||
$aFields['MESS_ACCOUNT'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_ACCOUNT']: '';
|
||||
$aFields['MESS_PASSWORD'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_PASSWORD']: '';
|
||||
$aFields['MESS_PASSWORD_HIDDEN'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_PASSWORD_HIDDEN']: '';
|
||||
if ($aFields['MESS_PASSWORD_HIDDEN'] !='') {
|
||||
$aFields['MESS_PASSWORD'] = $aFields['MESS_PASSWORD_HIDDEN'];
|
||||
$aFields['MESS_ENABLED'] = isset( $_POST['form']['MESS_ENABLED'] ) ? $_POST['form']['MESS_ENABLED'] : '';
|
||||
$aFields['MESS_ENGINE'] = isset( $_POST['form']['MESS_ENABLED'] ) ? $_POST['form']['MESS_ENGINE'] : '';
|
||||
$aFields['MESS_SERVER'] = isset( $_POST['form']['MESS_ENABLED'] ) ? trim( $_POST['form']['MESS_SERVER'] ) : '';
|
||||
$aFields['MESS_RAUTH'] = isset( $_POST['form']['MESS_ENABLED'] ) ? isset( $_POST['form']['MESS_RAUTH'] ) ? $_POST['form']['MESS_RAUTH'] : '' : '';
|
||||
$aFields['MESS_PORT'] = isset( $_POST['form']['MESS_ENABLED'] ) ? $_POST['form']['MESS_PORT'] : '';
|
||||
$aFields['MESS_ACCOUNT'] = isset( $_POST['form']['MESS_ENABLED'] ) ? $_POST['form']['MESS_ACCOUNT'] : '';
|
||||
$aFields['MESS_PASSWORD'] = isset( $_POST['form']['MESS_ENABLED'] ) ? $_POST['form']['MESS_PASSWORD'] : '';
|
||||
$aFields['MESS_PASSWORD_HIDDEN'] = isset( $_POST['form']['MESS_ENABLED'] ) ? $_POST['form']['MESS_PASSWORD_HIDDEN'] : '';
|
||||
if ($aFields['MESS_PASSWORD_HIDDEN'] != '') {
|
||||
$aFields['MESS_PASSWORD'] = $aFields['MESS_PASSWORD_HIDDEN'];
|
||||
}
|
||||
$aFields['MESS_PASSWORD_HIDDEN'] = '';
|
||||
$aPasswd = G::decrypt($aFields['MESS_PASSWORD'],'EMAILENCRYPT');
|
||||
$aPasswd = G::decrypt( $aFields['MESS_PASSWORD'], 'EMAILENCRYPT' );
|
||||
$passwd = $aFields['MESS_PASSWORD'];
|
||||
$passwdDec = G::decrypt($passwd,'EMAILENCRYPT');
|
||||
$auxPass = explode('hash:', $passwdDec);
|
||||
if (count($auxPass) > 1) {
|
||||
if (count($auxPass) == 2) {
|
||||
$passwdDec = G::decrypt( $passwd, 'EMAILENCRYPT' );
|
||||
$auxPass = explode( 'hash:', $passwdDec );
|
||||
if (count( $auxPass ) > 1) {
|
||||
if (count( $auxPass ) == 2) {
|
||||
$passwd = $auxPass[1];
|
||||
} else {
|
||||
array_shift($auxPass);
|
||||
$passwd = implode('', $auxPass);
|
||||
array_shift( $auxPass );
|
||||
$passwd = implode( '', $auxPass );
|
||||
}
|
||||
}
|
||||
$aFields['MESS_PASSWORD'] = $passwd;
|
||||
if ($aFields['MESS_PASSWORD'] != '') { // for plain text
|
||||
$aFields['MESS_PASSWORD'] = 'hash:'.$aFields['MESS_PASSWORD'];
|
||||
$aFields['MESS_PASSWORD'] = G::encrypt($aFields['MESS_PASSWORD'],'EMAILENCRYPT');
|
||||
if ($aFields['MESS_PASSWORD'] != '') { // for plain text
|
||||
$aFields['MESS_PASSWORD'] = 'hash:' . $aFields['MESS_PASSWORD'];
|
||||
$aFields['MESS_PASSWORD'] = G::encrypt( $aFields['MESS_PASSWORD'], 'EMAILENCRYPT' );
|
||||
}
|
||||
$aFields['MESS_BACKGROUND'] = isset($_POST['form']['MESS_ENABLED']) ?isset($_POST['form']['MESS_BACKGROUND']) ? $_POST['form']['MESS_BACKGROUND'] : '': '';
|
||||
$aFields['MESS_EXECUTE_EVERY'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_EXECUTE_EVERY']: '';
|
||||
$aFields['MESS_SEND_MAX'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_SEND_MAX']: '';
|
||||
$aFields['SMTPSecure'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['SMTPSecure']: '';
|
||||
$aFields['MESS_TRY_SEND_INMEDIATLY'] = isset($_POST['form']['MESS_ENABLED']) ?isset($_POST['form']['MESS_TRY_SEND_INMEDIATLY']) ? $_POST['form']['MESS_TRY_SEND_INMEDIATLY'] : '': '';
|
||||
$oConfiguration->update(array(
|
||||
'CFG_UID' => 'Emails',
|
||||
'OBJ_UID' => '',
|
||||
'CFG_VALUE' => serialize($aFields),
|
||||
'PRO_UID' => '',
|
||||
'USR_UID' => '',
|
||||
'APP_UID' => '')
|
||||
);
|
||||
G::SendTemporalMessage('ID_CHANGES_SAVED', 'TMP-INFO', 'label', 4, '100%');
|
||||
G::header('location: emails');
|
||||
$aFields['MESS_BACKGROUND'] = isset( $_POST['form']['MESS_ENABLED'] ) ? isset( $_POST['form']['MESS_BACKGROUND'] ) ? $_POST['form']['MESS_BACKGROUND'] : '' : '';
|
||||
$aFields['MESS_EXECUTE_EVERY'] = isset( $_POST['form']['MESS_ENABLED'] ) ? $_POST['form']['MESS_EXECUTE_EVERY'] : '';
|
||||
$aFields['MESS_SEND_MAX'] = isset( $_POST['form']['MESS_ENABLED'] ) ? $_POST['form']['MESS_SEND_MAX'] : '';
|
||||
$aFields['SMTPSecure'] = isset( $_POST['form']['MESS_ENABLED'] ) ? $_POST['form']['SMTPSecure'] : '';
|
||||
$aFields['MESS_TRY_SEND_INMEDIATLY'] = isset( $_POST['form']['MESS_ENABLED'] ) ? isset( $_POST['form']['MESS_TRY_SEND_INMEDIATLY'] ) ? $_POST['form']['MESS_TRY_SEND_INMEDIATLY'] : '' : '';
|
||||
$oConfiguration->update( array ('CFG_UID' => 'Emails','OBJ_UID' => '','CFG_VALUE' => serialize( $aFields ),'PRO_UID' => '','USR_UID' => '','APP_UID' => ''
|
||||
) );
|
||||
G::SendTemporalMessage( 'ID_CHANGES_SAVED', 'TMP-INFO', 'label', 4, '100%' );
|
||||
G::header( 'location: emails' );
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
G::loadClass('configuration');
|
||||
$c = new Configurations;
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('setup/environmentSettings', true);
|
||||
//$conf->aConfig['startCaseHideProcessInf']
|
||||
$oHeadPublisher->assign('FORMATS',$c->getFormats());
|
||||
G::RenderPage('publish', 'extJs');
|
||||
<?php
|
||||
G::loadClass( 'configuration' );
|
||||
$c = new Configurations();
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'setup/environmentSettings', true );
|
||||
//$conf->aConfig['startCaseHideProcessInf']
|
||||
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
|
||||
@@ -1,62 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Erik A.O. <erik@colosa.com>
|
||||
* @date Sept 13th, 2010
|
||||
*
|
||||
*/
|
||||
|
||||
G::LoadClass("configuration");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$request = isset($_POST["request"])? $_POST["request"] : (isset($_GET["request"])? $_GET["request"] : null);
|
||||
|
||||
switch ($request) {
|
||||
case "getUserMaskList":
|
||||
$result->rows = Configurations::getUserNameFormats();
|
||||
print(G::json_encode($result));
|
||||
break;
|
||||
|
||||
case "getDateFormats":
|
||||
$result->rows = Configurations::getDateFormats();
|
||||
print(G::json_encode($result));
|
||||
break;
|
||||
|
||||
case "getCasesListDateFormat":
|
||||
$result->rows = Configurations::getDateFormats();;
|
||||
print(G::json_encode($result));
|
||||
break;
|
||||
|
||||
case "getCasesListRowNumber":
|
||||
for ($i = 10; $i <= 50; $i+=5) {
|
||||
$formats[] = array("id" => "$i", "name" => "$i");
|
||||
}
|
||||
|
||||
$result->rows = $formats;
|
||||
print(G::json_encode($result));
|
||||
break;
|
||||
|
||||
case "save":
|
||||
$conf = new Configurations();
|
||||
|
||||
$conf->aConfig = array(
|
||||
"format" => $_POST["userFormat"],
|
||||
"dateFormat" => $_POST["dateFormat"],
|
||||
"startCaseHideProcessInf" => ((isset($_POST["hideProcessInf"]))? true : false),
|
||||
"casesListDateFormat" => $_POST["casesListDateFormat"],
|
||||
"casesListRowNumber" => intval($_POST["casesListRowNumber"]),
|
||||
"casesListRefreshTime" => intval($_POST["txtCasesRefreshTime"])
|
||||
);
|
||||
|
||||
$conf->saveConfig("ENVIRONMENT_SETTINGS", "");
|
||||
|
||||
$response = new stdclass();
|
||||
$response->success = true;
|
||||
$response->msg = G::LoadTranslation("ID_SAVED_SUCCESSFULLY");
|
||||
|
||||
echo G::json_encode($response);
|
||||
break;
|
||||
}
|
||||
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @author Erik A.O. <erik@colosa.com>
|
||||
* @date Sept 13th, 2010
|
||||
*
|
||||
*/
|
||||
|
||||
G::LoadClass( "configuration" );
|
||||
|
||||
$request = isset( $_POST["request"] ) ? $_POST["request"] : (isset( $_GET["request"] ) ? $_GET["request"] : null);
|
||||
|
||||
switch ($request) {
|
||||
case "getUserMaskList":
|
||||
$result->rows = Configurations::getUserNameFormats();
|
||||
print (G::json_encode( $result )) ;
|
||||
break;
|
||||
case "getDateFormats":
|
||||
$result->rows = Configurations::getDateFormats();
|
||||
print (G::json_encode( $result )) ;
|
||||
break;
|
||||
case "getCasesListDateFormat":
|
||||
$result->rows = Configurations::getDateFormats();
|
||||
;
|
||||
print (G::json_encode( $result )) ;
|
||||
break;
|
||||
case "getCasesListRowNumber":
|
||||
for ($i = 10; $i <= 50; $i += 5) {
|
||||
$formats[] = array ("id" => "$i","name" => "$i"
|
||||
);
|
||||
}
|
||||
|
||||
$result->rows = $formats;
|
||||
print (G::json_encode( $result )) ;
|
||||
break;
|
||||
case "save":
|
||||
$conf = new Configurations();
|
||||
|
||||
$conf->aConfig = array ("format" => $_POST["userFormat"],"dateFormat" => $_POST["dateFormat"],"startCaseHideProcessInf" => ((isset( $_POST["hideProcessInf"] )) ? true : false),"casesListDateFormat" => $_POST["casesListDateFormat"],"casesListRowNumber" => intval( $_POST["casesListRowNumber"] ),"casesListRefreshTime" => intval( $_POST["txtCasesRefreshTime"] )
|
||||
);
|
||||
|
||||
$conf->saveConfig( "ENVIRONMENT_SETTINGS", "" );
|
||||
|
||||
$response = new stdclass();
|
||||
$response->success = true;
|
||||
$response->msg = G::LoadTranslation( "ID_SAVED_SUCCESSFULLY" );
|
||||
|
||||
echo G::json_encode( $response );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user