From 8a065356eaf669405473e7528f785f249487a81e Mon Sep 17 00:00:00 2001 From: dheeyi william Date: Thu, 19 Jan 2017 10:27:02 -0400 Subject: [PATCH 01/18] HOR-2483 [MANTIS 21846] When output document is set to "Open the file" once click on the generated file link, the downloaded output document have an incorrect name. --- gulliver/system/class.g.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 6b593fb25..39e22b3ff 100644 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -1232,8 +1232,10 @@ class G case 'txt': G::sendHeaders( $filename, 'text/html', $download, $downloadFileName ); break; - case 'doc': case 'pdf': + G::sendHeaders( $filename, 'application/pdf', $download, $downloadFileName ); + break; + case 'doc': case 'pm': case 'po': G::sendHeaders( $filename, 'application/octet-stream', $download, $downloadFileName ); @@ -1283,12 +1285,14 @@ class G { if ($download) { if ($downloadFileName == '') { - $aAux = explode( '/', $filename ); - $downloadFileName = $aAux[count( $aAux ) - 1]; + $aAux = explode('/', $filename); + $downloadFileName = $aAux[count($aAux) - 1]; } - header( 'Content-Disposition: attachment; filename="' . $downloadFileName . '"' ); + header('Content-Disposition: attachment; filename="' . $downloadFileName . '"'); + } else { + header('Content-Disposition: inline; filename="' . $downloadFileName . '"'); } - header( 'Content-Type: ' . $contentType ); + header('Content-Type: ' . $contentType); //if userAgent (BROWSER) is MSIE we need special headers to avoid MSIE behaivor. $userAgent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); From 587229cfb9478431ca728523ac9b6c0e2059744c Mon Sep 17 00:00:00 2001 From: qronald Date: Thu, 19 Jan 2017 15:35:04 -0400 Subject: [PATCH 02/18] HOR-2485 --- workflow/engine/classes/class.pmFunctions.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index 8b31758aa..fe96690b2 100644 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -527,13 +527,27 @@ function WSLogin ($user, $pass, $endpoint = "") function WSOpen ($force = false) { if (isset( $_SESSION["WS_SESSION_ID"] ) || $force) { + $optionsHeaders = array( + "cache_wsdl" => WSDL_CACHE_NONE, + "soap_version" => SOAP_1_1, + "trace" => 1, + "stream_context" => stream_context_create( + array( + 'ssl' => array( + 'verify_peer' => 0, + 'verify_peer_name' => 0 + ) + ) + ) + ); + if (! isset( $_SESSION["WS_END_POINT"] )) { - $defaultEndpoint = "http://" . $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . "/sys" . SYS_SYS . "/en/classic/services/wsdl2"; + $defaultEndpoint = $_SERVER["REQUEST_SCHEME"] . "://" . $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . "/sys" . SYS_SYS . "/en/classic/services/wsdl2"; } $endpoint = isset( $_SESSION["WS_END_POINT"] ) ? $_SESSION["WS_END_POINT"] : $defaultEndpoint; - $client = new SoapClient( $endpoint ); + $client = new SoapClient( $endpoint, $optionsHeaders); return $client; } else { From 30b23873f38c07f3ae987e8821c5edc74f5202d8 Mon Sep 17 00:00:00 2001 From: dheeyi william Date: Fri, 20 Jan 2017 14:40:55 -0400 Subject: [PATCH 03/18] HOR-2462 [Zendesk 4018]- Grid is not able to delete data when populated by trigger --- workflow/engine/classes/class.pmDynaform.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/workflow/engine/classes/class.pmDynaform.php b/workflow/engine/classes/class.pmDynaform.php index 125166c24..d20c56dc1 100644 --- a/workflow/engine/classes/class.pmDynaform.php +++ b/workflow/engine/classes/class.pmDynaform.php @@ -1909,6 +1909,12 @@ class pmDynaform if ($validatorClass !== null) { $validatorClass->validatePost($post); } + //Clears the data in the appData for grids + if (array_key_exists($json->id, $this->fields) && $json->type === 'grid' && + !array_key_exists($json->id, $post) + ) { + $post[$json->variable] = array(array()); + } } }; $json = G::json_decode($this->record["DYN_CONTENT"]); From 7423148b862b0bc780502a6290608962c31c4105 Mon Sep 17 00:00:00 2001 From: dheeyi william Date: Thu, 26 Jan 2017 11:58:46 -0400 Subject: [PATCH 04/18] HOR-2527 CLONE - Array variable is not working in Mobile --- workflow/engine/classes/class.pmDynaform.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.pmDynaform.php b/workflow/engine/classes/class.pmDynaform.php index 125166c24..2ab1441e5 100644 --- a/workflow/engine/classes/class.pmDynaform.php +++ b/workflow/engine/classes/class.pmDynaform.php @@ -27,6 +27,7 @@ class pmDynaform private $context = array(); private $dataSources = null; private $databaseProviders = null; + private $propertyExclude = array(); public function __construct($fields = array()) { @@ -37,6 +38,7 @@ class pmDynaform $this->serverConf = &serverConf::getSingleton(); $this->isRTL = ($this->serverConf->isRtl(SYS_LANG)) ? 'true' : 'false'; $this->fields = $fields; + $this->propertyExclude = array('dataVariable'); $this->getDynaform(); $this->getDynaforms(); $this->synchronizeSubDynaform(); @@ -196,11 +198,13 @@ class pmDynaform if (is_string($value) && in_array(substr($value, 0, 2), $prefixs)) { $triggerValue = substr($value, 2); if (isset($this->fields["APP_DATA"][$triggerValue])) { - if ($key !== "dataVariable") { + if (!in_array($key, $this->propertyExclude)) { $json->{$key} = $this->fields["APP_DATA"][$triggerValue]; } } else { - $json->{$key} = ""; + if (!in_array($key, $this->propertyExclude)) { + $json->{$key} = ""; + } } } //set properties from 'formInstance' variable From a3a1a0c2e93a203c147ab9b47c2cc545460a90c1 Mon Sep 17 00:00:00 2001 From: dheeyi william Date: Thu, 26 Jan 2017 14:29:33 -0400 Subject: [PATCH 05/18] HOR-2527 CLONE - Array variable is not working in Mobile --- workflow/engine/classes/class.pmDynaform.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/workflow/engine/classes/class.pmDynaform.php b/workflow/engine/classes/class.pmDynaform.php index 2ab1441e5..1fb8638ab 100644 --- a/workflow/engine/classes/class.pmDynaform.php +++ b/workflow/engine/classes/class.pmDynaform.php @@ -27,7 +27,7 @@ class pmDynaform private $context = array(); private $dataSources = null; private $databaseProviders = null; - private $propertyExclude = array(); + private $propertiesToExclude = array(); public function __construct($fields = array()) { @@ -38,7 +38,7 @@ class pmDynaform $this->serverConf = &serverConf::getSingleton(); $this->isRTL = ($this->serverConf->isRtl(SYS_LANG)) ? 'true' : 'false'; $this->fields = $fields; - $this->propertyExclude = array('dataVariable'); + $this->propertiesToExclude = array('dataVariable'); $this->getDynaform(); $this->getDynaforms(); $this->synchronizeSubDynaform(); @@ -198,11 +198,11 @@ class pmDynaform if (is_string($value) && in_array(substr($value, 0, 2), $prefixs)) { $triggerValue = substr($value, 2); if (isset($this->fields["APP_DATA"][$triggerValue])) { - if (!in_array($key, $this->propertyExclude)) { + if (!in_array($key, $this->propertiesToExclude)) { $json->{$key} = $this->fields["APP_DATA"][$triggerValue]; } } else { - if (!in_array($key, $this->propertyExclude)) { + if (!in_array($key, $this->propertiesToExclude)) { $json->{$key} = ""; } } From eec8aa5f0843f8a18b91ad78846b91f05e58d385 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Tue, 31 Jan 2017 17:43:50 -0400 Subject: [PATCH 06/18] HOR-2624 --- workflow/engine/classes/class.case.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index 8a938d803..6d56a8544 100644 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -4433,6 +4433,11 @@ class Cases /*----------------------------------********---------------------------------*/ $this->getExecuteTriggerProcess($sApplicationUID, 'REASSIGNED'); + + //Delete record of the table LIST_UNASSIGNED + $unassigned = new ListUnassigned(); + $unassigned->remove($sApplicationUID, $iDelegation); + return true; } From c2f92115264c292baa1dbf6c85148f67b285e024 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Wed, 1 Feb 2017 12:28:15 -0400 Subject: [PATCH 07/18] HOR-2487 --- workflow/engine/classes/model/AppDelegation.php | 11 ++++++----- workflow/engine/methods/cases/cases_Step.php | 2 +- .../engine/src/ProcessMaker/Core/RoutingScreen.php | 3 +++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/workflow/engine/classes/model/AppDelegation.php b/workflow/engine/classes/model/AppDelegation.php index 7feeaa1df..abb930c01 100644 --- a/workflow/engine/classes/model/AppDelegation.php +++ b/workflow/engine/classes/model/AppDelegation.php @@ -442,6 +442,7 @@ class AppDelegation extends BaseAppDelegation //Get Task properties $task = TaskPeer::retrieveByPK( $this->getTasUid() ); + $aData = array(); $aData['TAS_UID'] = $this->getTasUid(); //Added to allow User defined Timing Control at Run time from Derivation screen if (isset( $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] ) && $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] == 'true') { @@ -471,7 +472,7 @@ class AppDelegation extends BaseAppDelegation //Calendar - Use the dates class to calculate dates $calendar = new calendar(); - $arrayCalendarData = array(); + $arrayCalendarData = $calendar->getCalendarData($aCalendarUID); if ($calendar->pmCalendarUid == "") { $calendar->getCalendar(null, $this->getProUid(), $this->getTasUid()); @@ -480,11 +481,11 @@ class AppDelegation extends BaseAppDelegation } //Due date - /*$iDueDate = $calendar->calculateDate( $this->getDelDelegateDate(), $aData['TAS_DURATION'], $aData['TAS_TIMEUNIT'] //hours or days, ( we only accept this two types or maybe weeks - );*/ - $dueDate = $calendar->dashCalculateDate($this->getDelDelegateDate(), $aData["TAS_DURATION"], $aData["TAS_TIMEUNIT"], $arrayCalendarData); + $initDate = $this->getDelDelegateDate(); + $timeZone = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($initDate); + $dueDate = $calendar->dashCalculateDate($timeZone, $aData["TAS_DURATION"], $aData["TAS_TIMEUNIT"], $arrayCalendarData); - //Return + $dueDate = \ProcessMaker\Util\DateTime::convertDataToUtc($dueDate); return $dueDate; } diff --git a/workflow/engine/methods/cases/cases_Step.php b/workflow/engine/methods/cases/cases_Step.php index 8b1b1ff3f..24f085044 100644 --- a/workflow/engine/methods/cases/cases_Step.php +++ b/workflow/engine/methods/cases/cases_Step.php @@ -1009,7 +1009,7 @@ try { $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] = ""; if ($aValues['NEXT_TASK']['TAS_TRANSFER_FLY'] == 'true') { $aFields['TASK'][$sKey]['NEXT_TASK']['TAS_DURATION'] = ''; - $hoursSelected = $daysSelected = ''; + $hoursSelected = $daysSelected = $minSelected = ''; if ($aFields['TASK'][$sKey]['NEXT_TASK']['TAS_TIMEUNIT'] == 'HOURS') { $hoursSelected = "selected = 'selected'"; } else { diff --git a/workflow/engine/src/ProcessMaker/Core/RoutingScreen.php b/workflow/engine/src/ProcessMaker/Core/RoutingScreen.php index d6dd9c209..dafe61a98 100644 --- a/workflow/engine/src/ProcessMaker/Core/RoutingScreen.php +++ b/workflow/engine/src/ProcessMaker/Core/RoutingScreen.php @@ -65,6 +65,9 @@ class RoutingScreen extends \Derivation } else { $aDataMerged[$key]['NEXT_ROUTING'][] = $post[$i]; } + if (isset($post[$i]['NEXT_TASK'])) { + $aDataMerged[$key]['NEXT_TASK'] = $post[$i]['NEXT_TASK']; + } } } } From a57d975564b2846f92b6aa3e8a3f13b45f602e41 Mon Sep 17 00:00:00 2001 From: dheeyi william Date: Thu, 2 Feb 2017 11:49:09 -0400 Subject: [PATCH 08/18] HOR-2629 Remove the getCounters in the NotificationDevice --- .../ProcessMaker/BusinessModel/Light/NotificationDevice.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Light/NotificationDevice.php b/workflow/engine/src/ProcessMaker/BusinessModel/Light/NotificationDevice.php index 13e45a3ff..34422b962 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Light/NotificationDevice.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Light/NotificationDevice.php @@ -199,11 +199,6 @@ class NotificationDevice $devices = $oNoti->loadUsersArrayId($userIds); } else { $devices = $oNoti->loadByUsersId($userIds); - $lists = new \ProcessMaker\BusinessModel\Lists(); - $counter = $lists->getCounters($userIds); - $light = new \ProcessMaker\Services\Api\Light(); - $result = $light->parserCountersCases($counter); - $data['counters'] = $result; } $devicesAndroidIds = array(); From 76e82877e61ac413717eca8e2ad5349848e139a7 Mon Sep 17 00:00:00 2001 From: dheeyi william Date: Mon, 6 Feb 2017 10:52:47 -0400 Subject: [PATCH 09/18] HOR-2636 [Zendesk 4094] - Auto Suggest/Combo Box feature when reassigning. --- .../engine/methods/cases/casesList_Ajax.php | 24 +++++++++++++++++++ workflow/engine/templates/cases/casesList.js | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/workflow/engine/methods/cases/casesList_Ajax.php b/workflow/engine/methods/cases/casesList_Ajax.php index 2612aea43..20f208433 100644 --- a/workflow/engine/methods/cases/casesList_Ajax.php +++ b/workflow/engine/methods/cases/casesList_Ajax.php @@ -64,6 +64,30 @@ if ($actionAjax == "userValues") { $users = filterUserListArray($users, $query); //now get users, just for the Search action switch ($action) { + case 'to_reassign': + $cUsers = $oAppCache->getToReassignListCriteria(null); + $cUsers->addSelectColumn(AppCacheViewPeer::USR_UID); + + if (g::MySQLSintaxis()) { + $cUsers->addGroupByColumn(AppCacheViewPeer::USR_UID); + } + + if (!is_null($query)) { + $filters = $cUsers->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $query . '%', Criteria::LIKE)->addOr( + $cUsers->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $query . '%', Criteria::LIKE)->addOr( + $cUsers->getNewCriterion(UsersPeer::USR_USERNAME, '%' . $query . '%', Criteria::LIKE))); + $cUsers->addAnd($filters); + } + $cUsers->setLimit(20); + $cUsers->addAscendingOrderByColumn(AppCacheViewPeer::APP_CURRENT_USER); + $oDataset = AppCacheViewPeer::doSelectRS($cUsers, Propel::getDbConnection('workflow_ro')); + $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $oDataset->next(); + while ($aRow = $oDataset->getRow()) { + $users[] = array("USR_UID" => $aRow['USR_UID'], "USR_FULLNAME" => $aRow['APP_CURRENT_USER']); + $oDataset->next(); + } + break; case 'search_simple': case 'search': G::LoadClass("configuration"); diff --git a/workflow/engine/templates/cases/casesList.js b/workflow/engine/templates/cases/casesList.js index 9331c55ef..f1469952b 100644 --- a/workflow/engine/templates/cases/casesList.js +++ b/workflow/engine/templates/cases/casesList.js @@ -2050,7 +2050,8 @@ Ext.onReady ( function() { btnReassign, "->", _("ID_USER"), - comboAllUsers, + suggestUser, + resetSuggestButton, "-", _("ID_CATEGORY"), comboCategory, From 03b6f0ef30a254b64424afb463b0b33a08bc5594 Mon Sep 17 00:00:00 2001 From: dheeyi william Date: Mon, 6 Feb 2017 11:15:10 -0400 Subject: [PATCH 10/18] HOR-2634 CLONE 3.2- Remove the autoload in reassignList.js --- workflow/engine/templates/cases/reassignList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/templates/cases/reassignList.js b/workflow/engine/templates/cases/reassignList.js index f666d6f7b..08e8d1228 100644 --- a/workflow/engine/templates/cases/reassignList.js +++ b/workflow/engine/templates/cases/reassignList.js @@ -32,7 +32,7 @@ var storeUsersToReassign = new Ext.data.Store({ remoteSort: false, - autoLoad:true, + autoLoad:false, proxy : proxyUsersToReassignList, reader: readerUsersToReassignList, writer: writerUsersToReassignList, // <-- plug a DataWriter into the store just as you would a Reader From aaaa2d35fb8bc83640e44623ad5af550d65ad172 Mon Sep 17 00:00:00 2001 From: dheeyi william Date: Mon, 6 Feb 2017 14:48:14 -0400 Subject: [PATCH 11/18] HOR-2630 Remove the casesMenuLoader?action=getProcess in the main.js --- .../engine/methods/cases/casesMenuLoader.php | 61 ------------------- workflow/engine/templates/cases/main.js | 52 +--------------- 2 files changed, 2 insertions(+), 111 deletions(-) diff --git a/workflow/engine/methods/cases/casesMenuLoader.php b/workflow/engine/methods/cases/casesMenuLoader.php index ddb50e00c..d45138fe7 100644 --- a/workflow/engine/methods/cases/casesMenuLoader.php +++ b/workflow/engine/methods/cases/casesMenuLoader.php @@ -9,9 +9,6 @@ switch ($action) { case 'getAllCounters': getAllCounters(); break; - case 'getProcess': - getProcess(); - break; /*----------------------------------********---------------------------------*/ case 'getAllCountersEnterprise': getAllCountersEnterprise(); @@ -218,64 +215,6 @@ function getLoadTreeMenuData () print $xml;*/ } -// get the process summary of specific case list type, -function getProcess () -{ - global $G_TMP_MENU; - global $userId; - if (! isset( $_GET['item'] )) { - die(); - } - - $oMenu = new Menu(); - $oMenu->load( 'cases' ); - $type = $_GET['item']; - $oCases = new AppCacheView(); - - $aTypesID = array (); - $aTypesID['CASES_INBOX'] = 'to_do'; - $aTypesID['CASES_DRAFT'] = 'draft'; - $aTypesID['CASES_CANCELLED'] = 'cancelled'; - $aTypesID['CASES_SENT'] = 'sent'; - $aTypesID['CASES_PAUSED'] = 'paused'; - $aTypesID['CASES_COMPLETED'] = 'completed'; - $aTypesID['CASES_SELFSERVICE'] = 'selfservice'; - //$aTypesID['CASES_TO_REVISE'] = 'to_revise'; - //$aTypesID['CASES_TO_REASSIGN'] = 'to_reassign'; - $aTypesID = Array ('CASES_INBOX' => 'to_do','CASES_DRAFT' => 'draft','CASES_CANCELLED' => 'cancelled','CASES_SENT' => 'sent','CASES_PAUSED' => 'paused','CASES_COMPLETED' => 'completed','CASES_SELFSERVICE' => 'selfservice','CASES_TO_REVISE' => 'to_revise','CASES_TO_REASSIGN' => 'to_reassign'); - - $aCount = $oCases->getAllCounters( Array ($aTypesID[$type] - ), $userId, true ); - - $response = Array (); - //disabling the summary... - /* - $i=0; - foreach($aCount[$aTypesID[$type]]['sumary'] as $PRO_UID=>$process){ - //{"text":"state","id":"src\/state","cls":"folder", loaded:true}, - $response[$i] = new stdClass(); - $response[$i]->text = $process['name'] . ' ('.$process['count'].')'; - $response[$i]->id = $process['name']; - $response[$i]->cls = 'folder'; - $response[$i]->loaded = true; - $i++; - } - */ - //ordering - /*for($i=0; $i<=count($response)-1; $i++){ - for($j=$i+1; $j<=count($response); $j++){ - - echo $response[$j]->text .'<'. $response[$i]->text; - if($response[$j]->text[0] < $response[$i]->text[0]){ - $x = $response[$i]; - $response[$i] = $response[$j]; - $response[$j] = $x; - } - } - }*/ - echo G::json_encode( $response ); -} - /*----------------------------------********---------------------------------*/ function getAllCountersEnterprise() { diff --git a/workflow/engine/templates/cases/main.js b/workflow/engine/templates/cases/main.js index a8b4b9b4c..cee5b829a 100644 --- a/workflow/engine/templates/cases/main.js +++ b/workflow/engine/templates/cases/main.js @@ -16,7 +16,6 @@ var propStore; var triggerStore; var debugVariablesFilter; -var ReloadTreeMenuItemDetail; var NOTIFIER_FLAG = false; var result; var _action = ''; @@ -258,39 +257,6 @@ Ext.onReady(function(){ } }); - - - var treeMenuItemDetail = new Ext.tree.TreePanel({ - id: 'tree_menuItem_detail', - region: 'south', - animate:true, - autoScroll:true, - loader: new Ext.tree.TreeLoader({ - dataUrl:'casesMenuLoader?action=getProcess' - }), - enableDD:true, - containerScroll: true, - border: false, - width: 250, - height: 120, - dropConfig: {appendOnly:true}, - collapsible: true, - split: true, - margins: '0 2 2 2', - cmargins: '2 2 2 2', - rootVisible: false, - root: new Ext.tree.AsyncTreeNode()/*, - tbar: [{ - text: 'reload', - handler: ReloadTreeMenuItemDetail - }]*/ - }); - - ReloadTreeMenuItemDetail = function(params){ - treeMenuItemDetail.loader.dataUrl = 'casesMenuLoader?action=getProcess&item='+params.item; - treeMenuItemDetail.root.reload(); - } - // set the root node var root = new Ext.tree.AsyncTreeNode({ text: 'Ext JS', @@ -300,8 +266,6 @@ Ext.onReady(function(){ expanded:true }); - treeMenuItemDetail.setRootNode(root); - mainMenu = new Ext.Panel({ id:'menuTreePanel', title: '', @@ -317,8 +281,7 @@ Ext.onReady(function(){ margins: '0 0 0 2', items: [ - treeMenuItems, - treeMenuItemDetail + treeMenuItems ] }); mainMenu.setTitle("
"); @@ -530,15 +493,6 @@ Ext.onReady(function(){ menuPanelC.hide(); menuPanelC.ownerCt.doLayout(); - /**show*/ - //w.show(); - //w.ownerCt.doLayout(); - //w.expand(); - - var menuPanelDetail = Ext.getCmp('tree_menuItem_detail'); - menuPanelDetail.hide(); - menuPanelDetail.ownerCt.doLayout(); - //FORMATS.casesListRefreshTime is in seconds setTimeout("timer()", parseInt(FORMATS.casesListRefreshTime) * 1000); }); @@ -571,9 +525,7 @@ function updateCasesTree() { document.getElementById('refreshNotifiers').src = '/images/ext/default/grid/loading.gif'; itemsTypes = Array('CASES_INBOX', 'CASES_DRAFT', 'CASES_CANCELLED', 'CASES_SENT', 'CASES_PAUSED', 'CASES_COMPLETED', 'CASES_SELFSERVICE'); - if (currentSelectedTreeMenuItem) { - ReloadTreeMenuItemDetail({item: currentSelectedTreeMenuItem}); - } + Ext.Ajax.request({ url: urlProxy + Math.random(), success: function (response) { From 88f31578f33c9dc84e9ab232073f46d4e561ecb7 Mon Sep 17 00:00:00 2001 From: Taylor Dondich Date: Mon, 6 Feb 2017 15:01:52 -0800 Subject: [PATCH 12/18] Add initial Jenkinsfile. --- Jenkinsfile | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..b567a76c9 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,96 @@ +#!groovy +node { + /** + * Branch should be in gitflow format. If not, then we'll abort. + */ + + if(!env.BRANCH_NAME.matches(/(feature|hotfix|release)\/.+/)) { + hipchatSend message: "${env.BRANCH_NAME} Build: Does not match gitflow naming. Aborted", room: 'engineering' + error "Job does not follow gitflow naming format." + } + // Parse out our short name and potential jira ticket. Null if not associated. If null, then for now we won't notify + // on jira ticket + def jiraTicket = env.BRANCH_NAME.find(/HOR-\d+/) + + def shortname = env.BRANCH_NAME.replace('/', '-').toLowerCase() + def dbSuffix = shortname.replace('-', '') + + echo "Building for ${env.BRANCH_NAME}" + + // Checkout source + checkout scm + + try { + stage('Start Notification') { + if(jiraTicket) { + jiraComment issueKey: jiraTicket, body: "Build ${env.BUILD_NUMBER} Starting.\nTicket will be updated once build is completed.\n\n${env.BUILD_URL}" + } + hipchatSend message: "${env.BRANCH_NAME} Build: ${env.BUILD_NUMBER} Starting.\n${env.BUILD_URL}", room: 'engineering' + } + + stage('Dependencies') { + echo "Running Composer" + sh 'composer install' + echo "Running rake" + sh 'rake' + } + + stage('Generate QA MySQL Databases') { + withCredentials([string(credentialsId: 'qa-rds-hostname', variable: 'rdsHostname'), usernamePassword(credentialsId: 'qa-rds-credentials', passwordVariable: 'rdsPassword', usernameVariable: 'rdsUsername')]) { + echo 'Dropping existing database and recreating.' + sh "mysql -h ${rdsHostname} -u ${rdsUsername} -p${rdsPassword} -e 'drop database if exists qa205${dbSuffix}; create database qa205${dbSuffix}'" + sh "mysql -h ${rdsHostname} -u ${rdsUsername} -p${rdsPassword} -e 'drop database if exists qa300${dbSuffix}; create database qa300${dbSuffix}'" + } + } + + stage('Publish to QA-205') { + sshagent(['processmaker-deploy']) { + echo 'Dropping existing files and recreating' + sh "ssh processmaker@build-qa205.processmaker.net 'rm -Rf /home/processmaker/${shortname}'" + sh "scp -r ./ processmaker@build-qa205.processmaker.net:~/${shortname}" + echo 'Creating necessary directories' + sh "ssh processmaker@build-qa205.processmaker.net 'mkdir -p /home/processmaker/${shortname}/workflow/engine/js/labels'" + sh "ssh processmaker@build-qa205.processmaker.net 'mkdir -p /home/processmaker/${shortname}/workflow/public_html/translations'" + } + } + + stage('Publish to QA-300') { + sshagent(['processmaker-deploy']) { + echo 'Dropping existing files and recreating' + sh "ssh processmaker@build-qa300.processmaker.net 'rm -Rf /home/processmaker/${shortname}'" + sh "scp -r ./ processmaker@build-qa300.processmaker.net:~/${shortname}" + echo 'Creating necessary directories' + sh "ssh processmaker@build-qa300.processmaker.net 'mkdir -p /home/processmaker/${shortname}/workflow/engine/js/labels'" + sh "ssh processmaker@build-qa300.processmaker.net 'mkdir -p /home/processmaker/${shortname}/workflow/public_html/translations'" + } + } + + stage('Success Notification') { + withCredentials([string(credentialsId: 'qa-rds-hostname', variable: 'rdsHostname'), usernamePassword(credentialsId: 'qa-rds-credentials', passwordVariable: 'rdsPassword', usernameVariable: 'rdsUsername')]) { + if(jiraTicket) { + jiraComment issueKey: jiraTicket, body: "" + + "Build ${env.BUILD_NUMBER} Completed.\n" + + "5.6 Build: https://${shortname}.qa205.processmaker.net\n" + + "Database Host: ${rdsHostname}\n" + + "Username: ${rdsUsername}\n" + + "Password: ${rdsPassword}\n" + + "Database: qa205${dbSuffix}\n\n" + + "7.0 Build: https://${shortname}.qa300.processmaker.net\n" + + "Database Host: ${rdsHostname}\n" + + "Username: ${rdsUsername}\n" + + "Password: ${rdsPassword}\n" + + "Database: qa300${dbSuffix}\n\n" + + "${env.BUILD_URL}" + } + hipchatSend room: 'engineering', message: "" + + "${env.BRANCH_NAME} Build: ${env.BUILD_NUMBER} Completed.\n" + + "${env.BUILD_URL}" + } + } + } catch(error) { + if(jiraTicket) { + jiraComment issueKey: jiraTicket, body: "Build ${env.BUILD_NUMBER} Failed: ${error}\n\n${env.BUILD_URL}" + } + hipchatSend message: "${env.BRANCH_NAME} Build: ${env.BUILD_NUMBER} Failed: ${error}\n${env.BUILD_URL}", room: 'engineering' + } +} \ No newline at end of file From b8ff3add6b77c7e83f63e6bfa8c60ab0b8e81b5b Mon Sep 17 00:00:00 2001 From: Taylor Dondich Date: Mon, 6 Feb 2017 15:05:42 -0800 Subject: [PATCH 13/18] Update Jenkins file to replace periods with dashes in shortname and dbsuffix naming. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b567a76c9..170ca59a7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ node { def jiraTicket = env.BRANCH_NAME.find(/HOR-\d+/) def shortname = env.BRANCH_NAME.replace('/', '-').toLowerCase() - def dbSuffix = shortname.replace('-', '') + def dbSuffix = shortname.replace('-', '').replace('.', '') echo "Building for ${env.BRANCH_NAME}" From db66e03953b84ccc7149652898619f64c24e5667 Mon Sep 17 00:00:00 2001 From: Taylor Dondich Date: Mon, 6 Feb 2017 15:15:01 -0800 Subject: [PATCH 14/18] Fix for the right place to add dashes. --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 170ca59a7..b10158ce7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,8 +12,8 @@ node { // on jira ticket def jiraTicket = env.BRANCH_NAME.find(/HOR-\d+/) - def shortname = env.BRANCH_NAME.replace('/', '-').toLowerCase() - def dbSuffix = shortname.replace('-', '').replace('.', '') + def shortname = env.BRANCH_NAME.replace('/', '-').replace('.', '-').toLowerCase() + def dbSuffix = shortname.replace('-', '') echo "Building for ${env.BRANCH_NAME}" From a953260ee838c5b1a824bfbd8f430d2688521f73 Mon Sep 17 00:00:00 2001 From: Taylor Dondich Date: Tue, 7 Feb 2017 08:37:46 -0800 Subject: [PATCH 15/18] Update Jenkinsfile to support bugfix branches and pull requests. --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b10158ce7..aa54badf8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,8 +3,7 @@ node { /** * Branch should be in gitflow format. If not, then we'll abort. */ - - if(!env.BRANCH_NAME.matches(/(feature|hotfix|release)\/.+/)) { + if(!env.BRANCH_NAME.matches(/(feature|hotfix|bugfix|release)\/.+/) && !test.matches(/^PR-.*$/)) { hipchatSend message: "${env.BRANCH_NAME} Build: Does not match gitflow naming. Aborted", room: 'engineering' error "Job does not follow gitflow naming format." } From c2d263f99dfbcb42dc60a102d4f2908312cfbe2b Mon Sep 17 00:00:00 2001 From: qronald Date: Tue, 7 Feb 2017 13:21:34 -0400 Subject: [PATCH 16/18] HOR-2652 --- .../src/ProcessMaker/Services/Api/Light.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Light.php b/workflow/engine/src/ProcessMaker/Services/Api/Light.php index 80f288b49..cf6b07266 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Light.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Light.php @@ -30,6 +30,35 @@ class Light extends Api 'delRiskDate' ]; + public function __isAllowed() + { + try { + $methodName = $this->restler->apiMethodInfo->methodName; + $arrayArgs = $this->restler->apiMethodInfo->arguments; + switch ($methodName) { + case 'doIfAlreadyRoute': + $applicationUid = $this->parameters[$arrayArgs['app_uid']]; + $delIndex = $this->parameters[$arrayArgs['cas_index']]; + $userUid = $this->getUserId(); + //Check if the user has the case + $appDelegation = new \AppDelegation(); + $aCurUser = $appDelegation->getCurrentUsers($applicationUid, $delIndex); + if (!empty($aCurUser)) { + foreach ($aCurUser as $key => $value) { + if ($value === $userUid) { + return true; + } + } + } + return false; + break; + } + return false; + } catch (\Exception $e) { + throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); + } + } + /** * Constructor of the class * @@ -793,6 +822,8 @@ class Light extends Api /** * Get Already Route * + * @access protected + * @class AccessControl {@className \ProcessMaker\Services\Api\Light} * @param string $app_uid {@min 1}{@max 32} * @param int $cas_index * From 580b0958b2bc71d03e5d98c0d44cca0d941ccc89 Mon Sep 17 00:00:00 2001 From: qronald Date: Wed, 8 Feb 2017 08:14:05 -0400 Subject: [PATCH 17/18] up observations --- workflow/engine/src/ProcessMaker/Services/Api/Light.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Light.php b/workflow/engine/src/ProcessMaker/Services/Api/Light.php index cf6b07266..32757d56a 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Light.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Light.php @@ -43,12 +43,8 @@ class Light extends Api //Check if the user has the case $appDelegation = new \AppDelegation(); $aCurUser = $appDelegation->getCurrentUsers($applicationUid, $delIndex); - if (!empty($aCurUser)) { - foreach ($aCurUser as $key => $value) { - if ($value === $userUid) { - return true; - } - } + if (!empty($aCurUser) && in_array($userUid, $aCurUser)) { + return true; } return false; break; From dacc02724a9c13777c94f8b1ddbb3d5033a6dcc7 Mon Sep 17 00:00:00 2001 From: Taylor Dondich Date: Wed, 8 Feb 2017 11:04:43 -0800 Subject: [PATCH 18/18] Update Jenkinsfile to evaluate proper variable for PR matching. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index aa54badf8..7d9279ade 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,7 @@ node { /** * Branch should be in gitflow format. If not, then we'll abort. */ - if(!env.BRANCH_NAME.matches(/(feature|hotfix|bugfix|release)\/.+/) && !test.matches(/^PR-.*$/)) { + if(!env.BRANCH_NAME.matches(/(feature|hotfix|bugfix|release)\/.+/) && !env.BRANCH_NAME.matches(/^PR-.*$/)) { hipchatSend message: "${env.BRANCH_NAME} Build: Does not match gitflow naming. Aborted", room: 'engineering' error "Job does not follow gitflow naming format." }