Conflicts

This commit is contained in:
Paula Quispe
2019-09-12 15:10:46 -04:00
65 changed files with 1199 additions and 1622 deletions

View File

@@ -224,6 +224,18 @@ try {
Propel::init(PATH_CORE . 'config' . PATH_SEP . '_databases_.php');
/**
* Load Laravel database connection
*/
$dbHost = explode(':', $DB_HOST);
config(['database.connections.workflow.host' => $dbHost[0]]);
config(['database.connections.workflow.database' => $DB_NAME]);
config(['database.connections.workflow.username' => $DB_USER]);
config(['database.connections.workflow.password' => $DB_PASS]);
if (count($dbHost) > 1) {
config(['database.connections.workflow.port' => $dbHost[1]]);
}
//Enable RBAC
$rbac = RBAC::getSingleton(PATH_DATA, session_id());
$rbac->sSystem = 'PROCESSMAKER';

View File

@@ -968,6 +968,7 @@ function run_check_workspace_disabled_code($args, $opts)
/**
* This function is executed only by one workspace
* Code Security Scanner related to the custom blacklist
*
* @param array $args, the specific actions must be: upgrade|check
* @param array $opts, workspaceName for to apply the database-upgrade
*

View File

@@ -3610,7 +3610,8 @@ class Cases
}
/**
* Review the code in the trigger if the feature is enable
* If the feature is enable and the code_scanner_scope has the argument trigger the code scanner will check the code
* Review in the running cases
*
* @param CodeScanner $cs
* @param string $code
@@ -3618,12 +3619,14 @@ class Cases
*
* @return string
*
* @link https://wiki.processmaker.com/Plugin_Trigger_Code_Security_Scanner_v2
*/
private function codeScannerReview(CodeScanner $cs, $code, $triTitle)
{
$foundDisabledCode = "";
/*----------------------------------********---------------------------------*/
if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) {
if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=") &&
in_array('trigger', $cs->getScope())) {
//Check disabled code
$arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $code);

View File

@@ -6352,17 +6352,21 @@ class Processes
}
/**
* Get disabled code
* If the feature is enable and the code_scanner_scope has the arguments for enable code scanner
* Review the triggers related to the process
*
* @param string $processUid Unique id of Process
* @param string $workspaceName Workspace name
*
* @return array Returns an array with disabled code found, array empty otherwise
* @return array
* @throws Exception
*
* @link https://wiki.processmaker.com/Plugin_Trigger_Code_Security_Scanner_v2
*/
public function getDisabledCode($processUid = null, $workspaceName = null)
{
try {
$arrayDisabledCode = array();
$arrayDisabledCode = [];
/*----------------------------------********---------------------------------*/
if (!PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) {
@@ -6412,23 +6416,24 @@ class Processes
$triggerTitle = $row["TRI_TITLE"];
$triggerWebbot = $row["TRI_WEBBOT"];
//Check disabled code
$arrayFoundDisabledCode = [];
// @todo: The PO's needs to define the behaviour when the command check-workspace-disabled-code was executed
$arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $triggerWebbot);
if (!empty($arrayFoundDisabledCode)) {
if (!isset($arrayDisabledCode[$processUid])) {
$arrayDisabledCode[$processUid] = array(
$arrayDisabledCode[$processUid] = [
"processUid" => $processUid,
"processTitle" => $processTitle,
"triggers" => array()
);
"triggers" => []
];
}
$arrayDisabledCode[$processUid]["triggers"][] = array(
$arrayDisabledCode[$processUid]["triggers"][] = [
"triggerUid" => $triggerUid,
"triggerTitle" => $triggerTitle,
"disabledCode" => $arrayFoundDisabledCode["source"],
);
];
}
}
}

View File

@@ -2464,9 +2464,14 @@ class WorkspaceTools
}
/**
* Get disabled code
* If the feature is enable and the code_scanner_scope was enable will check in the command
* Review when the command check-workspace-disabled-code was executed
*
* @return array Returns an array with disabled code found, array empty otherwise
* @return array
* @throws Exception
*
* @link https://wiki.processmaker.com/3.3/processmaker_command#check-workspace-disabled-code
* @uses cliWorkspaces.php
*/
public function getDisabledCode()
{

View File

@@ -6,6 +6,7 @@ use ProcessMaker\ChangeLog\ChangeLog;
/*----------------------------------********---------------------------------*/
use ProcessMaker\Core\JobsManager;
use ProcessMaker\Core\System;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Util\WsMessageResponse;
class WsBase
@@ -477,54 +478,48 @@ class WsBase
return $arrayData;
}
} else {
$arrayData = [];
$data = [];
$criteria = new Criteria("workflow");
$selectedColumns = [
'APP_DELEGATION.APP_UID',
'APP_DELEGATION.DEL_INDEX',
'APP_DELEGATION.APP_NUMBER',
'APPLICATION.APP_STATUS',
'APPLICATION.APP_TITLE',
'APP_DELEGATION.PRO_UID'
];
$criteria->addSelectColumn(AppCacheViewPeer::APP_UID);
$criteria->addSelectColumn(AppCacheViewPeer::DEL_INDEX);
$criteria->addSelectColumn(AppCacheViewPeer::APP_NUMBER);
$criteria->addSelectColumn(AppCacheViewPeer::APP_STATUS);
$criteria->addSelectColumn(AppCacheViewPeer::PRO_UID);
$query = Delegation::query()->select($selectedColumns);
$query->join('APPLICATION', function ($join) {
$join->on('APP_DELEGATION.APP_NUMBER', '=', 'APPLICATION.APP_NUMBER');
});
$query->join('APP_THREAD', function ($join) {
$join->on('APP_THREAD.APP_UID', '=', 'APP_DELEGATION.APP_UID');
});
$query->where('APP_DELEGATION.USR_UID', $userUid);
$query->whereNested(function ($query) {
$query->where('APPLICATION.APP_STATUS', 'TO_DO');
$query->orWhere('APPLICATION.APP_STATUS', 'DRAFT');
});
$query->whereNull('APP_DELEGATION.DEL_FINISH_DATE');
$query->where('APP_DELEGATION.DEL_THREAD_STATUS', 'OPEN');
$query->where('APP_THREAD.APP_THREAD_STATUS', 'OPEN');
$query->orderBy('APP_DELEGATION.APP_NUMBER', 'DESC');
$criteria->add(AppCacheViewPeer::USR_UID, $userUid);
$result = $query->get();
$data2 = $result->values()->toArray();
$aux = [];
$criteria->add(
//ToDo - getToDo()
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "TO_DO", CRITERIA::EQUAL)->addAnd(
$criteria->getNewCriterion(AppCacheViewPeer::DEL_FINISH_DATE, null, Criteria::ISNULL)
)->addAnd(
$criteria->getNewCriterion(AppCacheViewPeer::APP_THREAD_STATUS, "OPEN")
)->addAnd(
$criteria->getNewCriterion(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN")
)
)->addOr(
//Draft - getDraft()
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "DRAFT", CRITERIA::EQUAL)->addAnd(
$criteria->getNewCriterion(AppCacheViewPeer::APP_THREAD_STATUS, "OPEN")
)->addAnd(
$criteria->getNewCriterion(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN")
)
);
$criteria->addDescendingOrderByColumn(AppCacheViewPeer::APP_NUMBER);
$rsCriteria = AppCacheViewPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$arrayData[] = array(
"guid" => $row["APP_UID"],
"name" => $row["APP_NUMBER"],
"status" => $row["APP_STATUS"],
"delIndex" => $row["DEL_INDEX"],
"processId" => $row["PRO_UID"]
);
foreach ($data2 as $value) {
$aux['guid'] = $value['APP_UID'];
$aux['name'] = $value['APP_TITLE'];
$aux['status'] = $value['APP_STATUS'];
$aux['delIndex'] = $value['DEL_INDEX'];
$aux['processId'] = $value['PRO_UID'];
array_push($data, $aux);
}
return $arrayData;
return $data;
}
} catch (Exception $e) {
$arrayData = [];

View File

@@ -956,52 +956,6 @@ class Process extends BaseProcess
}
}
public function refreshUserAllCountersByProcessesGroupUid($proUidArray)
{
$aTypes = array(
'to_do',
'draft',
'cancelled',
'sent',
'paused',
'completed',
'selfservice'
);
$usersArray = array();
$users = new Users();
$oCase = new Cases();
$oCriteria = new Criteria();
$oCriteria->addSelectColumn(AppDelegationPeer::APP_UID);
$oCriteria->addSelectColumn(AppDelegationPeer::USR_UID);
$oCriteria->setDistinct();
$oCriteria->add(AppDelegationPeer::PRO_UID, $proUidArray, Criteria::IN);
$oRuleSet = AppDelegationPeer::doSelectRS($oCriteria);
$oRuleSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($oRuleSet->next()) {
$row = $oRuleSet->getRow();
if (isset($row['USR_UID']) && $row['USR_UID'] != '') {
$usersArray[$row['USR_UID']] = $row['USR_UID'];
}
$oCase->deleteDelegation($row['APP_UID']);
}
foreach ($usersArray as $value) {
$oAppCache = new AppCacheView();
$aCount = $oAppCache->getAllCounters($aTypes, $value);
$newData = array(
'USR_UID' => $value,
'USR_TOTAL_INBOX' => $aCount['to_do'],
'USR_TOTAL_DRAFT' => $aCount['draft'],
'USR_TOTAL_CANCELLED' => $aCount['cancelled'],
'USR_TOTAL_PARTICIPATED' => $aCount['sent'],
'USR_TOTAL_PAUSED' => $aCount['paused'],
'USR_TOTAL_COMPLETED' => $aCount['completed'],
'USR_TOTAL_UNASSIGNED' => $aCount['selfservice']
);
$users->update($newData);
}
}
/**
* Load a process object by PRO_ID
*

File diff suppressed because one or more lines are too long

View File

@@ -21656,8 +21656,8 @@ msgstr "Open SSL is optional"
# TRANSLATION
# LABEL/ID_PROCESSMAKER_REQUIREMENTS_PHP
#: LABEL/ID_PROCESSMAKER_REQUIREMENTS_PHP
msgid "PHP recommended version 5.6 or higher, PHP 7.2 is not yet supported"
msgstr "PHP recommended version 5.6 or higher, PHP 7.2 is not yet supported"
msgid "PHP recommended version 7.1 or higher, PHP 7.2 is not yet supported"
msgstr "PHP recommended version 7.1 or higher, PHP 7.2 is not yet supported"
# TRANSLATION
# LABEL/ID_PROCESSMAKER_REQUIREMENTS_SOAP
@@ -31727,42 +31727,6 @@ msgstr "Reassigned to"
msgid "BACK"
msgstr "BACK"
# cases/cases_ReassignBy.xml?title
# cases/cases_ReassignBy.xml
#: subtitle - title
msgid "<center>Reassignment of Cases</center>"
msgstr "<center>Reassignment of Cases</center>"
# cases/cases_ReassignBy.xml?REASSIGN_BY
# cases/cases_ReassignBy.xml
#: radiogroup - REASSIGN_BY
msgid "Reassign By"
msgstr "Reassign By"
# cases/cases_ReassignBy.xml?REASSIGN_BY-1
# cases/cases_ReassignBy.xml
#: radiogroup - REASSIGN_BY - 1
msgid "[cases/cases_ReassignBy.xml?REASSIGN_BY-1]"
msgstr "Case"
# cases/cases_ReassignBy.xml?REASSIGN_BY-2
# cases/cases_ReassignBy.xml
#: radiogroup - REASSIGN_BY - 2
msgid "[cases/cases_ReassignBy.xml?REASSIGN_BY-2]"
msgstr "User"
# cases/cases_ReassignBy.xml?REASSIGN_USER
# cases/cases_ReassignBy.xml
#: dropdown - REASSIGN_USER
msgid "[cases/cases_ReassignBy.xml?REASSIGN_USER] "
msgstr ""
# cases/cases_ReassignBy.xml?REASSIGN_USER-
# cases/cases_ReassignBy.xml
#: dropdown - REASSIGN_USER -
msgid "[cases/cases_ReassignBy.xml?REASSIGN_USER-]"
msgstr "- Select -"
# cases/cases_ReassignShowInfo.xml?TITLE
# cases/cases_ReassignShowInfo.xml
#: subtitle - TITLE
@@ -48441,60 +48405,6 @@ msgstr "Save"
msgid "[users/users_EditRT.xml?BTN_CANCEL] Cancel"
msgstr "Cancel"
# users/users_List.xml?USR_COMPLETENAME
# users/users_List.xml
#: text - USR_COMPLETENAME
msgid "[users/users_List.xml?USR_COMPLETENAME] Full Name"
msgstr "Full Name"
# users/users_List.xml?USR_USERNAME
# users/users_List.xml
#: text - USR_USERNAME
msgid "[users/users_List.xml?USR_USERNAME] Username"
msgstr "Username"
# users/users_List.xml?USR_EMAIL
# users/users_List.xml
#: text - USR_EMAIL
msgid "E-Mail"
msgstr "E-Mail"
# users/users_List.xml?USR_ROLE
# users/users_List.xml
#: text - USR_ROLE
msgid "[users/users_List.xml?USR_ROLE] Role"
msgstr "Role"
# users/users_List.xml?USR_DUE_DATE
# users/users_List.xml
#: text - USR_DUE_DATE
msgid "[users/users_List.xml?USR_DUE_DATE] Due Date"
msgstr "Due Date"
# users/users_List.xml?USR_EDIT
# users/users_List.xml
#: link - USR_EDIT
msgid "[users/users_List.xml?USR_EDIT] "
msgstr ""
# users/users_List.xml?USR_GROUP
# users/users_List.xml
#: link - USR_GROUP
msgid "[users/users_List.xml?USR_GROUP] "
msgstr ""
# users/users_List.xml?USR_AUTH
# users/users_List.xml
#: link - USR_AUTH
msgid "[users/users_List.xml?USR_AUTH] "
msgstr ""
# users/users_List.xml?USR_DELETE
# users/users_List.xml
#: link - USR_DELETE
msgid "[users/users_List.xml?USR_DELETE] "
msgstr ""
# users/users_New.xml?TITLE1
# users/users_New.xml
#: title - TITLE1
@@ -48711,12 +48621,6 @@ msgstr "Cancel"
msgid "[users/users_NewOptions.xml?MNU] Back to list"
msgstr "Back to list"
# users/users_Options.xml?MNU_ADD
# users/users_Options.xml
#: link - MNU_ADD
msgid "[users/users_Options.xml?MNU_ADD] New"
msgstr "New"
# users/users_ReassignCases.xml?PROCESS
# users/users_ReassignCases.xml
#: text - PROCESS

View File

@@ -12,7 +12,7 @@ include PATH_LANGUAGECONT . "translation." . SYS_LANG;
class InstallerModule extends Controller
{
const PHP_VERSION_MINIMUM_SUPPORTED = '5.6';
const PHP_VERSION_MINIMUM_SUPPORTED = '7.1';
const PHP_VERSION_NOT_SUPPORTED = '7.2';
public $path_config;
public $path_languages;

View File

@@ -40,12 +40,12 @@ class Designer extends Controller
$clientToken = $this->getCredentials($httpData);
$debug = false; //System::isDebugMode();
$consolidated = 0;
$enterprise = 0;
$distribution = 0;
$usrUid = $RBAC->userObj->getUsrUid();
$usrUid = (isset($RBAC->userObj)) ? $RBAC->userObj->getUsrUid() : '';
$userProperties = UsersPropertiesPeer::retrieveByPk($usrUid);
/*----------------------------------********---------------------------------*/
@@ -72,7 +72,8 @@ class Designer extends Controller
$this->setVar("SYS_LANG", SYS_LANG);
$this->setVar("SYS_SKIN", SYS_SKIN);
$this->setVar('HTTP_SERVER_HOSTNAME', System::getHttpServerHostnameRequestsFrontEnd());
$this->setVar('PMDYNAFORM_FIRST_TIME', $userProperties->getPmdynaformFirstTime());
isset($userProperties) ? $this->setVar('PMDYNAFORM_FIRST_TIME',
$userProperties->getPmdynaformFirstTime()) : $this->setVar('PMDYNAFORM_FIRST_TIME', '0');
$inpuDocument = new InputDocument();
$this->setVar('maxFileSizeInformation', G::json_encode($inpuDocument->getMaxFileSize()));
@@ -99,7 +100,8 @@ class Designer extends Controller
$this->setVar('pmuiJsCacheFile', file(PATH_HTML . "lib-dev/pmUI/build.cache", FILE_IGNORE_NEW_LINES));
$this->setVar('pmuiCssCacheFile', file(PATH_HTML . "lib-dev/pmUI/css.cache", FILE_IGNORE_NEW_LINES));
$this->setVar('designerCacheFile', file(PATH_HTML . "lib-dev/mafe/applications.cache", FILE_IGNORE_NEW_LINES));
$this->setVar('designerCacheFile',
file(PATH_HTML . "lib-dev/mafe/applications.cache", FILE_IGNORE_NEW_LINES));
$this->setVar('mafeJsFiles', $mafeJsFiles);
$this->setVar('mafeCssFiles', $mafeCssFiles);
} else {
@@ -253,7 +255,6 @@ class Designer extends Controller
"Content-Type" => "multipart/form-data;",
"Authorization" => "Basic " . base64_encode($client['CLIENT_ID'] . ":" . $client['CLIENT_SECRET'])
);
$request = new Request(array(), $request, array(), array(), array(), $server, null, $headers);
$oauthServer = new Server();
$response = $oauthServer->postToken($request, true);

View File

@@ -325,7 +325,6 @@ class Home extends Controller
// settings vars and rendering
$this->setVar('statusValues', $this->getStatusArray($httpData->t, $this->userUid));
$this->setVar('categoryValues', $this->getCategoryArray());
$this->setVar('allUsersValues', $this->getAllUsersArray('search'));
$this->setVar('categoryTitle', G::LoadTranslation("ID_CATEGORY"));
$this->setVar('processTitle', G::LoadTranslation("ID_PROCESS"));
$this->setVar('statusTitle', G::LoadTranslation("ID_STATUS"));
@@ -683,34 +682,6 @@ class Home extends Controller
return $category;
}
public function getAllUsersArray($action)
{
global $oAppCache;
$users = array();
$users[] = array("CURRENT_USER",G::LoadTranslation("ID_CURRENT_USER"));
$users[] = array("",G::LoadTranslation("ID_ALL_USERS"));
if ($action == 'to_reassign') {
//now get users, just for the Search action
$cUsers = $oAppCache->getToReassignListCriteria(null);
$cUsers->addSelectColumn(AppCacheViewPeer::USR_UID);
if (g::MySQLSintaxis()) {
$cUsers->addGroupByColumn(AppCacheViewPeer::USR_UID);
}
$cUsers->addAscendingOrderByColumn(AppCacheViewPeer::APP_CURRENT_USER);
$oDataset = AppCacheViewPeer::doSelectRS($cUsers);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$users[] = array($aRow['USR_UID'],$aRow['APP_CURRENT_USER']);
$oDataset->next();
}
}
return $users;
}
public function getStatusArray($action, $userUid)
{
$status = array();

View File

@@ -60485,7 +60485,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ) VALUES
( 'LABEL','ID_PROCESSMAKER_REQUIREMENTS_OPENSSL_OPTIONAL','en','Open SSL is optional','2014-01-15') ,
( 'LABEL','ID_PROCESSMAKER_REQUIREMENTS_PHP','en','PHP recommended version 5.6 or higher, PHP 7.2 is not yet supported','2018-06-13') ,
( 'LABEL','ID_PROCESSMAKER_REQUIREMENTS_PHP','en','PHP recommended version 7.1 or higher, PHP 7.2 is not yet supported','2018-06-13') ,
( 'LABEL','ID_PROCESSMAKER_REQUIREMENTS_SOAP','en','Soap Support','2014-01-15') ,
( 'LABEL','ID_PROCESSMAKER_SLOGAN1','en','This Business Process is Powered By ProcessMaker','2014-01-15') ,
( 'LABEL','ID_PROCESSMAKER_SUCCESS_INSTALLED','en','ProcessMaker was successfully installed<br/>Workspace <b>" {0} " </b> was installed correctly.','2014-01-15') ,

View File

@@ -1,140 +0,0 @@
/**
* Reassign ByUser routines
* Author Erik Amaru Ortiz <erik@colosa.com>
*/
var reassignPanel;
function toReassignPanel(){
if( checks_selected_ids.length == 0 ){
new leimnud.module.app.alert().make({label: G_STRINGS.ID_REASSIGN_BYUSER});
return 0;
}
/*oPanel = new leimnud.module.panel();
oPanel.options = {
size : { w:1000, h:600 },
position: { x:0,y:0,center:true },
title : G_STRINGS.ID_MSG_RESSIGN_BYUSER_PANEL,
statusBar: false,
control : {resize:false,roll:false,drag:true},
fx : { modal:true, opacity:true, blinkToFront:false, fadeIn:false, drag:true}
};
oPanel.events = {
remove: function() {
delete(oPanel);
//resetChecks();
//window.location = 'cases_ReassignByUser?REASSIGN_USER=' + getField('REASSIGN_USER').value;
}.extend(this)
};*/
//oPanel.make();
//oPanel.loader.show();
var USER_SELETED = getField('REASSIGN_USER').value;
var oRPC = new leimnud.module.rpc.xmlhttp({
url : 'cases_Ajax',
args: 'action=reassignByUserList&APP_UIDS='+checks_selected_ids+'&FROM_USR_ID='+USER_SELETED
});
oRPC.callback = function(rpc) {
//oPanel.loader.hide();
//var scs=rpc.xmlhttp.responseText.extractScript();
//oPanel.addContent(rpc.xmlhttp.responseText);
//scs.evalScript();
document.getElementById("publisherContent[0]").style.display = 'none';
document.getElementById("publisherContent[1]").style.display = 'none';
document.getElementById("publisherContent[10]").style.display = 'block';
document.getElementById("publisherContent[10]").innerHTML = rpc.xmlhttp.responseText;
}.extend(this);
oRPC.make();
//reassignPanel = oPanel;
}
function toReassign(){
var selects = document.getElementsByName('form[USERS]');
var USER_SELETED = getField('REASSIGN_USER').value;
var items = '';
for(i=0; i<selects.length; i++){
if( selects[i].value != "0" ){
if( items != '') items += ',';
id = selects[i].id;
id = id.trim();
items += selects[i].id.substring(5, selects[i].id.length-1) +'|'+ selects[i].value;
}
}
if( items.trim() == '' ){
new leimnud.module.app.alert().make({label: G_STRINGS.ID_REASSIGN_BYUSER});
return 0;
}
new leimnud.module.app.confirm().make({
label:G_STRINGS.ID_REASSIGN_BYUSER_CONFIRM,
action:function(){
var oRPC = new leimnud.module.rpc.xmlhttp({
url : 'cases_Ajax',
args: 'action=reassignByUser&items='+items+'&USR_UID='+USER_SELETED
});
//reassignPanel.loader.show();
oRPC.callback = function(rpc) {
//reassignPanel.loader.hide();
//reassignPanel.clearContent();
/*reassignPanel.events = {
remove: function() {
delete(oPanel);
window.location = 'cases_ReassignByUser?REASSIGN_USER=' + getField('REASSIGN_USER').value;
}.extend(this)
};*/
var scs=rpc.xmlhttp.responseText.extractScript();
//reassignPanel.addContent(rpc.xmlhttp.responseText);
document.getElementById("publisherContent[10]").innerHTML = rpc.xmlhttp.responseText;
scs.evalScript();
}.extend(this);
oRPC.make();
}.extend(this)
});
}
function cancelReassign(){
document.getElementById("publisherContent[0]").style.display = 'block';
document.getElementById("publisherContent[1]").style.display = 'block';
document.getElementById("publisherContent[10]").style.display = 'none';
document.getElementById("publisherContent[10]").innerHTML = '';
}
function resetChecks(){
checks_selected_ids.length = 0;
}
function WindowSize() {
var wSize = [0, 0];
if (typeof window.innerWidth != 'undefined')
{
wSize = [
window.innerWidth,
window.innerHeight
];
}
else if (typeof document.documentElement != 'undefined'
&& typeof document.documentElement.clientWidth !=
'undefined' && document.documentElement.clientWidth != 0)
{
wSize = [
document.documentElement.clientWidth,
document.documentElement.clientHeight
];
}
else {
wSize = [
document.getElementsByTagName('body')[0].clientWidth,
document.getElementsByTagName('body')[0].clientHeight
];
}
return wSize;
}

View File

@@ -438,6 +438,7 @@ class Ajax
$oHeadPublisher->addExtJsScript('cases/caseHistory', true); //adding a javascript file .js
$oHeadPublisher->addContent('cases/caseHistory'); //adding a html file .html.
$oHeadPublisher->assign('pageSize', $conf->getEnvSetting('casesListRowNumber'));
$oHeadPublisher->assign('FORMATS', $conf->getFormats());
G::RenderPage('publish', 'extJs');
}

View File

@@ -888,42 +888,6 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
$G_PUBLISH->AddContent('propeltable', 'cases/paged-table-reassigByUser2', 'cases/cases_ToReassignByUserList2', $oCriteria);
G::RenderPage('publish', 'raw');
break;
/* @Author Erik Amaru Ortiz <erik@colosa.com> */
case 'reassignByUser':
$oCases = new Cases();
$aCases = array();
if (isset($_POST['items']) && trim($_POST['items']) != '') {
$sItems = $_POST['items'];
$aItems = explode(',', $sItems);
$FROM_USR_UID = $_POST['USR_UID'];
foreach ($aItems as $item) {
list($APP_UID, $USR_UID) = explode('|', $item);
$aCase = $oCases->loadCaseInCurrentDelegation($APP_UID, true);
$oCase->reassignCase($aCase['APP_UID'], $aCase['DEL_INDEX'], $FROM_USR_UID, $USR_UID);
array_push($aCases, $aCase);
}
//G::pr($aCases);
//require_once 'classes/model/Users.php';
$oUser = new Users();
$sText = '';
foreach ($aCases as $aCase) {
$aCaseUpdated = $oCases->loadCaseInCurrentDelegation($aCase['APP_UID'], true);
$aUser = $oUser->load($aCaseUpdated['USR_UID']);
$sText .= $aCaseUpdated['APP_PRO_TITLE'] . ' - ' . ' Case: ' . $aCaseUpdated['APP_NUMBER'] . '# (' . $aCaseUpdated['APP_TAS_TITLE'] . ') <b> => Reassigned to => </b> <font color="blue">' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' [' . $aUser['USR_USERNAME'] . ']' . '</font><br />';
}
$G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $sText;
$aMessage['URL'] = 'cases_ReassignByUser?REASSIGN_USER=' . $_POST['USR_UID'];
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ReassignShowInfo', '', $aMessage);
G::RenderPage('publish', 'raw');
}
break;
case "uploadInputDocument":
//krumo($_POST);
$G_PUBLISH = new Publisher();

View File

@@ -1,150 +0,0 @@
<?php
/**
* cases_ReassignByUser.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.
*/
/**
* Reassign ByUser routines
* Author Erik Amaru Ortiz <erik@colosa.com>
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_REASSIGNCASE')) {
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;
}
if (! isset($_GET['REASSIGN_USER'])) {
$_GET['REASSIGN_USER'] = '';
}
$_GET['REASSIGN_BY'] = 2;
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN';
//////////////////
///SELECT USR_UID, CONCAT(USR_FIRSTNAME, ' ', USR_LASTNAME, ' (', USR_USERNAME, ')') AS USER_FULLNAME FROM USERS WHERE USR_STATUS <> 'CLOSED'//////
require_once 'classes/model/Users.php';
$oCriteria = new Criteria();
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL);
$oCriteria->add(UsersPeer::USR_STATUS, '', Criteria::NOT_EQUAL);
$oDataset = UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
///////////////////////
$oConf = new Configurations();
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
$defaultOption = isset($oConf->aConfig['format']) ? $oConf->aConfig['format'] : '';
$aUserInfo = array();
$aUserInfo[] = array('USR_UID' => 'char','USER_FULLNAME' => 'char'
);
while ($oDataset->next()) {
$aRow1 = $oDataset->getRow();
$infoUser = G::getFormatUserList($defaultOption, $aRow1);
$aUserInfo[] = array('USR_UID' => $aRow1['USR_UID'],'USER_FULLNAME' => $infoUser
);
}
global $_DBArray;
$_DBArray['aUserInfo'] = $aUserInfo;
$_SESSION['_DBArray'] = $_DBArray;
//////////////////
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ReassignBy', '', $_GET);
$sUserToReassign = trim($_GET['REASSIGN_USER']);
if ($_GET['REASSIGN_USER'] != '') {
$oTasks = new Tasks();
$oGroups = new Groups();
$oUser = new Users();
$oAppCache = new AppCacheView();
$oCriteriaToDo = $oAppCache->getToDoListCriteria($sUserToReassign);
$oCriteriaDraft = $oAppCache->getDraftListCriteria($sUserToReassign);
$aCasesList = array();
$oDataset = ApplicationPeer::doSelectRS($oCriteriaToDo);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($oDataset->next()) {
array_push($aCasesList, $oDataset->getRow());
}
$oDataset = ApplicationPeer::doSelectRS($oCriteriaDraft);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($oDataset->next()) {
array_push($aCasesList, $oDataset->getRow());
}
$filedNames = array("APP_UID","APP_NUMBER","APP_UPDATE_DATE","DEL_PRIORITY","DEL_INDEX","TAS_UID","DEL_INIT_DATE","DEL_FINISH_DATE","USR_UID","APP_STATUS","DEL_TASK_DUE_DATE","APP_CURRENT_USER","APP_TITLE","APP_PRO_TITLE","APP_TAS_TITLE","APP_DEL_PREVIOUS_USER"
);
$aCasesList = array_merge(array($filedNames
), $aCasesList);
// G::pr($aCasesList); die;
require_once('classes/class.xmlfield_InputPM.php');
global $_DBArray;
$_DBArray['reassign_byuser'] = $aCasesList;
$_SESSION['_DBArray'] = $_DBArray;
$oCriteria = new Criteria('dbarray');
$oCriteria->setDBArrayTable('reassign_byuser');
$oHeadPublisher = headPublisher::getSingleton();
$oHeadPublisher->addScriptFile('/jscore/cases/reassignByUser.js');
$G_PUBLISH->ROWS_PER_PAGE = 12;
$G_PUBLISH->AddContent('propeltable', 'cases/paged-table-reassigByUser', 'cases/cases_ToReassignByUserList', $oCriteria, array('FROM_USR_UID' => $sUserToReassign
));
}
G::RenderPage('publish', 'blank');
} catch (Exception $oException) {
$token = strtotime("now");
PMException::registerErrorLog($oException, $token);
G::outRes(G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)));
die;
}
?>
<div id="publisherContent[10]" style="display: none"></div>
<?php

View File

@@ -1,49 +1,56 @@
<?php
/**
* cases_Resume.php
*
* Shows a brief information about the case
*
* @link https://wiki.processmaker.com/3.2/Cases/Cases#Participated
*/
use ProcessMaker\BusinessModel\Cases as BmCases;
use ProcessMaker\BusinessModel\Task as BusinessModelTask;
use ProcessMaker\Util\DateTime;
/* Permissions */
/** Permissions */
switch ($RBAC->userCanAccess('PM_CASES')) {
case - 2:
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die();
break;
case - 1:
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die();
break;
}
/* GET , POST & $_SESSION Vars */
/* Menues */
/** Menu's */
$_SESSION['bNoShowSteps'] = true;
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'caseOptions';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = '_';
/* Prepare page before to show */
$oCase = new Cases();
//Check the authorization
$objCase = new \ProcessMaker\BusinessModel\Cases();
$aUserCanAccess = $objCase->userAuthorization(
/** Prepare page before to show */
// Check the authorization
$objCase = new BmCases();
$userCanAccess = $objCase->userAuthorization(
$_SESSION['USER_LOGGED'],
$_SESSION['PROCESS'],
$_GET['APP_UID'],
array('PM_ALLCASES'),
array('SUMMARY_FORM' => 'VIEW')
['PM_ALLCASES'],
['SUMMARY_FORM' => 'VIEW']
);
$cases = new Cases();
if (isset($_SESSION['ACTION']) && ($_SESSION['ACTION'] == 'jump')) {
$Fields = $oCase->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['ACTION']);
$Fields = $cases->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['ACTION']);
$process = new Process();
$processData = $process->load($Fields['PRO_UID']);
if (isset($processData['PRO_DYNAFORMS']['PROCESS']) && $processData['PRO_DYNAFORMS']['PROCESS'] != '' &&
$aUserCanAccess['objectPermissions']['SUMMARY_FORM']
$userCanAccess['objectPermissions']['SUMMARY_FORM']
) {
$_REQUEST['APP_UID'] = $Fields['APP_UID'];
$_REQUEST['DEL_INDEX'] = $Fields['DEL_INDEX'];
@@ -52,35 +59,30 @@ if (isset($_SESSION['ACTION']) && ($_SESSION['ACTION'] == 'jump')) {
exit();
}
} else {
$Fields = $oCase->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX']);
$Fields = $cases->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX']);
}
if (!$aUserCanAccess['participated'] && !$aUserCanAccess['supervisor'] && !$aUserCanAccess['rolesPermissions']['PM_ALLCASES'] && !$aUserCanAccess['objectPermissions']['SUMMARY_FORM']) {
$aMessage['MESSAGE'] = G::LoadTranslation('ID_NO_PERMISSION_NO_PARTICIPATED');
if (
!$userCanAccess['participated'] &&
!$userCanAccess['supervisor'] &&
!$userCanAccess['rolesPermissions']['PM_ALLCASES'] &&
!$userCanAccess['objectPermissions']['SUMMARY_FORM']
) {
$message = [];
$message['MESSAGE'] = G::LoadTranslation('ID_NO_PERMISSION_NO_PARTICIPATED');
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $message);
G::RenderPage('publishBlank', 'blank');
die();
}
if (isset($aRow['APP_TYPE'])) {
switch ($aRow['APP_TYPE']) {
case 'PAUSE':
$Fields['STATUS'] = ucfirst(strtolower(G::LoadTranslation('ID_PAUSED')));
break;
case 'CANCEL':
$Fields['STATUS'] = ucfirst(strtolower(G::LoadTranslation('ID_CANCELLED')));
break;
}
}
$actions = 'false';
if (isset($_GET['action']) && $_GET['action'] == 'paused') {
$actions = 'true';
}
/* Render page */
/** Render page */
$oHeadPublisher = headPublisher::getSingleton();
$oHeadPublisher->addScriptCode("
if (typeof parent != 'undefined') {
if (parent.showCaseNavigatorPanel) {
@@ -103,11 +105,11 @@ $oHeadPublisher->addScriptCode('
require_once 'classes/model/Process.php';
$objProc = new Process();
$aProc = $objProc->load($Fields['PRO_UID']);
$Fields['PRO_TITLE'] = $aProc['PRO_TITLE'];
$processFields = $objProc->load($Fields['PRO_UID']);
$Fields['PRO_TITLE'] = $processFields['PRO_TITLE'];
$objTask = new Task();
if (!isset($Fields['TAS_UID']) || $Fields['TAS_UID'] == '') {
if (!isset($Fields['TAS_UID']) || empty($Fields['TAS_UID'])) {
$Fields['TAS_UID'] = $Fields['APP_DATA']['TASK'];
}
@@ -118,12 +120,12 @@ $tasksInParallel = array_filter($tasksInParallel, function ($value) {
$nTasksInParallel = count($tasksInParallel);
if ($nTasksInParallel > 1) {
$aTask = $objTask->load($tasksInParallel[$nTasksInParallel - 1]);
$taskInfo = $objTask->load($tasksInParallel[$nTasksInParallel - 1]);
} else {
$aTask = $objTask->load($Fields['TAS_UID']);
$taskInfo = $objTask->load($Fields['TAS_UID']);
}
$Fields['TAS_TITLE'] = $aTask['TAS_TITLE'];
$Fields['TAS_TITLE'] = $taskInfo['TAS_TITLE'];
$Fields = DateTime::convertUtcToTimeZone($Fields);
$objUser = new Users();
@@ -153,9 +155,9 @@ if ($Fields['APP_STATUS'] != 'COMPLETED') {
}
}
$FieldsPar['DEL_DELEGATE_DATE'] = DateTime::convertUtcToTimeZone($row['DEL_DELEGATE_DATE']);
$FieldsPar['DEL_INIT_DATE'] = DateTime::convertUtcToTimeZone($row['DEL_INIT_DATE']);
$FieldsPar['DEL_INIT_DATE'] = DateTime::convertUtcToTimeZone($row['DEL_INIT_DATE']);
$FieldsPar['DEL_TASK_DUE_DATE'] = DateTime::convertUtcToTimeZone($row['DEL_TASK_DUE_DATE']);
$FieldsPar['DEL_FINISH_DATE'] = DateTime::convertUtcToTimeZone($row['DEL_FINISH_DATE']);
$FieldsPar['DEL_FINISH_DATE'] = DateTime::convertUtcToTimeZone($row['DEL_FINISH_DATE']);
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_Resume_Current_Task.xml', '', $FieldsPar);
}
}

View File

@@ -1,75 +0,0 @@
<?php
/**
* cases_UsersReassign.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 {
global $RBAC;
switch ($RBAC->userCanAccess( 'PM_REASSIGNCASE' )) {
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;
}
$oCase = new Cases();
$aCases = array ();
$aUsers = array ();
if (isset( $_POST['USERS'] ) && is_array( $_POST['USERS'] )) {
foreach ($_POST['USERS'] as $sKey => $sUser) {
if ($sUser != '') {
$oCase->reassignCase( $_POST['APPLICATIONS'][$sKey], $_POST['INDEXES'][$sKey], $_POST['USR_UID'], $sUser );
$aCases[] = $_POST['APPLICATIONS'][$sKey];
$aUsers[] = $sUser;
}
}
}
$oCase = new Cases();
require_once 'classes/model/Users.php';
$oUser = new Users();
$sText = '';
foreach ($aCases as $sKey => $sCase) {
$aCase = $oCase->loadCase( $sCase );
$aUser = $oUser->load( $aUsers[$sKey] );
$sText .= '(' . $aCase['APP_NUMBER'] . ') ' . $aCase['TITLE'] . ' => ' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' (' . $aUser['USR_USERNAME'] . ')' . '<br />';
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN';
$G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $sText;
$aMessage['URL'] = 'cases_ReassignByUser?REASSIGN_USER=' . $_POST['USR_UID'];
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ReassignShowInfo', '', $aMessage );
G::RenderPage( 'publish' );
} catch (Exception $oException) {
$token = strtotime("now");
PMException::registerErrorLog($oException, $token);
G::outRes( G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)) );
die;
}

View File

@@ -1,25 +1,31 @@
<?php
global $RBAC;
$RBAC->requirePermissions( 'PM_DELETE_PROCESS_CASES', 'PM_FACTORY' );
$resp = new StdClass();
try {
$uids = explode(',', $_POST['PRO_UIDS']);
$oProcess = new Process();
foreach ($uids as $uid) {
$oProcess->deleteProcessCases($uid);
}
$oProcess->refreshUserAllCountersByProcessesGroupUid($uids);
$resp->status = true;
$resp->msg = G::LoadTranslation('ID_ALL_RECORDS_DELETED_SUCESSFULLY');
echo G::json_encode($resp);
} catch (Exception $e) {
$resp->status = false;
$resp->msg = $e->getMessage();
$resp->trace = $e->getTraceAsString();
echo G::json_encode($resp);
}
<?php
/**
* processes_DeleteCases.php
*
* Deleting all Cases of a Process
*
* @link https://wiki.processmaker.com/3.2/Processes#Deleting_all_Cases_of_a_Process
*/
global $RBAC;
$RBAC->requirePermissions('PM_DELETE_PROCESS_CASES', 'PM_FACTORY');
$resp = new stdClass();
try {
$uids = explode(',', $_POST['PRO_UIDS']);
$process = new Process();
foreach ($uids as $uid) {
$process->deleteProcessCases($uid);
}
$resp->status = true;
$resp->msg = G::LoadTranslation('ID_ALL_RECORDS_DELETED_SUCESSFULLY');
echo G::json_encode($resp);
} catch (Exception $e) {
$resp->status = false;
$resp->msg = $e->getMessage();
$resp->trace = $e->getTraceAsString();
echo G::json_encode($resp);
}

View File

@@ -2,27 +2,13 @@
/**
* processes_ImportFile.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.
* If the feature is enable and the code_scanner_scope was enable the argument import_process will check the code
* Review in a process import
*
* 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.
* @link https://wiki.processmaker.com/3.1/Importing_and_Exporting_Projects#Importing_a_Project
*/
use \ProcessMaker\Importer\XmlImporter;
use ProcessMaker\Importer\XmlImporter;
use ProcessMaker\Validation\ValidationUploadedFiles;
ValidationUploadedFiles::getValidationUploadedFiles()->dispatch(function($validator) {
@@ -35,7 +21,7 @@ ValidationUploadedFiles::getValidationUploadedFiles()->dispatch(function($valida
});
ini_set("max_execution_time", 0);
$affectedGroups = array();
$affectedGroups = [];
$granularImport = false;
$objectImport = '';
$objectsToImport = '';
@@ -49,10 +35,10 @@ if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm
preg_match("/^(?:pm|pmx|pmx2)$/", pathinfo($_FILES["PROCESS_FILENAME"]["name"], PATHINFO_EXTENSION))
) {
//Check disabled code
$response = array();
$response = [];
try {
$arrayTrigger = array();
$arrayTrigger = [];
$projectTitle = "";
switch (pathinfo($_FILES["PROCESS_FILENAME"]["name"], PATHINFO_EXTENSION)) {
@@ -87,7 +73,11 @@ if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm
foreach ($arrayTrigger as $value) {
$arrayTriggerData = $value;
$arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $arrayTriggerData["TRI_WEBBOT"]);
if (in_array('import_process', $cs->getScope())) {
$arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $arrayTriggerData["TRI_WEBBOT"]);
} else {
$arrayFoundDisabledCode = [];
}
if (!empty($arrayFoundDisabledCode)) {
$strCodeAndLine = "";

View File

@@ -1,25 +1,10 @@
<?php
/**
* pluginsChange.php
* If the feature is enable and the code_scanner_scope was enable with the argument enable_plugin, will check the code
* Review when a plugin was enable
*
* 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.
* @link https://wiki.processmaker.com/3.0/Plugins#Enable_and_Disable_a_Plugin
*/
// lets display the items
@@ -55,13 +40,14 @@ if ($handle = opendir(PATH_PLUGINS)) {
->verifyfeature('B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=')
) {
//Check disabled code
$arrayFoundDisabledCode = [];
$cs = new CodeScanner(config("system.workspace"));
$arrayFoundDisabledCode = array_merge(
$cs->checkDisabledCode("FILE", PATH_PLUGINS . $pluginName . ".php"),
$cs->checkDisabledCode("PATH", PATH_PLUGINS . $pluginName)
);
if (in_array('enable_plugin', $cs->getScope())) {
$arrayFoundDisabledCode = array_merge(
$cs->checkDisabledCode("FILE", PATH_PLUGINS . $pluginName . ".php"),
$cs->checkDisabledCode("PATH", PATH_PLUGINS . $pluginName)
);
}
if (!empty($arrayFoundDisabledCode)) {
$response = array();

View File

@@ -3,25 +3,10 @@
*
* processes_ImportFile.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
* If the feature is enable and the code_scanner_scope was enable with the argument import_plugin, will check the code
* Review when a plugin was enable
*
* @link https://wiki.processmaker.com/3.0/Plugins#Import_a_Plugin
*/
use ProcessMaker\Core\System;
@@ -251,10 +236,12 @@ try {
/*----------------------------------********---------------------------------*/
if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) {
//Check disabled code
$arrayFoundDisabledCode = [];
$cs = new CodeScanner(config("system.workspace"));
$arrayFoundDisabledCode = array_merge($cs->checkDisabledCode("FILE", $path . $pluginFile), $cs->checkDisabledCode("PATH", $path . $sClassName));
if (in_array('import_plugin', $cs->getScope())) {
$arrayFoundDisabledCode = array_merge($cs->checkDisabledCode("FILE", $path . $pluginFile),
$cs->checkDisabledCode("PATH", $path . $sClassName));
}
if (!empty($arrayFoundDisabledCode)) {
throw new Exception(G::LoadTranslation("ID_DISABLED_CODE_PLUGIN"));

View File

@@ -2,24 +2,8 @@
/**
* triggers_Save.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
* If the feature is enable and the code_scanner_scope was enable with the argument trigger, will check the code
* Review when a trigger is save
*/
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
@@ -60,10 +44,11 @@ if (isset( $sfunction ) && $sfunction == 'lookforNameTrigger') {
isset($value["TRI_WEBBOT"])
) {
//Check disabled code
$arrayFoundDisabledCode = [];
$cs = new CodeScanner(config("system.workspace"));
$arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $value["TRI_WEBBOT"]);
if (in_array('trigger', $cs->getScope())) {
$arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $value["TRI_WEBBOT"]);
}
if (!empty($arrayFoundDisabledCode)) {
$strCodeAndLine = "";

View File

@@ -135,7 +135,20 @@ class ResponseReader
if (!empty($mail->textPlain)) {
preg_match("/{(.*)}/", $mail->textPlain, $matches);
if ($matches) {
$dataEmail = G::json_decode(Crypt::decryptString($matches[1]), true);
try {
$dataEmail = G::json_decode(Crypt::decryptString($matches[1]), true);
} catch (Exception $e) {
Bootstrap::registerMonolog(
$this->channel,
300,
G::LoadTranslation('ID_ABE_RESPONSE_CANNOT_BE_IDENTIFIED'),
[],
config("system.workspace"),
'processmaker.log'
);
$mailbox->markMailAsRead($mailId);
continue;
}
$dataAbeReq = loadAbeRequest($dataEmail['ABE_REQ_UID']);
if (config("system.workspace") === $dataEmail['workspace']
&& (array_key_exists('ABE_UID', $dataAbeReq) && $dataAbeReq['ABE_UID'] == $dataAbe['ABE_UID'])) {
@@ -149,7 +162,6 @@ class ResponseReader
throw (new Exception(G::LoadTranslation('ID_CASE_DELEGATION_ALREADY_CLOSED'), 400));
}
$this->processABE($this->case, $mail, $dataAbe);
$mailbox->markMailAsRead($mailId);
Bootstrap::registerMonolog(
$this->channel,
100, // DEBUG
@@ -174,6 +186,7 @@ class ResponseReader
'processmaker.log'
);
}
$mailbox->markMailAsRead($mailId);
}
}
}
@@ -347,7 +360,8 @@ class ResponseReader
true,
$caseInf['delIndex'],
$emailSetup,
0
0,
WsBase::MESSAGE_TYPE_ACTIONS_BY_EMAIL
);
return $result;
}

View File

@@ -11,6 +11,7 @@ use AppDelegationPeer;
use AppDocument;
use AppDocumentPeer;
use AppHistoryPeer;
use Application;
use ApplicationPeer;
use Applications;
use AppNotesPeer;
@@ -45,7 +46,6 @@ use ProcessMaker\Services\OAuth2\Server;
use ProcessMaker\Util\DateTime as UtilDateTime;
use ProcessMaker\Validation\ExceptionRestApi;
use ProcessMaker\Validation\Validator as FileValidator;
use ProcessPeer;
use ProcessUser;
use ProcessUserPeer;
@@ -3317,6 +3317,7 @@ class Cases
* @param array $objectPermissions, the permissions that we need to review
* @param boolean $objectSupervisor, if we need to get all the objects supervisor
* @param string $tasUid
*
* @return array
*/
public function userAuthorization(
@@ -3330,23 +3331,21 @@ class Cases
) {
$arrayAccess = [];
//User has participated
$participated = new ListParticipatedLast();
$listParticipated = $participated->loadList($usrUid, [], null, $appUid);
$arrayAccess['participated'] = (count($listParticipated) == 0) ? false : true;
// User has participated
$arrayAccess['participated'] = Delegation::participation($appUid, $usrUid);
//User is supervisor
// User is supervisor
$supervisor = new BmProcessSupervisor();
$isSupervisor = $supervisor->isUserProcessSupervisor($proUid, $usrUid);
$arrayAccess['supervisor'] = ($isSupervisor) ? true : false;
//If the user is supervisor we will to return the object assigned
// If the user is supervisor we will to return the object assigned
if ($isSupervisor && $objectSupervisor) {
$ps = new BmProcessSupervisor();
$arrayAccess['objectSupervisor'] = $ps->getObjectSupervisor($proUid);
}
//Roles Permissions
// Roles Permissions
if (count($rolesPermissions) > 0) {
global $RBAC;
foreach ($rolesPermissions as $value) {
@@ -3354,7 +3353,7 @@ class Cases
}
}
//Object Permissions
// Object Permissions
if (count($objectPermissions) > 0) {
$case = new ClassesCases();
foreach ($objectPermissions as $key => $value) {

View File

@@ -1,6 +1,12 @@
<?php
namespace ProcessMaker\BusinessModel;
use CodeScanner;
use Exception;
use G;
use PMLicensedFeatures;
use Triggers as ModelTriggers;
class Trigger
{
/**
@@ -134,76 +140,82 @@ class Trigger
}
/**
* Save Data for Trigger
* @var string $sProcessUID. Uid for Process
* @var string $dataTrigger. Data for Trigger
* @var string $create. Create o Update Trigger
* @var string $sTriggerUid. Uid for Trigger
* If the feature is enable and the code_scanner_scope was enable with the argument trigger, will check the code
* Review when a trigger is save or update
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
* @param string $proUid. Uid for Process
* @param array $dataTrigger. Data for Trigger
* @param boolean $create. Create o Update Trigger
* @param string $triggerUid. Uid for Trigger
*
* @return array
* @throws Exception
*
* @uses \ProcessMaker\Services\Api\Project\Trigger::doPostTrigger()
* @uses \ProcessMaker\Services\Api\Project\Trigger::doPutTrigger()
*/
public function saveTrigger($sProcessUID = '', $dataTrigger = array(), $create = false, $sTriggerUid = '')
public function saveTrigger($proUid = '', $dataTrigger = [], $create = false, $triggerUid = '')
{
if ( ($sProcessUID == '') || (count($dataTrigger) == 0) ) {
if ((empty($proUid)) || empty($dataTrigger)) {
return false;
}
$dataTrigger = array_change_key_case($dataTrigger, CASE_UPPER);
if ( $create && (isset($dataTrigger['TRI_UID'])) ) {
if ($create && (isset($dataTrigger['TRI_UID']))) {
unset($dataTrigger['TRI_UID']);
}
$dataTrigger= (array)$dataTrigger;
$dataTrigger = (array)$dataTrigger;
$dataTrigger['TRI_TYPE'] = 'SCRIPT';
if (isset($dataTrigger['TRI_TITLE'])) {
if (!$this->verifyNameTrigger($sProcessUID, $dataTrigger['TRI_TITLE'], $sTriggerUid)) {
throw new \Exception(\G::LoadTranslation("ID_CANT_SAVE_TRIGGER"));
if (!$this->verifyNameTrigger($proUid, $dataTrigger['TRI_TITLE'], $triggerUid)) {
throw new Exception(G::LoadTranslation("ID_CANT_SAVE_TRIGGER"));
}
}
/*----------------------------------********---------------------------------*/
if (\PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=") &&
if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=") &&
isset($dataTrigger["TRI_WEBBOT"])
) {
//Check disabled code
$cs = new \CodeScanner(config("system.workspace"));
$arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $dataTrigger["TRI_WEBBOT"]);
$arrayFoundDisabledCode = [];
$cs = new CodeScanner(config("system.workspace"));
if (in_array('trigger', $cs->getScope())) {
$arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $dataTrigger["TRI_WEBBOT"]);
}
if (!empty($arrayFoundDisabledCode)) {
$strCodeAndLine = "";
foreach ($arrayFoundDisabledCode["source"] as $key => $value) {
$strCodeAndLine .= (($strCodeAndLine != "")? ", " : "") . \G::LoadTranslation("ID_DISABLED_CODE_CODE_AND_LINE", array($key, implode(", ", $value)));
$strCodeAndLine .= (($strCodeAndLine != "") ? ", " : "") . G::LoadTranslation("ID_DISABLED_CODE_CODE_AND_LINE",
[$key, implode(", ", $value)]);
}
throw new \Exception(\G::LoadTranslation("ID_DISABLED_CODE_TRIGGER", array($strCodeAndLine)));
throw new Exception(G::LoadTranslation("ID_DISABLED_CODE_TRIGGER", [$strCodeAndLine]));
}
}
/*----------------------------------********---------------------------------*/
$dataTrigger['PRO_UID'] = $sProcessUID;
$oTrigger = new \Triggers();
$dataTrigger['PRO_UID'] = $proUid;
$trigger = new ModelTriggers();
if ($create) {
$oTrigger->create( $dataTrigger );
$dataTrigger['TRI_UID'] = $oTrigger->getTriUid();
$trigger->create($dataTrigger);
$dataTrigger['TRI_UID'] = $trigger->getTriUid();
}
$oTrigger->update( $dataTrigger );
$trigger->update($dataTrigger);
if ($create) {
$dataResp = $oTrigger->load( $dataTrigger['TRI_UID'] );
$dataResp = $trigger->load($dataTrigger['TRI_UID']);
$dataResp = array_change_key_case($dataResp, CASE_LOWER);
if (isset($dataResp['pro_uid'])) {
unset($dataResp['pro_uid']);
}
return $dataResp;
}
return array();
return [];
}
/**

View File

@@ -1,7 +1,9 @@
<?php
namespace ProcessMaker\BusinessModel;
use Criteria;
use ProcessMaker\Core\System;
use ResultSet;
use WebEntryPeer;
class WebEntry
@@ -962,31 +964,35 @@ class WebEntry
* Check the existence of a file of type web entry, returns true if it exists
* and false otherwise. Verification is done by the field WE_DATA and PRO_UID.
* The PRO_UID key and the file path are required.
* @param type $proUid
* @param type $filePath
* @return boolean
*
* @param string $proUid
* @param string $filePath
*
* @return bool
*/
public static function isWebEntry($proUid, $filePath)
{
// Validate if path file is valid
$fileName = basename($filePath);
if (empty($proUid) || empty($fileName)) {
return false;
}
// Transform the sent filename to a valid web entry filename
$fileName = trim($fileName);
$postfix = "Post.php";
$n = strlen($postfix);
$string = substr($fileName, 0, -$n);
if ($string . $postfix === $fileName) {
$fileName = $string . ".php";
}
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\WebEntryPeer::WE_DATA);
$criteria->add(\WebEntryPeer::PRO_UID, $proUid, \Criteria::EQUAL);
$criteria->add(\WebEntryPeer::WE_DATA, $fileName, \Criteria::EQUAL);
$resultSet = \WebEntryPeer::doSelectRS($criteria);
$resultSet->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$fileName = str_replace(['Post.php', 'Info.php'], '.php', $fileName);
// Search in DB the filename
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(WebEntryPeer::WE_DATA);
$criteria->add(WebEntryPeer::PRO_UID, $proUid, Criteria::EQUAL);
$criteria->add(WebEntryPeer::WE_DATA, $fileName, Criteria::EQUAL);
$resultSet = WebEntryPeer::doSelectRS($criteria);
$resultSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$resultSet->next();
$row = $resultSet->getRow();
// Web entry file exists?
return isset($row["WE_DATA"]);
}

View File

@@ -54,6 +54,7 @@ class System
'error_reporting' => "",
'display_errors' => 'On',
'enable_blacklist' => 0,
'code_scanner_scope' => 'import_plugin,enable_plugin,import_process,trigger',
'system_utc_time_zone' => 0,
'server_protocol' => '',
'leave_case_warning' => 0,

View File

@@ -0,0 +1,12 @@
<?php
namespace ProcessMaker\Model;
use Illuminate\Database\Eloquent\Model;
class AppThread extends Model
{
protected $table = 'APP_THREAD';
// We do not have create/update timestamps for this table
public $timestamps = false;
}

View File

@@ -563,4 +563,22 @@ class Delegation extends Model
return $arrayOpenThreads;
}
/**
* Return if the user has participation in the case
*
* @param string $appUid, Case key
* @param string $userUid, User key
*
* @return boolean
*/
public static function participation($appUid, $userUid)
{
$query = Delegation::query()->select();
$query->where('APP_UID', $appUid);
$query->where('USR_UID', $userUid);
$query->limit(1);
return ($query->count() > 0);
}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace ProcessMaker\Model;
use Illuminate\Database\Eloquent\Model;
class RbacRoles extends Model
{
protected $table = 'RBAC_ROLES';
public $timestamps = false;
}

View File

@@ -0,0 +1,12 @@
<?php
namespace ProcessMaker\Model;
use Illuminate\Database\Eloquent\Model;
class RbacUsers extends Model
{
protected $table = 'RBAC_USERS';
public $timestamps = false;
}

View File

@@ -0,0 +1,12 @@
<?php
namespace ProcessMaker\Model;
use Illuminate\Database\Eloquent\Model;
class RbacUsersRoles extends Model
{
protected $table = 'RBAC_USERS_ROLES';
public $timestamps = false;
}

View File

@@ -0,0 +1,15 @@
<?php
namespace ProcessMaker\Model;
use Illuminate\Database\Eloquent\Model;
class WebEntry extends Model
{
// Set our table name
protected $table = 'WEB_ENTRY';
protected $primaryKey = 'WE_UID';
// We do not have create/update timestamps for this table
public $timestamps = false;
}

View File

@@ -212,14 +212,21 @@
)
});
startDateRender = function(v){
var dateString = "-";
if(v != "-" && v != null){
dateString = _DF(v,"m/d/Y H:i:s");
}
/**
* This applies the date format from the global configuration.
* @param {String} value
* @return {String}
*/
startDateRender = function (value) {
var dateString,
date;
dateString = "-";
if (value !== "-" && value !== null) {
date = convertDate(value);
dateString = date.dateFormat(FORMATS.casesListDateFormat);
}
return dateString;
}
}
actionRenderingTranslation = function(v){
var actionTranslate = "";

View File

@@ -545,23 +545,6 @@ Ext.onReady ( function() {
return String.format("<a href='#' onclick='unpauseCaseFunction(\"{0}\",\"{1}\")'>" + _('ID_UNPAUSE') + "</a>", r.data['APP_UID'], r.data['DEL_INDEX'] );
}
function convertDate ( value ) {
myDate = new Date( 1900,0,1,0,0,0);
try{
if(!Ext.isDate( value )){
var myArray = value.split(' ');
var myArrayDate = myArray[0].split('-');
if ( myArray.length > 1 )
var myArrayHour = myArray[1].split(':');
else
var myArrayHour = new Array('0','0','0');
var myDate = new Date( myArrayDate[0], myArrayDate[1]-1, myArrayDate[2], myArrayHour[0], myArrayHour[1], myArrayHour[2] );
}
}
catch(e){};
return myDate;
}
function showDate (value,p,r) {
var myDate = convertDate( value );
return String.format("{0}", myDate.dateFormat( FORMATS.casesListDateFormat ));

View File

@@ -1,41 +0,0 @@
<form name="frmReassign" id="frmReassign" method="POST" action="cases_UsersReassign">
<div class="borderForm" style="width:; padding-left:0; padding-right:0; border-width:1;">
<div class="boxTop"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="pagedTableDefault" style="height:100%;" >
<table width="95%" align="center" cellpadding="2" cellspacing="0" border="0" class="pagedTable">
<tr>
<td class="pagedTableHeader"><img src="/js/maborak/core/images/separatorTable.gif" style=""/></td><td width="5%" class="pagedTableHeader">{ID_NUMBER}</td>
<td class="pagedTableHeader"><img src="/js/maborak/core/images/separatorTable.gif" style=""/></td><td width="25%" class="pagedTableHeader">{ID_CASE}</td>
<td class="pagedTableHeader"><img src="/js/maborak/core/images/separatorTable.gif" style=""/></td><td width="20%" class="pagedTableHeader">{ID_TASK}</td>
<td class="pagedTableHeader"><img src="/js/maborak/core/images/separatorTable.gif" style=""/></td><td width="20%" class="pagedTableHeader">{ID_PROCESS}</td>
<td class="pagedTableHeader"><img src="/js/maborak/core/images/separatorTable.gif" style=""/></td><td width="5%" class="pagedTableHeader">{ID_STATUS}</td>
<td class="pagedTableHeader"><img src="/js/maborak/core/images/separatorTable.gif" style=""/></td><td width="25%" class="pagedTableHeader">{ID_REASSIGN_TO}</td>
</tr>
<!-- START BLOCK : cases -->
<tr class="Row2" onmouseout="setRowClass(this, 'Row2');" onmouseover="setRowClass(this, 'RowPointer');">
<td /><td>{APP_NUMBER}</td>
<td /><td>{APP_TITLE}</td>
<td /><td>{APP_TAS_TITLE}</td>
<td /><td>{APP_PRO_TITLE}</td>
<td /><td>{ID_STATUS}</td>
<td /><td>
<input type="hidden" name="APPLICATIONS[]" id="APPLICATIONS[]" value="{APP_UID}" />
<input type="hidden" name="INDEXES[]" id="INDEXES[]" value="{DEL_INDEX}" />
<select name="USERS[]" id="USERS[]"><option value=""> - {ID_NO_REASSIGN} - </option>
<!-- START BLOCK : users -->
<option value="{USR_UID}">{USR_FULLNAME}</option>
<!-- END BLOCK : users -->
</select>
</td>
</tr>
<!-- END BLOCK : cases -->
<tr height="50">
<td colspan="12" align="center">
<input type="hidden" name="USR_UID" id="USR_UID" value="{USR_UID}" />
<input type="submit" name="btnReassign" id="btnReassign" value="{ID_REASSIGN}" class="module_app_button___gray" />
</td>
</tr>
</table>
</div>
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
</form>

View File

@@ -1,69 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm type="xmlform" name="cases_ReassignBy.xml" width="600" enabletemplate="1" mode="edit">
<title type="subtitle" enableHTML="1">
<en><![CDATA[<center>Reassignment of Cases</center>]]></en>
</title>
<REASSIGN_BY type="radiogroup" required="0" defaultvalue="1" mode="edit">
<en><![CDATA[Reassign By]]><option name="1"><![CDATA[Case]]></option><option name="2"><![CDATA[User]]></option></en>
</REASSIGN_BY>
<REASSIGN_USER type="dropdown" required="0" readonly="0" mode="edit" sqlconnection="dbarray"><![CDATA[
SELECT * FROM aUserInfo
]]><en><![CDATA[]]><option name=""><![CDATA[- Select -]]></option></en></REASSIGN_USER>
<JS type="javascript"><![CDATA[
var bFlag = false;
var client = getBrowserClient();
var dynaformOnload = function() {
if (!bFlag) {
if( client.browser == 'msie'){
document.getElementById('form[REASSIGN_BY][1]').onclick= function() {
if (this.checked) {
if (window.location.href.indexOf('cases_List?l=to_reassign') == -1) {
window.location = 'cases_List?l=to_reassign';
}
}
};
document.getElementById('form[REASSIGN_BY][2]').onclick= function() {
if (document.getElementById('form[REASSIGN_BY][2]').checked) {
if (window.location.href.indexOf('cases_ReassignByUser') == -1) {
window.location = 'cases_ReassignByUser';
}
}
};
leimnud.event.add(getField('REASSIGN_USER'), 'change', function() {
window.location = 'cases_ReassignByUser?REASSIGN_USER=' + getField('REASSIGN_USER').value;
});
} else { //for other firefox, safari, etc..
leimnud.event.add(getField('REASSIGN_BY][1'), 'click', function() {
if (this.checked) {
if (window.location.href.indexOf('cases_List?l=to_reassign') == -1) {
window.location = 'cases_List?l=to_reassign';
}
}
});
leimnud.event.add(getField('REASSIGN_BY][2'), 'click', function() {
if (this.checked) {
if (window.location.href.indexOf('cases_ReassignByUser') == -1) {
window.location = 'cases_ReassignByUser';
}
}
});
leimnud.event.add(getField('REASSIGN_USER'), 'change', function() {
window.location = 'cases_ReassignByUser?REASSIGN_USER=' + this.value;
});
}
bFlag = true;
}
};
if (getField('REASSIGN_BY][2').checked){
//showRowById('REASSIGN_USER');
document.getElementById('form[REASSIGN_USER]').style.display = 'block';
} else {
//hideRowById('REASSIGN_USER');
document.getElementById('form[REASSIGN_USER]').style.display = 'none';
}
]]></JS>
</dynaForm>

View File

@@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm type="pagetable" menu="users/users_Options" searchBy="USR_USERNAME | USR_LASTNAME | USR_FIRSTNAME | USR_EMAIL">
<USR_UID type="private" showInTable="0"/>
<USR_COMPLETENAME type="text" titlealign="left" align="left" colWidth="200">
<en><![CDATA[Full Name]]></en>
</USR_COMPLETENAME>
<USR_USERNAME type="text" titlealign="left" align="left" colWidth="120">
<en><![CDATA[Username]]></en>
</USR_USERNAME>
<USR_EMAIL type="text" titlealign="left" align="left" colWidth="190">
<en><![CDATA[E-Mail]]></en>
</USR_EMAIL>
<USR_ROLE type="text" titlealign="left" align="left" colWidth="180">
<en><![CDATA[Role]]></en>
</USR_ROLE>
<USR_DUE_DATE type="text" titlealign="left" align="left" colWidth="65">
<en><![CDATA[Due Date]]></en>
</USR_DUE_DATE>
<USR_EDIT type="link" colWidth="50" value="@#USR_EDIT" link="users_Edit?USR_UID=@#USR_UID">
<en><![CDATA[]]></en>
</USR_EDIT>
<USR_GROUP type="link" colWidth="25" value="@G::LoadTranslation(ID_VIEW_USER_GROUP)" link="#" onclick="viewUserGroups('@#USR_UID');return false;">
<en><![CDATA[]]></en>
</USR_GROUP>
<USR_AUTH type="link" colWidth="25" value="@#USR_AUTH" link="users_AuthSource?USR_UID=@#USR_UID">
<en><![CDATA[]]></en>
</USR_AUTH>
<!--USR_REASSIGN type="link" colWidth="100" value="@#USR_REASSIGN" link="#" onclick="reassignCases2(&#039;@#USR_UID&#039;);return false;">
<en/>
</USR_REASSIGN-->
<USR_DELETE type="link" colWidth="25" value="@#USR_DELETE" link="#" onclick="deleteUser('@#USR_UID');return false;">
<en><![CDATA[]]></en>
</USR_DELETE>
</dynaForm>

View File

@@ -1,200 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm type="xmlmenu">
<MNU_ADD type="link" value="" link="#" onclick="window.location = 'users_New';return false;" colAlign="left" colWidth="35">
<en><![CDATA[New]]></en>
</MNU_ADD>
<PAGED_TABLE_ID type="private"/>
<PAGED_TABLE_FAST_SEARCH type="FastSearch" label="@G::LoadTranslation(ID_SEARCH)"/>
<SEARCH_FILTER_FORM type="private"/>
<CONFIRM type="private"/>
<JS type="javascript"><![CDATA[
var simpleUserDelete = function(sUser) {
new leimnud.module.app.confirm().make({
label:'@#CONFIRM',
action:function() {
window.location = 'users_Delete?USR_UID=' + sUser;
}.extend(this)
});
};
var panel;
var gUSER_UID;
var deleteUser=function(sUser){
if (sUser == '00000000000000000000000000000001')
{
new leimnud.module.app.alert().make({
label: "@G::LoadTranslation(ID_CANNOT_DELETE_ADMIN_USER)"
});
}
else
{
gUSER_UID = sUser;
panel =new leimnud.module.panel();
panel.options={
size :{w:450,h:250},
position:{x:50,y:50,center:true},
statusBarButtons:[
{value:'@G::LoadTranslation(ID_DELETE)'},
{value: G_STRINGS.CANCEL}
],
title :G_STRINGS.ID_PROSESSESCASE,
control :{close:true,resize:false},fx:{modal:true},
statusBar:false,
fx :{shadow:true,modal:true}
};
panel.make();
panel.elements.statusBarButtons[0].onmouseup=function(){
var todoCount = parseInt(getField('TO_DO').value);
var draftCount = parseInt(getField('DRAFT').value);
var cancelledCount = parseInt(getField('CANCELLED').value);
var completedCount = parseInt(getField('COMPLETED').value);
if(todoCount== 0 && draftCount==0){
if(cancelledCount== 0 && completedCount==0){
location.href = "users_Delete?USR_UID="+gUSER_UID;
} else {
new leimnud.module.app.confirm().make({
label:G_STRINGS.USERS_DELETE_WITH_HISTORY,
width:350,
height:130,
action:function(){
location.href = "users_Delete?USR_UID="+gUSER_UID;
}.extend(this)
});
}
} else {
new leimnud.module.app.confirm().make({
label:G_STRINGS.USERS_REASSIGN,
width:350,
height:135,
action:function(){
/*location.href = "../cases/cases_ReassignByUser";*/
userReassing(gUSER_UID);
}.extend(this)
});
}
};
panel.elements.statusBarButtons[1].onmouseup=panel.remove;
panel.loader.show();
var r = new leimnud.module.rpc.xmlhttp({
url:"users_DeleteAssign.php",
method:"GET",
args:"USR_UID=" + sUser
});
r.callback=function(rpc)
{
panel.loader.hide();
panel.addContent(rpc.xmlhttp.responseText);
};
r.make();
}
}
function viewUserGroups(sUserUID){
popupWindow('' , 'users_Groups?sUserUID='+sUserUID , 400 , 330 );
/*refreshTree();*/
};
function showUserGroups(sUserUID){
var oRPC = new leimnud.module.rpc.xmlhttp({
url : '../users/users_Ajax',
async : false,
method: 'POST',
args : 'function=showUserGroups'+ '&sUserUID=' + sUserUID
});
oRPC.make();
currentPopupWindow.clearContent();
currentPopupWindow.addContent(oRPC.xmlhttp.responseText);
};
function deleteGroup(sGroup, sUser){
new leimnud.module.app.confirm().make({
label:G_STRINGS.ID_MSG_CONFIRM_REMOVE_USERGROUP,
action:function(){
var oRPC = new leimnud.module.rpc.xmlhttp({
url : '../users/users_Ajax',
async : false,
method: 'POST',
args : 'function=deleteGroup&GRP_UID=' + sGroup + '&USR_UID=' + sUser
});
oRPC.make();
currentPopupWindow.clearContent();
currentPopupWindow.addContent(oRPC.xmlhttp.responseText);
}.extend(this)
});
};
function showUserGroupInterface(sUserUID){
var oRPC = new leimnud.module.rpc.xmlhttp({
url : '../users/users_Ajax',
async : false,
method: 'POST',
args : 'function=showUserGroupInterface'+ '&sUserUID=' + sUserUID
});
oRPC.make();
currentPopupWindow.clearContent();
currentPopupWindow.addContent(oRPC.xmlhttp.responseText);
//currentPopupWindow.remove();
};
function saveUserGroup(sGroup, sUser){
var oRPC = new leimnud.module.rpc.xmlhttp({
url : '../users/users_Ajax',
async : false,
method: 'POST',
args : 'function=assignUserToGroup&GRP_UID=' + sGroup + '&USR_UID=' + sUser
});
oRPC.make();
currentPopupWindow.clearContent();
currentPopupWindow.addContent(oRPC.xmlhttp.responseText);
setTimeout('showUserGroups(\''+sUser+'\')',1500);
}
var reassignCases = function(sUser) {
window.location = 'users_ReassignCases?sUser=' + sUser;
};
var reassignCases2 = function(USR_UID) {
popupWindow('' , 'users_ReassignCases?USR_UID=' + USR_UID + '&iStep=1' , 500, 350);
};
function userReassing(USR_UID){
var panel =new leimnud.module.panel();
var width = 1000;
var height= 700;
panel.options={
size :{w:width, h:height},
position:{x:50,y:50,center:true},
statusBarButtons:[{value: G_STRINGS.CANCEL}],
title :G_STRINGS.ID_REASSIGNMENT,
control :{close:true,resize:false},fx:{modal:true},
statusBar:false,
fx :{shadow:true,modal:true}
};
panel.make();
ifrm = document.createElement("iframe");
ifrm.setAttribute("name", "userReassing");
ifrm.setAttribute("id","userReassing");
ifrm.setAttribute("src", "../cases/cases_ReassignByUser?REASSIGN_USER="+USR_UID);
ifrm.style.width = "100%";
ifrm.style.height = "99%";
ifrm.style.border = "0";
panel.addContent(ifrm);
panel.elements.statusBarButtons[0].onmouseup=function(){
panel.remove();
};
}
]]></JS>
</dynaForm>