Merge remote-tracking branch 'upstream/3.0.1.8' into 3.0.1.7-Gmail

This commit is contained in:
Dante
2016-02-17 14:18:56 -04:00
45 changed files with 1083 additions and 281 deletions

1
.gitignore vendored
View File

@@ -36,3 +36,4 @@ workflow/public_html/build-log.html
temp.txt
update.sh
workflow/public_html/translations/
build-prod.zip

View File

@@ -36,7 +36,6 @@ task :build => [:required] do
puts "Seems it is not a ProcessMaker installation"
exit(1)
end
if mode == "production"
targetDir = publicDir + "/lib"
pmUIFontsDir = targetDir + "/fonts"
@@ -58,6 +57,7 @@ task :build => [:required] do
buildPmUi(Dir.pwd + "/vendor/colosa/pmUI", targetDir, mode)
buildPmdynaform(Dir.pwd + "/vendor/colosa/pmDynaform", targetDir, mode)
buildPmdynaformZip(Dir.pwd + "/vendor/colosa/pmDynaform", publicDir)
buildMafe(Dir.pwd + "/vendor/colosa/MichelangeloFE", targetDir, mode)
@@ -210,6 +210,13 @@ def buildPmdynaform(homeDir, targetDir, mode)
puts "\nPmDynaform Build Finished!".magenta
end
def buildPmdynaformZip(homeDir, targetDir)
puts "\nBuilding Compress Zip library".green.bold
executeInto(homeDir, [ "mobile"])
copyFiles({homeDir + "/build-prod-zip/build-prod.zip" => targetDir + "/build-prod.zip"})
puts "\nPmDynaform Zip Build Finished!".magenta
end
def buildMafe(homeDir, targetDir, mode)
puts "\nBuilding PM Michelangelo FE".green.bold

View File

@@ -1583,8 +1583,8 @@ class XmlForm_Field_Suggest extends XmlForm_Field_SimpleText //by neyek
if (strlen( trim( $formVariableValue ) ) > 0) {
$value = $formVariableValue;
}
$name = "'" . $this->name . "'";
$str = '<input type="text" ' . $storeEntry . ' class="module_app_input___gray" size="' . $this->size . '" id="form' . $rowId . '[' . $this->name . '_label]" name="form' . $rowId . '[' . $this->name . '_label]" value="' . $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '" onblur="idSet(' . $name . ');" ';
$str = '<input type="text" ' . $storeEntry . ' class="module_app_input___gray" size="' . $this->size . '" id="form' . $rowId . '[' . $this->name . '_label]" name="form' . $rowId . '[' . $this->name . '_label]" value="' . $this->htmlentities($value, ENT_COMPAT, 'utf-8') . '" onblur="idSet(\'' . $this->name . '\');" ';
$str .= $this->NSDependentFields( true ) . ' ';
$str .= $this->NSRequiredValue() . ' ';
$str .= $this->NSGridLabel() . ' ';
@@ -1709,9 +1709,16 @@ class XmlForm_Field_Suggest extends XmlForm_Field_SimpleText //by neyek
return $str;
}
} else {
$str = '<span id="form' . $rowId . '[' . $this->name . ']" name="form' . $rowId . '[' . $this->name . ']" ' . $this->NSGridType() . ' >';
$str .= $this->htmlentities( $formVariableValue, ENT_COMPAT, 'utf-8' );
$str .= '</span>';
$str = $this->htmlentities($formVariableValue, ENT_COMPAT, 'utf-8');
$str .= '<input type="hidden" id="form' . $rowId . '[' . $this->name . '_label]" name="form' . $rowId . '[' . $this->name . '_label]" value="' . $this->htmlentities($formVariableValue, ENT_COMPAT, 'utf-8') . '" ';
$str .= $this->NSDependentFields(true) . ' ';
$str .= $this->NSRequiredValue() . ' ';
$str .= $this->NSGridLabel() . ' ';
$str .= '/>';
$str .= '<input type="hidden" id="form' . $rowId . '[' . $this->name . ']" name="form' . $rowId . '[' . $this->name . ']" value="' . $this->htmlentities($formVariableKeyValue, ENT_COMPAT, 'utf-8') . '" ';
$str .= $this->NSGridType() . ' ';
$str .= '/>';
return $str;
}
}

View File

@@ -474,7 +474,7 @@ class Applications
$sort = "";
//Current delegation (*)
if (($action == "sent" || $action == "search" || $action == "simple_search" || $action == "to_revise" || $action == "to_reassign") && ($status != "TO_DO")) {
if ($action == 'sent' || $action == 'simple_search' || $action == 'to_reassign') {
switch ($sortBk) {
case "APP_CACHE_VIEW.APP_CURRENT_USER":
$sort = "USRCR_" . $conf->userNameFormatGetFirstFieldByUsersTable();
@@ -578,8 +578,8 @@ class Applications
$maxDataset->close();
}*/
//Current delegation (*) || $action == "search" || $action == "to_revise"
if (($action == "sent" || $action == "simple_search" || $action == "to_reassign") && ($status != "TO_DO")) {
//Current delegation (*)
if ($action == 'sent' || $action == 'simple_search' || $action == 'to_reassign') {
//Current task
$aRow["APP_TAS_TITLE"] = $aRow["APPDELCR_APP_TAS_TITLE"];

View File

@@ -1010,6 +1010,7 @@ class PMPluginRegistry
*/
public function executeTriggers ($triggerId, $oData)
{
G::LoadThirdParty( "pear", "PEAR" );
foreach ($this->_aTriggers as $row => $detail) {
if ($triggerId == $detail->sTriggerId) {
//review all folders registered for this namespace
@@ -1116,8 +1117,9 @@ class PMPluginRegistry
*/
public function &getPlugin ($sNamespace)
{
$oPlugin = null;
if (array_key_exists( $sNamespace, $this->_aPlugins )) {
return $this->_aPlugins[$sNamespace];
$oPlugin = $this->_aPlugins[$sNamespace];
}
/*
$aDetails = KTUtil::arrayGet($this->_aPluginDetails, $sNamespace);
@@ -1133,6 +1135,7 @@ class PMPluginRegistry
$this->_aPlugins[$sNamespace] =& $oPlugin;
return $oPlugin;
*/
return $oPlugin;
}
/**

View File

@@ -176,9 +176,9 @@ class pmDynaform
$json->sql = "";
$json->optionsSql = array();
if ($json->dbConnection !== "" && $json->dbConnection !== "none" && $json->sql !== "") {
try {
$cnn = Propel::getConnection($json->dbConnection);
$stmt = $cnn->createStatement();
try {
$sql = G::replaceDataField($json->sql, $this->getValuesDependentFields($json));
$rs = $stmt->executeQuery($sql, \ResultSet::FETCHMODE_NUM);
while ($rs->next()) {
@@ -518,6 +518,7 @@ class pmDynaform
$jsonUpdate = G::json_decode($ri["DYN_CONTENT"]);
$jsonUpdate = $jsonUpdate->items[0];
$jsonUpdate->colSpan = $json->colSpan;
$jsonUpdate->mode = $json->mode;
$jsonUpdate->jsonUpdate = true;
$json = $jsonUpdate;
$this->jsonr($json);
@@ -941,6 +942,7 @@ class pmDynaform
$jsonUpdate = G::json_decode($ri["DYN_CONTENT"]);
$jsonUpdate = $jsonUpdate->items[0];
$jsonUpdate->colSpan = $jsonSearch->colSpan;
$jsonUpdate->mode = $jsonSearch->mode;
$this->jsonReplace($json, $ri["DYN_UID"], "id", $jsonUpdate);
}
$this->record["DYN_CONTENT"] = G::json_encode($json);

View File

@@ -2907,6 +2907,59 @@ function PMFSaveCurrentData ()
return $result;
}
/**
* @method
* Return an array of associative arrays which contain the unique task ID and title.
* @name PMFTasksListByProcessId
* @label PMF Tasks List By Process Id
* @param string | $processId | ID Process | To get the current process id, use the system variable @@PROCESS
* @return array | $result | Array result | Array of associative arrays which contain the unique task ID and title
*/
function PMFTasksListByProcessId($processId)
{
$result = array();
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(TaskPeer::TAS_UID);
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->addSelectColumn(ContentPeer::CON_LANG);
$criteria->addJoin(TaskPeer::TAS_UID, ContentPeer::CON_ID, Criteria::INNER_JOIN);
$criteria->add(ContentPeer::CON_CATEGORY, 'TAS_TITLE', Criteria::EQUAL);
$criteria->add(TaskPeer::PRO_UID, $processId, Criteria::EQUAL);
$ds = TaskPeer::doSelectRS($criteria);
$ds->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($ds->next()) {
$result[] = $ds->getRow();
}
return $result;
}
/**
* @method
* The requested text in the specified language | If not found returns false
* @name PMFGeti18nText
* @label PMF Get i18n Text
* @param string | $id | ID Text | Is the identifier of text, that must be the same to the column: "CON_ID" of the CONTENT table
* @param string | $category | Category | Is the category of the text, that must be the same to the column: "CON_CATEGORY" of the CONTENT table
* @param string | $lang | Language | Is the language of the text, that must be the same to the column: "CON_LANG" of the CONTENT table
* @return string | $text | Translated text | the translated text of a string in Content
*/
function PMFGeti18nText($id, $category, $lang = "en")
{
$text = false;
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add(ContentPeer::CON_ID, $id, Criteria::EQUAL);
$criteria->add(ContentPeer::CON_CATEGORY, $category, Criteria::EQUAL);
$criteria->add(ContentPeer::CON_LANG, $lang, Criteria::EQUAL);
$ds = ContentPeer::doSelectRS($criteria);
$ds->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$ds->next();
$row = $ds->getRow();
if (isset($row["CON_VALUE"])) {
$text = $row["CON_VALUE"];
}
return $text;
}
/**
* @method

View File

@@ -35,6 +35,7 @@ class triggerLibrary
//$folderData = new folderData($sProUid, $proFields['PRO_TITLE'], $sAppUid, $Fields['APP_TITLE'], $sUsrUid);
$oPluginRegistry = &PMPluginRegistry::getSingleton();
$aAvailablePmFunctions = $oPluginRegistry->getPmFunctions();
$oPluginRegistry->setupPlugins(); //Get and setup enabled plugins
foreach ($aAvailablePmFunctions as $key => $class) {
$filePlugin = PATH_PLUGINS . $class . PATH_SEP . 'classes' . PATH_SEP . 'class.pmFunctions.php';

View File

@@ -143,6 +143,7 @@ class AddonsManager extends BaseAddonsManager
//$oPluginRegistry->enablePlugin($oDetails->sNamespace);
//require_once (PATH_PLUGINS . $this->getAddonName() . ".php"); //ok
$oPluginRegistry->enablePlugin($this->getAddonName());
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins
} else {
//$oDetails = $oPluginRegistry->getPluginDetails($this->getAddonName());
//$oPluginRegistry->disablePlugin($oDetails->sNamespace);
@@ -455,4 +456,3 @@ class AddonsManager extends BaseAddonsManager
return true;
}
}

View File

@@ -373,7 +373,6 @@ class Application extends BaseApplication
$this->setAppUpdateDate('now');
$pin = G::generateCode(4, 'ALPHANUMERIC');
$this->setAppData(serialize(array('PIN' => $pin)));
$this->setAppPin(G::encryptOld($pin));
$c = new Criteria();
@@ -385,6 +384,8 @@ class Application extends BaseApplication
$maxNumber = $oSequences->getSequeceNumber("APP_NUMBER");
$this->setAppNumber($maxNumber);
$this->setAppData(serialize(['APP_NUMBER' => $maxNumber, 'PIN' => $pin]));
$oSequences->changeSequence('APP_NUMBER', $maxNumber);
$oSequences->unlockSequenceTable();

View File

@@ -340,6 +340,8 @@ class Process extends BaseProcess
public function getAll ()
{
$bpmn = new \ProcessMaker\Project\Bpmn();
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( ProcessPeer::PRO_UID );
@@ -359,7 +361,9 @@ class Process extends BaseProcess
$processes = Array ();
$uids = array ();
while ($oDataset->next()) {
$processes[] = $oDataset->getRow();
$row = $oDataset->getRow();
$row['PRO_PROCESS_TYPE'] = ($bpmn->exists($row['PRO_UID']))? 'BPMN' : 'CLASSIC';
$processes[] = $row;
$uids[] = $processes[sizeof( $processes ) - 1]['PRO_UID'];
}
//process details will have the info about the processes

View File

@@ -304,6 +304,8 @@ class AppProxy extends HttpProxyController
$data[] = array ('label' => $labelsCurrentTaskProperties['DEL_TASK_DUE_DATE'],'value' => $applicationFields['DEL_TASK_DUE_DATE'],'section' => $labelTitleCurrentTasks['TITLE2']);
$data[] = array ('label' => $labelsCurrentTaskProperties['DEL_FINISH_DATE'],'value' => $applicationFields['DEL_FINISH_DATE'],'section' => $labelTitleCurrentTasks['TITLE2']);
//$data[] = array('label'=>$labelsCurrentTaskProperties['DYN_UID'] , 'value' => $processData['PRO_DYNAFORMS']['PROCESS'];, 'section'=>$labelsCurrentTaskProperties['DYN_UID']);
$data = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($data);
return $data;
}
}

View File

@@ -145,7 +145,7 @@ class Designer extends Controller
$user = new \ProcessMaker\BusinessModel\User();
if ($user->checkPermission($row['USER_ID'], 'PM_FACTORY')) {
if ($user->checkPermission($row['USER_ID'], 'PM_FACTORY') || $proReadOnly == 'true') {
$this->setView('designer/index');
} else {
$this->setVar('accessDenied', G::LoadTranslation('ID_ACCESS_DENIED'));

View File

@@ -40,7 +40,6 @@ class Main extends Controller
$this->setVar( 'logout', G::LoadTranslation( 'ID_LOGOUT' ) );
$this->setVar( 'workspace', defined( 'SYS_SYS' ) ? ucfirst( SYS_SYS ) : '' );
$this->setVar( 'user_avatar', 'users/users_ViewPhotoGrid?pUID=' . $_SESSION['USER_LOGGED'] . '&h=' . rand() );
$this->setVar( 'udate', G::getformatedDate( date( 'Y-m-d' ), 'M d, yyyy', SYS_LANG ) );
// license notification
$expireInLabel = '';

View File

@@ -157,3 +157,12 @@ if ($RBAC->userCanAccess("PM_SETUP") == 1) {
/*----------------------------------********---------------------------------*/
$G_TMP_MENU->AddIdRawOption("CASES_LIST_SETUP", "../cases/casesListSetup", G::LoadTranslation("ID_CUSTOM_CASES_LISTS"), "", "", "settings");
}
/*----------------------------------********---------------------------------*/
$oPluginRegistry = &PMPluginRegistry::getSingleton();
$oObject = $oPluginRegistry->getPlugin("actionsByEmail");
if (!(get_class($oObject) === "actionsByEmailPlugin") &&
$licensedFeatures->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
$G_TMP_MENU->AddIdRawOption('PM_ACTIONS_BY_EMAIL_LOGS', '../actionsByEmail/ActionByEmail.php', G::LoadTranslation("ID_ACTIONS_BY_EMAIL_LOG"), '', '', 'logs');
}
/*----------------------------------********---------------------------------*/

View File

@@ -363,6 +363,8 @@ class Ajax
}
$taskData = $task->getDelegatedTaskData($_SESSION['TASK'], $_SESSION['APPLICATION'], $_SESSION['INDEX']);
$taskData = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($taskData);
print (G::json_encode($taskData));
}
@@ -518,14 +520,37 @@ class Ajax
print G::json_encode( $response );
die();
}
G::LoadClass( 'tasks' );
$task = new Task();
$tasks = $task->load($_SESSION['TASK']);
$case = new Cases();
$result = new stdclass();
$result->data = $case->getUsersToReassign($_SESSION['TASK'], $_SESSION['USER_LOGGED'], $tasks['PRO_UID']);
print G::json_encode($result);
if(isset($_SESSION['TASK']) && $_SESSION['TASK'] != '-1'){
$taskUid = $_SESSION['TASK'];
} else {
$taskUid = $_SESSION['CURRENT_TASK'];
}
$search = $_POST['search'];
$pageSize = $_POST['pageSize'];
$sortField = (isset($_POST['sort']))? $_POST['sort'] : '';
$sortDir = (isset($_POST['dir']))? $_POST['dir'] : '';
$start = (isset($_POST['start']))? $_POST['start'] : 0;
$limit = (isset($_POST['limit']))? $_POST['limit'] : $pageSize;
$response = [];
try {
$case = new \ProcessMaker\BusinessModel\Cases();
$result = $case->getUsersToReassign($_SESSION['USER_LOGGED'], $taskUid, ['filter' => $search], $sortField, $sortDir, $start, $limit);
$response['status'] = 'OK';
$response['success'] = true;
$response['resultTotal'] = $result['total'];
$response['resultRoot'] = $result['data'];
} catch (Exception $e) {
$response['status'] = 'ERROR';
$response['message'] = $e->getMessage();
}
echo G::json_encode($response);
}
public function reassignCase()

View File

@@ -122,11 +122,15 @@ if ($actionAjax == 'messageHistoryGridList_JXP') {
$r->data = $aProcesses;
$r->totalCount = $totalCount;
if (!empty($aProcesses)) {
if (!isset($r->data[0])) {
$r->data[0] = array('APP_MSG_TYPE' => '');
}
$r->data[0]["APP_MSG_TYPE"] = (array_key_exists($r->data[0]["APP_MSG_TYPE"], $arrayToTranslation))? $arrayToTranslation[$r->data[0]["APP_MSG_TYPE"]] : $r->data[0]["APP_MSG_TYPE"];
$r->data[0]["APP_MSG_TYPE"] = (array_key_exists($r->data[0]["APP_MSG_TYPE"], $arrayToTranslation)) ?
$arrayToTranslation[$r->data[0]["APP_MSG_TYPE"]] :
$r->data[0]["APP_MSG_TYPE"];
}
echo G::json_encode( $r );
}

View File

@@ -217,14 +217,32 @@ if ($actionAjax == "processListExtJs") {
}
if ($actionAjax == "getUsersToReassign") {
$_SESSION['TASK'] = $_REQUEST['TAS_UID'];
$case = new Cases();
G::LoadClass( 'tasks' );
$task = new Task();
$tasks = $task->load($_SESSION['TASK']);
$result = new stdclass();
$result->data = $case->getUsersToReassign( $_SESSION['TASK'], $_SESSION['USER_LOGGED'], $tasks['PRO_UID'] );
print G::json_encode( $result );
$taskUid = $_POST['taskUid'];
$search = $_POST['search'];
$pageSize = $_POST['pageSize'];
$sortField = (isset($_POST['sort']))? $_POST['sort'] : '';
$sortDir = (isset($_POST['dir']))? $_POST['dir'] : '';
$start = (isset($_POST['start']))? $_POST['start'] : 0;
$limit = (isset($_POST['limit']))? $_POST['limit'] : $pageSize;
$response = [];
try {
$case = new \ProcessMaker\BusinessModel\Cases();
$result = $case->getUsersToReassign($_SESSION['USER_LOGGED'], $taskUid, ['filter' => $search], $sortField, $sortDir, $start, $limit);
$response['status'] = 'OK';
$response['success'] = true;
$response['resultTotal'] = $result['total'];
$response['resultRoot'] = $result['data'];
} catch (Exception $e) {
$response['status'] = 'ERROR';
$response['message'] = $e->getMessage();
}
echo G::json_encode($response);
}
if ($actionAjax == 'reassignCase') {

View File

@@ -274,7 +274,7 @@ function getProcess ()
function getAllCounters ()
{
$userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
$oAppCache = new AppCacheView();
$aTypes = Array ();
$aTypes['to_do'] = 'CASES_INBOX';
$aTypes['draft'] = 'CASES_DRAFT';
@@ -285,29 +285,9 @@ function getAllCounters ()
$aTypes['selfservice'] = 'CASES_SELFSERVICE';
//$aTypes['to_revise'] = 'CASES_TO_REVISE';
//$aTypes['to_reassign'] = 'CASES_TO_REASSIGN';
$solrEnabled = false;
if ((($solrConf = System::solrEnv()) !== false)) {
G::LoadClass( 'AppSolr' );
$ApplicationSolrIndex = new AppSolr( $solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance'] );
if ($ApplicationSolrIndex->isSolrEnabled() && $solrConf['solr_enabled'] == true) {
$solrEnabled = true;
}
}
if ($solrEnabled) {
$aCount = $ApplicationSolrIndex->getCasesCount( $userUid );
//get paused count
$aCountMissing = $oAppCache->getAllCounters( array ('completed','cancelled'), $userUid );
$aCount = array_merge( $aCount, $aCountMissing );
} else {
$aCount = $oAppCache->getAllCounters( array_keys( $aTypes ), $userUid );
}
$case = new \ProcessMaker\BusinessModel\Cases();
$aCount = $case->getListCounters($userUid, array_keys($aTypes));
$response = Array ();
$i = 0;

View File

@@ -5,6 +5,7 @@ BEGIN
DECLARE APP_NUMBER INT;
DECLARE APP_STATUS VARCHAR(32);
DECLARE APP_CREATE_DATE DATETIME;
DECLARE APP_UPDATE_DATE DATETIME;
DECLARE APP_TITLE VARCHAR(255);
DECLARE APP_PRO_TITLE VARCHAR(255);
DECLARE APP_TAS_TITLE VARCHAR(255);
@@ -17,6 +18,8 @@ BEGIN
SELECT APPLICATION.APP_NUMBER into @APP_NUMBER FROM APPLICATION WHERE APP_UID = NEW.APP_UID LIMIT 1;
SELECT APPLICATION.APP_STATUS into @APP_STATUS FROM APPLICATION WHERE APP_UID = NEW.APP_UID LIMIT 1;
SELECT APPLICATION.APP_CREATE_DATE into @APP_CREATE_DATE FROM APPLICATION WHERE APP_UID = NEW.APP_UID LIMIT 1;
SELECT APPLICATION.APP_UPDATE_DATE into @APP_UPDATE_DATE FROM APPLICATION WHERE APP_UID = NEW.APP_UID LIMIT 1;
SELECT CONTENT.CON_VALUE into @APP_TITLE FROM CONTENT WHERE NEW.APP_UID=CON_ID AND CON_CATEGORY='APP_TITLE' and CON_LANG = '{lang}' LIMIT 1;
IF ( @APP_TITLE IS NULL ) THEN
SET @APP_TITLE = '';
@@ -108,7 +111,7 @@ BEGIN
NEW.DEL_DELAYED,
@APP_CREATE_DATE,
NULL,
NOW(),
@APP_UPDATE_DATE,
NEW.APP_OVERDUE_PERCENTAGE,
NEW.DEL_LAST_INDEX
);

View File

@@ -5,6 +5,7 @@ BEGIN
DECLARE APP_NUMBER INT;
DECLARE APP_STATUS VARCHAR(32);
DECLARE APP_CREATE_DATE DATETIME;
DECLARE APP_UPDATE_DATE DATETIME;
DECLARE APP_TITLE VARCHAR(255);
DECLARE APP_PRO_TITLE VARCHAR(255);
DECLARE APP_TAS_TITLE VARCHAR(255);
@@ -17,6 +18,8 @@ BEGIN
SELECT APPLICATION.APP_NUMBER into @APP_NUMBER FROM APPLICATION WHERE APP_UID = NEW.APP_UID LIMIT 1;
SELECT APPLICATION.APP_STATUS into @APP_STATUS FROM APPLICATION WHERE APP_UID = NEW.APP_UID LIMIT 1;
SELECT APPLICATION.APP_CREATE_DATE into @APP_CREATE_DATE FROM APPLICATION WHERE APP_UID = NEW.APP_UID LIMIT 1;
SELECT APPLICATION.APP_UPDATE_DATE into @APP_UPDATE_DATE FROM APPLICATION WHERE APP_UID = NEW.APP_UID LIMIT 1;
SELECT CONTENT.CON_VALUE into @APP_TITLE FROM CONTENT WHERE NEW.APP_UID=CON_ID AND CON_CATEGORY='APP_TITLE' and CON_LANG = '{lang}' LIMIT 1;
IF ( @APP_TITLE IS NULL ) THEN
SET @APP_TITLE = '';
@@ -71,6 +74,7 @@ BEGIN
DEL_FINISHED = NEW.DEL_FINISHED,
DEL_DELAYED = NEW.DEL_DELAYED,
APP_FINISH_DATE = NULL,
APP_UPDATE_DATE = @APP_UPDATE_DATE,
APP_OVERDUE_PERCENTAGE = NEW.APP_OVERDUE_PERCENTAGE,
DEL_LAST_INDEX = NEW.DEL_LAST_INDEX
WHERE

View File

@@ -14,10 +14,11 @@ BEGIN
END IF;
IF(OLD.APP_DATA<>NEW.APP_DATA) THEN
UPDATE APP_CACHE_VIEW SET APP_UPDATE_DATE = NOW() WHERE APP_UID = NEW.APP_UID;
UPDATE APP_CACHE_VIEW SET APP_UPDATE_DATE = NEW.APP_UPDATE_DATE WHERE APP_UID = NEW.APP_UID;
END IF;
IF (NEW.APP_STATUS = 'COMPLETED') THEN
UPDATE APP_CACHE_VIEW SET APP_FINISH_DATE = NEW.APP_FINISH_DATE WHERE APP_UID = NEW.APP_UID;
UPDATE APP_CACHE_VIEW SET APP_UPDATE_DATE = NEW.APP_UPDATE_DATE WHERE APP_UID = NEW.APP_UID;
END IF;
END

View File

@@ -21,8 +21,7 @@
<label class="textBlue"><a href="../../uxs/home">{$switch_interface_label}</a> | </label>
{/if}
<a href="{$linklogout}" class="tableOption">{$logout}</a>&nbsp;&nbsp;<br/>
<label class="textBlack"><b>{$rolename}</b> {$workspace_label} <b><u>{$workspace}</u></b> &nbsp; &nbsp; <br/>
{$udate}</label>&nbsp; &nbsp;
<label class="textBlack"><b>{$rolename}</b> {$workspace_label} <b><u>{$workspace}</u></b> &nbsp; &nbsp;</label>&nbsp; &nbsp;
{else}
{if $tracker eq 1}
<a href="{$linklogout}" class="tableOption">{$logout}</a>&nbsp;&nbsp;

View File

@@ -31,8 +31,7 @@
<label class="textBlue"><a href="../../uxs/home">{$switch_interface_label}</a> | </label>
{/if}
<a href="{$linklogout}" class="tableOption">{$logout}</a>&nbsp;&nbsp;<br/>
<label class="textBlack"><b>{$rolename}</b> {$workspace_label} <b><u>{$workspace}</u></b><br />
{$udate}</label>&nbsp; &nbsp;
<label class="textBlack"><b>{$rolename}</b> {$workspace_label} <b><u>{$workspace}</u></b></label>&nbsp; &nbsp;
{else}
{if $tracker eq 1}
<a href="{$linklogout}" class="tableOption">{$logout}</a>&nbsp;&nbsp;

View File

@@ -18,8 +18,7 @@
{php}if ((int)$_SESSION['USER_LOGGED'] != 0) {{/php}
{$msgVer}<label class="textBlue">{$userfullname} <a href="../users/myInfo">{$user}</a> | </label>
<a href="{$linklogout}" class="tableOption">{$logout}</a>&nbsp;&nbsp;<br/>
<label class="textBlack"><b>{$rolename}</b> {$workspace_label} <b><u>{$workspace}</u></b> &nbsp; &nbsp; <br/>
{$udate}</label>&nbsp; &nbsp;
<label class="textBlack"><b>{$rolename}</b> {$workspace_label} <b><u>{$workspace}</u></b> &nbsp; &nbsp;</label>&nbsp; &nbsp;
{php}}{/php}
</small>
</div>

View File

@@ -434,11 +434,6 @@ class SkinEngine
G::LoadClass( "configuration" );
$conf = new Configurations();
$conf->getFormats();
if (defined('SYS_SYS')) {
$smarty->assign('udate', $conf->getSystemDate(date('Y-m-d H:i:s')));
} else {
$smarty->assign('udate', G::getformatedDate(date('Y-m-d'), 'M d, yyyy', SYS_LANG));
}
$name = $conf->userNameFormat(isset($_SESSION['USR_USERNAME']) ? $_SESSION['USR_USERNAME']: '', isset($_SESSION['USR_FULLNAME']) ? htmlentities($_SESSION['USR_FULLNAME'] , ENT_QUOTES, 'UTF-8'): '', isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '');
$smarty->assign('user',$name);
}
@@ -758,11 +753,6 @@ class SkinEngine
G::LoadClass( "configuration" );
$conf = new Configurations();
$conf->getFormats();
if ( defined('SYS_SYS')) {
$smarty->assign('udate', $conf->getSystemDate(\ProcessMaker\Util\DateTime::convertUtcToTimeZone(date('Y-m-d H:i:s'))));
} else {
$smarty->assign('udate', G::getformatedDate(\ProcessMaker\Util\DateTime::convertUtcToTimeZone(date('Y-m-d H:i:s')), 'M d, yyyy', SYS_LANG));
}
$name = $conf->userNameFormat(isset($_SESSION['USR_USERNAME']) ? $_SESSION['USR_USERNAME']: '', isset($_SESSION['USR_FULLNAME']) ? htmlentities($_SESSION['USR_FULLNAME'] , ENT_QUOTES, 'UTF-8'): '', isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '');
$smarty->assign('user',$name);
}

View File

@@ -21,8 +21,7 @@
<label class="textBlue"><a href="../../uxs/home">{$switch_interface_label}</a> | </label>
{/if}
<a href="{$linklogout}" class="tableOption">{$logout}</a>&nbsp;&nbsp;<br/>
<label class="textBlack"><b>{$rolename}</b> {$workspace_label} <b><u>{$workspace}</u></b> &nbsp; &nbsp; <br/>
{$udate}</label>&nbsp; &nbsp;
<label class="textBlack"><b>{$rolename}</b> {$workspace_label} <b><u>{$workspace}</u></b> &nbsp; &nbsp;</label>&nbsp; &nbsp;
{/if}
</small>
</div>

View File

@@ -21,8 +21,7 @@
<label class="textBlue"><a href="../home">{$switch_interface_label}</a> | </label>
{/if}
<a href="{$linklogout}" class="tableOption">{$logout}</a>&nbsp;&nbsp;<br/>
<label class="textBlack"><b>{$rolename}</b> {$workspace_label} <b><u>{$workspace}</u></b> &nbsp; &nbsp; <br/>
{$udate}</label>&nbsp; &nbsp;
<label class="textBlack"><b>{$rolename}</b> {$workspace_label} <b><u>{$workspace}</u></b> &nbsp; &nbsp;</label>&nbsp; &nbsp;
{/if}
</small>
</div>

View File

@@ -75,6 +75,50 @@ class Cases
}
}
/**
* Get list counters
*
* @param string $userUid Unique id of User
* @param array $arrayType Type lists
*
* @return array Return the list counters
*/
public function getListCounters($userUid, array $arrayType)
{
try {
$solrEnabled = false;
$solrConf = \System::solrEnv();
if ($solrConf !== false) {
$ApplicationSolrIndex = new \AppSolr(
$solrConf['solr_enabled'],
$solrConf['solr_host'],
$solrConf['solr_instance']
);
if ($ApplicationSolrIndex->isSolrEnabled() && $solrConf['solr_enabled'] == true) {
$solrEnabled = true;
}
}
$appCacheView = new \AppCacheView();
if ($solrEnabled) {
$arrayListCounter = array_merge(
$ApplicationSolrIndex->getCasesCount($userUid),
$appCacheView->getAllCounters(['completed', 'cancelled'], $userUid)
);
} else {
$arrayListCounter = $appCacheView->getAllCounters($arrayType, $userUid);
}
//Return
return $arrayListCounter;
} catch (\Exception $e) {
throw $e;
}
}
/**
* Get list for Cases
*
@@ -1117,12 +1161,15 @@ class Cases
$aAux = $oAppDocument->load($aRow['APP_DOC_UID'], $aRow['DOC_VERSION']);
$lastVersion = $oAppDocument->getLastAppDocVersion($aRow['APP_DOC_UID'], $sApplicationUID);
if ($aAux['USR_UID'] !== "-1") {
try {
$aAux1 = $oUser->load($aAux['USR_UID']);
$sUser = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $aAux1["USR_USERNAME"], $aAux1["USR_FIRSTNAME"], $aAux1["USR_LASTNAME"]);
} catch (Exception $oException) {
//$sUser = '(USER DELETED)';
$sUser = '***';
}
} else {
$sUser = '***';
}
$aFields = array(
@@ -2420,4 +2467,196 @@ class Cases
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
/**
* Get Users to reassign
*
* @param string $userUid Unique id of User (User logged)
* @param string $taskUid Unique id of Task
* @param array $arrayFilterData Data of the filters
* @param string $sortField Field name to sort
* @param string $sortDir Direction of sorting (ASC, DESC)
* @param int $start Start
* @param int $limit Limit
*
* @return array Return Users to reassign
*/
public function getUsersToReassign($userUid, $taskUid, $arrayFilterData = null, $sortField = null, $sortDir = null, $start = null, $limit = null)
{
try {
$arrayUser = [];
$numRecTotal = 0;
//Set variables
$task = \TaskPeer::retrieveByPK($taskUid);
$processUid = $task->getProUid();
$user = new \ProcessMaker\BusinessModel\User();
$task = new \Tasks();
$group = new \Groups();
//Set variables
$filterName = 'filter';
if (!is_null($arrayFilterData) && is_array($arrayFilterData) && isset($arrayFilterData['filter'])) {
$arrayAux = [
'' => 'filter',
'LEFT' => 'lfilter',
'RIGHT' => 'rfilter'
];
$filterName = $arrayAux[(isset($arrayFilterData['filterOption']))? $arrayFilterData['filterOption'] : ''];
}
//Get data
if (!is_null($limit) && $limit . '' == '0') {
//Return
return [
'total' => $numRecTotal,
'start' => (int)((!is_null($start))? $start : 0),
'limit' => (int)((!is_null($limit))? $limit : 0),
$filterName => (!is_null($arrayFilterData) && is_array($arrayFilterData) && isset($arrayFilterData['filter']))? $arrayFilterData['filter'] : '',
'data' => $arrayUser
];
}
//Set variables
$processSupervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$arrayResult = $processSupervisor->getProcessSupervisors($processUid, 'ASSIGNED', null, null, null, 'group');
$arrayGroupUid = array_merge(
array_map(function ($value) { return $value['GRP_UID']; }, $task->getGroupsOfTask($taskUid, 1)), //Groups
array_map(function ($value) { return $value['GRP_UID']; }, $task->getGroupsOfTask($taskUid, 2)), //AdHoc Groups
array_map(function ($value) { return $value['grp_uid']; }, $arrayResult['data']) //ProcessSupervisor Groups
);
$sqlTaskUser = '
SELECT ' . \TaskUserPeer::USR_UID . '
FROM ' . \TaskUserPeer::TABLE_NAME . '
WHERE ' . \TaskUserPeer::TAS_UID . ' = \'%s\' AND
' . \TaskUserPeer::TU_TYPE . ' IN (1, 2) AND
' . \TaskUserPeer::TU_RELATION . ' = 1
';
$sqlGroupUser = '
SELECT ' . \GroupUserPeer::USR_UID . '
FROM ' . \GroupUserPeer::TABLE_NAME . '
WHERE ' . \GroupUserPeer::GRP_UID . ' IN (%s)
';
$sqlProcessSupervisor = '
SELECT ' . \ProcessUserPeer::USR_UID . '
FROM ' . \ProcessUserPeer::TABLE_NAME . '
WHERE ' . \ProcessUserPeer::PRO_UID . ' = \'%s\' AND
' . \ProcessUserPeer::PU_TYPE . ' = \'%s\'
';
$sqlUserToReassign = '(' . sprintf($sqlTaskUser, $taskUid) . ')';
if (!empty($arrayGroupUid)) {
$sqlUserToReassign .= ' UNION (' . sprintf($sqlGroupUser, '\'' . implode('\', \'', $arrayGroupUid) . '\'') . ')';
}
$sqlUserToReassign .= ' UNION (' . sprintf($sqlProcessSupervisor, $processUid, 'SUPERVISOR') . ')';
//Query
$criteria = new \Criteria('workflow');
$criteria->addSelectColumn(\UsersPeer::USR_UID);
$criteria->addSelectColumn(\UsersPeer::USR_USERNAME);
$criteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
$criteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
$criteria->addAlias('USER_TO_REASSIGN', '(' . $sqlUserToReassign . ')');
$criteria->addJoin(\UsersPeer::USR_UID, 'USER_TO_REASSIGN.USR_UID', \Criteria::INNER_JOIN);
if (!is_null($arrayFilterData) && is_array($arrayFilterData) && isset($arrayFilterData['filter']) && trim($arrayFilterData['filter']) != '') {
$arraySearch = [
'' => '%' . $arrayFilterData['filter'] . '%',
'LEFT' => $arrayFilterData['filter'] . '%',
'RIGHT' => '%' . $arrayFilterData['filter']
];
$search = $arraySearch[(isset($arrayFilterData['filterOption']))? $arrayFilterData['filterOption'] : ''];
$criteria->add(
$criteria->getNewCriterion(\UsersPeer::USR_USERNAME, $search, \Criteria::LIKE)->addOr(
$criteria->getNewCriterion(\UsersPeer::USR_FIRSTNAME, $search, \Criteria::LIKE))->addOr(
$criteria->getNewCriterion(\UsersPeer::USR_LASTNAME, $search, \Criteria::LIKE))
);
}
$criteria->add(\UsersPeer::USR_STATUS, 'ACTIVE', \Criteria::EQUAL);
if (!$user->checkPermission($userUid, 'PM_SUPERVISOR')) {
$criteria->add(\UsersPeer::USR_UID, $userUid, \Criteria::NOT_EQUAL);
}
//Number records total
$criteriaCount = clone $criteria;
$criteriaCount->clearSelectColumns();
$criteriaCount->addSelectColumn('COUNT(' . \UsersPeer::USR_UID . ') AS NUM_REC');
$rsCriteriaCount = \UsersPeer::doSelectRS($criteriaCount);
$rsCriteriaCount->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$result = $rsCriteriaCount->next();
$row = $rsCriteriaCount->getRow();
$numRecTotal = (int)($row['NUM_REC']);
//Query
if (!is_null($sortField) && trim($sortField) != '') {
$sortField = strtoupper($sortField);
if (in_array(\UsersPeer::TABLE_NAME . '.' . $sortField, $criteria->getSelectColumns())) {
$sortField = \UsersPeer::TABLE_NAME . '.' . $sortField;
} else {
$sortField = \UsersPeer::USR_FIRSTNAME;
}
} else {
$sortField = \UsersPeer::USR_FIRSTNAME;
}
if (!is_null($sortDir) && trim($sortDir) != '' && strtoupper($sortDir) == 'DESC') {
$criteria->addDescendingOrderByColumn($sortField);
} else {
$criteria->addAscendingOrderByColumn($sortField);
}
if (!is_null($start)) {
$criteria->setOffset((int)($start));
}
if (!is_null($limit)) {
$criteria->setLimit((int)($limit));
}
$rsCriteria = \UsersPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$arrayUser[] = $row;
}
//Return
return [
'total' => $numRecTotal,
'start' => (int)((!is_null($start))? $start : 0),
'limit' => (int)((!is_null($limit))? $limit : 0),
$filterName => (!is_null($arrayFilterData) && is_array($arrayFilterData) && isset($arrayFilterData['filter']))? $arrayFilterData['filter'] : '',
'data' => $arrayUser
];
} catch (\Exception $e) {
throw $e;
}
}
}

View File

@@ -3,6 +3,26 @@ namespace ProcessMaker\BusinessModel\Cases;
class InputDocument
{
/**
* Verify exists app_doc_uid in table APP_DOCUMENT
*
* @param string $applicationUid
*
* return void Throw exception
*/
private function throwExceptionIfNotExistsAppDocument($appDocumentUid)
{
try {
$appDocument = \AppDocumentPeer::retrieveByPK($appDocumentUid, 1);
if (is_null($appDocument)) {
throw new \Exception(\G::LoadTranslation("ID_CASES_INPUT_DOES_NOT_EXIST", array($appDocumentUid)));
}
} catch (\Exception $e) {
throw $e;
}
}
/**
* Check if the user has permissions
*
@@ -47,6 +67,9 @@ class InputDocument
throw new \Exception(\G::LoadTranslation("ID_USER_NOT_HAVE_PERMISSION_DELETE_INPUT_DOCUMENT", array($userUid)));
}
//verfiry exists $appDocumentUid
$this->throwExceptionIfNotExistsAppDocument($appDocumentUid);
//Verify data permission
$flagPermission = 0;
@@ -351,13 +374,16 @@ class InputDocument
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$sUser = '***';
if ($row["USR_UID"] !== '-1') {
$arrayUserData = $user->load($row["USR_UID"]);
$sUser = $configuraction->usersNameFormatBySetParameters($confEnvSetting["format"], $arrayUserData["USR_USERNAME"], $arrayUserData["USR_FIRSTNAME"], $arrayUserData["USR_LASTNAME"]);
}
$arrayAppDocument = $appDocument->load($row["APP_DOC_UID"], $row["DOC_VERSION"]);
$row["APP_DOC_FILENAME"] = $arrayAppDocument["APP_DOC_FILENAME"];
$row["APP_DOC_CREATE_USER"] = $configuraction->usersNameFormatBySetParameters($confEnvSetting["format"], $arrayUserData["USR_USERNAME"], $arrayUserData["USR_FIRSTNAME"], $arrayUserData["USR_LASTNAME"]);
$row["APP_DOC_CREATE_USER"] = $sUser;
$row["APP_DOC_LINK"] = "cases/cases_ShowDocument?a=" . $row["APP_DOC_UID"] . "&v=" . $row["DOC_VERSION"];
$arrayInputDocument[] = $this->getAppDocumentDataFromRecord($row);

View File

@@ -3,6 +3,26 @@ namespace ProcessMaker\BusinessModel\Cases;
class OutputDocument
{
/**
* Verify exists app_doc_uid in table APP_DOCUMENT when is output
*
* @param string $applicationUid
*
* return void Throw exception output not exists
*/
private function throwExceptionIfNotExistsAppDocument($appDocumentUid)
{
try {
$appDocument = \AppDocumentPeer::retrieveByPK($appDocumentUid, 1);
if (is_null($appDocument)) {
throw new \Exception(\G::LoadTranslation("ID_CASES_OUTPUT_DOES_NOT_EXIST", array($appDocumentUid)));
}
} catch (\Exception $e) {
throw $e;
}
}
/**
* Check if the user has permissions
*
@@ -26,6 +46,9 @@ class OutputDocument
$flagInbox = 0;
}
//Verfiry exists $appDocumentUid
$this->throwExceptionIfNotExistsAppDocument($appDocumentUid);
//Verify data permission
$flagPermission = 0;

View File

@@ -50,6 +50,27 @@ class Department
}
}
/**
* Verify if the User is not in a Department
*
* @param string $departmentUid
* @param string $userUid
*
* return void Throw exception user not exists
*/
private function throwExceptionUserNotExistsInDepartment($departmentUid, $userUid)
{
try {
$user = \UsersPeer::retrieveByPK($userUid);
if (is_null($user) || $user->getDepUid() != $departmentUid) {
throw new \Exception(\G::LoadTranslation('ID_USER_NOT_EXIST_DEPARTMENT', [$userUid]));
}
} catch (\Exception $e) {
throw $e;
}
}
/**
* Verify if exists the title of a Department
*
@@ -253,6 +274,8 @@ class Department
$dep_uid = Validator::depUid($dep_uid);
$usr_uid = Validator::usrUid($usr_uid);
$this->throwExceptionUserNotExistsInDepartment($dep_uid, $usr_uid);
$dep = new \Department();
$dep->load( $dep_uid );
$manager = $dep->getDepManager();

View File

@@ -22,6 +22,18 @@ class Light
{
$response = null;
try {
// getting bpmn projects
$c = new Criteria('workflow');
$c->addSelectColumn(\BpmnProjectPeer::PRJ_UID);
$ds = \ProcessPeer::doSelectRS($c, \Propel::getDbConnection('workflow_ro'));
$ds->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$bpmnProjects = array();
while ($ds->next()) {
$row = $ds->getRow();
$bpmnProjects[] = $row['PRJ_UID'];
}
$oProcess = new \Process();
$oCase = new \Cases();
@@ -65,7 +77,7 @@ class Light
$tempTreeChildren = array ();
foreach ($processList[$key] as $keyChild => $processInfoChild) {
$webEntryEventStart = $webEntryEvent->getWebEntryEvents($processInfoChild['pro_uid']);
if(empty($webEntryEventStart)){
if (empty($webEntryEventStart) && in_array($processInfoChild['pro_uid'], $bpmnProjects)) {
$tempTreeChild['text'] = $keyChild; //ellipsis ( $keyChild, 50 );
$tempTreeChild['processId'] = $processInfoChild['pro_uid'];
$tempTreeChild['taskId'] = $processInfoChild['uid'];

View File

@@ -152,11 +152,13 @@ class NotificationDevice
{
try {
$response = array();
$typeList = 'todo';
foreach ($aTasks as $aTask) {
$arrayTaskUser = array();
switch ($aTask["TAS_ASSIGN_TYPE"]) {
case "SELF_SERVICE":
$arrayTaskUser = $this->getTaskUserSelfService($aTask["TAS_UID"], $appFields);
$typeList = 'unassigned';
break;
default:
if (isset($aTask["USR_UID"]) && !empty($aTask["USR_UID"])) {
@@ -181,7 +183,7 @@ class NotificationDevice
'caseId' => $appFields['APP_UID'],
'caseTitle' => $appFields['APP_TITLE'],
'delIndex' => $delIndex,
'typeList' => 'todo'
'typeList' => $typeList
);
if ($userIds) {

View File

@@ -2,7 +2,6 @@
namespace ProcessMaker\BusinessModel;
use \G;
use Luracast\Restler\User;
class ProcessSupervisor
{

View File

@@ -231,6 +231,9 @@ class Variable
$this->throwExceptionIfNotExistsVariable($variableUid);
//Verify variable
$this->throwExceptionIfVariableIsAssociatedAditionalTable($variableUid);
$variable = $this->getVariable($processUid, $variableUid);
\G::LoadClass('pmDynaform');
$pmDynaform = new \pmDynaform();
@@ -556,13 +559,16 @@ class Variable
\G::LoadClass('pmDynaform');
$pmDynaform = new \pmDynaform();
$field = $pmDynaform->searchField($arrayVariable["dyn_uid"], $arrayVariable["field_id"]);
$variableDbConnectionUid = $field !== null ? $field->dbConnection : "";
$dbConnection = "workflow";
if ($field !== null && !empty($field->dbConnection)) {
$dbConnection = $field->dbConnection;
}
$variableSql = $field !== null ? $field->sql : "";
//Get data
$_SESSION["PROCESS"] = $processUid;
$cnn = \Propel::getConnection(($variableDbConnectionUid . "" != "")? $variableDbConnectionUid : "workflow");
$cnn = \Propel::getConnection($dbConnection);
$stmt = $cnn->createStatement();
$replaceFields = G::replaceDataField($variableSql, $arrayVariable);
@@ -605,6 +611,40 @@ class Variable
}
}
/**
* Check if the variable is associated to Report Table
*
* @param string $variableUid Unique id of variable
*
* @return void Throw exception
*/
public function throwExceptionIfVariableIsAssociatedAditionalTable($variableUid)
{
try {
$criteria = new \Criteria('workflow');
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_UID);
$criteria->addJoin(\ProcessVariablesPeer::PRJ_UID, \AdditionalTablesPeer::PRO_UID, \Criteria::INNER_JOIN);
$arrayCondition = [];
$arrayCondition[] = array(\AdditionalTablesPeer::ADD_TAB_UID, \FieldsPeer::ADD_TAB_UID, \Criteria::EQUAL);
$arrayCondition[] = array(\ProcessVariablesPeer::VAR_NAME, \FieldsPeer::FLD_NAME, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::INNER_JOIN);
$criteria->add(\ProcessVariablesPeer::VAR_UID, $variableUid, \Criteria::EQUAL);
$rsCriteria = \ProcessVariablesPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if ($rsCriteria->next()) {
throw new \Exception(\G::LoadTranslation('ID_VARIABLE_ASSOCIATED_WITH_REPORT_TABLE', array($variableUid)));
}
} catch (\Exception $e) {
throw $e;
}
}
/**
* Verify if the variable is being used in a Dynaform
*
@@ -677,13 +717,16 @@ class Variable
\G::LoadClass('pmDynaform');
$pmDynaform = new \pmDynaform();
$field = $pmDynaform->searchField($arrayVariable["dyn_uid"], $variableName);
$variableDbConnectionUid = $field !== null ? $field->dbConnection : "";
$dbConnection = "workflow";
if ($field !== null && !empty($field->dbConnection)) {
$dbConnection = $field->dbConnection;
}
$variableSql = $field !== null ? $field->sql : "";
//Get data
$_SESSION["PROCESS"] = $processUid;
$cnn = \Propel::getConnection(($variableDbConnectionUid . "" != "") ? $variableDbConnectionUid : "workflow");
$cnn = \Propel::getConnection($dbConnection);
$stmt = $cnn->createStatement();
$replaceFields = G::replaceDataField($variableSql, $arrayVariable);
@@ -702,7 +745,7 @@ class Variable
}
$parser = new \PHPSQLParser($replaceFields);
$filter = str_replace("'", "''", $filter);
$replaceFields = $this->queryModified($parser->parsed, $filter, "*searchtype*", $start, $limit);
$replaceFields = $this->queryModified($parser->parsed, $filter, "*searchtype*", $start, $limit, $dbConnection);
$rs = $stmt->executeQuery($replaceFields, \ResultSet::FETCHMODE_NUM);
while ($rs->next()) {
@@ -721,7 +764,7 @@ class Variable
}
}
public function queryModified($sqlParsed, $inputSel = "", $searchType, $start, $limit)
public function queryModified($sqlParsed, $inputSel = "", $searchType = "*searchtype*", $start = 0, $limit = "", $dbConnection = "workflow")
{
if (!empty($sqlParsed['SELECT'])) {
$sqlSelectOptions = (isset($sqlParsed["OPTIONS"]) && count($sqlParsed["OPTIONS"]) > 0) ? implode(" ", $sqlParsed["OPTIONS"]) : null;
@@ -845,6 +888,26 @@ class Variable
$sqlLimit = " LIMIT " . $sqlParsed['LIMIT']['start'] . ", " . $sqlParsed['LIMIT']['end'];
}
//get database provider
$a = new \Criteria("workflow");
$a->addSelectColumn(\DbSourcePeer::DBS_TYPE);
$a->add(\DbSourcePeer::DBS_UID, $dbConnection, \Criteria::EQUAL);
$ds = \DbSourcePeer::doSelectRS($a);
$ds->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$ds->next();
$row = $ds->getRow();
if (isset($row["DBS_TYPE"])) {
if ($row["DBS_TYPE"] === "pgsql") {
$sqlLimit = $this->limitPgsql($start, $limit);
}
if ($row["DBS_TYPE"] === "mssql") {
return $this->limitMssqlOracle($sqlSelect, $sqlFrom, $sqlWhere, $sqlGroupBy, $sqlHaving, $sqlOrderBy, $start, $limit, true);
}
if ($row["DBS_TYPE"] === "oracle") {
return $this->limitMssqlOracle($sqlSelect, $sqlFrom, $sqlWhere, $sqlGroupBy, $sqlHaving, $sqlOrderBy, $start, $limit, false);
}
}
return $sqlSelect . $sqlFrom . $sqlWhere . $sqlGroupBy . $sqlHaving . $sqlOrderBy . $sqlLimit;
}
if (!empty($sqlParsed['CALL'])) {
@@ -873,6 +936,36 @@ class Variable
}
}
public function limitPgsql($start = 0, $limit = "")
{
$sqlLimit = "";
if ($start >= 0) {
$sqlLimit = " OFFSET " . $start;
}
if ($limit !== "") {
$sqlLimit = $sqlLimit . " LIMIT " . $limit;
}
return $sqlLimit;
}
public function limitMssqlOracle($sqlSelect = "", $sqlFrom = "", $sqlWhere = "", $sqlGroupBy = "", $sqlHaving = "", $sqlOrderBy = "", $start = 0, $limit = "", $isMssql = true)
{
$sqlLimit = "";
if ($start >= 0) {
$sqlLimit = "WHERE rn >= " . $start;
}
if ($start >= 0 && $limit != "") {
$sqlLimit = "WHERE rn BETWEEN " . $start . " AND " . $limit;
}
$sql = ""
. "SELECT * FROM ("
. " " . $sqlSelect . ", ROW_NUMBER() OVER( " . $sqlOrderBy . " desc )-1 " . ($isMssql ? " AS " : "") . " rn "
. " " . $sqlFrom . $sqlWhere . $sqlGroupBy . $sqlHaving
. ")" . ($isMssql ? " AS A " : "")
. $sqlLimit;
return $sql;
}
public function getVariableTypeByName($processUid, $variableName)
{
try {

View File

@@ -114,20 +114,19 @@ class Department extends Api
}
/**
* @url PUT /:dep_uid/unassign-user/:usr_uid
* @url DELETE /:dep_uid/unassign-user/:usr_uid
*
* @param string $dep_uid {@min 1}{@max 32}
* @param string $usr_uid {@min 1}{@max 32}
*
* @return array
* @status 200
*
*/
public function doPutUnassignUser($dep_uid, $usr_uid)
public function doDeleteUnassignUser($dep_uid, $usr_uid)
{
try {
$oDepartment = new \ProcessMaker\BusinessModel\Department();
$response = $oDepartment->unassignUser($dep_uid, $usr_uid);
return $response;
$oDepartment->unassignUser($dep_uid, $usr_uid);
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}

View File

@@ -39,9 +39,25 @@ class Light extends Api
{
try {
$userId = $this->getUserId();
$lists = new \ProcessMaker\BusinessModel\Lists();
$response = $lists->getCounters($userId);
$result = $this->parserCountersCases($response);
/*----------------------------------********---------------------------------*/
if (true) {
//In enterprise version this block of code should always be executed
//In community version this block of code is deleted and is executed the other
$list = new \ProcessMaker\BusinessModel\Lists();
$arrayListCounter = $list->getCounters($userId);
} else {
/*----------------------------------********---------------------------------*/
$case = new \ProcessMaker\BusinessModel\Cases();
$arrayListCounter = $case->getListCounters(
$userId,
['to_do', 'draft', 'sent', 'selfservice', 'paused', 'completed', 'cancelled']
);
/*----------------------------------********---------------------------------*/
}
/*----------------------------------********---------------------------------*/
$result = $this->parserCountersCases($arrayListCounter);
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
@@ -58,12 +74,23 @@ class Light extends Api
"CASES_PAUSED" => "paused",
"CASES_COMPLETED" => "completed",
"CASES_SELFSERVICE" => "unassigned",
'to_do' => 'toDo',
'draft' => 'draft',
'cancelled' => 'cancelled',
'sent' => 'participated',
'paused' => 'paused',
'completed' => 'completed',
'selfservice' => 'unassigned'
);
$response = array();
foreach ($data as $counterList) {
foreach ($data as $key => $counterList) {
if(isset($structure[$counterList['item']])){
$name = $structure[$counterList['item']];
$response[$name] = $counterList['count'];
} else {
if (isset($structure[$key])) {
$response[$structure[$key]] = $counterList;
}
}
}
return $response;
@@ -105,7 +132,6 @@ class Light extends Api
$filter = '',
$date_from = '',
$date_to = '',
$action = '',
$newestthan = '',
$oldestthan =''
) {
@@ -123,14 +149,26 @@ class Light extends Api
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
$dataList['dateTo'] = $date_to;
$dataList['action'] = $action;
$dataList['newestthan'] = $newestthan;
$dataList['oldestthan'] = $oldestthan;
Validator::throwExceptionIfDataNotMetIso8601Format($dataList, $this->arrayFieldIso8601);
$dataList = DateTime::convertDataToUtc($dataList, $this->arrayFieldIso8601);
$lists = new \ProcessMaker\BusinessModel\Lists();
$response = $lists->getList('inbox', $dataList);
/*----------------------------------********---------------------------------*/
if (true) {
//In enterprise version this block of code should always be executed
//In community version this block of code is deleted and is executed the other
$list = new \ProcessMaker\BusinessModel\Lists();
$response = $list->getList('inbox', $dataList);
} else {
/*----------------------------------********---------------------------------*/
$case = new \ProcessMaker\BusinessModel\Cases();
$response = $case->getList($dataList);
/*----------------------------------********---------------------------------*/
}
/*----------------------------------********---------------------------------*/
if ($newestthan != '') {
$response['data'] = array_reverse($response['data']);
}
@@ -209,8 +247,21 @@ class Light extends Api
Validator::throwExceptionIfDataNotMetIso8601Format($dataList, $this->arrayFieldIso8601);
$dataList = DateTime::convertDataToUtc($dataList, $this->arrayFieldIso8601);
$oCases = new \ProcessMaker\BusinessModel\Lists();
$response = $oCases->getList('inbox', $dataList);
/*----------------------------------********---------------------------------*/
if (true) {
//In enterprise version this block of code should always be executed
//In community version this block of code is deleted and is executed the other
$list = new \ProcessMaker\BusinessModel\Lists();
$response = $list->getList('inbox', $dataList);
} else {
/*----------------------------------********---------------------------------*/
$case = new \ProcessMaker\BusinessModel\Cases();
$response = $case->getList($dataList);
/*----------------------------------********---------------------------------*/
}
/*----------------------------------********---------------------------------*/
if ($newestthan != '') {
$response['data'] = array_reverse($response['data']);
}
@@ -279,6 +330,7 @@ class Light extends Api
) {
try {
$dataList['userId'] = $this->getUserId();
$dataList['action'] = 'sent';
$dataList['paged'] = $paged;
$dataList['count'] = $count;
@@ -298,8 +350,21 @@ class Light extends Api
Validator::throwExceptionIfDataNotMetIso8601Format($dataList, $this->arrayFieldIso8601);
$dataList = DateTime::convertDataToUtc($dataList, $this->arrayFieldIso8601);
$oCases = new \ProcessMaker\BusinessModel\Lists();
$response = $oCases->getList('participated_last', $dataList);
/*----------------------------------********---------------------------------*/
if (true) {
//In enterprise version this block of code should always be executed
//In community version this block of code is deleted and is executed the other
$list = new \ProcessMaker\BusinessModel\Lists();
$response = $list->getList('participated_last', $dataList);
} else {
/*----------------------------------********---------------------------------*/
$case = new \ProcessMaker\BusinessModel\Cases();
$response = $case->getList($dataList);
/*----------------------------------********---------------------------------*/
}
/*----------------------------------********---------------------------------*/
if ($newestthan != '') {
$response['data'] = array_reverse($response['data']);
}
@@ -380,8 +445,21 @@ class Light extends Api
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
$dataList['dateTo'] = $date_to;
$lists = new \ProcessMaker\BusinessModel\Lists();
$response = $lists->getList('paused', $dataList);
/*----------------------------------********---------------------------------*/
if (true) {
//In enterprise version this block of code should always be executed
//In community version this block of code is deleted and is executed the other
$list = new \ProcessMaker\BusinessModel\Lists();
$response = $list->getList('paused', $dataList);
} else {
/*----------------------------------********---------------------------------*/
$case = new \ProcessMaker\BusinessModel\Cases();
$response = $case->getList($dataList);
/*----------------------------------********---------------------------------*/
}
/*----------------------------------********---------------------------------*/
$result = $this->parserDataParticipated($response['data']);
return DateTime::convertUtcToIso8601($result, $this->arrayFieldIso8601);
} catch (\Exception $e) {
@@ -511,13 +589,27 @@ class Light extends Api
if (is_array($d)) {
$newData = array();
foreach ($d as $field => $value) {
if (array_key_exists($field, $structure)) {
$newName = $structure[$field];
if (
preg_match(
'/\|(' . $field . ')\|/i',
'|' . implode('|', array_keys($structure)) . '|',
$arrayMatch
) &&
!is_array($structure[$arrayMatch[1]])
) {
$newName = $structure[$arrayMatch[1]];
$newData[$newName] = is_null($value) ? "":$value;
} else {
foreach ($structure as $name => $str) {
if (is_array($str) && array_key_exists($field, $str)) {
$newName = $str[$field];
if (is_array($str) &&
preg_match(
'/\|(' . $field . ')\|/i',
'|' . implode('|', array_keys($str)) . '|',
$arrayMatch
) &&
!is_array($str[$arrayMatch[1]])
) {
$newName = $str[$arrayMatch[1]];
$newData[$name][$newName] = is_null($value) ? "":$value;
}
}
@@ -526,13 +618,27 @@ class Light extends Api
if (count($newData) > 0)
$response[] = $newData;
} else {
if (array_key_exists($field, $structure)) {
$newName = $structure[$field];
if (
preg_match(
'/\|(' . $field . ')\|/i',
'|' . implode('|', array_keys($structure)) . '|',
$arrayMatch
) &&
!is_array($structure[$arrayMatch[1]])
) {
$newName = $structure[$arrayMatch[1]];
$response[$newName] = is_null($d) ? "":$d;
} else {
foreach ($structure as $name => $str) {
if (is_array($str) && array_key_exists($field, $str)) {
$newName = $str[$field];
if (is_array($str) &&
preg_match(
'/\|(' . $field . ')\|/i',
'|' . implode('|', array_keys($str)) .'|',
$arrayMatch
) &&
!is_array($str[$arrayMatch[1]])
) {
$newName = $str[$arrayMatch[1]];
$response[$name][$newName] = is_null($d) ? "":$d;
}
}

View File

@@ -118,7 +118,9 @@ class TimerEvent extends Api
public function doPutTimerEvent($prj_uid, $tmrevn_uid, array $request_data)
{
try {
$arrayData = $this->timerEvent->update($tmrevn_uid, $request_data);
\ProcessMaker\BusinessModel\Validator::throwExceptionIfDataNotMetIso8601Format($request_data, $this->arrayFieldIso8601);
$arrayData = $this->timerEvent->update($tmrevn_uid, \ProcessMaker\Util\DateTime::convertDataToUtc($request_data, $this->arrayFieldIso8601));
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}

View File

@@ -65,7 +65,8 @@ class System extends Api
try {
$enabledFeatures = array();
/*----------------------------------********---------------------------------*/
$keys = array ('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=');
$keys = array ('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=',
'oq3S29xemxEZXJpZEIzN01qenJUaStSekY4cTdJVm5vbWtVM0d4S2lJSS9qUT0=');
foreach ($keys as $key) {
if (\PMLicensedFeatures
::getSingleton()

View File

@@ -417,7 +417,8 @@ var ActionTabFrameGlobal = '';
// cls : 'grid_with_checkbox',
columnLines: true,
viewConfig: {
forceFit:true
forceFit:true,
emptyText: (_('ID_NO_RECORDS_FOUND'))
},
cm: new Ext.grid.ColumnModel({
defaults: {

View File

@@ -1460,7 +1460,8 @@ Ext.onReady ( function() {
var APP_UID = optionMenuReassignGlobal.APP_UID;
var DEL_INDEX = optionMenuReassignGlobal.DEL_INDEX;
var rowSelected = Ext.getCmp('reassignGrid').getSelectionModel().getSelected();
var rowSelected = Ext.getCmp("grdpnlUsersToReassign").getSelectionModel().getSelected();
if( rowSelected ) {
PMExt.confirm(_('ID_CONFIRM'), _('ID_REASSIGN_CONFIRM'), function(){
var loadMask = new Ext.LoadMask(winReassignInCasesList.getEl(), {msg: _('ID_PROCESSING')});
@@ -1500,6 +1501,8 @@ Ext.onReady ( function() {
//optionMenuPause.setMinValue('2010-11-04');
var loadMaskUsersToReassign = new Ext.LoadMask(Ext.getBody(), {msg: _("ID_LOADING_GRID")});
var optionMenuReassignGlobal = {};
optionMenuReassignGlobal.APP_UID = "";
optionMenuReassignGlobal.DEL_INDEX = "";
@@ -1548,83 +1551,156 @@ Ext.onReady ( function() {
optionMenuReassignGlobal.APP_UID = APP_UID;
optionMenuReassignGlobal.DEL_INDEX = DEL_INDEX;
if( rowSelected ){
var store = new Ext.data.Store( {
autoLoad: true,
//Variables
var pageSizeUsersToReassign = 10;
//Stores
var storeUsersToReassign = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'casesList_Ajax?actionAjax=getUsersToReassign&TAS_UID='+TAS_UID
url: "casesList_Ajax",
method: "POST"
}),
reader: new Ext.data.JsonReader({
root: 'data',
root: "resultRoot",
totalProperty: "resultTotal",
fields: [
{name : 'USR_UID'},
{name : 'USR_USERNAME'},
{name : 'USR_FIRSTNAME'},
{name : 'USR_LASTNAME'}
{name : "USR_UID"},
{name : "USR_USERNAME"},
{name : "USR_FIRSTNAME"},
{name : "USR_LASTNAME"}
]
})
}),
remoteSort: true,
listeners: {
beforeload: function (store)
{
winReassignInCasesList.setDisabled(true);
loadMaskUsersToReassign.show();
this.baseParams = {
actionAjax: "getUsersToReassign",
taskUid: TAS_UID,
search: Ext.getCmp("txtSearchUsersToReassign").getValue(),
pageSize: pageSizeUsersToReassign
};
},
load: function (store, record, opt)
{
winReassignInCasesList.setDisabled(false);
loadMaskUsersToReassign.hide();
}
}
});
var grid = new Ext.grid.GridPanel( {
id: 'reassignGrid',
height:300,
width:'300',
title : '',
stateful : true,
stateId : 'gridCasesList',
enableColumnResize: true,
enableHdMenu: true,
frame:false,
cls : 'grid_with_checkbox',
columnLines: true,
//Components
var pagingUsersToReassign = new Ext.PagingToolbar({
id: "pagingUsersToReassign",
viewConfig: {
forceFit:true
},
pageSize: pageSizeUsersToReassign,
store: storeUsersToReassign,
displayInfo: true,
displayMsg: _("ID_DISPLAY_ITEMS"),
emptyMsg: _("ID_NO_RECORDS_FOUND")
});
cm: new Ext.grid.ColumnModel({
var cmodelUsersToReassign = new Ext.grid.ColumnModel({
defaults: {
width: 200,
sortable: true
},
columns: [
{id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false},
{header: _('ID_FIRSTNAME'), dataIndex: 'USR_FIRSTNAME', width: 300},
{header: _('ID_LASTNAME'), dataIndex: 'USR_LASTNAME', width: 300}
{id: "USR_UID", dataIndex: "USR_UID", hidden: true, hideable: false},
{id: "USR_FIRSTNAME", dataIndex: "USR_FIRSTNAME", header: _("ID_FIRSTNAME"), width: 300},
{id: "USR_LASTNAME", dataIndex: "USR_LASTNAME", header: _("ID_LASTNAME"), width: 300}
]
}),
});
store: store,
var smodelUsersToReassign = new Ext.grid.RowSelectionModel({
singleSelect: true
});
var grdpnlUsersToReassign = new Ext.grid.GridPanel({
id: "grdpnlUsersToReassign",
store: storeUsersToReassign,
colModel: cmodelUsersToReassign,
selModel: smodelUsersToReassign,
columnLines: true,
viewConfig: {forceFit: true},
enableColumnResize: true,
enableHdMenu: true,
tbar: [
{
text:_('ID_REASSIGN'),
iconCls: 'ICON_CASES_TO_REASSIGN',
handler: function(){
//Actions.reassignCase
text: _("ID_REASSIGN"),
iconCls: "ICON_CASES_TO_REASSIGN",
handler: function ()
{
reassingCaseToUser();
}
},
"->",
{
xtype: "textfield",
id: "txtSearchUsersToReassign",
emptyText: _("ID_EMPTY_SEARCH"),
width: 150,
allowBlank: true,
listeners: {
specialkey: function (f, e)
{
if (e.getKey() == e.ENTER) {
pagingUsersToReassign.moveFirst();
}
}
}
},
{
text: "X",
ctCls: "pm_search_x_button",
handler: function ()
{
Ext.getCmp("txtSearchUsersToReassign").reset();
}
},
{
text: _("ID_SEARCH"),
handler: function ()
{
pagingUsersToReassign.moveFirst();
}
}
],
listeners: {
//rowdblclick: openCase,
render: function(){
this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING')});
this.ownerCt.doLayout();
}
}
bbar: pagingUsersToReassign,
title: ""
});
winReassignInCasesList = new Ext.Window({
title: '',
width: 450,
height: 280,
height: 350,
layout:'fit',
autoScroll:true,
modal: true,
maximizable: false,
items: [grid]
items: [grdpnlUsersToReassign]
});
winReassignInCasesList.show();
grdpnlUsersToReassign.store.load();
}
}
},

View File

@@ -934,81 +934,152 @@ Ext.onReady(function(){
Actions.getUsersToReassign = function()
{
var store = new Ext.data.Store( {
autoLoad: true,
var loadMaskUsersToReassign = new Ext.LoadMask(Ext.getBody(), {msg: _("ID_LOADING_GRID")});
//Variables
var pageSizeUsersToReassign = 10;
//Stores
var storeUsersToReassign = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'ajaxListener?action=getUsersToReassign'
url: "ajaxListener",
method: "POST"
}),
reader: new Ext.data.JsonReader({
root: 'data',
root: "resultRoot",
totalProperty: "resultTotal",
fields: [
{name : 'USR_UID'},
{name : 'USR_USERNAME'},
{name : 'USR_FIRSTNAME'},
{name : 'USR_LASTNAME'}
{name : "USR_UID"},
{name : "USR_USERNAME"},
{name : "USR_FIRSTNAME"},
{name : "USR_LASTNAME"}
]
})
}),
remoteSort: true,
listeners: {
beforeload: function (store)
{
winReassignInCasesList.setDisabled(true);
loadMaskUsersToReassign.show();
this.baseParams = {
action: "getUsersToReassign",
search: Ext.getCmp("txtSearchUsersToReassign").getValue(),
pageSize: pageSizeUsersToReassign
};
},
load: function (store, record, opt)
{
winReassignInCasesList.setDisabled(false);
loadMaskUsersToReassign.hide();
}
}
});
var grid = new Ext.grid.GridPanel( {
id: 'reassignGrid',
height:300,
width:'300',
title : '',
stateful : true,
stateId : 'gridCasesOpen',
enableColumnResize: true,
enableHdMenu: true,
frame:false,
cls : 'grid_with_checkbox',
columnLines: true,
//Components
var pagingUsersToReassign = new Ext.PagingToolbar({
id: "pagingUsersToReassign",
viewConfig: {
forceFit:true
},
pageSize: pageSizeUsersToReassign,
store: storeUsersToReassign,
displayInfo: true,
displayMsg: _("ID_DISPLAY_ITEMS"),
emptyMsg: _("ID_NO_RECORDS_FOUND")
});
cm: new Ext.grid.ColumnModel({
var cmodelUsersToReassign = new Ext.grid.ColumnModel({
defaults: {
width: 200,
sortable: true
},
columns: [
{id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false},
{header: _('ID_USER_NAME'), dataIndex: 'USR_USERNAME', width: 300},
{header: _('ID_FIRSTNAME'), dataIndex: 'USR_FIRSTNAME', width: 300},
{header: _('ID_LASTNAME'), dataIndex: 'USR_LASTNAME', width: 300}
{id: "USR_UID", dataIndex: "USR_UID", hidden: true, hideable: false},
{id: "USR_FIRSTNAME", dataIndex: "USR_FIRSTNAME", header: _("ID_FIRSTNAME"), width: 300},
{id: "USR_LASTNAME", dataIndex: "USR_LASTNAME", header: _("ID_LASTNAME"), width: 300}
]
}),
sm: new Ext.grid.RowSelectionModel({singleSelect: true}),
store: store,
});
var smodelUsersToReassign = new Ext.grid.RowSelectionModel({
singleSelect: true
});
var grdpnlUsersToReassign = new Ext.grid.GridPanel({
id: "grdpnlUsersToReassign",
store: storeUsersToReassign,
colModel: cmodelUsersToReassign,
selModel: smodelUsersToReassign,
columnLines: true,
viewConfig: {forceFit: true},
enableColumnResize: true,
enableHdMenu: true,
tbar: [
{
text:_('ID_REASSIGN'),
iconCls: 'ICON_CASES_TO_REASSIGN',
text: _("ID_REASSIGN"),
iconCls: "ICON_CASES_TO_REASSIGN",
handler: Actions.reassignCase
},
"->",
{
xtype: "textfield",
id: "txtSearchUsersToReassign",
emptyText: _("ID_EMPTY_SEARCH"),
width: 150,
allowBlank: true,
listeners: {
specialkey: function (f, e)
{
if (e.getKey() == e.ENTER) {
pagingUsersToReassign.moveFirst();
}
}
}
},
{
text: "X",
ctCls: "pm_search_x_button",
handler: function ()
{
Ext.getCmp("txtSearchUsersToReassign").reset();
}
},
{
text: _("ID_SEARCH"),
handler: function ()
{
pagingUsersToReassign.moveFirst();
}
}
],
listeners: {
//rowdblclick: openCase,
render: function(){
this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING')});
this.ownerCt.doLayout();
}
}
bbar: pagingUsersToReassign,
title: ""
});
var win = new Ext.Window({
var winReassignInCasesList = new Ext.Window({
title: '',
width: 450,
height: 280,
height: 350,
layout:'fit',
autoScroll:true,
modal: true,
resizable: false,
maximizable: false,
items: [grid]
items: [grdpnlUsersToReassign]
});
Ext.Ajax.request({
url : 'ajaxListener' ,
params : {action : 'verifySession'},
@@ -1034,7 +1105,9 @@ Ext.onReady(function(){
}
});
} else {
win.show();
winReassignInCasesList.show();
grdpnlUsersToReassign.store.load();
}
},
failure: function ( result, request) {
@@ -1047,7 +1120,8 @@ Ext.onReady(function(){
Actions.reassignCase = function()
{
var rowSelected = Ext.getCmp('reassignGrid').getSelectionModel().getSelected();
var rowSelected = Ext.getCmp("grdpnlUsersToReassign").getSelectionModel().getSelected();
if( rowSelected ) {
PMExt.confirm(_('ID_CONFIRM'), _('ID_REASSIGN_CONFIRM'), function(){
Ext.Ajax.request({

View File

@@ -721,9 +721,14 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
}
});
var types = new Ext.data.SimpleStore({
fields: ['REP_TAB_TYPE', 'type'],
data : [['NORMAL',_("ID_GLOBAL")],['GRID',_("ID_GRID")]]
var arrayBpmnTypeData = [["NORMAL", _("ID_GLOBAL")]];
var arrayClassicTypeData = [["NORMAL", _("ID_GLOBAL")], ["GRID", _("ID_GRID")]];
var types = new Ext.data.ArrayStore({
storeId: "types",
autoDestroy: true,
fields: ["REP_TAB_TYPE", "type"]
});
comboReport = new Ext.form.ComboBox({
@@ -889,7 +894,7 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
action: 'getProcessList'
},
reader : new Ext.data.JsonReader( {
fields : [{name : 'PRO_UID'}, {name : 'PRO_TITLE'},{name : 'PRO_DESCRIPTION'}]
fields : [{name : 'PRO_UID'}, {name : 'PRO_TITLE'},{name : 'PRO_DESCRIPTION'}, {name: "PRO_PROCESS_TYPE"}]
}),
listeners: {
load: function() {
@@ -952,6 +957,18 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
listeners:{
select: function(){
var dataStore = Ext.getCmp('PROCESS').store.getRange();
var i = Ext.getCmp('PROCESS').store.find("PRO_UID", Ext.getCmp('PROCESS').getValue());
types.loadData(
(dataStore[i].data.PRO_PROCESS_TYPE == "BPMN")? arrayBpmnTypeData : arrayClassicTypeData, false
);
var dataStoreAux = types.getRange(0);
comboReport.setValue(dataStoreAux[0].data.REP_TAB_TYPE);
comboGridsList.setVisible(false);
comboDbConnections.getStore().reload({params:{PRO_UID : Ext.getCmp('PROCESS').getValue()}});
if (Ext.getCmp('REP_TAB_TYPE').getValue() == 'GRID') {
gridsListStore.reload({params:{PRO_UID : Ext.getCmp('PROCESS').getValue()}});

View File

@@ -86,9 +86,9 @@ Ext.onReady(function(){
Ext.MessageBox.show({
title: '',
width: 500,
height: 500,
msg: "<pre style='font-size:10px'>"+resp.result.msg+"</pre>",
width: 510,
height: 300,
msg: "<div style=\"overflow: auto; width: 439px; height: 200px;\">" + stringReplace("\\x0A", "<br />", resp.result.msg) + "</div>",
buttons: Ext.MessageBox.OK,
animEl: 'mb9',
fn: function(){},