From ce40eb957f3b7e6dba0daadabf87e03633f39894 Mon Sep 17 00:00:00 2001 From: jonathan Date: Tue, 10 Mar 2015 15:10:47 -0400 Subject: [PATCH 1/7] update styles in index.html of designer --- workflow/engine/templates/designer/index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/workflow/engine/templates/designer/index.html b/workflow/engine/templates/designer/index.html index 5b407f802..54a3e3dd3 100644 --- a/workflow/engine/templates/designer/index.html +++ b/workflow/engine/templates/designer/index.html @@ -82,12 +82,14 @@ From d3af8f1a6233d6edb060f3d0913ee8c68d9abe43 Mon Sep 17 00:00:00 2001 From: dheeyi Date: Thu, 12 Mar 2015 16:40:31 -0400 Subject: [PATCH 2/7] PM-1618 Home > Documents: Al momento de arrastrar una carpeta a otra se crean carpetas vacias Causa : Listeners no adecuados(ExtJS). Solucion : Hacer uso de otros eventos de tipo Listeners(ExtJS). --- .../engine/templates/cases/casesDocuments.js | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/workflow/engine/templates/cases/casesDocuments.js b/workflow/engine/templates/cases/casesDocuments.js index 9a272b7c5..481fffbbd 100755 --- a/workflow/engine/templates/cases/casesDocuments.js +++ b/workflow/engine/templates/cases/casesDocuments.js @@ -1739,6 +1739,16 @@ function copymoveCtx(e) { copymove('moveExecute'); } +var loader = new Ext.tree.TreeLoader({ + preloadChildren : true, + dataUrl : '../appFolder/appFolderAjax.php', + baseParams : { + action : 'expandNode', + sendWhat : 'dirs', + renderTree : 1 + } + }); + var documentsTab = { id : 'documents', // title : 'Documents', @@ -1772,15 +1782,7 @@ var documentsTab = { } ], // rootVisible: false, - loader : new Ext.tree.TreeLoader({ - preloadChildren : true, - dataUrl : '../appFolder/appFolderAjax.php', - baseParams : { - action : 'expandNode', - sendWhat : 'dirs', - renderTree : 1 - } - }), + loader : loader, containerScroll : true, enableDD : true, ddGroup : 'TreeDD', @@ -1834,10 +1836,10 @@ var documentsTab = { return true; } }, - 'beforenodedrop' : { - fn : function(e) { - dropEvent = e; - copymoveCtx(e); + 'nodedrop' : { + fn : function(e) { + dropEvent = e; + copymoveCtx(e); datastore.reload(); } }, From 1fd78621a0814b3b096e2d8292bc6022592496cb Mon Sep 17 00:00:00 2001 From: jonathan Date: Thu, 12 Mar 2015 17:29:20 -0400 Subject: [PATCH 3/7] update last icons in designer --- workflow/engine/templates/designer/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow/engine/templates/designer/index.html b/workflow/engine/templates/designer/index.html index 54a3e3dd3..864036d8a 100644 --- a/workflow/engine/templates/designer/index.html +++ b/workflow/engine/templates/designer/index.html @@ -86,8 +86,8 @@
  • -
  • -
  • +
  • +
  • From 28cd3411ad4d5c8f837dbd40ea7a413a35535415 Mon Sep 17 00:00:00 2001 From: dheeyi Date: Fri, 13 Mar 2015 13:33:09 -0400 Subject: [PATCH 4/7] PM-864, PM-865, PM-805 y PM-1848 causa : Definida previamente asi. solucion : Redefinicion y ajustes. --- .../engine/templates/oauth2/clientSetup.js | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/workflow/engine/templates/oauth2/clientSetup.js b/workflow/engine/templates/oauth2/clientSetup.js index 79ef6c783..e0f051809 100644 --- a/workflow/engine/templates/oauth2/clientSetup.js +++ b/workflow/engine/templates/oauth2/clientSetup.js @@ -254,7 +254,7 @@ clientSetup.application = { data: [["20"], ["30"], ["40"], ["50"], ["100"]], autoLoad: true }); - + //Components var winData = new Ext.Window({ layout: "fit", @@ -289,7 +289,11 @@ clientSetup.application = { id: "txtName", name: "txtName", - fieldLabel: "Name" + fieldLabel: "Name", + validator: function(value){ + var val = (value=='')? false: true; + return val; + } }, { xtype: "label", @@ -320,8 +324,15 @@ clientSetup.application = { id: "txtWebSite", name: "txtWebSite", - fieldLabel: "Web Site", - vtype: "url" + fieldLabel: "Web Site", + validator: function (value){ + var regexpUrl = /[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi; + var regexStringIp = new RegExp(regexpUrl); + var regexpIpAdress = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/g; + var regexNumberIp = new RegExp(regexpIpAdress); + var result = (value.match(regexStringIp) || value.match(regexNumberIp))? true : false; + return result; + } }, { xtype: "label", @@ -345,7 +356,7 @@ clientSetup.application = { fieldLabel: " ", labelSeparator: "", - html: "" + "here should we return after successfully authenticating? For @Anywhere applications, only the domain specified in the callback will be used. OAuth 1.0a applications should explicitly specify their oauth_callback URL on the request token step, regardless of the value given here. To restrict your application from using callbacks, leave this field blank." + "" + html: "" + "URL where redirected after successfully authenticating (calling the {workspace}/oauth2/authorize endpoint). This URL typically contains code to get the access token from the {workspace}/oauth2/token endpoint. To prevent your application from using callbacks, leave this field blank." + "" } ] }) @@ -499,7 +510,7 @@ clientSetup.application = { var btnDetail = new Ext.Action({ id: "btnDetail", - text: _("ID_DETAIL"), + text: _("ID_DETAILS"), iconCls: "button_menu_ext ss_sprite ss_zoom", handler: function () @@ -695,7 +706,7 @@ clientSetup.application = { items: [grdpnlMain] }); } + } -Ext.onReady(clientSetup.application.init, clientSetup.application); - +Ext.onReady(clientSetup.application.init, clientSetup.application); \ No newline at end of file From 326af06080251f842ab1c02e585fb981033c6ef8 Mon Sep 17 00:00:00 2001 From: Luis Fernando Saisa Lopez Date: Mon, 16 Mar 2015 13:27:49 -0400 Subject: [PATCH 5/7] PM-1668 "Designer > No se habilita en Logs-> el auditLog..." SOLVED > Code Issue: No se habilita en Logs-> el auditLog cuando este se habilita > Solution: Cuando se habilita el Audit Log en SETTINGS>AUDIT LOG y se cambia al tab Logs se mostrara en la lista el Audit Log habilitado. --- workflow/engine/templates/setup/main.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/workflow/engine/templates/setup/main.js b/workflow/engine/templates/setup/main.js index 4ff9ece69..0424cb71d 100755 --- a/workflow/engine/templates/setup/main.js +++ b/workflow/engine/templates/setup/main.js @@ -4,6 +4,8 @@ */ var _NODE_SELECTED; +var flagRenderTabLog = false; + var main = function(){ var cookiep = new Ext.state.CookieProvider(); @@ -130,7 +132,19 @@ var main = function(){ activeTab:this.items.indexOf(this.getActiveTab()) }; }, - items: items + items: items, + listeners: { + tabchange: function (tabpanel, tab) + { + if (tab.id == "logs" && flagRenderTabLog) { + tab.getLoader().load(tab.root); + } + + if (tab.id == "logs") { + flagRenderTabLog = true; + } + } + } }), { region: 'center', @@ -166,5 +180,3 @@ new Ext.KeyMap(document, { }); Ext.onReady(main); - - From 3e96335fd5f5c722105180c4e086b4d8b15b66e2 Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Mon, 16 Mar 2015 14:44:38 -0400 Subject: [PATCH 6/7] PM-1835 "0016971: Triggers set to run before an output..." SOLVED Issue: 0016971: Triggers set to run before an output document step run twice Cause: OutputDocument require two instance for creation, that being the cause Solution: The before triggers for OutputDocument is executed in first instance --- workflow/engine/methods/cases/cases_Step.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/workflow/engine/methods/cases/cases_Step.php b/workflow/engine/methods/cases/cases_Step.php index ee1204f01..3b0e14ba9 100755 --- a/workflow/engine/methods/cases/cases_Step.php +++ b/workflow/engine/methods/cases/cases_Step.php @@ -130,7 +130,13 @@ if (isset( $oProcessFieds['PRO_DEBUG'] ) && $oProcessFieds['PRO_DEBUG']) { } //cleaning debug variables -if (! isset( $_GET['breakpoint'] )) { +$flagExecuteBeforeTriggers = !isset($_GET["breakpoint"]); + +if (isset($_GET["TYPE"]) && $_GET["TYPE"] == "OUTPUT_DOCUMENT" && isset($_GET["ACTION"]) && $_GET["ACTION"] != "GENERATE") { + $flagExecuteBeforeTriggers = false; +} + +if ($flagExecuteBeforeTriggers) { if (isset( $_SESSION['TRIGGER_DEBUG']['info'] )) { unset( $_SESSION['TRIGGER_DEBUG']['info'] ); } From 88ff66c3cd1447996c5bcf568a00c558137bf981 Mon Sep 17 00:00:00 2001 From: Ronald Quenta Date: Tue, 17 Mar 2015 16:07:31 -0400 Subject: [PATCH 7/7] Fix in endpoint location, download base64 and streaming file --- .../methods/cases/casesStreamingFile.php | 4 +- .../src/ProcessMaker/BusinessModel/Light.php | 7 ++- .../src/ProcessMaker/Services/Api/Light.php | 60 +++++-------------- 3 files changed, 21 insertions(+), 50 deletions(-) diff --git a/workflow/engine/methods/cases/casesStreamingFile.php b/workflow/engine/methods/cases/casesStreamingFile.php index a5e644156..fdc5c1ffb 100644 --- a/workflow/engine/methods/cases/casesStreamingFile.php +++ b/workflow/engine/methods/cases/casesStreamingFile.php @@ -24,8 +24,8 @@ if ($actionAjax == "streaming") { $file = \G::getPathFromFileUID($oAppDocument->Fields['APP_UID'], $sAppDocUid); - $realPath = PATH_DOCUMENT . $app_uid . '/' . $file[0] . $file[1] . '_' . $iDocVersion . '.' . $ext; - $realPath1 = PATH_DOCUMENT . $app_uid . '/' . $file[0] . $file[1] . '.' . $ext; + $realPath = PATH_DOCUMENT . G::getPathFromUID($app_uid) . '/' . $file[0] . $file[1] . '_' . $iDocVersion . '.' . $ext; + $realPath1 = PATH_DOCUMENT . G::getPathFromUID($app_uid) . '/' . $file[0] . $file[1] . '.' . $ext; if (file_exists( $realPath )) { $finfo = finfo_open(FILEINFO_MIME_TYPE); diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Light.php b/workflow/engine/src/ProcessMaker/BusinessModel/Light.php index c2015ae7d..a45f086d1 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Light.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Light.php @@ -403,8 +403,8 @@ class Light //$app_uid = \G::getPathFromUID($oAppDocument->Fields['APP_UID']); $file = \G::getPathFromFileUID($oAppDocument->Fields['APP_UID'], $sAppDocUid); - $realPath = PATH_DOCUMENT . $app_uid . '/' . $file[0] . $file[1] . '_' . $iDocVersion . '.' . $ext; - $realPath1 = PATH_DOCUMENT . $app_uid . '/' . $file[0] . $file[1] . '.' . $ext; + $realPath = PATH_DOCUMENT . G::getPathFromUID($app_uid) . '/' . $file[0] . $file[1] . '_' . $iDocVersion . '.' . $ext; + $realPath1 = PATH_DOCUMENT . G::getPathFromUID($app_uid) . '/' . $file[0] . $file[1] . '.' . $ext; $width = isset($fileData['width']) ? $fileData['width']:null; $height = isset($fileData['height']) ? $fileData['height']:null; @@ -604,8 +604,9 @@ class Light */ public function getInformation($userUid, $type, $app_uid) { - //$response = array(); + $response = array(); switch ($type) { + case 'unassigned': case 'paused': case 'participated': $oCase = new \Cases(); diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Light.php b/workflow/engine/src/ProcessMaker/Services/Api/Light.php index c3421e0c6..ea3b3382a 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Light.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Light.php @@ -611,52 +611,18 @@ class Light extends Api } /** - * @url POST /case/:app_uid/input-document + * @url POST /case/:app_uid/upload/location * - * @param string $app_uid { @min 32}{@max 32} - * @param string $tas_uid {@min 32}{@max 32} - * @param string $app_doc_comment - * @param string $inp_doc_uid {@min 32}{@max 32} - */ - public function doPostInputDocument($app_uid, $tas_uid, $app_doc_comment, $inp_doc_uid) - { - try { - $userUid = $this->getUserId(); - $inputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument(); - $file = $inputDocument->addCasesInputDocument($app_uid, $tas_uid, $app_doc_comment, $inp_doc_uid, $userUid); - $response = $this->parserInputDocument($file); - } catch (\Exception $e) { - throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); - } - return $response; - } - - public function parserInputDocument ($data) - { - $structure = array( - 'app_doc_uid' => 'fileId', - 'app_doc_filename' => 'fileName', - 'app_doc_version' => 'version' - ); - $response = $this->replaceFields($data, $structure); - return $response; - } - - /** - * @url POST /case/:app_uid/input-document/location - * - * @param string $app_uid { @min 32}{@max 32} - * @param string $tas_uid {@min 32}{@max 32} - * @param string $app_doc_comment - * @param string $inp_doc_uid {@min 32}{@max 32} - * @param float $latitude {@min -90}{@max 90} + * @param string $app_uid { @min 32}{@max 32} + * @param float $latitude {@min -90}{@max 90} * @param float $longitude {@min -180}{@max 180} */ - public function postInputDocumentLocation($app_uid, $tas_uid, $app_doc_comment, $inp_doc_uid, $latitude, $longitude) + public function postInputDocumentLocation($app_uid, $latitude, $longitude) { try { $userUid = $this->getUserId(); - $inputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument(); + $oMobile = new \ProcessMaker\BusinessModel\Light(); + $url = "http://maps.googleapis.com/maps/api/staticmap?center=".$latitude.','.$longitude."&format=jpg&size=600x600&zoom=15&markers=color:blue%7Clabel:S%7C".$latitude.','.$longitude; $imageLocation = imagecreatefromjpeg($url); $tmpfname = tempnam("php://temp","pmm"); @@ -668,17 +634,21 @@ class Light extends Api $_FILES["form"]["error"] = 0; $sizes = getimagesize($tmpfname); $_FILES["form"]["size"] = ($sizes['0'] * $sizes['1']); - $file = $inputDocument->addCasesInputDocument($app_uid, $tas_uid, $app_doc_comment, $inp_doc_uid, $userUid); + + $request_data = array(array('name' => $_FILES["form"]["name"])); + $file = $oMobile->postUidUploadFiles($userUid, $app_uid, $request_data); $strPathName = PATH_DOCUMENT . G::getPathFromUID($app_uid) . PATH_SEP; - $strFileName = $file->app_doc_uid . "_" . $file->app_doc_version . ".jpg"; - copy($tmpfname, $strPathName . "/" . $strFileName); - $response = $this->parserInputDocument($file); + $strFileName = $file[0]['appDocUid'] . "_" . $file[0]['docVersion'] . ".jpg"; + if (! is_dir( $strPathName )) { + G::verifyPath( $strPathName, true ); + } + copy($tmpfname, $strPathName . $strFileName); unlink($tmpfname); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); } - return $response; + return $file; } /**