change
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
$filter = new InputFilter();
|
||||
$_POST = $filter->xssFilterHard($_POST);
|
||||
$_GET = $filter->xssFilterHard($_GET);
|
||||
@@ -1623,7 +1625,7 @@ function uploadExternalDocument()
|
||||
G::uploadFile($fileObj['tempName'], $sPathName, $sFileName); //upload
|
||||
|
||||
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
if ($oPluginRegistry->existsTrigger (PM_UPLOAD_DOCUMENT) && class_exists ('uploadDocumentData')) {
|
||||
$oData['APP_UID'] = $appId;
|
||||
$documentData = new uploadDocumentData (
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
try {
|
||||
$docUid = $_POST['form']['DOC_UID'];
|
||||
$appDocUid = $_POST['form']['APP_DOC_UID'];
|
||||
@@ -124,7 +127,7 @@ try {
|
||||
G::uploadFile($_FILES['form']['tmp_name']['APP_DOC_FILENAME'], $sPathName, $sFileName);
|
||||
|
||||
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
if ($oPluginRegistry->existsTrigger(PM_UPLOAD_DOCUMENT) && class_exists('uploadDocumentData')) {
|
||||
|
||||
$oData['APP_UID'] = $appId;
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
try {
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
@@ -153,7 +156,7 @@ try {
|
||||
}
|
||||
break;
|
||||
case 'authSourcesNew':
|
||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
|
||||
$arr = Array ();
|
||||
$oDirectory = dir( PATH_RBAC . 'plugins' . PATH_SEP );
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com>
|
||||
@@ -1022,7 +1024,7 @@ class Ajax
|
||||
}
|
||||
}
|
||||
|
||||
$pluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
if ($pluginRegistry->existsTrigger(PM_GET_CASES_AJAX_LISTENER)) {
|
||||
$ajax = $pluginRegistry->executeTriggers(PM_GET_CASES_AJAX_LISTENER, null);
|
||||
} else {
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
unset($_SESSION['APPLICATION']);
|
||||
|
||||
//get the action from GET or POST, default is todo
|
||||
@@ -194,12 +197,13 @@ $oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState());
|
||||
$oHeadPublisher->assign('isIE', Bootstrap::isIE());
|
||||
$oHeadPublisher->assign('__OPEN_APPLICATION_UID__', $openApplicationUid);
|
||||
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$fromPlugin = $oPluginRegistry->getOpenReassignCallback();
|
||||
$jsFunction = false;
|
||||
if(sizeof($fromPlugin)) {
|
||||
foreach($fromPlugin as $key => $jsFile) {
|
||||
$jsFile = $jsFile->callBackFile;
|
||||
/** @var \ProcessMaker\Plugins\Interfaces\OpenReassignCallback $jsFile */
|
||||
foreach($fromPlugin as $jsFile) {
|
||||
$jsFile = $jsFile->getCallBackFile();
|
||||
if(is_file($jsFile)) {
|
||||
$jsFile = file_get_contents($jsFile);
|
||||
if(!empty($jsFile)) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
$filter = new InputFilter();
|
||||
$_POST = $filter->xssFilterHard($_POST);
|
||||
$_REQUEST = $filter->xssFilterHard($_REQUEST);
|
||||
@@ -306,7 +308,7 @@ function getSimpleDashboardData ()
|
||||
|
||||
function getRegisteredDashboards ()
|
||||
{
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$dashBoardPages = $oPluginRegistry->getDashboardPages();
|
||||
print_r( G::json_encode( $dashBoardPages ) );
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
*/
|
||||
//validate the data post
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
$dynaForm = DynaformPeer::retrieveByPK($_GET["UID"]);
|
||||
|
||||
$flagDynaFormNewVersion = !is_null($dynaForm) && $dynaForm->getDynVersion() == 2;
|
||||
@@ -180,7 +182,7 @@ if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
|
||||
G::uploadFile( $arrayFileTmpName[$i], $sPathName, $sFileName );
|
||||
|
||||
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
|
||||
if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT ) && class_exists( "uploadDocumentData" )) {
|
||||
$triggerDetail = $oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT );
|
||||
@@ -188,7 +190,7 @@ if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
|
||||
$uploadReturn = $oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT, $documentData );
|
||||
|
||||
if ($uploadReturn) {
|
||||
$aFields["APP_DOC_PLUGIN"] = $triggerDetail->sNamespace;
|
||||
$aFields["APP_DOC_PLUGIN"] = $triggerDetail->getNamespace();
|
||||
|
||||
if (! isset( $aFields["APP_DOC_UID"] )) {
|
||||
$aFields["APP_DOC_UID"] = $sAppDocUid;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
if (! isset( $_REQUEST['action'] )) {
|
||||
$return['success'] = 'failure';
|
||||
$return['message'] = 'You may request an action';
|
||||
@@ -25,7 +27,7 @@ function searchSavedJob ($schUid)
|
||||
|
||||
function pluginsList ()
|
||||
{
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$activePluginsForCaseScheduler = $oPluginRegistry->getCaseSchedulerPlugins();
|
||||
$selectedPlugin = "";
|
||||
if ((isset( $_REQUEST['plg_uid'] )) && ($_REQUEST['plg_uid'] != "")) {
|
||||
@@ -56,11 +58,12 @@ function pluginCaseSchedulerForm ()
|
||||
}
|
||||
$G_PUBLISH = new Publisher();
|
||||
$params = explode( "--", $_REQUEST['selectedOption'] );
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$activePluginsForCaseScheduler = $oPluginRegistry->getCaseSchedulerPlugins();
|
||||
|
||||
foreach ($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail) {
|
||||
if (($caseSchedulerPluginDetail->sNamespace == $params[0]) && ($caseSchedulerPluginDetail->sActionId == $params[1])) {
|
||||
/** @var \ProcessMaker\Plugins\Interfaces\CaseSchedulerPlugin $caseSchedulerPluginDetail */
|
||||
foreach ($activePluginsForCaseScheduler as $caseSchedulerPluginDetail) {
|
||||
if (($caseSchedulerPluginDetail->equalNamespaceTo($params[0])) &&
|
||||
($caseSchedulerPluginDetail->equalActionIdTo($params[1]))) {
|
||||
$caseSchedulerSelected = $caseSchedulerPluginDetail;
|
||||
}
|
||||
}
|
||||
@@ -74,7 +77,7 @@ function pluginCaseSchedulerForm ()
|
||||
$oData = array ("PRO_UID" => $_REQUEST['pro_uid']
|
||||
);
|
||||
}
|
||||
$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionForm, $oData );
|
||||
$oPluginRegistry->executeMethod($caseSchedulerPluginDetail->getNamespace(), $caseSchedulerPluginDetail->getActionForm(), $oData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
* @author David Callizaya <davidsantos@colosa.com>
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
if (isset($_REQUEST['actionAjax']) && $_REQUEST['actionAjax'] == "verifySession" ) {
|
||||
if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
|
||||
@@ -107,7 +109,7 @@ if (file_exists( $realPath )) {
|
||||
|
||||
if (!$sw_file_exists) {
|
||||
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT )) {
|
||||
$error_message = G::LoadTranslation( 'ID_ERROR_FILE_NOT_EXIST', SYS_LANG, array('filename' => $info['basename'] . $ver . '.' . $ext) ) . ' ' . G::LoadTranslation('ID_CONTACT_ADMIN');
|
||||
} else {
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
$filter = new InputFilter();
|
||||
|
||||
list($_GET['UID'], $_GET['TYPE'], $_GET['POSITION'], $_GET['ACTION']) = $filter->xssRegexFilter(
|
||||
@@ -382,7 +385,7 @@ try {
|
||||
$Fields['MESSAGE1'] = G::LoadTranslation( 'ID_PLEASE_ENTER_COMMENTS' );
|
||||
$Fields['MESSAGE2'] = G::LoadTranslation( 'ID_PLEASE_SELECT_FILE' );
|
||||
//START: If there is a Break Step registered from Plugin Similar as a Trigger debug
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT_BEFORE )) {
|
||||
//If a Plugin has registered a Break Page Evaluator
|
||||
$oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT_BEFORE, array ('USR_UID' => $_SESSION['USER_LOGGED']) );
|
||||
@@ -391,18 +394,6 @@ try {
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'cases/paged-table-inputDocuments', 'cases/cases_InputdocsList', $oCase->getInputDocumentsCriteria( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_GET['UID'] ), array_merge( array ('DOC_UID' => $_GET['UID']
|
||||
), $Fields ) ); //$aFields
|
||||
|
||||
|
||||
//call plugin
|
||||
//if ( $oPluginRegistry->existsTrigger ( PM_CASE_DOCUMENT_LIST ) ) {
|
||||
// $folderData = new folderData (null, null, $_SESSION['APPLICATION'], null, $_SESSION['USER_LOGGED'] );
|
||||
// $oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
// $oPluginRegistry->executeTriggers ( PM_CASE_DOCUMENT_LIST , $folderData );
|
||||
// //end plugin
|
||||
//}
|
||||
//else
|
||||
// $G_PUBLISH->AddContent('propeltable', 'cases/paged-table-inputDocuments', 'cases/cases_InputdocsList', $oCase->getInputDocumentsCriteria($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_GET['UID']), array_merge(array('DOC_UID'=>$_GET['UID']),$Fields));//$aFields
|
||||
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$titleDocument = "<h3>" . htmlspecialchars($Fields['INP_DOC_TITLE'], ENT_QUOTES) . "<br><small>" . G::LoadTranslation('ID_INPUT_DOCUMENT') . "</small></h3>";
|
||||
if ($Fields['INP_DOC_DESCRIPTION']) {
|
||||
@@ -454,7 +445,7 @@ try {
|
||||
switch ($_GET['ACTION']) {
|
||||
case 'GENERATE':
|
||||
//START: If there is a Break Step registered from Plugin Similar as a Trigger debug
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT_BEFORE )) {
|
||||
//If a Plugin has registered a Break Page Evaluator
|
||||
$oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT_BEFORE, array ('USR_UID' => $_SESSION['USER_LOGGED']) );
|
||||
@@ -646,7 +637,7 @@ try {
|
||||
//Save data - End
|
||||
|
||||
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT ) && class_exists( 'uploadDocumentData' )) {
|
||||
$triggerDetail = $oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT );
|
||||
|
||||
@@ -663,7 +654,7 @@ try {
|
||||
$uploadReturn = $oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT, $documentData );
|
||||
if ($uploadReturn) {
|
||||
//Only delete if the file was saved correctly
|
||||
$aFields['APP_DOC_PLUGIN'] = $triggerDetail->sNamespace;
|
||||
$aFields['APP_DOC_PLUGIN'] = $triggerDetail->getNamespace();
|
||||
//$oAppDocument = new AppDocument();
|
||||
//$oAppDocument->update($aFields);
|
||||
unlink( $pathOutput . $sFilename . '.pdf' );
|
||||
@@ -718,7 +709,7 @@ try {
|
||||
$lastVersion = $oAppDocument->getLastAppDocVersion( $_GET['DOC'], $_SESSION['APPLICATION'] );
|
||||
$aFields = $oAppDocument->load( $_GET['DOC'], $lastVersion );
|
||||
$listing = false;
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
if ($oPluginRegistry->existsTrigger( PM_CASE_DOCUMENT_LIST )) {
|
||||
$folderData = new folderData( null, null, $_SESSION['APPLICATION'], null, $_SESSION['USER_LOGGED'] );
|
||||
$folderData->PMType = "OUTPUT";
|
||||
@@ -1119,7 +1110,7 @@ try {
|
||||
if ($noShowTitle == 0) {
|
||||
$G_PUBLISH->AddContent( 'smarty', 'cases/cases_title', '', '', $array );
|
||||
}
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$externalSteps = $oPluginRegistry->getSteps();
|
||||
|
||||
$sNamespace = '';
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
try {
|
||||
|
||||
$oAppDocument = new AppDocument();
|
||||
@@ -52,7 +54,7 @@ try {
|
||||
G::uploadFile( $_FILES['form']['tmp_name']['APP_DOC_FILENAME'], $sPathName, $sFileName );
|
||||
|
||||
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT ) && class_exists( 'uploadDocumentData' )) {
|
||||
$oData['APP_UID'] = $_GET['APP_UID'];
|
||||
$documentData = new uploadDocumentData( $_GET['APP_UID'], $_SESSION['USER_LOGGED'], $sPathName . $sFileName, $aFields['APP_DOC_FILENAME'], $sAppDocUid );
|
||||
|
||||
@@ -22,11 +22,6 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
//call plugin
|
||||
// $oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
// $existsDynaforms = $oPluginRegistry->existsTrigger(PM_NEW_DYNAFORM_LIST );
|
||||
|
||||
|
||||
//for now, we are going with the default list, because the plugin is not complete
|
||||
include ('dynaforms_Edit.php');
|
||||
die();
|
||||
|
||||
@@ -80,11 +80,11 @@ try {
|
||||
BasePeer::doUpdate($oCriteriaSelect, $oCriteriaUpdate, $cnn);
|
||||
|
||||
//are all the plugins that are enabled in the workspace
|
||||
$pluginRegistry =& ProcessMaker\Plugins\PluginsRegistry::loadSingleton();
|
||||
foreach ($pluginRegistry->_aPluginDetails as $plugin) {
|
||||
$pluginRegistry = ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
foreach ($pluginRegistry->getPlugins() as $plugin) {
|
||||
if ($plugin->enabled && !in_array($plugin->sNamespace, $licenseManager->features)) {
|
||||
$pluginRegistry->disablePlugin($plugin->sNamespace);
|
||||
$pluginRegistry->pluginAdapter->savePlugin($plugin->sNamespace, $pluginRegistry);
|
||||
$pluginRegistry->savePlugin($plugin->sNamespace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
if (!defined("PATH_PM_ENTERPRISE")) {
|
||||
define("PATH_PM_ENTERPRISE", PATH_CORE . "enterprise/");
|
||||
}
|
||||
@@ -103,10 +105,10 @@ class enterprisePlugin extends PMPlugin
|
||||
|
||||
public function install()
|
||||
{
|
||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
|
||||
$pluginDetail = $pluginRegistry->getPluginDetails("enterprise.php");
|
||||
$pluginRegistry->enablePlugin($pluginDetail->sNamespace);
|
||||
$pluginRegistry->enablePlugin($pluginDetail->getNamespace());
|
||||
|
||||
file_put_contents(PATH_DATA_SITE . "plugin.singleton", $pluginRegistry->serializeInstance());
|
||||
}
|
||||
@@ -118,10 +120,10 @@ class enterprisePlugin extends PMPlugin
|
||||
public function setup()
|
||||
{
|
||||
if (!PluginsRegistryPeer::retrieveByPK(md5('enterprise'))) {
|
||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$pluginDetail = $pluginRegistry->getPluginDetails("enterprise.php");
|
||||
$pluginRegistry->enablePlugin($pluginDetail->sNamespace);
|
||||
$pluginRegistry->pluginAdapter->savePlugin($pluginDetail->sNamespace, $pluginRegistry);
|
||||
$pluginRegistry->enablePlugin($pluginDetail->getNamespace());
|
||||
$pluginRegistry->savePlugin($pluginDetail->getNamespace());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,16 +178,17 @@ class enterprisePlugin extends PMPlugin
|
||||
if (file_exists(PATH_CORE . "plugins" . PATH_SEP . $pluginName . ".php")) {
|
||||
require_once (PATH_CORE . "plugins" . PATH_SEP . $pluginName . ".php");
|
||||
|
||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
|
||||
$pluginDetail = $pluginRegistry->getPluginDetails($pluginName . ".php");
|
||||
|
||||
if ($pluginDetail) {
|
||||
$pluginRegistry->enablePlugin($pluginDetail->sNamespace);
|
||||
$pluginRegistry->disablePlugin($pluginDetail->sNamespace);
|
||||
$pluginRegistry->enablePlugin($pluginDetail->getNamespace());
|
||||
$pluginRegistry->disablePlugin($pluginDetail->getNamespace());
|
||||
|
||||
///////
|
||||
$plugin = new $pluginDetail->sClassName($pluginDetail->sNamespace, $pluginDetail->sFilename);
|
||||
$className = $pluginDetail->getClassName();
|
||||
$plugin = new $className($pluginDetail->getNamespace(), $pluginDetail->getFile());
|
||||
//$this->_aPlugins[$pluginDetail->sNamespace] = $plugin;
|
||||
|
||||
if (method_exists($plugin, "uninstall")) {
|
||||
@@ -193,7 +196,7 @@ class enterprisePlugin extends PMPlugin
|
||||
}
|
||||
|
||||
///////
|
||||
file_put_contents(PATH_DATA_SITE . "plugin.singleton", $pluginRegistry->serializeInstance());
|
||||
$pluginRegistry->savePlugin($pluginDetail->getNamespace());
|
||||
}
|
||||
|
||||
///////
|
||||
@@ -323,7 +326,7 @@ class enterprisePlugin extends PMPlugin
|
||||
}
|
||||
}
|
||||
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry->registerPlugin('enterprise', __FILE__); //<- enterprise string must be in single quote, otherwise generate error
|
||||
|
||||
//since we are placing pmLicenseManager and EE together.. after register EE, we need to require_once the pmLicenseManager
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
global $RBAC;
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
$RBAC->requirePermissions("PM_SETUP_ADVANCE");
|
||||
require_once PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . 'enterprise.php';
|
||||
|
||||
@@ -75,7 +77,7 @@ try {
|
||||
throw (new Exception($str));
|
||||
}
|
||||
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$pluginFile = $sClassName . '.php';
|
||||
|
||||
if ($bMainFile && $bClassFile) {
|
||||
@@ -136,9 +138,9 @@ try {
|
||||
|
||||
$details = $oPluginRegistry->getPluginDetails($pluginFile);
|
||||
|
||||
$oPluginRegistry->installPlugin($details->sNamespace);
|
||||
$oPluginRegistry->installPlugin($details->getNamespace());
|
||||
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins
|
||||
$size = file_put_contents(PATH_DATA_SITE . "plugin.singleton", $oPluginRegistry->serializeInstance());
|
||||
$oPluginRegistry->savePlugin($details->getNamespace());
|
||||
|
||||
//G::header("Location: pluginsList");
|
||||
//die;
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
|
||||
$pluginFile = $_GET['id'];
|
||||
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
|
||||
$details = $oPluginRegistry->getPluginDetails( $pluginFile );
|
||||
$xmlform = isset($details->sPluginFolder) ? $details->sPluginFolder . '/' . $details->sSetupPage : '';
|
||||
$folder = $details->getFolder();
|
||||
$xmlform = (isset($folder)) ? $folder . '/' . $details->getSetupPage() : '';
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
@@ -23,7 +24,7 @@ try {
|
||||
throw ( new Exception ('setup .xml file is not defined for this plugin') );
|
||||
}
|
||||
|
||||
$Fields = $oPluginRegistry->getFieldsForPageSetup( $details->sNamespace );
|
||||
$Fields = $oPluginRegistry->getFieldsForPageSetup( $details->getNamespace() );
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $xmlform, '',$Fields ,'pluginsSetupSave?id='.$pluginFile );
|
||||
} catch (Exception $e) {
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
|
||||
@@ -57,7 +57,7 @@ foreach ($availablePlugins as $filename) {
|
||||
}
|
||||
|
||||
//print "change to ENABLED";
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
|
||||
$pluginFile = $sClassName . '.php';
|
||||
if (! file_exists( PATH_PLUGINS . $sClassName . '.php' )) {
|
||||
@@ -67,10 +67,10 @@ foreach ($availablePlugins as $filename) {
|
||||
require_once (PATH_PLUGINS . $pluginFile);
|
||||
$details = $oPluginRegistry->getPluginDetails( $pluginFile );
|
||||
|
||||
$oPluginRegistry->installPlugin( $details->sNamespace );
|
||||
$oPluginRegistry->enablePlugin( $details->sNamespace );
|
||||
$oPluginRegistry->installPlugin($details->getNamespace());
|
||||
$oPluginRegistry->enablePlugin($details->getNamespace());
|
||||
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins
|
||||
$size = file_put_contents( PATH_DATA_SITE . 'plugin.singleton', $oPluginRegistry->serializeInstance() );
|
||||
$oPluginRegistry->savePlugin($details->getNamespace());
|
||||
|
||||
$message .= "$filename - OK<br>";
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
try {
|
||||
$usr = '';
|
||||
$pwd = '';
|
||||
@@ -172,7 +174,7 @@ try {
|
||||
}
|
||||
|
||||
//Execute the SSO Script from plugin
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$lSession="";
|
||||
$loginInfo = new loginInfo ($usr, $pwd, $lSession );
|
||||
if ($oPluginRegistry->existsTrigger ( PM_LOGIN )) {
|
||||
@@ -425,7 +427,7 @@ try {
|
||||
setcookie("PM-TabPrimary", 101010010, time() + (24 * 60 * 60), '/');
|
||||
}
|
||||
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
if ($oPluginRegistry->existsTrigger ( PM_AFTER_LOGIN )) {
|
||||
$oPluginRegistry->executeTriggers ( PM_AFTER_LOGIN , $_SESSION['USER_LOGGED'] );
|
||||
}
|
||||
|
||||
@@ -50,15 +50,19 @@ if (class_exists('redirectDetail')) {
|
||||
if (isset($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'])) {
|
||||
$userRole = $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'];
|
||||
}
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
//$oPluginRegistry->showArrays();
|
||||
$aRedirectLogin = $oPluginRegistry->getRedirectLogins();
|
||||
if (isset($aRedirectLogin)) {
|
||||
if (is_array($aRedirectLogin)) {
|
||||
foreach ($aRedirectLogin as $key => $detail) {
|
||||
/** @var \ProcessMaker\Plugins\Interfaces\RedirectDetail $detail */
|
||||
foreach ($aRedirectLogin as $detail) {
|
||||
if (isset($detail->sPathMethod)) {
|
||||
if ($detail->sRoleCode == $userRole) {
|
||||
G::header('location: /sys' . SYS_TEMP . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $detail->sPathMethod );
|
||||
if ($detail->equalRoleCodeTo($userRole)) {
|
||||
G::header(
|
||||
'location: /sys' . SYS_TEMP . '/' . SYS_LANG .
|
||||
'/' . SYS_SKIN . '/' . $detail->getPathMethod()
|
||||
);
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,11 +37,12 @@ if ($aux['extension'] != 'dat') {
|
||||
BasePeer::doUpdate($oCriteriaSelect, $oCriteriaUpdate, $cnn);
|
||||
|
||||
//are all the plugins that are enabled in the workspace
|
||||
$pluginRegistry =& ProcessMaker\Plugins\PluginsRegistry::loadSingleton();
|
||||
foreach ($pluginRegistry->_aPluginDetails as $plugin) {
|
||||
if ($plugin->enabled && !in_array($plugin->sNamespace, $licenseManager->features)) {
|
||||
$pluginRegistry->disablePlugin($plugin->sNamespace);
|
||||
$pluginRegistry->pluginAdapter->savePlugin($plugin->sNamespace, $pluginRegistry);
|
||||
$pluginRegistry = ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
/** @var \ProcessMaker\Plugins\Interfaces\PluginDetail $plugin */
|
||||
foreach ($pluginRegistry->getPlugins() as $plugin) {
|
||||
if ($plugin->isEnabled() && !in_array($plugin->getNamespace(), $licenseManager->features)) {
|
||||
$pluginRegistry->disablePlugin($plugin->getNamespace());
|
||||
$pluginRegistry->savePlugin($plugin->getNamespace());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ if (isset ($_SESSION['USER_LOGGED'])) {
|
||||
}
|
||||
} else {
|
||||
// Execute SSO trigger
|
||||
$pluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$pluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
if (defined('PM_SINGLE_SIGN_ON')) {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
|
||||
@@ -47,9 +47,8 @@ $status = array(
|
||||
array("pending", G::LoadTranslation('ID_PENDING'))
|
||||
);
|
||||
|
||||
$pluginRegistry = PMPluginRegistry::getSingleton();
|
||||
$statusER = $pluginRegistry->getStatusPlugin('externalRegistration');
|
||||
$flagER = (preg_match('/^enabled$/', $statusER))? 1 : 0;
|
||||
$pluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$flagER = $pluginRegistry->isEnable('externalRegistration') ? 1 : 0;
|
||||
|
||||
$processes = getProcessArray($userUid);
|
||||
|
||||
|
||||
@@ -36,10 +36,8 @@ switch($req){
|
||||
|
||||
$arrayType = [];
|
||||
|
||||
$pluginRegistry = PMPluginRegistry::getSingleton();
|
||||
$statusEr = $pluginRegistry->getStatusPlugin('externalRegistration');
|
||||
|
||||
$flagEr = (preg_match('/^enabled$/', $statusEr))? 1 : 0;
|
||||
$pluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$flagEr = $pluginRegistry->isEnable('externalRegistration') ? 1 : 0;
|
||||
|
||||
if ($flagEr == 0) {
|
||||
$arrayType[] = 'EXTERNAL_REGISTRATION';
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com>
|
||||
@@ -112,7 +115,7 @@ class Ajax
|
||||
$oData['PRO_TEMPLATE'] = (isset($_POST['PRO_TEMPLATE']) && $_POST['PRO_TEMPLATE'] != '') ? $_POST['form']['PRO_TEMPLATE'] : '';
|
||||
$oData['PROCESSMAP'] = $oProcessMap;
|
||||
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry->executeTriggers(PM_NEW_PROCESS_SAVE, $oData);
|
||||
} else {
|
||||
//$oProcessMap->updateProcess($_POST['form']);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
//$oHeadPublisher = & headPublisher::getSingleton();
|
||||
global $RBAC;
|
||||
@@ -47,12 +48,12 @@ if ($pmVersion != "") {
|
||||
$arrayFlagMenuNewOption = (version_compare($pmVersion . "", "3", ">="))? array("bpmn" => true) : array("pm" => true);
|
||||
}
|
||||
|
||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
|
||||
$arrayMenuNewOptionPlugin = array();
|
||||
$arrayContextMenuOptionPlugin = array();
|
||||
|
||||
foreach ($pluginRegistry->getDesignerMenu() as $value) {
|
||||
foreach ($oPluginRegistry->getDesignerMenu() as $value) {
|
||||
if (file_exists($value->file)) {
|
||||
require_once($value->file);
|
||||
|
||||
@@ -102,11 +103,11 @@ if($RBAC->userCanAccess('PM_DELETE_PROCESS_CASES') === 1) {
|
||||
}
|
||||
$oHeadPublisher->assign('deleteCasesFlag', $deleteCasesFlag);
|
||||
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$callBackFile = $oPluginRegistry->getImportProcessCallback();
|
||||
$file = false;
|
||||
if(sizeof($callBackFile)) {
|
||||
$file = $callBackFile[0]->callBackFile != "" ? $callBackFile[0]->callBackFile : false;
|
||||
$file = $callBackFile[0]->getCallBackFile() != "" ? $callBackFile[0]->getCallBackFile() : false;
|
||||
}
|
||||
$oHeadPublisher->assign("importProcessCallbackFile", $file);
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ if ($access != 1) {
|
||||
}
|
||||
|
||||
//call plugins
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry->executeTriggers( PM_NEW_PROCESS_LIST, NULL );
|
||||
|
||||
$aFields['MESSAGE1'] = G::LoadTranslation( 'ID_MSG_ERROR_PRO_TITLE' );
|
||||
|
||||
@@ -68,7 +68,7 @@ switch ($function) {
|
||||
$oData['PRO_TEMPLATE'] = (isset( $_POST['form']['PRO_TEMPLATE'] ) && $_POST['form']['PRO_TEMPLATE'] != '') ? $_POST['form']['PRO_TEMPLATE'] : '';
|
||||
$oData['PROCESSMAP'] = $oProcessMap;
|
||||
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry->executeTriggers( PM_NEW_PROCESS_SAVE, $oData );
|
||||
|
||||
G::header( 'location: processes_Map?PRO_UID=' . $sProUid );
|
||||
|
||||
@@ -74,7 +74,7 @@ $reports[] = array ('RPT_NUMBER' => count( $reports ),'RPT_UID' => 5,'RPT_TITLE'
|
||||
'RPT_TITLE' => "Report 9",//G::LoadTranslation('ID_REPORT6'),
|
||||
'VIEW' => G::LoadTranslation('ID_VIEW'));*/
|
||||
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$aAvailableReports = $oPluginRegistry->getReports();
|
||||
|
||||
//$aReports = array();
|
||||
|
||||
@@ -210,7 +210,7 @@ try {
|
||||
break;
|
||||
default:
|
||||
$foundReport = false;
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$aAvailableReports = $oPluginRegistry->getReports();
|
||||
foreach ($aAvailableReports as $sReportClass) {
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ if (isset( $_FILES ) && $_FILES["ATTACH_FILE"]["error"] == 0) {
|
||||
|
||||
|
||||
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
|
||||
if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT ) && class_exists( "uploadDocumentData" )) {
|
||||
$triggerDetail = $oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT );
|
||||
@@ -146,7 +146,7 @@ if (isset( $_FILES ) && $_FILES["ATTACH_FILE"]["error"] == 0) {
|
||||
$uploadReturn = $oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT, $documentData );
|
||||
|
||||
if ($uploadReturn) {
|
||||
$aFields["APP_DOC_PLUGIN"] = $triggerDetail->sNamespace;
|
||||
$aFields["APP_DOC_PLUGIN"] = $triggerDetail->getNamespace();
|
||||
|
||||
if (! isset( $aFields["APP_DOC_UID"] )) {
|
||||
$aFields["APP_DOC_UID"] = $sAppDocUid;
|
||||
|
||||
@@ -32,18 +32,17 @@ $filter = new InputFilter();
|
||||
$path = PATH_PLUGINS . $pluginFile;
|
||||
$path = $filter->validateInput($path, 'path');
|
||||
|
||||
$oPluginRegistry =& ProcessMaker\Plugins\PluginsRegistry::loadSingleton();
|
||||
$oPluginRegistry =& ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
|
||||
if ($handle = opendir(PATH_PLUGINS)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if (strpos($file, '.php', 1) && $file == $pluginFile) {
|
||||
if ($pluginStatus == '1') {
|
||||
//print "change to disable";
|
||||
// change to disable
|
||||
$details = $oPluginRegistry->getPluginDetails($pluginFile);
|
||||
$oPluginRegistry->disablePlugin($details->sNamespace);
|
||||
$oPluginRegistry->pluginAdapter->savePlugin($details->sNamespace, $oPluginRegistry);
|
||||
G::auditLog("DisablePlugin", "Plugin Name: " . $details->sNamespace);
|
||||
//print "size saved : $size <br>";
|
||||
$oPluginRegistry->disablePlugin($details->getNamespace());
|
||||
//$oPluginRegistry->adapter->savePlugin($details->sNamespace, $oPluginRegistry);
|
||||
G::auditLog("DisablePlugin", "Plugin Name: " . $details->getNamespace());
|
||||
} else {
|
||||
$pluginName = str_replace(".php", "", $pluginFile);
|
||||
|
||||
@@ -73,14 +72,13 @@ if ($handle = opendir(PATH_PLUGINS)) {
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
//print "change to ENABLED";
|
||||
// change to ENABLED
|
||||
require_once($path);
|
||||
$details = $oPluginRegistry->getPluginDetails($pluginFile);
|
||||
$oPluginRegistry->enablePlugin($details->sNamespace);
|
||||
$oPluginRegistry->enablePlugin($details->getNamespace());
|
||||
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins
|
||||
$oPluginRegistry->pluginAdapter->savePlugin($details->sNamespace, $oPluginRegistry);
|
||||
G::auditLog("EnablePlugin", "Plugin Name: " . $details->sNamespace);
|
||||
//print "size saved : $size <br>";
|
||||
$oPluginRegistry->savePlugin($details->getNamespace());
|
||||
G::auditLog("EnablePlugin", "Plugin Name: " . $details->getNamespace());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ if ($access != 1) {
|
||||
}
|
||||
}
|
||||
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_SUB_MENU = 'setup';
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
global $RBAC;
|
||||
$RBAC->requirePermissions( 'PM_SETUP_ADVANCE' );
|
||||
@@ -67,7 +68,7 @@ try {
|
||||
$tar->extractList( $listFiles, PATH_PLUGINS . 'data');
|
||||
$tar->extractList( $licenseName, PATH_PLUGINS);
|
||||
|
||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$autoPlugins = glob(PATH_PLUGINS . "data/enterprise/data/*.tar");
|
||||
$autoPluginsA = array();
|
||||
|
||||
@@ -91,10 +92,9 @@ try {
|
||||
}
|
||||
|
||||
$pluginDetail = $pluginRegistry->getPluginDetails($sClassName . ".php");
|
||||
$pluginRegistry->installPlugin($pluginDetail->sNamespace); //error
|
||||
$pluginRegistry->installPlugin($pluginDetail->getNamespace()); //error
|
||||
$pluginRegistry->savePlugin($pluginDetail->getNamespace());
|
||||
}
|
||||
|
||||
file_put_contents(PATH_DATA_SITE . "plugin.singleton", $pluginRegistry->serializeInstance());
|
||||
$licfile = glob(PATH_PLUGINS . "*.dat");
|
||||
|
||||
if ((isset($licfile[0])) && ( is_file($licfile[0]) )) {
|
||||
@@ -141,7 +141,7 @@ try {
|
||||
$tar->extractList( $listFiles, PATH_PLUGINS . 'data');
|
||||
$tar->extractList( $licenseName, PATH_PLUGINS);
|
||||
|
||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$autoPlugins = glob(PATH_PLUGINS . "data/plugins/*.tar");
|
||||
$autoPluginsA = array();
|
||||
|
||||
@@ -165,11 +165,10 @@ try {
|
||||
}
|
||||
|
||||
$pluginDetail = $pluginRegistry->getPluginDetails($sClassName . ".php");
|
||||
$pluginRegistry->installPlugin($pluginDetail->sNamespace); //error
|
||||
$pluginRegistry->installPlugin($pluginDetail->getNamespace()); //error
|
||||
$pluginRegistry->savePlugin($pluginDetail->getNamespace());
|
||||
}
|
||||
|
||||
file_put_contents(PATH_DATA_SITE . "plugin.singleton", $pluginRegistry->serializeInstance());
|
||||
|
||||
$licfile = glob(PATH_PLUGINS . "*.dat");
|
||||
|
||||
if ((isset($licfile[0])) && ( is_file($licfile[0]) )) {
|
||||
@@ -222,7 +221,7 @@ try {
|
||||
file_put_contents($pathFileFlag, 'New Enterprise');
|
||||
}
|
||||
|
||||
$oPluginRegistry =& ProcessMaker\Plugins\PluginsRegistry::loadSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$pluginFile = $sClassName . '.php';
|
||||
|
||||
if ($bMainFile && $bClassFile) {
|
||||
@@ -326,13 +325,13 @@ try {
|
||||
|
||||
$details = $oPluginRegistry->getPluginDetails( $pluginFile );
|
||||
|
||||
$oPluginRegistry->installPlugin( $details->sNamespace );
|
||||
$oPluginRegistry->installPlugin($details->getNamespace());
|
||||
|
||||
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins
|
||||
$oPluginRegistry->pluginAdapter->savePlugin($details->sNamespace , $oPluginRegistry);
|
||||
$oPluginRegistry->savePlugin($details->getNamespace());
|
||||
|
||||
$response = $oPluginRegistry->verifyTranslation( $details->sNamespace);
|
||||
G::auditLog("InstallPlugin", "Plugin Name: ".$details->sNamespace );
|
||||
$response = $oPluginRegistry->verifyTranslation($details->getNamespace());
|
||||
G::auditLog("InstallPlugin", "Plugin Name: " . $details->getNamespace());
|
||||
|
||||
//if ($response->recordsCountSuccess <= 0) {
|
||||
//throw (new Exception( 'The plugin ' . $details->sNamespace . ' couldn\'t verify any translation item. Verified Records:' . $response->recordsCountSuccess));
|
||||
|
||||
@@ -42,7 +42,7 @@ $filter = new InputFilter();
|
||||
$pluginName = $_REQUEST['pluginUid'];
|
||||
$pluginName = $filter->xssFilterHard($pluginName);
|
||||
|
||||
$pluginRegistry =& ProcessMaker\Plugins\PluginsRegistry::loadSingleton();
|
||||
$pluginRegistry =& ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$pluginRegistry->uninstallPlugin($pluginName);
|
||||
|
||||
G::auditLog('RemovePlugin','Plugin Name: '.$pluginName);
|
||||
|
||||
@@ -24,10 +24,11 @@
|
||||
|
||||
$pluginFile = $_GET['id'];
|
||||
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
|
||||
$details = $oPluginRegistry->getPluginDetails( $pluginFile );
|
||||
$xmlform = isset( $details->sPluginFolder ) ? $details->sPluginFolder . '/' . $details->sSetupPage : '';
|
||||
$folder = $details->getFolder();
|
||||
$xmlform = isset($folder) ? $folder . '/' . $details->getSetupPage() : '';
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
@@ -45,7 +46,7 @@ try {
|
||||
if (! file_exists( PATH_PLUGINS . $xmlform . '.xml' ))
|
||||
throw (new Exception( 'setup .xml file is not defined for this plugin' ));
|
||||
|
||||
$Fields = $oPluginRegistry->getFieldsForPageSetup( $details->sNamespace );
|
||||
$Fields = $oPluginRegistry->getFieldsForPageSetup( $details->getNamespace() );
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $xmlform, '', $Fields, 'pluginsSetupSave?id=' . $pluginFile );
|
||||
} catch (Exception $e) {
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
|
||||
$pluginFile = $_GET['id'];
|
||||
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
|
||||
$details = $oPluginRegistry->getPluginDetails( $pluginFile );
|
||||
try {
|
||||
$Fields = $oPluginRegistry->updateFieldsForPageSetup( $details->sNamespace, $_POST );
|
||||
$Fields = $oPluginRegistry->updateFieldsForPageSetup( $details->getNamespace(), $_POST );
|
||||
$str = "$Fields fields saved successfully!";
|
||||
G::SendTemporalMessage( $str, 'info', 'string', 3, 100 );
|
||||
G::Header( "location: pluginsSetup?id=$pluginFile" );
|
||||
|
||||
@@ -1,462 +1,461 @@
|
||||
<?php
|
||||
/**
|
||||
* trackerAjax.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.
|
||||
*/
|
||||
try {
|
||||
|
||||
$filter = new InputFilter();
|
||||
$_POST = $filter->xssFilterHard($_POST);
|
||||
|
||||
if (isset( $_POST['form']['action'] )) {
|
||||
$_POST['action'] = $_POST['form']['action'];
|
||||
}
|
||||
|
||||
switch ($_POST['action']) {
|
||||
case 'availableCaseTrackerObjects':
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->availableCaseTrackerObjects( $_POST['PRO_UID'] );
|
||||
break;
|
||||
case 'assignCaseTrackerObject':
|
||||
$oProcessMap = new ProcessMap();
|
||||
$cto_UID = $oProcessMap->assignCaseTrackerObject( $_POST['PRO_UID'], $_POST['OBJECT_TYPE'], $_POST['OBJECT_UID'] );
|
||||
$oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($_POST['PRO_UID']);
|
||||
G::auditLog('CaseTrackers','Assign Case Tracker Object ('.$cto_UID.' - '.$_POST['OBJECT_TYPE'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
echo $cto_UID;
|
||||
break;
|
||||
case 'removeCaseTrackerObject':
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->removeCaseTrackerObject( $_POST['CTO_UID'], $_POST['PRO_UID'], $_POST['STEP_POSITION'] );
|
||||
$oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($_POST['PRO_UID']);
|
||||
G::auditLog('CaseTrackers','Remove Case Tracker Object ('.$_POST['CTO_UID'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'upCaseTrackerObject':
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->upCaseTrackerObject( $_POST['CTO_UID'], $_POST['PRO_UID'], $_POST['STEP_POSITION'] );
|
||||
$oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($_POST['PRO_UID']);
|
||||
G::auditLog('CaseTrackers','Move Up Case Tracker Object ('.$_POST['CTO_UID'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'downCaseTrackerObject':
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->downCaseTrackerObject( $_POST['CTO_UID'], $_POST['PRO_UID'], $_POST['STEP_POSITION'] );
|
||||
$oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($_POST['PRO_UID']);
|
||||
G::auditLog('CaseTrackers','Move Down Case Tracker Object ('.$_POST['CTO_UID'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'editStagesMap':
|
||||
$oTemplatePower = new TemplatePower( PATH_TPL . 'tracker/stages_Map.html' );
|
||||
$oTemplatePower->prepare();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptCode( '
|
||||
var pb=leimnud.dom.capture("tag.body 0");
|
||||
Sm=new stagesmap();
|
||||
Sm.options = {
|
||||
target : "sm_target",
|
||||
dataServer: "../tracker/tracker_Ajax",
|
||||
uid : "' . $_POST['PRO_UID'] . '",
|
||||
lang : "' . SYS_LANG . '",
|
||||
theme : "processmaker",
|
||||
size : {w:"780",h:"540"},
|
||||
images_dir: "/jscore/processmap/core/images/",
|
||||
rw : true,
|
||||
hideMenu : false
|
||||
};
|
||||
Sm.make();' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'showUploadedDocumentTracker':
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/InputDocument.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->Fields = $oAppDocument->load( $_POST['APP_DOC_UID'] );
|
||||
|
||||
$oInputDocument = new InputDocument();
|
||||
if ($oAppDocument->Fields['DOC_UID'] != - 1) {
|
||||
$Fields = $oInputDocument->load( $oAppDocument->Fields['DOC_UID'] );
|
||||
} else {
|
||||
$Fields = array ('INP_DOC_FORM_NEEDED' => '','FILENAME' => $oAppDocument->Fields['APP_DOC_FILENAME']);
|
||||
}
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( AppDelegationPeer::DEL_INDEX, $oAppDocument->Fields['DEL_INDEX'] );
|
||||
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
$oTask = new Task();
|
||||
$aTask = $oTask->load( $aRow['TAS_UID'] );
|
||||
$Fields['ORIGIN'] = $aTask['TAS_TITLE'];
|
||||
$oUser = new Users();
|
||||
$aUser = $oUser->load( $oAppDocument->Fields['USR_UID'] );
|
||||
$Fields['CREATOR'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
|
||||
switch ($Fields['INP_DOC_FORM_NEEDED']) {
|
||||
case 'REAL':
|
||||
$sXmlForm = 'tracker/tracker_ViewAnyInputDocument2';
|
||||
break;
|
||||
case 'VIRTUAL':
|
||||
$sXmlForm = 'tracker/tracker_ViewAnyInputDocument1';
|
||||
break;
|
||||
case 'VREAL':
|
||||
$sXmlForm = 'tracker/tracker_ViewAnyInputDocument3';
|
||||
break;
|
||||
default:
|
||||
$sXmlForm = 'tracker/tracker_ViewAnyInputDocument';
|
||||
break;
|
||||
}
|
||||
$oAppDocument->Fields['VIEW'] = G::LoadTranslation( 'ID_OPEN' );
|
||||
$oAppDocument->Fields['FILE'] = 'tracker_ShowDocument?a=' . $_POST['APP_DOC_UID'] . '&r=' . rand();
|
||||
|
||||
//If plugin and trigger are defined for listing
|
||||
if ($oPluginRegistry->existsTrigger( PM_CASE_DOCUMENT_LIST_ARR )) {
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$filesPluginArray = $oPluginRegistry->executeTriggers( PM_CASE_DOCUMENT_LIST_ARR, $_SESSION['APPLICATION'] );
|
||||
//Now search for the file, if exists the change the download URL
|
||||
foreach ($filesPluginArray as $file) {
|
||||
if ($file->filename == $_POST['APP_DOC_UID']) {
|
||||
$oAppDocument->Fields['FILE'] = $file->downloadScript;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $sXmlForm, '', G::array_merges( $Fields, $oAppDocument->Fields ), '' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'showGeneratedDocumentTracker':
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
$oAppDocument = new AppDocument();
|
||||
$aFields = $oAppDocument->load( $_POST['APP_DOC_UID'] );
|
||||
require_once 'classes/model/OutputDocument.php';
|
||||
$oOutputDocument = new OutputDocument();
|
||||
$aOD = $oOutputDocument->load( $aFields['DOC_UID'] );
|
||||
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( AppDelegationPeer::APP_UID, $aFields['APP_UID'] );
|
||||
$oCriteria->add( AppDelegationPeer::DEL_INDEX, $aFields['DEL_INDEX'] );
|
||||
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
$oTask = new Task();
|
||||
$aTask = $oTask->load( $aRow['TAS_UID'] );
|
||||
$aFields['ORIGIN'] = $aTask['TAS_TITLE'];
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$aUser = $oUser->load( $aFields['USR_UID'] );
|
||||
$aFields['CREATOR'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
|
||||
$aFields['VIEW'] = G::LoadTranslation( 'ID_OPEN' );
|
||||
$aFields['FILE1'] = 'tracker_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand();
|
||||
$aFields['FILE2'] = 'tracker_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand();
|
||||
|
||||
//If plugin and trigger are defined for listing
|
||||
if ($oPluginRegistry->existsTrigger( PM_CASE_DOCUMENT_LIST_ARR )) {
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$filesPluginArray = $oPluginRegistry->executeTriggers( PM_CASE_DOCUMENT_LIST_ARR, $aFields['APP_UID'] );
|
||||
//Now search for the file, if exists the change the download URL
|
||||
foreach ($filesPluginArray as $file) {
|
||||
if ($file->filename == $_POST['APP_DOC_UID']) {
|
||||
$aFields['FILE2'] = $file->downloadScript; // The PDF is the only one uploaded to KT
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tracker/tracker_ViewAnyOutputDocument', '', G::array_merges( $aOD, $aFields ), '' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'load':
|
||||
$oConnection = Propel::getConnection( 'workflow' );
|
||||
$oStatement = $oConnection->prepareStatement( "CREATE TABLE IF NOT EXISTS `STAGE` (
|
||||
`STG_UID` VARCHAR( 32 ) NOT NULL ,
|
||||
`PRO_UID` VARCHAR( 32 ) NOT NULL ,
|
||||
`STG_POSX` INT( 11 ) NOT NULL DEFAULT '0',
|
||||
`STG_POSY` INT( 11 ) NOT NULL DEFAULT '0',
|
||||
`STG_INDEX` INT( 11 ) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY ( `STG_UID` )
|
||||
);" );
|
||||
$oStatement->executeQuery();
|
||||
/**
|
||||
* ************************************************************************************************************
|
||||
*/
|
||||
require_once 'classes/model/Stage.php';
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
//$oJSON = new Services_JSON();
|
||||
$oData = Bootstrap::json_decode( stripslashes( $_POST['data'] ) );
|
||||
$oProcess = new Process();
|
||||
$aRow = $oProcess->load( $oData->uid );
|
||||
$oSM = new stdclass();
|
||||
$oSM->title = new stdclass();
|
||||
$oSM->title->label = strip_tags( $aRow['PRO_TITLE'] );
|
||||
//$oSM->title->position->x = $aRow['PRO_TITLE_X'];
|
||||
//$oSM->title->position->y = $aRow['PRO_TITLE_Y'];
|
||||
$oSM->title->position = new stdclass();
|
||||
$oSM->title->position->x = 10;
|
||||
$oSM->title->position->y = 10;
|
||||
$oSM->stages = array ();
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( StagePeer::STG_UID );
|
||||
$oCriteria->addSelectColumn( ContentPeer::CON_VALUE );
|
||||
$oCriteria->addSelectColumn( StagePeer::STG_POSX );
|
||||
$oCriteria->addSelectColumn( StagePeer::STG_POSY );
|
||||
$aConditions = array ();
|
||||
$aConditions[] = array (0 => StagePeer::STG_UID,1 => ContentPeer::CON_ID);
|
||||
$aConditions[] = array (0 => ContentPeer::CON_CATEGORY,1 => DBAdapter::getStringDelimiter() . 'STG_TITLE' . DBAdapter::getStringDelimiter());
|
||||
$aConditions[] = array (0 => ContentPeer::CON_LANG,1 => DBAdapter::getStringDelimiter() . SYS_LANG . DBAdapter::getStringDelimiter());
|
||||
$oCriteria->addJoinMC( $aConditions, Criteria::LEFT_JOIN );
|
||||
$oCriteria->add( StagePeer::PRO_UID, $oData->uid );
|
||||
$oCriteria->addAscendingOrderByColumn( StagePeer::STG_INDEX );
|
||||
$oDataset = StagePeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
while ($aRow1 = $oDataset->getRow()) {
|
||||
$oStage = new stdclass();
|
||||
$oStage->uid = $aRow1['STG_UID'];
|
||||
$oStage->label = strip_tags( $aRow1['CON_VALUE'] );
|
||||
$oStage->position = new stdclass();
|
||||
$oStage->position->x = (int) $aRow1['STG_POSX'];
|
||||
$oStage->position->y = (int) $aRow1['STG_POSY'];
|
||||
$oStage->derivation = new stdclass();
|
||||
$oStage->derivation->to = array ();
|
||||
if (! $oData->mode) {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( TaskPeer::STG_UID, $aRow1['STG_UID'] );
|
||||
$oDataset1 = TaskPeer::doSelectRS( $oCriteria );
|
||||
$oDataset1->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset1->next();
|
||||
$aTasks = array ();
|
||||
while ($aRow2 = $oDataset1->getRow()) {
|
||||
$aTasks[] = $aRow2['TAS_UID'];
|
||||
$oDataset1->next();
|
||||
}
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( AppDelegationPeer::APP_UID, $_SESSION['APPLICATION'] );
|
||||
$oCriteria->add( AppDelegationPeer::TAS_UID, $aTasks, Criteria::IN );
|
||||
$oCriteria->add( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL )->addOr( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_FINISH_DATE, '' ) ) );
|
||||
if (AppDelegationPeer::doCount( $oCriteria ) > 0) {
|
||||
$oStage->color = '#FF0000';
|
||||
} else {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( AppDelegationPeer::APP_UID, $_SESSION['APPLICATION'] );
|
||||
$oCriteria->add( AppDelegationPeer::TAS_UID, $aTasks, Criteria::IN );
|
||||
$oCriteria->add( AppDelegationPeer::DEL_THREAD_STATUS, 'CLOSED' );
|
||||
if (AppDelegationPeer::doCount( $oCriteria ) > 0) {
|
||||
$oStage->color = '#006633';
|
||||
} else {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( AppDelegationPeer::APP_UID, $_SESSION['APPLICATION'] );
|
||||
$oCriteria->add( AppDelegationPeer::TAS_UID, $aTasks, Criteria::IN );
|
||||
if (AppDelegationPeer::doCount( $oCriteria ) == 0) {
|
||||
$oStage->color = '#939598';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$oSM->stages[] = $oStage;
|
||||
$oDataset->next();
|
||||
}
|
||||
foreach ($oSM->stages as $iKey => $oStage) {
|
||||
if (isset( $oSM->stages[$iKey + 1] )) {
|
||||
$oDerivation = new stdclass();
|
||||
$oDerivation->stage = $oSM->stages[$iKey + 1]->uid;
|
||||
$oSM->stages[$iKey]->derivation->to = array ($oDerivation);
|
||||
$oSM->stages[$iKey]->derivation->type = 0;
|
||||
}
|
||||
}
|
||||
//$oJSON = new Services_JSON();
|
||||
echo Bootstrap::json_encode( $oSM );
|
||||
break;
|
||||
case 'addStage':
|
||||
require_once 'classes/model/Stage.php';
|
||||
//$oJSON = new Services_JSON();
|
||||
$oData = Bootstrap::json_decode( stripslashes( $_POST['data'] ) );
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( 'STG_UID' );
|
||||
$oCriteria->add( StagePeer::PRO_UID, $oData->uid );
|
||||
$oDataset = StagePeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aStages = array ();
|
||||
$iStageNumber = 0;
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aStages[] = $aRow['STG_UID'];
|
||||
$iStageNumber ++;
|
||||
$oDataset->next();
|
||||
}
|
||||
if ($iStageNumber == 0) {
|
||||
$iStageNumber = 1;
|
||||
}
|
||||
$iIndex = $iStageNumber + 1;
|
||||
$bContinue = false;
|
||||
while (! $bContinue) {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( 'COUNT(*) AS TIMES' );
|
||||
$oCriteria->add( ContentPeer::CON_ID, $aStages, Criteria::IN );
|
||||
$oCriteria->add( ContentPeer::CON_CATEGORY, 'STG_TITLE' );
|
||||
$oCriteria->add( ContentPeer::CON_LANG, SYS_LANG );
|
||||
$oCriteria->add( ContentPeer::CON_VALUE, G::LoadTranslation( 'ID_STAGE' ) . ' ' . $iStageNumber );
|
||||
$oDataset = ContentPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
if ((int) $aRow['TIMES'] > 0) {
|
||||
$iStageNumber += 1;
|
||||
} else {
|
||||
$bContinue = true;
|
||||
}
|
||||
}
|
||||
$oStage = new Stage();
|
||||
$oNewStage = new stdclass();
|
||||
$oNewStage->label = G::LoadTranslation( 'ID_STAGE' ) . ' ' . $iStageNumber;
|
||||
|
||||
if ($oData->position->x < 0)
|
||||
$oData->position->x *= - 1;
|
||||
if ($oData->position->y < 0)
|
||||
$oData->position->y *= - 1;
|
||||
|
||||
$oNewStage->uid = $oStage->create( array ('PRO_UID' => $oData->uid,'STG_TITLE' => $oNewStage->label,'STG_POSX' => $oData->position->x,'STG_POSY' => $oData->position->y,'STG_INDEX' => $iIndex) );
|
||||
//$oJSON = new Services_JSON();
|
||||
echo Bootstrap::json_encode( $oNewStage );
|
||||
break;
|
||||
case 'saveStagePosition':
|
||||
require_once 'classes/model/Stage.php';
|
||||
//$oJSON = new Services_JSON();
|
||||
$oData = Bootstrap::json_decode( stripslashes( $_POST['data'] ) );
|
||||
$oStage = new Stage();
|
||||
$aFields = $oStage->load( $oData->uid );
|
||||
$aFields['STG_UID'] = $oData->uid;
|
||||
$aFields['STG_POSX'] = $oData->position->x;
|
||||
$aFields['STG_POSY'] = $oData->position->y;
|
||||
$oStage->update( $aFields );
|
||||
break;
|
||||
case 'deleteStage':
|
||||
require_once 'classes/model/Stage.php';
|
||||
//$oJSON = new Services_JSON();
|
||||
$oData = Bootstrap::json_decode( stripslashes( $_POST['data'] ) );
|
||||
$oStage = new Stage();
|
||||
$aFields = $oStage->load( $oData->stg_uid );
|
||||
$oStage->remove( $oData->stg_uid );
|
||||
$oStage->reorderPositions( $aFields['PRO_UID'], $aFields['STG_INDEX'] );
|
||||
require_once 'classes/model/Task.php';
|
||||
$oCriteria1 = new Criteria( 'workflow' );
|
||||
$oCriteria1->add( TaskPeer::STG_UID, $oData->stg_uid );
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->add( TaskPeer::STG_UID, '' );
|
||||
BasePeer::doUpdate( $oCriteria1, $oCriteria2, Propel::getConnection( 'workflow' ) );
|
||||
break;
|
||||
case 'editStage':
|
||||
require_once 'classes/model/Stage.php';
|
||||
//$oJSON = new Services_JSON();
|
||||
$oData = Bootstrap::json_decode( stripslashes( $_POST['data'] ) );
|
||||
$oStage = new Stage();
|
||||
$aFields = $oStage->load( $oData->stg_uid );
|
||||
$aFields['THEINDEX'] = $oData->theindex;
|
||||
$aFields['action'] = 'updateStage';
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tracker/tracker_StageEdit', '', $aFields, '../tracker/tracker_Ajax' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'updateStage':
|
||||
require_once 'classes/model/Stage.php';
|
||||
$oStage = new Stage();
|
||||
$aFields = $oStage->load( $_POST['form']['STG_UID'] );
|
||||
$aFields['STG_TITLE'] = $_POST['form']['STG_TITLE'];
|
||||
$oStage->update( $aFields );
|
||||
break;
|
||||
case 'tasksAssigned':
|
||||
require_once 'classes/model/Stage.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
//$oJSON = new Services_JSON();
|
||||
$oData = Bootstrap::json_decode( stripslashes( $_POST['data'] ) );
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( TaskPeer::TAS_UID );
|
||||
$oCriteria->addSelectColumn( TaskPeer::TAS_TITLE );
|
||||
$oCriteria->add( TaskPeer::STG_UID, $oData->stg_uid );
|
||||
$oCriteria->addAscendingOrderByColumn( TaskPeer::TAS_TITLE );
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'tracker/tracker_StageTasks', $oCriteria, array ('PRO_UID' => $oData->pro_uid,'STG_UID' => $oData->stg_uid) );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'availableTasksForTheStage':
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( TaskPeer::TAS_UID );
|
||||
$oCriteria->addSelectColumn( TaskPeer::TAS_TITLE );
|
||||
$oCriteria->add( TaskPeer::PRO_UID, $_POST['PRO_UID'] );
|
||||
$oCriteria->add( TaskPeer::STG_UID, '' );
|
||||
$oCriteria->addAscendingOrderByColumn( TaskPeer::TAS_TITLE );
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'tracker/tracker_AvailableStageTasks', $oCriteria, array ('STG_UID' => $_POST['STG_UID']) );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'assignTaskToStage':
|
||||
require_once 'classes/model/Task.php';
|
||||
$oCriteria1 = new Criteria( 'workflow' );
|
||||
$oCriteria1->add( TaskPeer::TAS_UID, $_POST['TAS_UID'] );
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->add( TaskPeer::STG_UID, $_POST['STG_UID'] );
|
||||
BasePeer::doUpdate( $oCriteria1, $oCriteria2, Propel::getConnection( 'workflow' ) );
|
||||
break;
|
||||
case 'removeTaskFromTheStage':
|
||||
require_once 'classes/model/Task.php';
|
||||
$oCriteria1 = new Criteria( 'workflow' );
|
||||
$oCriteria1->add( TaskPeer::TAS_UID, $_POST['TAS_UID'] );
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->add( TaskPeer::STG_UID, '' );
|
||||
BasePeer::doUpdate( $oCriteria1, $oCriteria2, Propel::getConnection( 'workflow' ) );
|
||||
break;
|
||||
|
||||
case "processMapLegend":
|
||||
$arrayField = array ();
|
||||
$arrayField["sLabel1"] = G::LoadTranslation( "ID_TASK_IN_PROGRESS" );
|
||||
$arrayField["sLabel2"] = G::LoadTranslation( "ID_COMPLETED_TASK" );
|
||||
$arrayField["sLabel3"] = G::LoadTranslation( "ID_PENDING_TASK" );
|
||||
$arrayField["sLabel4"] = G::LoadTranslation( "ID_PARALLEL_TASK" );
|
||||
$arrayField["tracker"] = 1;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( "smarty", "cases/cases_Leyends", "", "", $arrayField );
|
||||
G::RenderPage( "publish", "raw" );
|
||||
break;
|
||||
}
|
||||
} catch (Exception $oException) {
|
||||
$token = strtotime("now");
|
||||
PMException::registerErrorLog($oException, $token);
|
||||
G::outRes( G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)) );
|
||||
die;
|
||||
}
|
||||
|
||||
<?php
|
||||
/**
|
||||
* trackerAjax.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.
|
||||
*/
|
||||
try {
|
||||
$filter = new InputFilter();
|
||||
$_POST = $filter->xssFilterHard($_POST);
|
||||
|
||||
if (isset( $_POST['form']['action'] )) {
|
||||
$_POST['action'] = $_POST['form']['action'];
|
||||
}
|
||||
|
||||
switch ($_POST['action']) {
|
||||
case 'availableCaseTrackerObjects':
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->availableCaseTrackerObjects( $_POST['PRO_UID'] );
|
||||
break;
|
||||
case 'assignCaseTrackerObject':
|
||||
$oProcessMap = new ProcessMap();
|
||||
$cto_UID = $oProcessMap->assignCaseTrackerObject( $_POST['PRO_UID'], $_POST['OBJECT_TYPE'], $_POST['OBJECT_UID'] );
|
||||
$oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($_POST['PRO_UID']);
|
||||
G::auditLog('CaseTrackers','Assign Case Tracker Object ('.$cto_UID.' - '.$_POST['OBJECT_TYPE'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
echo $cto_UID;
|
||||
break;
|
||||
case 'removeCaseTrackerObject':
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->removeCaseTrackerObject( $_POST['CTO_UID'], $_POST['PRO_UID'], $_POST['STEP_POSITION'] );
|
||||
$oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($_POST['PRO_UID']);
|
||||
G::auditLog('CaseTrackers','Remove Case Tracker Object ('.$_POST['CTO_UID'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'upCaseTrackerObject':
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->upCaseTrackerObject( $_POST['CTO_UID'], $_POST['PRO_UID'], $_POST['STEP_POSITION'] );
|
||||
$oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($_POST['PRO_UID']);
|
||||
G::auditLog('CaseTrackers','Move Up Case Tracker Object ('.$_POST['CTO_UID'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'downCaseTrackerObject':
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->downCaseTrackerObject( $_POST['CTO_UID'], $_POST['PRO_UID'], $_POST['STEP_POSITION'] );
|
||||
$oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($_POST['PRO_UID']);
|
||||
G::auditLog('CaseTrackers','Move Down Case Tracker Object ('.$_POST['CTO_UID'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'editStagesMap':
|
||||
$oTemplatePower = new TemplatePower( PATH_TPL . 'tracker/stages_Map.html' );
|
||||
$oTemplatePower->prepare();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptCode( '
|
||||
var pb=leimnud.dom.capture("tag.body 0");
|
||||
Sm=new stagesmap();
|
||||
Sm.options = {
|
||||
target : "sm_target",
|
||||
dataServer: "../tracker/tracker_Ajax",
|
||||
uid : "' . $_POST['PRO_UID'] . '",
|
||||
lang : "' . SYS_LANG . '",
|
||||
theme : "processmaker",
|
||||
size : {w:"780",h:"540"},
|
||||
images_dir: "/jscore/processmap/core/images/",
|
||||
rw : true,
|
||||
hideMenu : false
|
||||
};
|
||||
Sm.make();' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'showUploadedDocumentTracker':
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/InputDocument.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->Fields = $oAppDocument->load( $_POST['APP_DOC_UID'] );
|
||||
|
||||
$oInputDocument = new InputDocument();
|
||||
if ($oAppDocument->Fields['DOC_UID'] != - 1) {
|
||||
$Fields = $oInputDocument->load( $oAppDocument->Fields['DOC_UID'] );
|
||||
} else {
|
||||
$Fields = array ('INP_DOC_FORM_NEEDED' => '','FILENAME' => $oAppDocument->Fields['APP_DOC_FILENAME']);
|
||||
}
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( AppDelegationPeer::DEL_INDEX, $oAppDocument->Fields['DEL_INDEX'] );
|
||||
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
$oTask = new Task();
|
||||
$aTask = $oTask->load( $aRow['TAS_UID'] );
|
||||
$Fields['ORIGIN'] = $aTask['TAS_TITLE'];
|
||||
$oUser = new Users();
|
||||
$aUser = $oUser->load( $oAppDocument->Fields['USR_UID'] );
|
||||
$Fields['CREATOR'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
|
||||
switch ($Fields['INP_DOC_FORM_NEEDED']) {
|
||||
case 'REAL':
|
||||
$sXmlForm = 'tracker/tracker_ViewAnyInputDocument2';
|
||||
break;
|
||||
case 'VIRTUAL':
|
||||
$sXmlForm = 'tracker/tracker_ViewAnyInputDocument1';
|
||||
break;
|
||||
case 'VREAL':
|
||||
$sXmlForm = 'tracker/tracker_ViewAnyInputDocument3';
|
||||
break;
|
||||
default:
|
||||
$sXmlForm = 'tracker/tracker_ViewAnyInputDocument';
|
||||
break;
|
||||
}
|
||||
$oAppDocument->Fields['VIEW'] = G::LoadTranslation( 'ID_OPEN' );
|
||||
$oAppDocument->Fields['FILE'] = 'tracker_ShowDocument?a=' . $_POST['APP_DOC_UID'] . '&r=' . rand();
|
||||
|
||||
//If plugin and trigger are defined for listing
|
||||
if ($oPluginRegistry->existsTrigger( PM_CASE_DOCUMENT_LIST_ARR )) {
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$filesPluginArray = $oPluginRegistry->executeTriggers( PM_CASE_DOCUMENT_LIST_ARR, $_SESSION['APPLICATION'] );
|
||||
//Now search for the file, if exists the change the download URL
|
||||
foreach ($filesPluginArray as $file) {
|
||||
if ($file->filename == $_POST['APP_DOC_UID']) {
|
||||
$oAppDocument->Fields['FILE'] = $file->downloadScript;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $sXmlForm, '', G::array_merges( $Fields, $oAppDocument->Fields ), '' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'showGeneratedDocumentTracker':
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
$oAppDocument = new AppDocument();
|
||||
$aFields = $oAppDocument->load( $_POST['APP_DOC_UID'] );
|
||||
require_once 'classes/model/OutputDocument.php';
|
||||
$oOutputDocument = new OutputDocument();
|
||||
$aOD = $oOutputDocument->load( $aFields['DOC_UID'] );
|
||||
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( AppDelegationPeer::APP_UID, $aFields['APP_UID'] );
|
||||
$oCriteria->add( AppDelegationPeer::DEL_INDEX, $aFields['DEL_INDEX'] );
|
||||
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
$oTask = new Task();
|
||||
$aTask = $oTask->load( $aRow['TAS_UID'] );
|
||||
$aFields['ORIGIN'] = $aTask['TAS_TITLE'];
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$aUser = $oUser->load( $aFields['USR_UID'] );
|
||||
$aFields['CREATOR'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
|
||||
$aFields['VIEW'] = G::LoadTranslation( 'ID_OPEN' );
|
||||
$aFields['FILE1'] = 'tracker_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand();
|
||||
$aFields['FILE2'] = 'tracker_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand();
|
||||
|
||||
//If plugin and trigger are defined for listing
|
||||
if ($oPluginRegistry->existsTrigger( PM_CASE_DOCUMENT_LIST_ARR )) {
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$filesPluginArray = $oPluginRegistry->executeTriggers( PM_CASE_DOCUMENT_LIST_ARR, $aFields['APP_UID'] );
|
||||
//Now search for the file, if exists the change the download URL
|
||||
foreach ($filesPluginArray as $file) {
|
||||
if ($file->filename == $_POST['APP_DOC_UID']) {
|
||||
$aFields['FILE2'] = $file->downloadScript; // The PDF is the only one uploaded to KT
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tracker/tracker_ViewAnyOutputDocument', '', G::array_merges( $aOD, $aFields ), '' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'load':
|
||||
$oConnection = Propel::getConnection( 'workflow' );
|
||||
$oStatement = $oConnection->prepareStatement( "CREATE TABLE IF NOT EXISTS `STAGE` (
|
||||
`STG_UID` VARCHAR( 32 ) NOT NULL ,
|
||||
`PRO_UID` VARCHAR( 32 ) NOT NULL ,
|
||||
`STG_POSX` INT( 11 ) NOT NULL DEFAULT '0',
|
||||
`STG_POSY` INT( 11 ) NOT NULL DEFAULT '0',
|
||||
`STG_INDEX` INT( 11 ) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY ( `STG_UID` )
|
||||
);" );
|
||||
$oStatement->executeQuery();
|
||||
/**
|
||||
* ************************************************************************************************************
|
||||
*/
|
||||
require_once 'classes/model/Stage.php';
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
//$oJSON = new Services_JSON();
|
||||
$oData = Bootstrap::json_decode( stripslashes( $_POST['data'] ) );
|
||||
$oProcess = new Process();
|
||||
$aRow = $oProcess->load( $oData->uid );
|
||||
$oSM = new stdclass();
|
||||
$oSM->title = new stdclass();
|
||||
$oSM->title->label = strip_tags( $aRow['PRO_TITLE'] );
|
||||
//$oSM->title->position->x = $aRow['PRO_TITLE_X'];
|
||||
//$oSM->title->position->y = $aRow['PRO_TITLE_Y'];
|
||||
$oSM->title->position = new stdclass();
|
||||
$oSM->title->position->x = 10;
|
||||
$oSM->title->position->y = 10;
|
||||
$oSM->stages = array ();
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( StagePeer::STG_UID );
|
||||
$oCriteria->addSelectColumn( ContentPeer::CON_VALUE );
|
||||
$oCriteria->addSelectColumn( StagePeer::STG_POSX );
|
||||
$oCriteria->addSelectColumn( StagePeer::STG_POSY );
|
||||
$aConditions = array ();
|
||||
$aConditions[] = array (0 => StagePeer::STG_UID,1 => ContentPeer::CON_ID);
|
||||
$aConditions[] = array (0 => ContentPeer::CON_CATEGORY,1 => DBAdapter::getStringDelimiter() . 'STG_TITLE' . DBAdapter::getStringDelimiter());
|
||||
$aConditions[] = array (0 => ContentPeer::CON_LANG,1 => DBAdapter::getStringDelimiter() . SYS_LANG . DBAdapter::getStringDelimiter());
|
||||
$oCriteria->addJoinMC( $aConditions, Criteria::LEFT_JOIN );
|
||||
$oCriteria->add( StagePeer::PRO_UID, $oData->uid );
|
||||
$oCriteria->addAscendingOrderByColumn( StagePeer::STG_INDEX );
|
||||
$oDataset = StagePeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
while ($aRow1 = $oDataset->getRow()) {
|
||||
$oStage = new stdclass();
|
||||
$oStage->uid = $aRow1['STG_UID'];
|
||||
$oStage->label = strip_tags( $aRow1['CON_VALUE'] );
|
||||
$oStage->position = new stdclass();
|
||||
$oStage->position->x = (int) $aRow1['STG_POSX'];
|
||||
$oStage->position->y = (int) $aRow1['STG_POSY'];
|
||||
$oStage->derivation = new stdclass();
|
||||
$oStage->derivation->to = array ();
|
||||
if (! $oData->mode) {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( TaskPeer::STG_UID, $aRow1['STG_UID'] );
|
||||
$oDataset1 = TaskPeer::doSelectRS( $oCriteria );
|
||||
$oDataset1->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset1->next();
|
||||
$aTasks = array ();
|
||||
while ($aRow2 = $oDataset1->getRow()) {
|
||||
$aTasks[] = $aRow2['TAS_UID'];
|
||||
$oDataset1->next();
|
||||
}
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( AppDelegationPeer::APP_UID, $_SESSION['APPLICATION'] );
|
||||
$oCriteria->add( AppDelegationPeer::TAS_UID, $aTasks, Criteria::IN );
|
||||
$oCriteria->add( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL )->addOr( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_FINISH_DATE, '' ) ) );
|
||||
if (AppDelegationPeer::doCount( $oCriteria ) > 0) {
|
||||
$oStage->color = '#FF0000';
|
||||
} else {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( AppDelegationPeer::APP_UID, $_SESSION['APPLICATION'] );
|
||||
$oCriteria->add( AppDelegationPeer::TAS_UID, $aTasks, Criteria::IN );
|
||||
$oCriteria->add( AppDelegationPeer::DEL_THREAD_STATUS, 'CLOSED' );
|
||||
if (AppDelegationPeer::doCount( $oCriteria ) > 0) {
|
||||
$oStage->color = '#006633';
|
||||
} else {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( AppDelegationPeer::APP_UID, $_SESSION['APPLICATION'] );
|
||||
$oCriteria->add( AppDelegationPeer::TAS_UID, $aTasks, Criteria::IN );
|
||||
if (AppDelegationPeer::doCount( $oCriteria ) == 0) {
|
||||
$oStage->color = '#939598';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$oSM->stages[] = $oStage;
|
||||
$oDataset->next();
|
||||
}
|
||||
foreach ($oSM->stages as $iKey => $oStage) {
|
||||
if (isset( $oSM->stages[$iKey + 1] )) {
|
||||
$oDerivation = new stdclass();
|
||||
$oDerivation->stage = $oSM->stages[$iKey + 1]->uid;
|
||||
$oSM->stages[$iKey]->derivation->to = array ($oDerivation);
|
||||
$oSM->stages[$iKey]->derivation->type = 0;
|
||||
}
|
||||
}
|
||||
//$oJSON = new Services_JSON();
|
||||
echo Bootstrap::json_encode( $oSM );
|
||||
break;
|
||||
case 'addStage':
|
||||
require_once 'classes/model/Stage.php';
|
||||
//$oJSON = new Services_JSON();
|
||||
$oData = Bootstrap::json_decode( stripslashes( $_POST['data'] ) );
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( 'STG_UID' );
|
||||
$oCriteria->add( StagePeer::PRO_UID, $oData->uid );
|
||||
$oDataset = StagePeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aStages = array ();
|
||||
$iStageNumber = 0;
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aStages[] = $aRow['STG_UID'];
|
||||
$iStageNumber ++;
|
||||
$oDataset->next();
|
||||
}
|
||||
if ($iStageNumber == 0) {
|
||||
$iStageNumber = 1;
|
||||
}
|
||||
$iIndex = $iStageNumber + 1;
|
||||
$bContinue = false;
|
||||
while (! $bContinue) {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( 'COUNT(*) AS TIMES' );
|
||||
$oCriteria->add( ContentPeer::CON_ID, $aStages, Criteria::IN );
|
||||
$oCriteria->add( ContentPeer::CON_CATEGORY, 'STG_TITLE' );
|
||||
$oCriteria->add( ContentPeer::CON_LANG, SYS_LANG );
|
||||
$oCriteria->add( ContentPeer::CON_VALUE, G::LoadTranslation( 'ID_STAGE' ) . ' ' . $iStageNumber );
|
||||
$oDataset = ContentPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
if ((int) $aRow['TIMES'] > 0) {
|
||||
$iStageNumber += 1;
|
||||
} else {
|
||||
$bContinue = true;
|
||||
}
|
||||
}
|
||||
$oStage = new Stage();
|
||||
$oNewStage = new stdclass();
|
||||
$oNewStage->label = G::LoadTranslation( 'ID_STAGE' ) . ' ' . $iStageNumber;
|
||||
|
||||
if ($oData->position->x < 0)
|
||||
$oData->position->x *= - 1;
|
||||
if ($oData->position->y < 0)
|
||||
$oData->position->y *= - 1;
|
||||
|
||||
$oNewStage->uid = $oStage->create( array ('PRO_UID' => $oData->uid,'STG_TITLE' => $oNewStage->label,'STG_POSX' => $oData->position->x,'STG_POSY' => $oData->position->y,'STG_INDEX' => $iIndex) );
|
||||
//$oJSON = new Services_JSON();
|
||||
echo Bootstrap::json_encode( $oNewStage );
|
||||
break;
|
||||
case 'saveStagePosition':
|
||||
require_once 'classes/model/Stage.php';
|
||||
//$oJSON = new Services_JSON();
|
||||
$oData = Bootstrap::json_decode( stripslashes( $_POST['data'] ) );
|
||||
$oStage = new Stage();
|
||||
$aFields = $oStage->load( $oData->uid );
|
||||
$aFields['STG_UID'] = $oData->uid;
|
||||
$aFields['STG_POSX'] = $oData->position->x;
|
||||
$aFields['STG_POSY'] = $oData->position->y;
|
||||
$oStage->update( $aFields );
|
||||
break;
|
||||
case 'deleteStage':
|
||||
require_once 'classes/model/Stage.php';
|
||||
//$oJSON = new Services_JSON();
|
||||
$oData = Bootstrap::json_decode( stripslashes( $_POST['data'] ) );
|
||||
$oStage = new Stage();
|
||||
$aFields = $oStage->load( $oData->stg_uid );
|
||||
$oStage->remove( $oData->stg_uid );
|
||||
$oStage->reorderPositions( $aFields['PRO_UID'], $aFields['STG_INDEX'] );
|
||||
require_once 'classes/model/Task.php';
|
||||
$oCriteria1 = new Criteria( 'workflow' );
|
||||
$oCriteria1->add( TaskPeer::STG_UID, $oData->stg_uid );
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->add( TaskPeer::STG_UID, '' );
|
||||
BasePeer::doUpdate( $oCriteria1, $oCriteria2, Propel::getConnection( 'workflow' ) );
|
||||
break;
|
||||
case 'editStage':
|
||||
require_once 'classes/model/Stage.php';
|
||||
//$oJSON = new Services_JSON();
|
||||
$oData = Bootstrap::json_decode( stripslashes( $_POST['data'] ) );
|
||||
$oStage = new Stage();
|
||||
$aFields = $oStage->load( $oData->stg_uid );
|
||||
$aFields['THEINDEX'] = $oData->theindex;
|
||||
$aFields['action'] = 'updateStage';
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tracker/tracker_StageEdit', '', $aFields, '../tracker/tracker_Ajax' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'updateStage':
|
||||
require_once 'classes/model/Stage.php';
|
||||
$oStage = new Stage();
|
||||
$aFields = $oStage->load( $_POST['form']['STG_UID'] );
|
||||
$aFields['STG_TITLE'] = $_POST['form']['STG_TITLE'];
|
||||
$oStage->update( $aFields );
|
||||
break;
|
||||
case 'tasksAssigned':
|
||||
require_once 'classes/model/Stage.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
//$oJSON = new Services_JSON();
|
||||
$oData = Bootstrap::json_decode( stripslashes( $_POST['data'] ) );
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( TaskPeer::TAS_UID );
|
||||
$oCriteria->addSelectColumn( TaskPeer::TAS_TITLE );
|
||||
$oCriteria->add( TaskPeer::STG_UID, $oData->stg_uid );
|
||||
$oCriteria->addAscendingOrderByColumn( TaskPeer::TAS_TITLE );
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'tracker/tracker_StageTasks', $oCriteria, array ('PRO_UID' => $oData->pro_uid,'STG_UID' => $oData->stg_uid) );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'availableTasksForTheStage':
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( TaskPeer::TAS_UID );
|
||||
$oCriteria->addSelectColumn( TaskPeer::TAS_TITLE );
|
||||
$oCriteria->add( TaskPeer::PRO_UID, $_POST['PRO_UID'] );
|
||||
$oCriteria->add( TaskPeer::STG_UID, '' );
|
||||
$oCriteria->addAscendingOrderByColumn( TaskPeer::TAS_TITLE );
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'tracker/tracker_AvailableStageTasks', $oCriteria, array ('STG_UID' => $_POST['STG_UID']) );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'assignTaskToStage':
|
||||
require_once 'classes/model/Task.php';
|
||||
$oCriteria1 = new Criteria( 'workflow' );
|
||||
$oCriteria1->add( TaskPeer::TAS_UID, $_POST['TAS_UID'] );
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->add( TaskPeer::STG_UID, $_POST['STG_UID'] );
|
||||
BasePeer::doUpdate( $oCriteria1, $oCriteria2, Propel::getConnection( 'workflow' ) );
|
||||
break;
|
||||
case 'removeTaskFromTheStage':
|
||||
require_once 'classes/model/Task.php';
|
||||
$oCriteria1 = new Criteria( 'workflow' );
|
||||
$oCriteria1->add( TaskPeer::TAS_UID, $_POST['TAS_UID'] );
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->add( TaskPeer::STG_UID, '' );
|
||||
BasePeer::doUpdate( $oCriteria1, $oCriteria2, Propel::getConnection( 'workflow' ) );
|
||||
break;
|
||||
|
||||
case "processMapLegend":
|
||||
$arrayField = array ();
|
||||
$arrayField["sLabel1"] = G::LoadTranslation( "ID_TASK_IN_PROGRESS" );
|
||||
$arrayField["sLabel2"] = G::LoadTranslation( "ID_COMPLETED_TASK" );
|
||||
$arrayField["sLabel3"] = G::LoadTranslation( "ID_PENDING_TASK" );
|
||||
$arrayField["sLabel4"] = G::LoadTranslation( "ID_PARALLEL_TASK" );
|
||||
$arrayField["tracker"] = 1;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( "smarty", "cases/cases_Leyends", "", "", $arrayField );
|
||||
G::RenderPage( "publish", "raw" );
|
||||
break;
|
||||
}
|
||||
} catch (Exception $oException) {
|
||||
$token = strtotime("now");
|
||||
PMException::registerErrorLog($oException, $token);
|
||||
G::outRes( G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)) );
|
||||
die;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user