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 temp.txt
update.sh update.sh
workflow/public_html/translations/ 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" puts "Seems it is not a ProcessMaker installation"
exit(1) exit(1)
end end
if mode == "production" if mode == "production"
targetDir = publicDir + "/lib" targetDir = publicDir + "/lib"
pmUIFontsDir = targetDir + "/fonts" pmUIFontsDir = targetDir + "/fonts"
@@ -55,9 +54,10 @@ task :build => [:required] do
pmdynaformDir = targetDir + "/pmdynaform" pmdynaformDir = targetDir + "/pmdynaform"
prepareDirs([targetDir, pmUIDir, mafeDir, pmdynaformDir, jsTargetDir, cssTargetDir, cssImagesTargetDir, imgTargetDir, pmUIFontsDir]) prepareDirs([targetDir, pmUIDir, mafeDir, pmdynaformDir, jsTargetDir, cssTargetDir, cssImagesTargetDir, imgTargetDir, pmUIFontsDir])
buildPmUi(Dir.pwd + "/vendor/colosa/pmUI", targetDir, mode) buildPmUi(Dir.pwd + "/vendor/colosa/pmUI", targetDir, mode)
buildPmdynaform(Dir.pwd + "/vendor/colosa/pmDynaform", 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) buildMafe(Dir.pwd + "/vendor/colosa/MichelangeloFE", targetDir, mode)
@@ -67,7 +67,7 @@ task :build => [:required] do
pmdynaformHash = getHash(Dir.pwd + "/vendor/colosa/pmDynaform") pmdynaformHash = getHash(Dir.pwd + "/vendor/colosa/pmDynaform")
hashVendors = pmuiHash+"-"+mafeHash hashVendors = pmuiHash+"-"+mafeHash
## Building minified JS Files ## Building minified JS Files
puts "Building file: " + "/js/mafe-#{hashVendors}.js".cyan puts "Building file: " + "/js/mafe-#{hashVendors}.js".cyan
mafeCompresedFile = targetDir + "/js/mafe-#{hashVendors}.js" mafeCompresedFile = targetDir + "/js/mafe-#{hashVendors}.js"
mafeCompresedContent = "" mafeCompresedContent = ""
@@ -168,18 +168,18 @@ end
def buildPmdynaform(homeDir, targetDir, mode) def buildPmdynaform(homeDir, targetDir, mode)
puts "\nBuilding PmDynaform library".green.bold puts "\nBuilding PmDynaform library".green.bold
# Defining target directories # Defining target directories
pmdynaformDir = targetDir + "/pmdynaform" pmdynaformDir = targetDir + "/pmdynaform"
executeInto(homeDir, [ "default"]) executeInto(homeDir, [ "default"])
require 'fileutils' require 'fileutils'
Dir.mkdir("#{pmdynaformDir}/build") Dir.mkdir("#{pmdynaformDir}/build")
FileUtils.cp_r(Dir["#{homeDir}/build/*"],"#{pmdynaformDir}/build") FileUtils.cp_r(Dir["#{homeDir}/build/*"],"#{pmdynaformDir}/build")
Dir.mkdir("#{pmdynaformDir}/libs") Dir.mkdir("#{pmdynaformDir}/libs")
FileUtils.cp_r(Dir["#{homeDir}/libs/*"],"#{pmdynaformDir}/libs") FileUtils.cp_r(Dir["#{homeDir}/libs/*"],"#{pmdynaformDir}/libs")
template = "" template = ""
config = File.read "#{homeDir}/config/templates.json" config = File.read "#{homeDir}/config/templates.json"
json = JSON.parse config json = JSON.parse config
@@ -191,14 +191,14 @@ def buildPmdynaform(homeDir, targetDir, mode)
end end
template += s template += s
end end
htmlTemplates=["pmdynaform.html"] htmlTemplates=["pmdynaform.html"]
htmlTemplates.each do |htmlTemplate| htmlTemplates.each do |htmlTemplate|
FileUtils.cp("#{Dir.pwd}/workflow/engine/templates/cases/#{htmlTemplate}", "#{pmdynaformDir}/build/#{htmlTemplate}") FileUtils.cp("#{Dir.pwd}/workflow/engine/templates/cases/#{htmlTemplate}", "#{pmdynaformDir}/build/#{htmlTemplate}")
target = "#{pmdynaformDir}/build/#{htmlTemplate}" target = "#{pmdynaformDir}/build/#{htmlTemplate}"
html = File.read target html = File.read target
while html['###TEMPLATES##'] do while html['###TEMPLATES##'] do
html['###TEMPLATES###'] = template html['###TEMPLATES###'] = template
end end
@@ -206,10 +206,17 @@ def buildPmdynaform(homeDir, targetDir, mode)
file.write html file.write html
end end
end end
puts "\nPmDynaform Build Finished!".magenta puts "\nPmDynaform Build Finished!".magenta
end 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) def buildMafe(homeDir, targetDir, mode)
puts "\nBuilding PM Michelangelo FE".green.bold 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) { if (strlen( trim( $formVariableValue ) ) > 0) {
$value = $formVariableValue; $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->NSDependentFields( true ) . ' ';
$str .= $this->NSRequiredValue() . ' '; $str .= $this->NSRequiredValue() . ' ';
$str .= $this->NSGridLabel() . ' '; $str .= $this->NSGridLabel() . ' ';
@@ -1709,9 +1709,16 @@ class XmlForm_Field_Suggest extends XmlForm_Field_SimpleText //by neyek
return $str; return $str;
} }
} else { } else {
$str = '<span id="form' . $rowId . '[' . $this->name . ']" name="form' . $rowId . '[' . $this->name . ']" ' . $this->NSGridType() . ' >'; $str = $this->htmlentities($formVariableValue, ENT_COMPAT, 'utf-8');
$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 .= '</span>'; $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; return $str;
} }
} }

View File

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

View File

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

View File

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

View File

@@ -2907,6 +2907,59 @@ function PMFSaveCurrentData ()
return $result; 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 * @method

View File

@@ -35,6 +35,7 @@ class triggerLibrary
//$folderData = new folderData($sProUid, $proFields['PRO_TITLE'], $sAppUid, $Fields['APP_TITLE'], $sUsrUid); //$folderData = new folderData($sProUid, $proFields['PRO_TITLE'], $sAppUid, $Fields['APP_TITLE'], $sUsrUid);
$oPluginRegistry = &PMPluginRegistry::getSingleton(); $oPluginRegistry = &PMPluginRegistry::getSingleton();
$aAvailablePmFunctions = $oPluginRegistry->getPmFunctions(); $aAvailablePmFunctions = $oPluginRegistry->getPmFunctions();
$oPluginRegistry->setupPlugins(); //Get and setup enabled plugins
foreach ($aAvailablePmFunctions as $key => $class) { foreach ($aAvailablePmFunctions as $key => $class) {
$filePlugin = PATH_PLUGINS . $class . PATH_SEP . 'classes' . PATH_SEP . 'class.pmFunctions.php'; $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); //$oPluginRegistry->enablePlugin($oDetails->sNamespace);
//require_once (PATH_PLUGINS . $this->getAddonName() . ".php"); //ok //require_once (PATH_PLUGINS . $this->getAddonName() . ".php"); //ok
$oPluginRegistry->enablePlugin($this->getAddonName()); $oPluginRegistry->enablePlugin($this->getAddonName());
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins
} else { } else {
//$oDetails = $oPluginRegistry->getPluginDetails($this->getAddonName()); //$oDetails = $oPluginRegistry->getPluginDetails($this->getAddonName());
//$oPluginRegistry->disablePlugin($oDetails->sNamespace); //$oPluginRegistry->disablePlugin($oDetails->sNamespace);
@@ -455,4 +456,3 @@ class AddonsManager extends BaseAddonsManager
return true; return true;
} }
} }

View File

@@ -60,7 +60,7 @@ class Application extends BaseApplication
if (!$oApplication->exists($this->getAppUid())) { if (!$oApplication->exists($this->getAppUid())) {
return false; return false;
} }
if ($this->getAppUid() == '') { if ($this->getAppUid() == '') {
throw (new Exception( "Error in getAppTitle, the APP_UID can't be blank")); throw (new Exception( "Error in getAppTitle, the APP_UID can't be blank"));
} }
@@ -373,7 +373,6 @@ class Application extends BaseApplication
$this->setAppUpdateDate('now'); $this->setAppUpdateDate('now');
$pin = G::generateCode(4, 'ALPHANUMERIC'); $pin = G::generateCode(4, 'ALPHANUMERIC');
$this->setAppData(serialize(array('PIN' => $pin)));
$this->setAppPin(G::encryptOld($pin)); $this->setAppPin(G::encryptOld($pin));
$c = new Criteria(); $c = new Criteria();
@@ -385,6 +384,8 @@ class Application extends BaseApplication
$maxNumber = $oSequences->getSequeceNumber("APP_NUMBER"); $maxNumber = $oSequences->getSequeceNumber("APP_NUMBER");
$this->setAppNumber($maxNumber); $this->setAppNumber($maxNumber);
$this->setAppData(serialize(['APP_NUMBER' => $maxNumber, 'PIN' => $pin]));
$oSequences->changeSequence('APP_NUMBER', $maxNumber); $oSequences->changeSequence('APP_NUMBER', $maxNumber);
$oSequences->unlockSequenceTable(); $oSequences->unlockSequenceTable();
@@ -591,7 +592,7 @@ class Application extends BaseApplication
} }
$calendar = new calendar(); $calendar = new calendar();
$c = new Criteria( 'workflow' ); $c = new Criteria( 'workflow' );
$c->clearSelectColumns(); $c->clearSelectColumns();
$c->addSelectColumn( ApplicationPeer::APP_UID ); $c->addSelectColumn( ApplicationPeer::APP_UID );
@@ -616,7 +617,7 @@ class Application extends BaseApplication
$rs->next(); $rs->next();
$row = $rs->getRow(); $row = $rs->getRow();
$i = 0; $i = 0;
$now = strtotime( 'now' ); $now = strtotime( 'now' );
while (is_array( $row )) { while (is_array( $row )) {
$appNumber = $row['APP_NUMBER']; $appNumber = $row['APP_NUMBER'];
@@ -634,7 +635,7 @@ class Application extends BaseApplication
//get the object, //get the object,
$oApp = ApplicationPeer::retrieveByPk( $row['APP_UID'] ); $oApp = ApplicationPeer::retrieveByPk( $row['APP_UID'] );
//getting the calendar //getting the calendar
$calendar->getCalendar(null, $proUid); $calendar->getCalendar(null, $proUid);
$calData = $calendar->getCalendarData(); $calData = $calendar->getCalendarData();
@@ -648,8 +649,8 @@ class Application extends BaseApplication
if($appFinishDate == null){//When the process didnt finish yet. if($appFinishDate == null){//When the process didnt finish yet.
//Duration //Duration
$appDuration = $calendar->dashCalculateDurationWithCalendar($appInitDate, date("Y-m-d H:i:s"), $calData ); $appDuration = $calendar->dashCalculateDurationWithCalendar($appInitDate, date("Y-m-d H:i:s"), $calData );
$appDuration = $appDuration / (24 * 60 * 60); //Saving the proDuration in days. The calculateDurationWithCalendar func returns segs. $appDuration = $appDuration / (24 * 60 * 60); //Saving the proDuration in days. The calculateDurationWithCalendar func returns segs.
$oApp->setAppDuration( $appDuration ); $oApp->setAppDuration( $appDuration );
@@ -662,7 +663,7 @@ class Application extends BaseApplication
$appDuration = $calendar->dashCalculateDurationWithCalendar($appInitDate, $appFinishDate, $calData ); $appDuration = $calendar->dashCalculateDurationWithCalendar($appInitDate, $appFinishDate, $calData );
$appDuration = $appDuration / (24 * 60 * 60); //Saving the proDuration in days. The calculateDurationWithCalendar func returns mins. $appDuration = $appDuration / (24 * 60 * 60); //Saving the proDuration in days. The calculateDurationWithCalendar func returns mins.
$oApp->setAppDuration( $appDuration ); $oApp->setAppDuration( $appDuration );
//Delay Duration //Delay Duration
$delayDuration = $calendar->dashCalculateDurationWithCalendar( $proDueDate, $appFinishDate, $calData ); $delayDuration = $calendar->dashCalculateDurationWithCalendar( $proDueDate, $appFinishDate, $calData );
$delayDuration = $delayDuration / (24 * 60 * 60); //Days $delayDuration = $delayDuration / (24 * 60 * 60); //Days
@@ -674,7 +675,7 @@ class Application extends BaseApplication
$rs->next(); $rs->next();
$row = $rs->getRow(); $row = $rs->getRow();
} }
if ($cron == 1) { if ($cron == 1) {
$arrayCron = unserialize( trim( @file_get_contents( PATH_DATA . "cron" ) ) ); $arrayCron = unserialize( trim( @file_get_contents( PATH_DATA . "cron" ) ) );
$arrayCron["processcTimeStart"] = time(); $arrayCron["processcTimeStart"] = time();
@@ -683,7 +684,7 @@ class Application extends BaseApplication
} catch (Exception $oError) { } catch (Exception $oError) {
error_log( $oError->getMessage() ); error_log( $oError->getMessage() );
} }
} }
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
} }

View File

@@ -340,6 +340,8 @@ class Process extends BaseProcess
public function getAll () public function getAll ()
{ {
$bpmn = new \ProcessMaker\Project\Bpmn();
$oCriteria = new Criteria( 'workflow' ); $oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( ProcessPeer::PRO_UID ); $oCriteria->addSelectColumn( ProcessPeer::PRO_UID );
@@ -359,7 +361,9 @@ class Process extends BaseProcess
$processes = Array (); $processes = Array ();
$uids = array (); $uids = array ();
while ($oDataset->next()) { 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']; $uids[] = $processes[sizeof( $processes ) - 1]['PRO_UID'];
} }
//process details will have the info about the processes //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_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['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[] = array('label'=>$labelsCurrentTaskProperties['DYN_UID'] , 'value' => $processData['PRO_DYNAFORMS']['PROCESS'];, 'section'=>$labelsCurrentTaskProperties['DYN_UID']);
$data = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($data);
return $data; return $data;
} }
} }

View File

@@ -145,7 +145,7 @@ class Designer extends Controller
$user = new \ProcessMaker\BusinessModel\User(); $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'); $this->setView('designer/index');
} else { } else {
$this->setVar('accessDenied', G::LoadTranslation('ID_ACCESS_DENIED')); $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( 'logout', G::LoadTranslation( 'ID_LOGOUT' ) );
$this->setVar( 'workspace', defined( 'SYS_SYS' ) ? ucfirst( SYS_SYS ) : '' ); $this->setVar( 'workspace', defined( 'SYS_SYS' ) ? ucfirst( SYS_SYS ) : '' );
$this->setVar( 'user_avatar', 'users/users_ViewPhotoGrid?pUID=' . $_SESSION['USER_LOGGED'] . '&h=' . rand() ); $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 // license notification
$expireInLabel = ''; $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"); $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 = $task->getDelegatedTaskData($_SESSION['TASK'], $_SESSION['APPLICATION'], $_SESSION['INDEX']);
$taskData = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($taskData);
print (G::json_encode($taskData)); print (G::json_encode($taskData));
} }
@@ -518,14 +520,37 @@ class Ajax
print G::json_encode( $response ); print G::json_encode( $response );
die(); 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() public function reassignCase()

View File

@@ -122,11 +122,15 @@ if ($actionAjax == 'messageHistoryGridList_JXP') {
$r->data = $aProcesses; $r->data = $aProcesses;
$r->totalCount = $totalCount; $r->totalCount = $totalCount;
if (!isset($r->data[0])) { if (!empty($aProcesses)) {
$r->data[0] = array('APP_MSG_TYPE' => ''); 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 ); echo G::json_encode( $r );
} }

View File

@@ -85,7 +85,7 @@ if ($actionAjax == "userValues") {
$cUsers->addSelectColumn(UsersPeer::USR_FIRSTNAME); $cUsers->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$cUsers->addSelectColumn(UsersPeer::USR_LASTNAME); $cUsers->addSelectColumn(UsersPeer::USR_LASTNAME);
$cUsers->add( UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL ); $cUsers->add( UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL );
if (!is_null($query)) { if (!is_null($query)) {
$filters = $cUsers->getNewCriterion( UsersPeer::USR_FIRSTNAME, '%'.$query.'%', Criteria::LIKE )->addOr( $filters = $cUsers->getNewCriterion( UsersPeer::USR_FIRSTNAME, '%'.$query.'%', Criteria::LIKE )->addOr(
$cUsers->getNewCriterion( UsersPeer::USR_LASTNAME, '%'.$query.'%', Criteria::LIKE )->addOr( $cUsers->getNewCriterion( UsersPeer::USR_LASTNAME, '%'.$query.'%', Criteria::LIKE )->addOr(
@@ -217,14 +217,32 @@ if ($actionAjax == "processListExtJs") {
} }
if ($actionAjax == "getUsersToReassign") { if ($actionAjax == "getUsersToReassign") {
$_SESSION['TASK'] = $_REQUEST['TAS_UID']; $taskUid = $_POST['taskUid'];
$case = new Cases(); $search = $_POST['search'];
G::LoadClass( 'tasks' ); $pageSize = $_POST['pageSize'];
$task = new Task();
$tasks = $task->load($_SESSION['TASK']); $sortField = (isset($_POST['sort']))? $_POST['sort'] : '';
$result = new stdclass(); $sortDir = (isset($_POST['dir']))? $_POST['dir'] : '';
$result->data = $case->getUsersToReassign( $_SESSION['TASK'], $_SESSION['USER_LOGGED'], $tasks['PRO_UID'] ); $start = (isset($_POST['start']))? $_POST['start'] : 0;
print G::json_encode( $result ); $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') { if ($actionAjax == 'reassignCase') {

View File

@@ -80,7 +80,7 @@ function getLoadTreeMenuData ()
$index = $i; $index = $i;
list($childs, $index) = getChilds($oMenu, ++$index); list($childs, $index) = getChilds($oMenu, ++$index);
$menuCases[$CurrentBlockID]['blockItems'][$oMenu->Id[$i]]['childs'] = $childs; $menuCases[$CurrentBlockID]['blockItems'][$oMenu->Id[$i]]['childs'] = $childs;
$i = $index; $i = $index;
@@ -274,7 +274,7 @@ function getProcess ()
function getAllCounters () function getAllCounters ()
{ {
$userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null; $userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
$oAppCache = new AppCacheView();
$aTypes = Array (); $aTypes = Array ();
$aTypes['to_do'] = 'CASES_INBOX'; $aTypes['to_do'] = 'CASES_INBOX';
$aTypes['draft'] = 'CASES_DRAFT'; $aTypes['draft'] = 'CASES_DRAFT';
@@ -285,29 +285,9 @@ function getAllCounters ()
$aTypes['selfservice'] = 'CASES_SELFSERVICE'; $aTypes['selfservice'] = 'CASES_SELFSERVICE';
//$aTypes['to_revise'] = 'CASES_TO_REVISE'; //$aTypes['to_revise'] = 'CASES_TO_REVISE';
//$aTypes['to_reassign'] = 'CASES_TO_REASSIGN'; //$aTypes['to_reassign'] = 'CASES_TO_REASSIGN';
$solrEnabled = false;
if ((($solrConf = System::solrEnv()) !== false)) { $case = new \ProcessMaker\BusinessModel\Cases();
G::LoadClass( 'AppSolr' ); $aCount = $case->getListCounters($userUid, array_keys($aTypes));
$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 );
}
$response = Array (); $response = Array ();
$i = 0; $i = 0;
@@ -326,7 +306,7 @@ function getChilds($menu, $index)
for ($i = $index; $i < count($menu->Options); $i++) { for ($i = $index; $i < count($menu->Options); $i++) {
if ($menu->Types[$i] == 'childNode') { if ($menu->Types[$i] == 'childNode') {
$childs[$menu->Id[$i]] = array( $childs[$menu->Id[$i]] = array(
'label' => $menu->Labels[$i], 'label' => $menu->Labels[$i],
'link' => $menu->Options[$i], 'link' => $menu->Options[$i],

View File

@@ -5,6 +5,7 @@ BEGIN
DECLARE APP_NUMBER INT; DECLARE APP_NUMBER INT;
DECLARE APP_STATUS VARCHAR(32); DECLARE APP_STATUS VARCHAR(32);
DECLARE APP_CREATE_DATE DATETIME; DECLARE APP_CREATE_DATE DATETIME;
DECLARE APP_UPDATE_DATE DATETIME;
DECLARE APP_TITLE VARCHAR(255); DECLARE APP_TITLE VARCHAR(255);
DECLARE APP_PRO_TITLE VARCHAR(255); DECLARE APP_PRO_TITLE VARCHAR(255);
DECLARE APP_TAS_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_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_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_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; 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 IF ( @APP_TITLE IS NULL ) THEN
SET @APP_TITLE = ''; SET @APP_TITLE = '';
@@ -108,7 +111,7 @@ BEGIN
NEW.DEL_DELAYED, NEW.DEL_DELAYED,
@APP_CREATE_DATE, @APP_CREATE_DATE,
NULL, NULL,
NOW(), @APP_UPDATE_DATE,
NEW.APP_OVERDUE_PERCENTAGE, NEW.APP_OVERDUE_PERCENTAGE,
NEW.DEL_LAST_INDEX NEW.DEL_LAST_INDEX
); );

View File

@@ -5,6 +5,7 @@ BEGIN
DECLARE APP_NUMBER INT; DECLARE APP_NUMBER INT;
DECLARE APP_STATUS VARCHAR(32); DECLARE APP_STATUS VARCHAR(32);
DECLARE APP_CREATE_DATE DATETIME; DECLARE APP_CREATE_DATE DATETIME;
DECLARE APP_UPDATE_DATE DATETIME;
DECLARE APP_TITLE VARCHAR(255); DECLARE APP_TITLE VARCHAR(255);
DECLARE APP_PRO_TITLE VARCHAR(255); DECLARE APP_PRO_TITLE VARCHAR(255);
DECLARE APP_TAS_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_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_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_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; 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 IF ( @APP_TITLE IS NULL ) THEN
SET @APP_TITLE = ''; SET @APP_TITLE = '';
@@ -71,6 +74,7 @@ BEGIN
DEL_FINISHED = NEW.DEL_FINISHED, DEL_FINISHED = NEW.DEL_FINISHED,
DEL_DELAYED = NEW.DEL_DELAYED, DEL_DELAYED = NEW.DEL_DELAYED,
APP_FINISH_DATE = NULL, APP_FINISH_DATE = NULL,
APP_UPDATE_DATE = @APP_UPDATE_DATE,
APP_OVERDUE_PERCENTAGE = NEW.APP_OVERDUE_PERCENTAGE, APP_OVERDUE_PERCENTAGE = NEW.APP_OVERDUE_PERCENTAGE,
DEL_LAST_INDEX = NEW.DEL_LAST_INDEX DEL_LAST_INDEX = NEW.DEL_LAST_INDEX
WHERE WHERE

View File

@@ -14,10 +14,11 @@ BEGIN
END IF; END IF;
IF(OLD.APP_DATA<>NEW.APP_DATA) THEN 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; END IF;
IF (NEW.APP_STATUS = 'COMPLETED') THEN 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_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 IF;
END END

View File

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

View File

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

View File

@@ -434,11 +434,6 @@ class SkinEngine
G::LoadClass( "configuration" ); G::LoadClass( "configuration" );
$conf = new Configurations(); $conf = new Configurations();
$conf->getFormats(); $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'] : ''); $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); $smarty->assign('user',$name);
} }
@@ -758,11 +753,6 @@ class SkinEngine
G::LoadClass( "configuration" ); G::LoadClass( "configuration" );
$conf = new Configurations(); $conf = new Configurations();
$conf->getFormats(); $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'] : ''); $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); $smarty->assign('user',$name);
} }

View File

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

View File

@@ -21,8 +21,7 @@
<label class="textBlue"><a href="../home">{$switch_interface_label}</a> | </label> <label class="textBlue"><a href="../home">{$switch_interface_label}</a> | </label>
{/if} {/if}
<a href="{$linklogout}" class="tableOption">{$logout}</a>&nbsp;&nbsp;<br/> <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/> <label class="textBlack"><b>{$rolename}</b> {$workspace_label} <b><u>{$workspace}</u></b> &nbsp; &nbsp;</label>&nbsp; &nbsp;
{$udate}</label>&nbsp; &nbsp;
{/if} {/if}
</small> </small>
</div> </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 * Get list for Cases
* *
@@ -1117,12 +1161,15 @@ class Cases
$aAux = $oAppDocument->load($aRow['APP_DOC_UID'], $aRow['DOC_VERSION']); $aAux = $oAppDocument->load($aRow['APP_DOC_UID'], $aRow['DOC_VERSION']);
$lastVersion = $oAppDocument->getLastAppDocVersion($aRow['APP_DOC_UID'], $sApplicationUID); $lastVersion = $oAppDocument->getLastAppDocVersion($aRow['APP_DOC_UID'], $sApplicationUID);
try { if ($aAux['USR_UID'] !== "-1") {
$aAux1 = $oUser->load($aAux['USR_UID']); try {
$aAux1 = $oUser->load($aAux['USR_UID']);
$sUser = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $aAux1["USR_USERNAME"], $aAux1["USR_FIRSTNAME"], $aAux1["USR_LASTNAME"]); $sUser = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $aAux1["USR_USERNAME"], $aAux1["USR_FIRSTNAME"], $aAux1["USR_LASTNAME"]);
} catch (Exception $oException) { } catch (Exception $oException) {
//$sUser = '(USER DELETED)'; $sUser = '***';
}
} else {
$sUser = '***'; $sUser = '***';
} }
$aFields = array( $aFields = array(
@@ -2420,4 +2467,196 @@ class Cases
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); 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 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 * 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))); throw new \Exception(\G::LoadTranslation("ID_USER_NOT_HAVE_PERMISSION_DELETE_INPUT_DOCUMENT", array($userUid)));
} }
//verfiry exists $appDocumentUid
$this->throwExceptionIfNotExistsAppDocument($appDocumentUid);
//Verify data permission //Verify data permission
$flagPermission = 0; $flagPermission = 0;
@@ -351,13 +374,16 @@ class InputDocument
while ($rsCriteria->next()) { while ($rsCriteria->next()) {
$row = $rsCriteria->getRow(); $row = $rsCriteria->getRow();
$arrayUserData = $user->load($row["USR_UID"]); $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"]); $arrayAppDocument = $appDocument->load($row["APP_DOC_UID"], $row["DOC_VERSION"]);
$row["APP_DOC_FILENAME"] = $arrayAppDocument["APP_DOC_FILENAME"]; $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"]; $row["APP_DOC_LINK"] = "cases/cases_ShowDocument?a=" . $row["APP_DOC_UID"] . "&v=" . $row["DOC_VERSION"];
$arrayInputDocument[] = $this->getAppDocumentDataFromRecord($row); $arrayInputDocument[] = $this->getAppDocumentDataFromRecord($row);

View File

@@ -3,6 +3,26 @@ namespace ProcessMaker\BusinessModel\Cases;
class OutputDocument 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 * Check if the user has permissions
* *
@@ -26,6 +46,9 @@ class OutputDocument
$flagInbox = 0; $flagInbox = 0;
} }
//Verfiry exists $appDocumentUid
$this->throwExceptionIfNotExistsAppDocument($appDocumentUid);
//Verify data permission //Verify data permission
$flagPermission = 0; $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 * Verify if exists the title of a Department
* *
@@ -253,6 +274,8 @@ class Department
$dep_uid = Validator::depUid($dep_uid); $dep_uid = Validator::depUid($dep_uid);
$usr_uid = Validator::usrUid($usr_uid); $usr_uid = Validator::usrUid($usr_uid);
$this->throwExceptionUserNotExistsInDepartment($dep_uid, $usr_uid);
$dep = new \Department(); $dep = new \Department();
$dep->load( $dep_uid ); $dep->load( $dep_uid );
$manager = $dep->getDepManager(); $manager = $dep->getDepManager();

View File

@@ -22,6 +22,18 @@ class Light
{ {
$response = null; $response = null;
try { 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(); $oProcess = new \Process();
$oCase = new \Cases(); $oCase = new \Cases();
@@ -65,7 +77,7 @@ class Light
$tempTreeChildren = array (); $tempTreeChildren = array ();
foreach ($processList[$key] as $keyChild => $processInfoChild) { foreach ($processList[$key] as $keyChild => $processInfoChild) {
$webEntryEventStart = $webEntryEvent->getWebEntryEvents($processInfoChild['pro_uid']); $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['text'] = $keyChild; //ellipsis ( $keyChild, 50 );
$tempTreeChild['processId'] = $processInfoChild['pro_uid']; $tempTreeChild['processId'] = $processInfoChild['pro_uid'];
$tempTreeChild['taskId'] = $processInfoChild['uid']; $tempTreeChild['taskId'] = $processInfoChild['uid'];

View File

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

View File

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

View File

@@ -231,6 +231,9 @@ class Variable
$this->throwExceptionIfNotExistsVariable($variableUid); $this->throwExceptionIfNotExistsVariable($variableUid);
//Verify variable
$this->throwExceptionIfVariableIsAssociatedAditionalTable($variableUid);
$variable = $this->getVariable($processUid, $variableUid); $variable = $this->getVariable($processUid, $variableUid);
\G::LoadClass('pmDynaform'); \G::LoadClass('pmDynaform');
$pmDynaform = new \pmDynaform(); $pmDynaform = new \pmDynaform();
@@ -556,13 +559,16 @@ class Variable
\G::LoadClass('pmDynaform'); \G::LoadClass('pmDynaform');
$pmDynaform = new \pmDynaform(); $pmDynaform = new \pmDynaform();
$field = $pmDynaform->searchField($arrayVariable["dyn_uid"], $arrayVariable["field_id"]); $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 : ""; $variableSql = $field !== null ? $field->sql : "";
//Get data //Get data
$_SESSION["PROCESS"] = $processUid; $_SESSION["PROCESS"] = $processUid;
$cnn = \Propel::getConnection(($variableDbConnectionUid . "" != "")? $variableDbConnectionUid : "workflow"); $cnn = \Propel::getConnection($dbConnection);
$stmt = $cnn->createStatement(); $stmt = $cnn->createStatement();
$replaceFields = G::replaceDataField($variableSql, $arrayVariable); $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 * Verify if the variable is being used in a Dynaform
* *
@@ -677,13 +717,16 @@ class Variable
\G::LoadClass('pmDynaform'); \G::LoadClass('pmDynaform');
$pmDynaform = new \pmDynaform(); $pmDynaform = new \pmDynaform();
$field = $pmDynaform->searchField($arrayVariable["dyn_uid"], $variableName); $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 : ""; $variableSql = $field !== null ? $field->sql : "";
//Get data //Get data
$_SESSION["PROCESS"] = $processUid; $_SESSION["PROCESS"] = $processUid;
$cnn = \Propel::getConnection(($variableDbConnectionUid . "" != "") ? $variableDbConnectionUid : "workflow"); $cnn = \Propel::getConnection($dbConnection);
$stmt = $cnn->createStatement(); $stmt = $cnn->createStatement();
$replaceFields = G::replaceDataField($variableSql, $arrayVariable); $replaceFields = G::replaceDataField($variableSql, $arrayVariable);
@@ -702,7 +745,7 @@ class Variable
} }
$parser = new \PHPSQLParser($replaceFields); $parser = new \PHPSQLParser($replaceFields);
$filter = str_replace("'", "''", $filter); $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); $rs = $stmt->executeQuery($replaceFields, \ResultSet::FETCHMODE_NUM);
while ($rs->next()) { 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'])) { if (!empty($sqlParsed['SELECT'])) {
$sqlSelectOptions = (isset($sqlParsed["OPTIONS"]) && count($sqlParsed["OPTIONS"]) > 0) ? implode(" ", $sqlParsed["OPTIONS"]) : null; $sqlSelectOptions = (isset($sqlParsed["OPTIONS"]) && count($sqlParsed["OPTIONS"]) > 0) ? implode(" ", $sqlParsed["OPTIONS"]) : null;
@@ -844,6 +887,26 @@ class Variable
if (!empty($sqlParsed['LIMIT'])) { if (!empty($sqlParsed['LIMIT'])) {
$sqlLimit = " LIMIT " . $sqlParsed['LIMIT']['start'] . ", " . $sqlParsed['LIMIT']['end']; $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; return $sqlSelect . $sqlFrom . $sqlWhere . $sqlGroupBy . $sqlHaving . $sqlOrderBy . $sqlLimit;
} }
@@ -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) public function getVariableTypeByName($processUid, $variableName)
{ {
try { try {
@@ -897,4 +990,4 @@ class Variable
} }
} }
} }

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 $dep_uid {@min 1}{@max 32}
* @param string $usr_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 { try {
$oDepartment = new \ProcessMaker\BusinessModel\Department(); $oDepartment = new \ProcessMaker\BusinessModel\Department();
$response = $oDepartment->unassignUser($dep_uid, $usr_uid); $oDepartment->unassignUser($dep_uid, $usr_uid);
return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
} }

View File

@@ -39,9 +39,25 @@ class Light extends Api
{ {
try { try {
$userId = $this->getUserId(); $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) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
} }
@@ -58,12 +74,23 @@ class Light extends Api
"CASES_PAUSED" => "paused", "CASES_PAUSED" => "paused",
"CASES_COMPLETED" => "completed", "CASES_COMPLETED" => "completed",
"CASES_SELFSERVICE" => "unassigned", "CASES_SELFSERVICE" => "unassigned",
'to_do' => 'toDo',
'draft' => 'draft',
'cancelled' => 'cancelled',
'sent' => 'participated',
'paused' => 'paused',
'completed' => 'completed',
'selfservice' => 'unassigned'
); );
$response = array(); $response = array();
foreach ($data as $counterList) { foreach ($data as $key => $counterList) {
if(isset($structure[$counterList['item']])){ if(isset($structure[$counterList['item']])){
$name = $structure[$counterList['item']]; $name = $structure[$counterList['item']];
$response[$name] = $counterList['count']; $response[$name] = $counterList['count'];
} else {
if (isset($structure[$key])) {
$response[$structure[$key]] = $counterList;
}
} }
} }
return $response; return $response;
@@ -105,7 +132,6 @@ class Light extends Api
$filter = '', $filter = '',
$date_from = '', $date_from = '',
$date_to = '', $date_to = '',
$action = '',
$newestthan = '', $newestthan = '',
$oldestthan ='' $oldestthan =''
) { ) {
@@ -123,14 +149,26 @@ class Light extends Api
$dataList['filter'] = $filter; $dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from; $dataList['dateFrom'] = $date_from;
$dataList['dateTo'] = $date_to; $dataList['dateTo'] = $date_to;
$dataList['action'] = $action;
$dataList['newestthan'] = $newestthan; $dataList['newestthan'] = $newestthan;
$dataList['oldestthan'] = $oldestthan; $dataList['oldestthan'] = $oldestthan;
Validator::throwExceptionIfDataNotMetIso8601Format($dataList, $this->arrayFieldIso8601); Validator::throwExceptionIfDataNotMetIso8601Format($dataList, $this->arrayFieldIso8601);
$dataList = DateTime::convertDataToUtc($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 != '') { if ($newestthan != '') {
$response['data'] = array_reverse($response['data']); $response['data'] = array_reverse($response['data']);
} }
@@ -209,8 +247,21 @@ class Light extends Api
Validator::throwExceptionIfDataNotMetIso8601Format($dataList, $this->arrayFieldIso8601); Validator::throwExceptionIfDataNotMetIso8601Format($dataList, $this->arrayFieldIso8601);
$dataList = DateTime::convertDataToUtc($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 != '') { if ($newestthan != '') {
$response['data'] = array_reverse($response['data']); $response['data'] = array_reverse($response['data']);
} }
@@ -279,6 +330,7 @@ class Light extends Api
) { ) {
try { try {
$dataList['userId'] = $this->getUserId(); $dataList['userId'] = $this->getUserId();
$dataList['action'] = 'sent';
$dataList['paged'] = $paged; $dataList['paged'] = $paged;
$dataList['count'] = $count; $dataList['count'] = $count;
@@ -298,8 +350,21 @@ class Light extends Api
Validator::throwExceptionIfDataNotMetIso8601Format($dataList, $this->arrayFieldIso8601); Validator::throwExceptionIfDataNotMetIso8601Format($dataList, $this->arrayFieldIso8601);
$dataList = DateTime::convertDataToUtc($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 != '') { if ($newestthan != '') {
$response['data'] = array_reverse($response['data']); $response['data'] = array_reverse($response['data']);
} }
@@ -380,8 +445,21 @@ class Light extends Api
$dataList['filter'] = $filter; $dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from; $dataList['dateFrom'] = $date_from;
$dataList['dateTo'] = $date_to; $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']); $result = $this->parserDataParticipated($response['data']);
return DateTime::convertUtcToIso8601($result, $this->arrayFieldIso8601); return DateTime::convertUtcToIso8601($result, $this->arrayFieldIso8601);
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -511,13 +589,27 @@ class Light extends Api
if (is_array($d)) { if (is_array($d)) {
$newData = array(); $newData = array();
foreach ($d as $field => $value) { foreach ($d as $field => $value) {
if (array_key_exists($field, $structure)) { if (
$newName = $structure[$field]; preg_match(
'/\|(' . $field . ')\|/i',
'|' . implode('|', array_keys($structure)) . '|',
$arrayMatch
) &&
!is_array($structure[$arrayMatch[1]])
) {
$newName = $structure[$arrayMatch[1]];
$newData[$newName] = is_null($value) ? "":$value; $newData[$newName] = is_null($value) ? "":$value;
} else { } else {
foreach ($structure as $name => $str) { foreach ($structure as $name => $str) {
if (is_array($str) && array_key_exists($field, $str)) { if (is_array($str) &&
$newName = $str[$field]; 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; $newData[$name][$newName] = is_null($value) ? "":$value;
} }
} }
@@ -526,13 +618,27 @@ class Light extends Api
if (count($newData) > 0) if (count($newData) > 0)
$response[] = $newData; $response[] = $newData;
} else { } else {
if (array_key_exists($field, $structure)) { if (
$newName = $structure[$field]; preg_match(
'/\|(' . $field . ')\|/i',
'|' . implode('|', array_keys($structure)) . '|',
$arrayMatch
) &&
!is_array($structure[$arrayMatch[1]])
) {
$newName = $structure[$arrayMatch[1]];
$response[$newName] = is_null($d) ? "":$d; $response[$newName] = is_null($d) ? "":$d;
} else { } else {
foreach ($structure as $name => $str) { foreach ($structure as $name => $str) {
if (is_array($str) && array_key_exists($field, $str)) { if (is_array($str) &&
$newName = $str[$field]; 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; $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) public function doPutTimerEvent($prj_uid, $tmrevn_uid, array $request_data)
{ {
try { 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) { } catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
} }

View File

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

View File

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

View File

@@ -1460,7 +1460,8 @@ Ext.onReady ( function() {
var APP_UID = optionMenuReassignGlobal.APP_UID; var APP_UID = optionMenuReassignGlobal.APP_UID;
var DEL_INDEX = optionMenuReassignGlobal.DEL_INDEX; var DEL_INDEX = optionMenuReassignGlobal.DEL_INDEX;
var rowSelected = Ext.getCmp('reassignGrid').getSelectionModel().getSelected(); var rowSelected = Ext.getCmp("grdpnlUsersToReassign").getSelectionModel().getSelected();
if( rowSelected ) { if( rowSelected ) {
PMExt.confirm(_('ID_CONFIRM'), _('ID_REASSIGN_CONFIRM'), function(){ PMExt.confirm(_('ID_CONFIRM'), _('ID_REASSIGN_CONFIRM'), function(){
var loadMask = new Ext.LoadMask(winReassignInCasesList.getEl(), {msg: _('ID_PROCESSING')}); var loadMask = new Ext.LoadMask(winReassignInCasesList.getEl(), {msg: _('ID_PROCESSING')});
@@ -1500,6 +1501,8 @@ Ext.onReady ( function() {
//optionMenuPause.setMinValue('2010-11-04'); //optionMenuPause.setMinValue('2010-11-04');
var loadMaskUsersToReassign = new Ext.LoadMask(Ext.getBody(), {msg: _("ID_LOADING_GRID")});
var optionMenuReassignGlobal = {}; var optionMenuReassignGlobal = {};
optionMenuReassignGlobal.APP_UID = ""; optionMenuReassignGlobal.APP_UID = "";
optionMenuReassignGlobal.DEL_INDEX = ""; optionMenuReassignGlobal.DEL_INDEX = "";
@@ -1548,83 +1551,156 @@ Ext.onReady ( function() {
optionMenuReassignGlobal.APP_UID = APP_UID; optionMenuReassignGlobal.APP_UID = APP_UID;
optionMenuReassignGlobal.DEL_INDEX = DEL_INDEX; optionMenuReassignGlobal.DEL_INDEX = DEL_INDEX;
if( rowSelected ){ if( rowSelected ){
var store = new Ext.data.Store( { //Variables
autoLoad: true, var pageSizeUsersToReassign = 10;
proxy : new Ext.data.HttpProxy({
url: 'casesList_Ajax?actionAjax=getUsersToReassign&TAS_UID='+TAS_UID //Stores
var storeUsersToReassign = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: "casesList_Ajax",
method: "POST"
}), }),
reader : new Ext.data.JsonReader( {
root: 'data', reader: new Ext.data.JsonReader({
fields : [ root: "resultRoot",
{name : 'USR_UID'}, totalProperty: "resultTotal",
{name : 'USR_USERNAME'}, fields: [
{name : 'USR_FIRSTNAME'}, {name : "USR_UID"},
{name : 'USR_LASTNAME'} {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( { //Components
id: 'reassignGrid', var pagingUsersToReassign = new Ext.PagingToolbar({
height:300, id: "pagingUsersToReassign",
width:'300',
title : '', pageSize: pageSizeUsersToReassign,
stateful : true, store: storeUsersToReassign,
stateId : 'gridCasesList', displayInfo: true,
displayMsg: _("ID_DISPLAY_ITEMS"),
emptyMsg: _("ID_NO_RECORDS_FOUND")
});
var cmodelUsersToReassign = new Ext.grid.ColumnModel({
defaults: {
width: 200,
sortable: true
},
columns: [
{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}
]
});
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, enableColumnResize: true,
enableHdMenu: true, enableHdMenu: true,
frame:false,
cls : 'grid_with_checkbox',
columnLines: true,
viewConfig: { tbar: [
forceFit:true
},
cm: 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}
]
}),
store: store,
tbar:[
{ {
text:_('ID_REASSIGN'), text: _("ID_REASSIGN"),
iconCls: 'ICON_CASES_TO_REASSIGN', iconCls: "ICON_CASES_TO_REASSIGN",
handler: function(){
//Actions.reassignCase handler: function ()
{
reassingCaseToUser(); 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: { bbar: pagingUsersToReassign,
//rowdblclick: openCase,
render: function(){ title: ""
this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING')});
this.ownerCt.doLayout();
}
}
}); });
winReassignInCasesList = new Ext.Window({ winReassignInCasesList = new Ext.Window({
title: '', title: '',
width: 450, width: 450,
height: 280, height: 350,
layout:'fit', layout:'fit',
autoScroll:true, autoScroll:true,
modal: true, modal: true,
maximizable: false, maximizable: false,
items: [grid] items: [grdpnlUsersToReassign]
}); });
winReassignInCasesList.show(); winReassignInCasesList.show();
grdpnlUsersToReassign.store.load();
} }
} }
}, },

View File

@@ -934,82 +934,153 @@ Ext.onReady(function(){
Actions.getUsersToReassign = function() Actions.getUsersToReassign = function()
{ {
var store = new Ext.data.Store( { var loadMaskUsersToReassign = new Ext.LoadMask(Ext.getBody(), {msg: _("ID_LOADING_GRID")});
autoLoad: true,
proxy : new Ext.data.HttpProxy({ //Variables
url: 'ajaxListener?action=getUsersToReassign' var pageSizeUsersToReassign = 10;
}),
reader : new Ext.data.JsonReader( { //Stores
root: 'data', var storeUsersToReassign = new Ext.data.Store({
fields : [ proxy: new Ext.data.HttpProxy({
{name : 'USR_UID'}, url: "ajaxListener",
{name : 'USR_USERNAME'}, method: "POST"
{name : 'USR_FIRSTNAME'}, }),
{name : 'USR_LASTNAME'}
] reader: new Ext.data.JsonReader({
}) root: "resultRoot",
totalProperty: "resultTotal",
fields: [
{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( { //Components
id: 'reassignGrid', var pagingUsersToReassign = new Ext.PagingToolbar({
height:300, id: "pagingUsersToReassign",
width:'300',
title : '',
stateful : true,
stateId : 'gridCasesOpen',
enableColumnResize: true,
enableHdMenu: true,
frame:false,
cls : 'grid_with_checkbox',
columnLines: true,
viewConfig: { pageSize: pageSizeUsersToReassign,
forceFit:true 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: { defaults: {
width: 200, width: 200,
sortable: true sortable: true
}, },
columns: [ columns: [
{id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false}, {id: "USR_UID", dataIndex: "USR_UID", hidden: true, hideable: false},
{header: _('ID_USER_NAME'), dataIndex: 'USR_USERNAME', width: 300}, {id: "USR_FIRSTNAME", dataIndex: "USR_FIRSTNAME", header: _("ID_FIRSTNAME"), width: 300},
{header: _('ID_FIRSTNAME'), dataIndex: 'USR_FIRSTNAME', width: 300}, {id: "USR_LASTNAME", dataIndex: "USR_LASTNAME", header: _("ID_LASTNAME"), width: 300}
{header: _('ID_LASTNAME'), dataIndex: 'USR_LASTNAME', width: 300}
] ]
}),
sm: new Ext.grid.RowSelectionModel({singleSelect: true}),
store: store,
tbar:[
{
text:_('ID_REASSIGN'),
iconCls: 'ICON_CASES_TO_REASSIGN',
handler: Actions.reassignCase
}
],
listeners: {
//rowdblclick: openCase,
render: function(){
this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING')});
this.ownerCt.doLayout();
}
}
}); });
var win = new Ext.Window({ 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: 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();
}
}
],
bbar: pagingUsersToReassign,
title: ""
});
var winReassignInCasesList = new Ext.Window({
title: '', title: '',
width: 450, width: 450,
height: 280, height: 350,
layout:'fit', layout:'fit',
autoScroll:true, autoScroll:true,
modal: true, modal: true,
resizable: false, resizable: false,
maximizable: false, maximizable: false,
items: [grid] items: [grdpnlUsersToReassign]
}); });
Ext.Ajax.request({
Ext.Ajax.request({
url : 'ajaxListener' , url : 'ajaxListener' ,
params : {action : 'verifySession'}, params : {action : 'verifySession'},
success: function ( result, request ) { success: function ( result, request ) {
@@ -1034,7 +1105,9 @@ Ext.onReady(function(){
} }
}); });
} else { } else {
win.show(); winReassignInCasesList.show();
grdpnlUsersToReassign.store.load();
} }
}, },
failure: function ( result, request) { failure: function ( result, request) {
@@ -1047,7 +1120,8 @@ Ext.onReady(function(){
Actions.reassignCase = function() Actions.reassignCase = function()
{ {
var rowSelected = Ext.getCmp('reassignGrid').getSelectionModel().getSelected(); var rowSelected = Ext.getCmp("grdpnlUsersToReassign").getSelectionModel().getSelected();
if( rowSelected ) { if( rowSelected ) {
PMExt.confirm(_('ID_CONFIRM'), _('ID_REASSIGN_CONFIRM'), function(){ PMExt.confirm(_('ID_CONFIRM'), _('ID_REASSIGN_CONFIRM'), function(){
Ext.Ajax.request({ Ext.Ajax.request({

View File

@@ -427,10 +427,10 @@ Ext.onReady(function(){
} }
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
]; ];
function validateFieldSizeAutoincrement(valueType, defaultValue) { function validateFieldSizeAutoincrement(valueType, defaultValue) {
if (Ext.getCmp("sizeEdit").getEl()) { if (Ext.getCmp("sizeEdit").getEl()) {
if (valueType === 'INTEGER' || valueType === 'BIGINT' || valueType === 'SMALLINT' || valueType === 'TINYINT') { if (valueType === 'INTEGER' || valueType === 'BIGINT' || valueType === 'SMALLINT' || valueType === 'TINYINT') {
Ext.getCmp("sizeEdit").enable(); Ext.getCmp("sizeEdit").enable();
Ext.getCmp("sizeEdit").setMaxValue(99); Ext.getCmp("sizeEdit").setMaxValue(99);
@@ -438,13 +438,13 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
if (defaultValue) { if (defaultValue) {
Ext.getCmp("sizeEdit").setValue(''); Ext.getCmp("sizeEdit").setValue('');
} }
Ext.getCmp("field_incre").enable(); Ext.getCmp("field_incre").enable();
if (defaultValue) { if (defaultValue) {
Ext.getCmp("field_incre").setValue(false); Ext.getCmp("field_incre").setValue(false);
} }
} }
if (valueType === 'CHAR' || valueType === 'VARCHAR' || valueType === 'LONGVARCHAR') { if (valueType === 'CHAR' || valueType === 'VARCHAR' || valueType === 'LONGVARCHAR') {
Ext.getCmp("sizeEdit").enable(); Ext.getCmp("sizeEdit").enable();
Ext.getCmp("sizeEdit").setMaxValue(((valueType === 'CHAR') ? 255 : 999)); Ext.getCmp("sizeEdit").setMaxValue(((valueType === 'CHAR') ? 255 : 999));
@@ -452,15 +452,15 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
if (defaultValue) { if (defaultValue) {
Ext.getCmp("sizeEdit").setValue(''); Ext.getCmp("sizeEdit").setValue('');
} }
Ext.getCmp("field_incre").disable(); Ext.getCmp("field_incre").disable();
Ext.getCmp("field_incre").setValue(false); Ext.getCmp("field_incre").setValue(false);
} }
if (valueType === 'BOOLEAN' || valueType === 'DATE' || valueType === 'DATETIME' || valueType === 'TIME' || valueType === 'DECIMAL' || valueType === 'DOUBLE' || valueType === 'FLOAT' || valueType === 'REAL') { if (valueType === 'BOOLEAN' || valueType === 'DATE' || valueType === 'DATETIME' || valueType === 'TIME' || valueType === 'DECIMAL' || valueType === 'DOUBLE' || valueType === 'FLOAT' || valueType === 'REAL') {
Ext.getCmp("sizeEdit").disable(); Ext.getCmp("sizeEdit").disable();
Ext.getCmp("sizeEdit").setValue(''); Ext.getCmp("sizeEdit").setValue('');
Ext.getCmp("field_incre").disable(); Ext.getCmp("field_incre").disable();
Ext.getCmp("field_incre").setValue(false); Ext.getCmp("field_incre").setValue(false);
} }
@@ -721,9 +721,14 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
} }
}); });
var types = new Ext.data.SimpleStore({ var arrayBpmnTypeData = [["NORMAL", _("ID_GLOBAL")]];
fields: ['REP_TAB_TYPE', 'type'], var arrayClassicTypeData = [["NORMAL", _("ID_GLOBAL")], ["GRID", _("ID_GRID")]];
data : [['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({ comboReport = new Ext.form.ComboBox({
@@ -876,7 +881,7 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
} }
} }
}); });
comboReport.setReadOnly(isBpmn); comboReport.setReadOnly(isBpmn);
processStore = new Ext.data.Store( { processStore = new Ext.data.Store( {
@@ -889,7 +894,7 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
action: 'getProcessList' action: 'getProcessList'
}, },
reader : new Ext.data.JsonReader( { 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: { listeners: {
load: function() { load: function() {
@@ -952,6 +957,18 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
listeners:{ listeners:{
select: function(){ 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()}}); comboDbConnections.getStore().reload({params:{PRO_UID : Ext.getCmp('PROCESS').getValue()}});
if (Ext.getCmp('REP_TAB_TYPE').getValue() == 'GRID') { if (Ext.getCmp('REP_TAB_TYPE').getValue() == 'GRID') {
gridsListStore.reload({params:{PRO_UID : Ext.getCmp('PROCESS').getValue()}}); gridsListStore.reload({params:{PRO_UID : Ext.getCmp('PROCESS').getValue()}});

View File

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