added the process context menu
This commit is contained in:
@@ -73,6 +73,24 @@ class Processes {
|
||||
|
||||
$oProcess->Update( $proFields );
|
||||
}
|
||||
|
||||
/**
|
||||
* change debug mode of any Process
|
||||
* @param string $sProUid
|
||||
* @return boolean
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/
|
||||
function changeDebugMode ( $sProUid = '') {
|
||||
$oProcess = new Process();
|
||||
$Fields = $oProcess->Load( $sProUid );
|
||||
$proFields['PRO_UID'] = $sProUid;
|
||||
if ( $Fields['PRO_DEBUG'] == '1' )
|
||||
$proFields['PRO_DEBUG'] = '0';
|
||||
else
|
||||
$proFields['PRO_DEBUG'] = '1';
|
||||
|
||||
$oProcess->Update( $proFields );
|
||||
}
|
||||
|
||||
/**
|
||||
* changes in DB the parent GUID
|
||||
|
||||
@@ -612,6 +612,7 @@ class Process extends BaseProcess {
|
||||
$process['PRO_CATEGORY_LABEL'] = trim($process['PRO_CATEGORY']) != ''? $process['CATEGORY_NAME']: G::LoadTranslation('ID_PROCESS_NO_CATEGORY');
|
||||
$process['PRO_TITLE'] = $proTitle;
|
||||
$process['PRO_DESCRIPTION'] = $proDescription;
|
||||
$process['PRO_DEBUG'] = $process['PRO_DEBUG'];
|
||||
$process['PRO_DEBUG_LABEL'] = ($process['PRO_DEBUG']=="1")? G::LoadTranslation('ID_ON'): G::LoadTranslation('ID_OFF');
|
||||
$process['PRO_STATUS_LABEL'] = $process ['PRO_STATUS'] == 'ACTIVE'? G::LoadTranslation ('ID_ACTIVE'): G::LoadTranslation('ID_INACTIVE');
|
||||
$process['PRO_CREATE_USER_LABEL'] = $userOwner;
|
||||
@@ -622,7 +623,7 @@ class Process extends BaseProcess {
|
||||
$process['CASES_COUNT'] = $casesCountTotal;
|
||||
|
||||
unset( $process['PRO_CREATE_USER']);
|
||||
unset( $process['PRO_DEBUG']);
|
||||
|
||||
$aProcesses[] = $process;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
<?
|
||||
|
||||
$request = isset($_GET['request']) ? $_GET['request'] : $_POST['request'];
|
||||
|
||||
switch($request)
|
||||
{
|
||||
case 'categoriesList':
|
||||
require_once "classes/model/ProcessCategory.php";
|
||||
|
||||
$processCategory = new ProcessCategory;
|
||||
$defaultOption = Array();
|
||||
$defaultOption[] = Array('CATEGORY_UID'=>'<reset>', 'CATEGORY_NAME'=>G::LoadTranslation('ID_ALL'));
|
||||
$defaultOption[] = Array('CATEGORY_UID'=>'', 'CATEGORY_NAME'=>G::LoadTranslation('ID_PROCESS_NO_CATEGORY'));
|
||||
|
||||
$response->rows = array_merge($defaultOption, $processCategory->getAll('array'));
|
||||
|
||||
echo G::json_encode($response);
|
||||
break;
|
||||
|
||||
case 'processCategories':
|
||||
require_once "classes/model/ProcessCategory.php";
|
||||
|
||||
$processCategory = new ProcessCategory;
|
||||
$defaultOption = Array();
|
||||
$defaultOption[] = Array('CATEGORY_UID'=>'', 'CATEGORY_NAME'=>G::LoadTranslation('ID_PROCESS_NO_CATEGORY'));
|
||||
|
||||
$response->rows = array_merge($defaultOption, $processCategory->getAll('array'));
|
||||
|
||||
echo G::json_encode($response);
|
||||
break;
|
||||
|
||||
case 'saveProcess':
|
||||
try{
|
||||
require_once 'classes/model/Task.php';
|
||||
G::LoadClass('processMap');
|
||||
$oProcessMap = new ProcessMap();
|
||||
|
||||
if( ! isset($_POST['PRO_UID']) ) {
|
||||
|
||||
if( Process::existsByProTitle($_POST['PRO_TITLE']) ) {
|
||||
$result = array(
|
||||
'success' => false,
|
||||
'msg' => 'Process Save Error',
|
||||
'errors' => array(
|
||||
'PRO_TITLE' => G::LoadTranslation('ID_PROCESSTITLE_ALREADY_EXISTS', SYS_LANG, $_POST)
|
||||
)
|
||||
);
|
||||
print G::json_encode($result);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$processData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
||||
$processData['PRO_TITLE'] = $_POST['PRO_TITLE'];
|
||||
$processData['PRO_DESCRIPTION'] = $_POST['PRO_DESCRIPTION'];
|
||||
$processData['PRO_CATEGORY'] = $_POST['PRO_CATEGORY'];
|
||||
|
||||
$sProUid = $oProcessMap->createProcess($processData);
|
||||
|
||||
//call plugins
|
||||
$oData['PRO_UID'] = $sProUid;
|
||||
$oData['PRO_TEMPLATE'] = ( isset($_POST['PRO_TEMPLATE']) && $_POST['PRO_TEMPLATE'] != '' ) ? $_POST['form']['PRO_TEMPLATE'] : '';
|
||||
$oData['PROCESSMAP'] = $oProcessMap;
|
||||
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry->executeTriggers ( PM_NEW_PROCESS_SAVE , $oData );
|
||||
|
||||
} else {
|
||||
//$oProcessMap->updateProcess($_POST['form']);
|
||||
$sProUid = $_POST['PRO_UID'];
|
||||
}
|
||||
|
||||
//Save Calendar ID for this process
|
||||
if( isset($_POST['PRO_CALENDAR']) ){
|
||||
G::LoadClass("calendar");
|
||||
$calendarObj=new Calendar();
|
||||
$calendarObj->assignCalendarTo($sProUid, $_POST['PRO_CALENDAR'], 'PROCESS');
|
||||
}
|
||||
|
||||
$result->success = true;
|
||||
$result->PRO_UID = $sProUid;
|
||||
$result->msg = G::LoadTranslation('ID_CREATE_PROCESS_SUCCESS');
|
||||
} catch(Exception $e){
|
||||
$result->success = false;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
|
||||
print G::json_encode($result);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* processes_ChangeStatus.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.
|
||||
*
|
||||
*/
|
||||
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;
|
||||
}
|
||||
$ids = explode(',', $_GET['UIDS']);
|
||||
|
||||
G::LoadClass('processes');
|
||||
$oProcess = new Processes();
|
||||
if( count($ids) > 0 ){
|
||||
foreach($ids as $id)
|
||||
$oProcess->changeStatus ($id);
|
||||
}
|
||||
//G::header('location: ' . $_SERVER['HTTP_REFERER']);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -106,4 +106,20 @@
|
||||
button.x-btn-text:focus,.x-combo-selected{
|
||||
-moz-outline-style:none;
|
||||
outline:none;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-activate{
|
||||
background-image: url("/images/activate.png");
|
||||
}
|
||||
|
||||
.icon-deactivate{
|
||||
background-image: url("/images/deactivate.png");
|
||||
}
|
||||
|
||||
.icon-debug{
|
||||
background-image: url("/images/debug.png");
|
||||
}
|
||||
|
||||
.icon-debug-disabled{
|
||||
background-image: url("/images/debug_disabled.png");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user