2012-10-17 11:45:42 -04:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* main.php Cases List main processor
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2017-08-14 16:13:46 -04:00
|
|
|
|
|
|
|
|
use ProcessMaker\Core\System;
|
2017-08-01 12:16:06 -04:00
|
|
|
use ProcessMaker\Plugins\PluginRegistry;
|
2012-10-17 11:45:42 -04:00
|
|
|
|
2012-11-12 16:21:52 -04:00
|
|
|
//$oHeadPublisher = & headPublisher::getSingleton();
|
2014-06-20 16:08:47 -04:00
|
|
|
global $RBAC;
|
|
|
|
|
$RBAC->requirePermissions( 'PM_FACTORY' );
|
2012-11-12 16:21:52 -04:00
|
|
|
|
2012-10-17 11:45:42 -04:00
|
|
|
$conf = new Configurations();
|
|
|
|
|
|
2017-08-14 16:13:46 -04:00
|
|
|
$pmVersion = (preg_match("/^([\d\.]+).*$/", System::getVersion(), $arrayMatch))? $arrayMatch[1] : ""; //Otherwise: Branch master
|
2015-09-21 10:18:44 -04:00
|
|
|
|
2016-04-06 12:02:39 -04:00
|
|
|
/*----------------------------------********---------------------------------*/
|
|
|
|
|
if (true) {
|
|
|
|
|
$arrayFlagImportFileExtension = array("pm", "pmx", "pmx2", "bpmn");
|
|
|
|
|
} else {
|
|
|
|
|
/*----------------------------------********---------------------------------*/
|
|
|
|
|
$arrayFlagImportFileExtension = array("pm", "pmx", "bpmn");
|
|
|
|
|
/*----------------------------------********---------------------------------*/
|
|
|
|
|
}
|
|
|
|
|
/*----------------------------------********---------------------------------*/
|
|
|
|
|
|
2015-09-21 10:18:44 -04:00
|
|
|
$arrayFlagMenuNewOption = array("pm" => true, "bpmn" => true);
|
|
|
|
|
|
|
|
|
|
if ($pmVersion != "") {
|
|
|
|
|
$arrayFlagImportFileExtension = (version_compare($pmVersion . "", "3", ">="))? $arrayFlagImportFileExtension : array("pm");
|
|
|
|
|
$arrayFlagMenuNewOption = (version_compare($pmVersion . "", "3", ">="))? array("bpmn" => true) : array("pm" => true);
|
2015-03-23 20:34:18 -04:00
|
|
|
}
|
|
|
|
|
|
2017-08-01 12:16:06 -04:00
|
|
|
$oPluginRegistry = PluginRegistry::loadSingleton();
|
2015-03-23 20:34:18 -04:00
|
|
|
|
2015-09-21 10:18:44 -04:00
|
|
|
$arrayMenuNewOptionPlugin = array();
|
|
|
|
|
$arrayContextMenuOptionPlugin = array();
|
2015-09-16 14:21:16 -04:00
|
|
|
|
2017-08-01 12:16:06 -04:00
|
|
|
foreach ($oPluginRegistry->getDesignerMenu() as $value) {
|
2015-09-21 10:18:44 -04:00
|
|
|
if (file_exists($value->file)) {
|
|
|
|
|
require_once($value->file);
|
2015-09-16 14:21:16 -04:00
|
|
|
|
2015-09-21 10:18:44 -04:00
|
|
|
$className = "DesignerMenu" . $value->pluginName;
|
2015-09-16 14:21:16 -04:00
|
|
|
|
2015-09-21 10:18:44 -04:00
|
|
|
if (class_exists($className)) {
|
|
|
|
|
$obj = new $className();
|
2015-09-16 14:21:16 -04:00
|
|
|
|
2015-09-21 10:18:44 -04:00
|
|
|
if (method_exists($obj, "getDesignerMenu")) {
|
|
|
|
|
$arrayDesignerMenuData = $obj->getDesignerMenu();
|
|
|
|
|
|
|
|
|
|
if (isset($arrayDesignerMenuData["MENU_NEW_OPTION"]) && is_array($arrayDesignerMenuData["MENU_NEW_OPTION"])) {
|
|
|
|
|
$arrayMenuNewOptionPlugin = array_merge($arrayMenuNewOptionPlugin, $arrayDesignerMenuData["MENU_NEW_OPTION"]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($arrayDesignerMenuData["CONTEXT_MENU_OPTION"]) && is_array($arrayDesignerMenuData["CONTEXT_MENU_OPTION"])) {
|
|
|
|
|
$arrayContextMenuOptionPlugin = array_merge($arrayContextMenuOptionPlugin, $arrayDesignerMenuData["CONTEXT_MENU_OPTION"]);
|
2015-09-16 14:21:16 -04:00
|
|
|
}
|
|
|
|
|
}
|
2015-09-21 10:18:44 -04:00
|
|
|
}
|
2015-09-16 14:21:16 -04:00
|
|
|
}
|
2015-03-23 20:34:18 -04:00
|
|
|
}
|
|
|
|
|
|
2012-10-17 11:45:42 -04:00
|
|
|
$oHeadPublisher->addExtJsScript( 'processes/main', true ); //adding a javascript file .js
|
|
|
|
|
$oHeadPublisher->addContent( 'processes/main' ); //adding a html file .html.
|
|
|
|
|
|
2013-03-19 10:12:35 -04:00
|
|
|
$partnerFlag = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : false;
|
|
|
|
|
$oHeadPublisher->assign( 'PARTNER_FLAG', $partnerFlag );
|
2012-10-17 11:45:42 -04:00
|
|
|
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
|
2015-09-21 10:18:44 -04:00
|
|
|
$oHeadPublisher->assign("arrayFlagImportFileExtension", $arrayFlagImportFileExtension);
|
|
|
|
|
$oHeadPublisher->assign("arrayFlagMenuNewOption", $arrayFlagMenuNewOption);
|
|
|
|
|
$oHeadPublisher->assign("arrayMenuNewOptionPlugin", $arrayMenuNewOptionPlugin);
|
|
|
|
|
$oHeadPublisher->assign("arrayContextMenuOptionPlugin", $arrayContextMenuOptionPlugin);
|
2016-02-25 17:52:40 -04:00
|
|
|
$oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState());
|
2015-09-16 14:21:16 -04:00
|
|
|
|
2017-08-04 16:49:29 -04:00
|
|
|
$designer = new Designer();
|
|
|
|
|
$oHeadPublisher->assign('SYS_SYS', SYS_SYS);
|
|
|
|
|
$oHeadPublisher->assign('SYS_LANG', SYS_LANG);
|
|
|
|
|
$oHeadPublisher->assign('SYS_SKIN', SYS_SKIN);
|
2017-08-14 16:13:46 -04:00
|
|
|
$oHeadPublisher->assign('HTTP_SERVER_HOSTNAME', System::getHttpServerHostnameRequestsFrontEnd());
|
2017-08-05 15:02:25 -04:00
|
|
|
$oHeadPublisher->assign('credentials', base64_encode(G::json_encode($designer->getCredentials())));
|
2017-08-04 16:49:29 -04:00
|
|
|
|
2016-03-02 17:08:45 -04:00
|
|
|
$deleteCasesFlag = false;
|
|
|
|
|
global $RBAC;
|
2016-03-29 16:29:05 -04:00
|
|
|
if($RBAC->userCanAccess('PM_DELETE_PROCESS_CASES') === 1) {
|
2016-03-02 17:08:45 -04:00
|
|
|
$deleteCasesFlag = true;
|
|
|
|
|
}
|
|
|
|
|
$oHeadPublisher->assign('deleteCasesFlag', $deleteCasesFlag);
|
|
|
|
|
|
2017-08-01 12:16:06 -04:00
|
|
|
$oPluginRegistry = PluginRegistry::loadSingleton();
|
2015-11-30 17:00:15 -04:00
|
|
|
$callBackFile = $oPluginRegistry->getImportProcessCallback();
|
|
|
|
|
$file = false;
|
|
|
|
|
if(sizeof($callBackFile)) {
|
2017-08-01 12:16:06 -04:00
|
|
|
$file = $callBackFile[0]->getCallBackFile() != "" ? $callBackFile[0]->getCallBackFile() : false;
|
2015-11-30 17:00:15 -04:00
|
|
|
}
|
|
|
|
|
$oHeadPublisher->assign("importProcessCallbackFile", $file);
|
|
|
|
|
|
2016-04-08 15:55:18 -04:00
|
|
|
$isGranularFeature = false;
|
|
|
|
|
/*----------------------------------********---------------------------------*/
|
|
|
|
|
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
|
|
|
|
if ($licensedFeatures->verifyfeature('jXsSi94bkRUcVZyRStNVExlTXhEclVadGRRcG9xbjNvTWVFQUF3cklKQVBiVT0=')) {
|
|
|
|
|
$isGranularFeature = true;
|
|
|
|
|
}
|
|
|
|
|
/*----------------------------------********---------------------------------*/
|
|
|
|
|
$oHeadPublisher->assign("isGranularFeature", $isGranularFeature);
|
|
|
|
|
|
2012-10-17 11:45:42 -04:00
|
|
|
G::RenderPage( 'publish', 'extJs' );
|
2015-09-21 10:18:44 -04:00
|
|
|
|