From 1e03cebdd8ae826e1bbd19a0efb163fbcf8af29f Mon Sep 17 00:00:00 2001 From: Hector Cortez Date: Mon, 1 Oct 2012 11:19:47 -0400 Subject: [PATCH 01/15] BUG Move "Enable HTML Editing" checkbox, "Restore Original HTML" SOLVED - Move "Enable HTML Editing" checkbox, "Restore Original HTML" and "Refresh view" buttons to top of "HTML" tab in DynaForm Editor - Buttons are moved to the top --- .../engine/xmlform/dynaforms/dynaforms_HtmlEditor.html | 8 ++++---- .../engine/xmlform/dynaforms/dynaforms_HtmlEditor.xml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/workflow/engine/xmlform/dynaforms/dynaforms_HtmlEditor.html b/workflow/engine/xmlform/dynaforms/dynaforms_HtmlEditor.html index 06352fb69..dd36667a1 100755 --- a/workflow/engine/xmlform/dynaforms/dynaforms_HtmlEditor.html +++ b/workflow/engine/xmlform/dynaforms/dynaforms_HtmlEditor.html @@ -6,16 +6,16 @@ - - - - + + + + diff --git a/workflow/engine/xmlform/dynaforms/dynaforms_HtmlEditor.xml b/workflow/engine/xmlform/dynaforms/dynaforms_HtmlEditor.xml index 02cbbda2d..1cff5a631 100755 --- a/workflow/engine/xmlform/dynaforms/dynaforms_HtmlEditor.xml +++ b/workflow/engine/xmlform/dynaforms/dynaforms_HtmlEditor.xml @@ -5,10 +5,6 @@ - -HTML View - - Enable HTML Editing @@ -21,6 +17,10 @@ Refresh View + +HTML View + + HTML Code From afcd23969e95ca762ce7aaa9c87075f224ec5f93 Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Mon, 1 Oct 2012 13:44:27 -0400 Subject: [PATCH 02/15] Add validation when change the url without a workspace but with a session active --- workflow/engine/methods/login/sysLogin.php | 4 ++++ workflow/engine/skinEngine/skinEngine.php | 24 ++++++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/workflow/engine/methods/login/sysLogin.php b/workflow/engine/methods/login/sysLogin.php index 869e75272..bdac765c2 100755 --- a/workflow/engine/methods/login/sysLogin.php +++ b/workflow/engine/methods/login/sysLogin.php @@ -30,6 +30,10 @@ if (isset ($_POST['form']['USER_ENV'])) { die (); } +@session_destroy(); +session_start(); +session_regenerate_id(); + //Required classes for dbArray work require_once ("propel/Propel.php"); require_once ("creole/Creole.php"); diff --git a/workflow/engine/skinEngine/skinEngine.php b/workflow/engine/skinEngine/skinEngine.php index 6e07d23a1..992c52aa2 100755 --- a/workflow/engine/skinEngine/skinEngine.php +++ b/workflow/engine/skinEngine/skinEngine.php @@ -240,22 +240,22 @@ class SkinEngine $templateFile = $this->layoutFile['dirname'] . PATH_SEP . $this->layoutFileExtjs['basename']; } - + $template = new TemplatePower($templateFile); $template->prepare(); $template->assign('header', $header); $template->assign('styles', $styles); $template->assign('bodyTemplate', $body); - + // verify is RTL $oServerConf =& serverConf::getSingleton(); if ($oServerConf->isRtl(SYS_LANG)) { - $template->assign('dirBody', 'dir="RTL"'); + $template->assign('dirBody', 'dir="RTL"'); } // end verify // verify is IE - $doctype = ''; + $doctype = ''; $meta = ''; $iexplores = array( 'IE=10' => '(MSIE 10\.[0-9]+)', @@ -264,16 +264,16 @@ class SkinEngine 'IE=7' => '(MSIE 7\.[0-9]+)', 'IE=6' => '(MSIE 6\.[0-9]+)' ); - - foreach ($iexplores as $browser => $pattern) { + + foreach ($iexplores as $browser => $pattern) { if (preg_match('/'.$pattern.'/', $_SERVER['HTTP_USER_AGENT'])) { $doctype = ''; - $meta = ''; - } + $meta = ''; + } } // end verify - - $template->assign('meta', $meta); + + $template->assign('meta', $meta); $template->assign('doctype', $doctype); echo $template->getOutputContent(); } @@ -598,7 +598,9 @@ class SkinEngine $header = ''; if (isset($oHeadPublisher)) { - $oHeadPublisher->title = isset($_SESSION['USR_USERNAME']) ? '(' . $_SESSION['USR_USERNAME'] . ' ' . G::LoadTranslation('ID_IN') . ' ' . SYS_SYS . ')' : ''; + if (defined('SYS_SYS')) { + $oHeadPublisher->title = isset($_SESSION['USR_USERNAME']) ? '(' . $_SESSION['USR_USERNAME'] . ' ' . G::LoadTranslation('ID_IN') . ' ' . SYS_SYS . ')' : ''; + } $header = $oHeadPublisher->printHeader(); $header .= $oHeadPublisher->getExtJsStylesheets($this->cssFileName); } From dd1b914ee8624977709deb86cd7f64478fd732a5 Mon Sep 17 00:00:00 2001 From: Hector Cortez Date: Mon, 1 Oct 2012 14:36:55 -0400 Subject: [PATCH 03/15] BUG Move "Enable HTML Editing" checkbox, "Restore Original HTML" SOLVED - Move "Enable HTML Editing" checkbox, "Restore Original HTML" and "Refresh view" buttons to top of "HTML" tab in DynaForm Editor. - Added messageBox of alert. --- .../xmlform/dynaforms/dynaforms_HtmlEditor.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/workflow/engine/xmlform/dynaforms/dynaforms_HtmlEditor.xml b/workflow/engine/xmlform/dynaforms/dynaforms_HtmlEditor.xml index 1cff5a631..bb743aeec 100755 --- a/workflow/engine/xmlform/dynaforms/dynaforms_HtmlEditor.xml +++ b/workflow/engine/xmlform/dynaforms/dynaforms_HtmlEditor.xml @@ -73,7 +73,18 @@ getField("PME_HTML_ENABLETEMPLATE","dynaforms_HtmlEditor").onclick=function() { /*getField("ENABLETEMPLATE","dynaforms_Properties").checked=this.checked; dynaformEditor.saveProperties();*/ - dynaformEditor.setEnableTemplate( this.checked ); + if (getField("PME_HTML_ENABLETEMPLATE","dynaforms_HtmlEditor").checked == true) { + new leimnud.module.app.confirm().make( + { + label: "@G::LoadTranslation(ID_MSG_ENABLE_HTML_EDITING)", + size:{ w: 350, h: 150 }, + action: function() { }, + cancel: function() { + getField("PME_HTML_ENABLETEMPLATE","dynaforms_HtmlEditor").checked = false; + } + }); + dynaformEditor.setEnableTemplate( this.checked ); + } } ]]> From 7cc1da974eeb696a8e7852cb39bf8dde16848fef Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Mon, 1 Oct 2012 18:02:24 -0400 Subject: [PATCH 04/15] BUG 9871 PM 2.0.44 testing 2 se Borran los datos en pmtables con chrome SOLVED - Unnecesary text-transform style in the table name field and field name - Deleted the unnecesary text-transform style --- workflow/engine/templates/pmTables/edit.js | 2 -- workflow/engine/templates/pmTables/editReport.js | 7 ------- 2 files changed, 9 deletions(-) diff --git a/workflow/engine/templates/pmTables/edit.js b/workflow/engine/templates/pmTables/edit.js index fc93caa18..5be0aaeb2 100755 --- a/workflow/engine/templates/pmTables/edit.js +++ b/workflow/engine/templates/pmTables/edit.js @@ -160,7 +160,6 @@ Ext.onReady(function(){ editor: { xtype: 'textfield', allowBlank: true, - style:'text-transform: uppercase', listeners:{ change: function(f,e){ this.setValue(this.getValue().toUpperCase()); @@ -546,7 +545,6 @@ Ext.onReady(function(){ emptyText: _("ID_SET_A_TABLE_NAME"), width: 250, stripCharsRe: /(\W+)/g, - style:'text-transform: uppercase', listeners:{ change: function(){ this.setValue(this.getValue().toUpperCase()) diff --git a/workflow/engine/templates/pmTables/editReport.js b/workflow/engine/templates/pmTables/editReport.js index aa8a29e0a..b2860ac62 100755 --- a/workflow/engine/templates/pmTables/editReport.js +++ b/workflow/engine/templates/pmTables/editReport.js @@ -277,13 +277,7 @@ Ext.onReady(function(){ editor: { xtype: 'textfield', allowBlank: true, - style:'text-transform: uppercase', listeners:{ - /*specialkey: function(f,e){ - if(e.getKey()==e.ENTER){ - this.setValue(this.getValue().toUpperCase()); - } - }*/ change: function(f,e){ this.setValue(this.getValue().toUpperCase()); } @@ -797,7 +791,6 @@ Ext.onReady(function(){ emptyText: _("ID_SET_A_TABLE_NAME"), width: 250, stripCharsRe: /(\W+)/g, - style:'text-transform: uppercase', listeners:{ change: function(){ this.setValue(this.getValue().toUpperCase()); From d6f1539a7bfd285a836111a4ddf20ad770134e3d Mon Sep 17 00:00:00 2001 From: ralph Date: Tue, 2 Oct 2012 10:27:57 -0400 Subject: [PATCH 05/15] BUG 9855 Rest Services for ProcessMaker. PROBLEM There were no documentation for use of Rest by Curl and Rest with Java use. SOLVED Adding Classes to help to use Rest by Curl and Adding samples to use Rest with Java. --- .../engine/methods/services/Rest/CRUD.java | 200 ++++++++++++++++++ .../methods/services/Rest/CURLMessage.php | 116 ++++++++++ .../methods/services/Rest/FormatedMessage.php | 29 +++ .../methods/services/Rest/JsonMessage.php | 29 +++ .../methods/services/Rest/RestMessage.php | 33 +++ .../methods/services/Rest/SimpleMessage.php | 26 +++ .../methods/services/Rest/XmlMessage.php | 34 +++ .../engine/methods/services/Rest/testing.php | 38 ++++ 8 files changed, 505 insertions(+) create mode 100644 workflow/engine/methods/services/Rest/CRUD.java create mode 100644 workflow/engine/methods/services/Rest/CURLMessage.php create mode 100644 workflow/engine/methods/services/Rest/FormatedMessage.php create mode 100644 workflow/engine/methods/services/Rest/JsonMessage.php create mode 100644 workflow/engine/methods/services/Rest/RestMessage.php create mode 100644 workflow/engine/methods/services/Rest/SimpleMessage.php create mode 100644 workflow/engine/methods/services/Rest/XmlMessage.php create mode 100644 workflow/engine/methods/services/Rest/testing.php diff --git a/workflow/engine/methods/services/Rest/CRUD.java b/workflow/engine/methods/services/Rest/CRUD.java new file mode 100644 index 000000000..c9dea78f0 --- /dev/null +++ b/workflow/engine/methods/services/Rest/CRUD.java @@ -0,0 +1,200 @@ +//Archivo HolaMundo.java + +// Main class to sent differen kind of messages +import org.apache.http.impl.client.DefaultHttpClient; + +// Enter CRUD memebers +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpDelete; + +// Used to set JSON or XML messages request +import org.apache.http.entity.StringEntity; + +// Needed for response goal +import org.apache.http.HttpResponse; +import org.apache.http.HttpEntity; +import org.apache.http.util.EntityUtils; + + +public class CRUD +{ + private static void PostSample() + { + System.out.println("POST: Enter login params\n"); + + String loginParamsXML = "\n" + +"\n" + +"admin\n" + +"admin\n" + +""; + String URI = "http://ralph.pmos.colosa.net/rest/ralph/login/"; + + System.out.println( "Request: "+URI + "\n"+ loginParamsXML + "\n"); + + DefaultHttpClient httpClient = new DefaultHttpClient(); + HttpPost postRequest = new HttpPost(URI); + try + { + StringEntity input = new StringEntity( loginParamsXML); + input.setContentType("application/xml"); + postRequest.setEntity(input); + HttpResponse httpResponse = httpClient.execute(postRequest); + + HttpEntity responseEntity = httpResponse.getEntity(); + if( responseEntity != null) + { + String response = new String(); + response = EntityUtils.toString( responseEntity); + System.out.println( "Response: " + response + "\n"); + } + } + catch( java.io.IOException x) + { + throw new RuntimeException("I/O error" + x.toString()); + } + } + + private static void GetSample() + { + System.out.println("GET: Display TRANSLATION table row\n"); + + String URI = "http://ralph.pmos.colosa.net/rest/ralph/TRANSLATION/LABEL/LOGIN/en/"; + System.out.println( "Request: " + URI + "\n"); + + DefaultHttpClient httpClient = new DefaultHttpClient(); + HttpGet getRequest = new HttpGet(URI); + try + { + HttpResponse httpResponse = httpClient.execute(getRequest); + + HttpEntity responseEntity = httpResponse.getEntity(); + if( responseEntity != null) + { + String response = new String(); + response = EntityUtils.toString( responseEntity); + System.out.println( "Response: " + response + "\n"); + } + } + catch( java.io.IOException x) + { + throw new RuntimeException("I/O error" + x.toString()); + } + } + + private static void AnotherPostSample() + { + System.out.println("POST: Insert new row in TRANLATION\n"); + + String URI = "http://ralph.pmos.colosa.net/rest/ralph/TRANSLATION/"; + String newRow = "BUTTON/ESCAPE/en/sample/2012-05-05/"; + System.out.println( "Request: " + URI + " new row: " + newRow + "\n"); + URI = URI + newRow; + + DefaultHttpClient httpClient = new DefaultHttpClient(); + HttpPost postRequest = new HttpPost(URI); + try + { + HttpResponse httpResponse = httpClient.execute(postRequest); + + HttpEntity responseEntity = httpResponse.getEntity(); + if( responseEntity != null) + { + String response = new String(); + if(response.isEmpty()) + { + System.out.println( "Response: Status code: " + httpResponse.getStatusLine().getStatusCode()+ "\n"); + return; + } + response = EntityUtils.toString( responseEntity); + System.out.println( "Response: " + response + "\n"); + } + } + catch( java.io.IOException x) + { + throw new RuntimeException("I/O error" + x.toString()); + } + } + + private static void PutSample() + { + System.out.println("POST: Update a row in TRANLATION\n"); + + String URI = "http://ralph.pmos.colosa.net/rest/ralph/TRANSLATION/"; + String index = "BUTTON/ESCAPE/en/"; + String updateData = "changesample/2011-07-06/"; + + System.out.println( "Request: " + URI + " index: " + index + " updateData: " + updateData + "\n"); + URI = URI + index + updateData; + + DefaultHttpClient httpClient = new DefaultHttpClient(); + HttpPut putRequest = new HttpPut(URI); + try + { + HttpResponse httpResponse = httpClient.execute(putRequest); + + HttpEntity responseEntity = httpResponse.getEntity(); + if( responseEntity != null) + { + String response = new String(); + if(response.isEmpty()) + { + System.out.println( "Response: Status code: " + httpResponse.getStatusLine().getStatusCode()+ "\n"); + return; + } + response = EntityUtils.toString( responseEntity); + System.out.println( "Response: " + response + "\n"); + } + } + catch( java.io.IOException x) + { + throw new RuntimeException("I/O error" + x.toString()); + } + } + + private static void DeleteSample() + { + System.out.println("DELETE: Remove a row in TRANLATION\n"); + + String URI = "http://ralph.pmos.colosa.net/rest/ralph/TRANSLATION/"; + String index = "BUTTON/ESCAPE/en/"; + + System.out.println( "Request: " + URI + "index:" + index + "\n"); + URI = URI + index; + + DefaultHttpClient httpClient = new DefaultHttpClient(); + HttpDelete deleteRequest = new HttpDelete(URI); + try + { + HttpResponse httpResponse = httpClient.execute(deleteRequest); + + HttpEntity responseEntity = httpResponse.getEntity(); + if( responseEntity != null) + { + String response = new String(); + if(response.isEmpty()) + { + System.out.println( "Response: Status code: " + httpResponse.getStatusLine().getStatusCode()+ "\n"); + return; + } + response = EntityUtils.toString( responseEntity); + System.out.println( "Response: " + response + "\n"); + } + } + catch( java.io.IOException x) + { + throw new RuntimeException("I/O error" + x.toString()); + } + } + + public static void main(String args[]) + { + System.out.println("CRUD sample."); + PostSample(); + GetSample(); + AnotherPostSample(); + PutSample(); + DeleteSample(); + } +} \ No newline at end of file diff --git a/workflow/engine/methods/services/Rest/CURLMessage.php b/workflow/engine/methods/services/Rest/CURLMessage.php new file mode 100644 index 000000000..7ca2f992a --- /dev/null +++ b/workflow/engine/methods/services/Rest/CURLMessage.php @@ -0,0 +1,116 @@ +restServer = PROTOCOL_HTTP.COLON.PATH_SEP.PATH_SEP; + $this->restServer .= $_SERVER['SERVER_NAME'].PATH_SEP; + $this->restServer .= $this->serviceTechnic.PATH_SEP.$user.PATH_SEP; + + $this->ch = curl_init(); + curl_setopt( $this->ch, CURLOPT_TIMEOUT, 2); + curl_setopt( $this->ch, CURLOPT_POST, 1); + curl_setopt( $this->ch, CURLOPT_RETURNTRANSFER, 1); + } + //set the message in order to follow the message format + abstract protected function format( array $message); + + //Set properties used in a simpleMessage Class like a set in a URI, or formatted as a JSon msg. + abstract protected function setMoreProperties( $messageFormated); + + //attach the method to the restServer path, set the type of the message, and the message itself. + protected function setMessageProperties( $method, array $message) + { + $messageFormated = $this->format( $message); + $this->server_method = $this->restServer . $method; + $this->setMoreProperties( $messageFormated); + } + //Send or execute(curl notation) the message using a rest method + public function send( $method, array $message) + { + self::setMessageProperties( $method, $message); + $this->output = curl_exec( $this->ch); + return $this->output; + } + //set the message to GET method type + public function sendGET( $method, array $message) + { + curl_setopt($this->ch, CURLOPT_HTTPGET, true); + return $this->send( $method, $message); + } + //set the message to POST method type + public function sendPOST( $method, array $message) + { + curl_setopt($this->ch, CURLOPT_POST, true); + return $this->send( $method, $message); + } + //set the message to PUT method type + public function sendPUT( $method, array $message) + { + curl_setopt($this->ch, CURLOPT_PUT, true); + return $this->send( $method, $message); + } + //set the message to DELETE method type + public function sendDELETE( $method, array $message) + { + curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, "DELETE"); + return $this->send( $method, $message); + } + //Display all the data that the response could got. + public function displayResponse() + { + $error = curl_error($this->ch); + $result = array( 'header' => '', + 'body' => '', + 'curl_error' => '', + 'http_code' => '', + 'last_url' => ''); + if ( $error != "" ) + { + $result['curl_error'] = $error; + return $result; + } + $response = $this->output; + $header_size = curl_getinfo($this->ch,CURLINFO_HEADER_SIZE); + $result['header'] = substr($response, 0, $header_size); + $result['body'] = substr( $response, $header_size ); + $result['http_code'] = curl_getinfo($this -> ch,CURLINFO_HTTP_CODE); + $result['last_url'] = curl_getinfo($this -> ch,CURLINFO_EFFECTIVE_URL); + + echo $this->type." Response: ".$response."
"; + foreach($result as $index => $data) + { + if( $data != "") + { + echo $index."=".$data."
"; + } + } + echo "
"; + } + //Close the Curl session using the Curl Handle set by curl_init() function. + public function close() + { + curl_close( $this->ch); + } +} + +?> diff --git a/workflow/engine/methods/services/Rest/FormatedMessage.php b/workflow/engine/methods/services/Rest/FormatedMessage.php new file mode 100644 index 000000000..7909acfbc --- /dev/null +++ b/workflow/engine/methods/services/Rest/FormatedMessage.php @@ -0,0 +1,29 @@ +server_method . PATH_SEP . $messageFormated."
"; + // + curl_setopt($this->ch, CURLOPT_URL, $this->server_method); + $contentSelected = $this->content . $this->type; + curl_setopt($this->ch, CURLOPT_HTTPHEADER, array($contentSelected)); + curl_setopt($this->ch, CURLOPT_POSTFIELDS, $messageFormated); + } +} +?> \ No newline at end of file diff --git a/workflow/engine/methods/services/Rest/JsonMessage.php b/workflow/engine/methods/services/Rest/JsonMessage.php new file mode 100644 index 000000000..535657aa8 --- /dev/null +++ b/workflow/engine/methods/services/Rest/JsonMessage.php @@ -0,0 +1,29 @@ +type = "json"; + } + //Format the array parameter to a json format. + protected function format( array $message) + { + if ( empty( $message) ) + { + return ; + } + if ( is_array( $message) ) + { + $jsonMessage = json_encode( $message); + } + return $jsonMessage; + } +} + +?> \ No newline at end of file diff --git a/workflow/engine/methods/services/Rest/RestMessage.php b/workflow/engine/methods/services/Rest/RestMessage.php new file mode 100644 index 000000000..a12fd8ee1 --- /dev/null +++ b/workflow/engine/methods/services/Rest/RestMessage.php @@ -0,0 +1,33 @@ +type = "rest"; + } + //Format the array parameter to a single rest line format separed by '/'. + protected function format( array $message) + { + $rest = ""; + if ( !empty( $message) ) + { + if ( is_array( $message) ) + { + foreach( $message as $index => $data) + { + $rest .= "/" . $data; + } + $rest .= "/"; + } + } + return $rest; + } +} + +?> diff --git a/workflow/engine/methods/services/Rest/SimpleMessage.php b/workflow/engine/methods/services/Rest/SimpleMessage.php new file mode 100644 index 000000000..b9b26606b --- /dev/null +++ b/workflow/engine/methods/services/Rest/SimpleMessage.php @@ -0,0 +1,26 @@ +server_method . PATH_SEP . $messageFormated."
"; + // + curl_setopt($this->ch, CURLOPT_URL, $this->server_method . $messageFormated); + } +} +?> \ No newline at end of file diff --git a/workflow/engine/methods/services/Rest/XmlMessage.php b/workflow/engine/methods/services/Rest/XmlMessage.php new file mode 100644 index 000000000..fdc96ca3e --- /dev/null +++ b/workflow/engine/methods/services/Rest/XmlMessage.php @@ -0,0 +1,34 @@ +type = "xml"; + } + //Format the array parameter to a xml valid format. TODO: Need to find out a better way to do it. + protected function format( array $message) + { + if ( empty( $message) ) + { + return ; + } + if ( is_array( $message) ) + { + $xml = ""; + foreach( $message as $index => $data) + { + $xml .= "<".$index.">".$data.""; + } + $xml .= ""; + } + return $xml; + } +} + +?> diff --git a/workflow/engine/methods/services/Rest/testing.php b/workflow/engine/methods/services/Rest/testing.php new file mode 100644 index 000000000..86e3d85a1 --- /dev/null +++ b/workflow/engine/methods/services/Rest/testing.php @@ -0,0 +1,38 @@ +'admin', 'password'=>'admin'); +$method = "login"; + +$jsonm = new JsonMessage(); +$jsonm->send( $method, $msg); +$jsonm->displayResponse(); + +$xmlm = new XmlMessage(); +$xmlm->send( $method, $msg); +$xmlm->displayResponse(); + +$msg = array("LABEL","LOGIN","en"); +$table = "TRANSLATION"; + +$rest = new RestMessage(); +$rest->sendGET( $table, $msg); +$rest->displayResponse(); + +$msg = array("HOUSE","PUSHIN","en","maullidin","2012-06-06" ); +$rest->sendPOST( $table, $msg); +$rest->displayResponse(); + +$msg = array("HOUSE","PUSHIN","en","wacheneger","2012-07-06" ); +$rest->sendPUT( $table, $msg); +$rest->displayResponse(); + +$msg = array("HOUSE","PUSHIN","en" ); +$rest->sendDELETE( $table, $msg); +$rest->displayResponse(); + + +?> From d83dceb3418b8f94e56adbd5ca6cefad6130df20 Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Date: Tue, 2 Oct 2012 10:45:03 -0400 Subject: [PATCH 06/15] =?UTF-8?q?BUG=209720=20Proceso=20de=20actualizaci?= =?UTF-8?q?=C3=B3e=20ProcessMaker=20es=20lento=20IMPROVEMENT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ProcessMaker update process is slow for query. - Was optimized queries and was modified the rebuild "Table content". --- workflow/engine/classes/model/Content.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/classes/model/Content.php b/workflow/engine/classes/model/Content.php index f997ac050..a6923dd00 100755 --- a/workflow/engine/classes/model/Content.php +++ b/workflow/engine/classes/model/Content.php @@ -276,7 +276,7 @@ class Content extends BaseContent { * * @param array $langs */ - function regenerateContent($langId) + function regenerateContent($langs) { //Search the language $key = array_search('en',$langs); From c7765e2e80c058b5caf37ba82e94ac16d5e1f3f4 Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Tue, 2 Oct 2012 12:15:08 -0400 Subject: [PATCH 07/15] Improvement in the style for the login box in uxmodern --- .../skinEngine/uxmodern/css/xtheme-gray.css | 6 +-- workflow/engine/templates/main/login.js | 43 ++++++++++--------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/workflow/engine/skinEngine/uxmodern/css/xtheme-gray.css b/workflow/engine/skinEngine/uxmodern/css/xtheme-gray.css index 0071bb68c..963600dd2 100644 --- a/workflow/engine/skinEngine/uxmodern/css/xtheme-gray.css +++ b/workflow/engine/skinEngine/uxmodern/css/xtheme-gray.css @@ -1478,15 +1478,15 @@ body.x-body-masked .x-window-plain .x-window-mc { body.x-pm-login-body{ width: 100%; } -body.x-pm-login-body div.x-window{ +body.x-pm-login-body div.x-window-login{ /*!important needed to change position, not appearance. Not allows JavaScrpit change Position.*/ - left: 50% !important; + left: 50% !important; margin-left: -185px !important; /*Left Location for Login Box. Must be a half from the width of login Box.*/ margin-top: -120px !important; /*Top Location for Login Box. Must be a half from height of login Box.*/ overflow: auto !important; position: absolute !important; top: 50% !important; -} +} body.x-pm-login-body div.x-ie-shadow, body.x-pm-login-body div.x-shadow{ /*Disappears the shadow Login Box.*/ display: none !important; diff --git a/workflow/engine/templates/main/login.js b/workflow/engine/templates/main/login.js index e007b6d3f..ee2121609 100644 --- a/workflow/engine/templates/main/login.js +++ b/workflow/engine/templates/main/login.js @@ -1,7 +1,7 @@ /* * ProcessMaker Login * Created on date Jul 15, 2011 - * + * * @author Erik Amaru Ortiz */ @@ -40,7 +40,7 @@ var Login = function() { enableVirtualKeyboard : false, enableForgotPassword : false, fieldsWidth : 200, - + /** Init method */ init : function() { new Ext.KeyMap(document, { @@ -49,18 +49,18 @@ var Login = function() { Login.submit(); } }); - + Ext.QuickTips.init(); Ext.form.Field.prototype.msgTarget = 'side'; this.enableVirtualKeyboard = virtualKeyboad; this.enableForgotPassword = forgotPasswd; - + this.initComponents(); - + this.window.show(); Ext.getCmp('userTxt').focus(true, 1000); - + if (typeof errMsg != 'undefined') { Ext.msgBoxSlider.msgTopCenter('alert', 'ERROR', errMsg, 10); } @@ -87,27 +87,27 @@ Login.initComponents = function() fieldLabel: _('ID_USER'), allowBlank: false } - + var usernameTxt = { id : 'usernameTxt', name : 'username', fieldLabel: _('ID_USER'), allowBlank: false } - + var emailTxt = { id : 'emailTxt', name : 'email', fieldLabel: _('ID_EMAIL'), allowBlank: false } - + var passwordTxt = { fieldLabel: _('ID_PASSWORD'), name : 'form[USR_PASSWORD]', inputType : 'password', allowBlank: false, - + validationEvent : this.enableVirtualKeyboard == true ? 'blur' : 'keyup', enableKeyEvents : true, width: this.fieldsWidth, //this.enableVirtualKeyboard == true ? 183 : this.fieldsWidth, @@ -116,7 +116,7 @@ Login.initComponents = function() languageSelection: true }, plugins: this.enableVirtualKeyboard == true ? new Ext.ux.plugins.VirtualKeyboard() : null, - + listeners: { render: function() { this.capsWarningTooltip = new Ext.ToolTip({ @@ -132,7 +132,7 @@ Login.initComponents = function() this.disable(); }); }, - + keypress: { fn: function(field, e) { if(this.forceVirtualKeyboard) { @@ -161,7 +161,7 @@ Login.initComponents = function() } } } - + /*, listeners : { specialkey: function(f,e){ @@ -171,7 +171,7 @@ Login.initComponents = function() } }*/ } - + var forgotPasswordLink = { xtype: 'box', autoEl: { @@ -251,7 +251,7 @@ Login.initComponents = function() this.form = new Ext.FormPanel(formConfig); - + this.forgotPasswordForm = new Ext.FormPanel({ id : 'fp-form', labelWidth: 80, @@ -282,7 +282,7 @@ Login.initComponents = function() handler: Login.restore }] }); - + this.forgotPasswordForm = new Ext.FormPanel({ id : 'fp-form', labelWidth: 80, @@ -315,6 +315,7 @@ Login.initComponents = function() }); this.window = new Ext.Window({ + cls: 'x-window-login', layout: 'fit', title: _('LOGIN'), width: 380, @@ -332,7 +333,7 @@ Login.initComponents = function() items: [] }) }); - + this.fpWindow = new Ext.Window({ layout: 'fit', title: _('ID_FORGOT_PASSWORD'), @@ -405,7 +406,7 @@ Login.restore = function() Login.sendFpRequest = function() { Ext.getCmp('login-statusbar2').showBusy(); - + if (!Login.forgotPasswordForm.getForm().isValid()) { Ext.getCmp('login-statusbar2').setStatus({ text: _('ID_VALIDATION_ERRORS'), @@ -414,7 +415,7 @@ Login.sendFpRequest = function() }); return; } - + Login.forgotPasswordForm.getForm().submit({ method: 'POST', waitTitle: '', @@ -449,7 +450,7 @@ Login.sendFpRequest = function() //Login.form.getForm().reset(); } }); - + } @@ -469,7 +470,7 @@ Login.submit = function() Ext.getCmp('login-statusbar').showBusy(); - + if (!Login.form.getForm().isValid()) { Ext.getCmp('login-statusbar').setStatus({ text: _('ID_VALIDATION_ERRORS'), From fa0f6b695a69536a0db389409eac3fe66fd8c5c4 Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Tue, 2 Oct 2012 12:20:59 -0400 Subject: [PATCH 08/15] Improvement in the layout for the skin uxmodern, related to the bug 9759 --- workflow/engine/skinEngine/uxmodern/layout.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/workflow/engine/skinEngine/uxmodern/layout.html b/workflow/engine/skinEngine/uxmodern/layout.html index 42b2faf43..c937d8bf9 100644 --- a/workflow/engine/skinEngine/uxmodern/layout.html +++ b/workflow/engine/skinEngine/uxmodern/layout.html @@ -19,7 +19,7 @@ {if $user_logged neq ''} {$msgVer} {if $switch_interface} - + {/if} {$logout}  
{$HTML}{$form.HTML}
{$form.PME_HTML_ENABLETEMPLATE}{$PME_HTML_ENABLETEMPLATE}{$form.PME_REFRESH_VIEW}{$form.PME_RESTORE_HTML}
{$HTML}{$form.HTML}
{$HTML2} {$form.HTML2}
- {if $footer neq ''} - {/if} \ No newline at end of file From 6372bf808adc1deb7ccda5a9e39e4b36d314fe8b Mon Sep 17 00:00:00 2001 From: Ralph Asendeteufrer Date: Tue, 2 Oct 2012 13:13:19 -0400 Subject: [PATCH 09/15] BUG 9855 REST services for ProcessMaker Solved PROBLEM There were no documentation for use of Rest by Curl and Rest with Java use. SOLVED Adding classes to help to use Rest by Curl and Adding samples to use Rest with Java. --- .../engine/methods/services/Rest/CRUD.java | 347 +++++++++--------- .../methods/services/Rest/CURLMessage.php | 215 ++++++----- .../methods/services/Rest/FormatedMessage.php | 59 +-- .../methods/services/Rest/JsonMessage.php | 58 +-- .../methods/services/Rest/RestMessage.php | 66 ++-- .../methods/services/Rest/SimpleMessage.php | 55 ++- .../methods/services/Rest/XmlMessage.php | 68 ++-- .../engine/methods/services/Rest/testing.php | 23 +- 8 files changed, 501 insertions(+), 390 deletions(-) diff --git a/workflow/engine/methods/services/Rest/CRUD.java b/workflow/engine/methods/services/Rest/CRUD.java index c9dea78f0..56262aef7 100644 --- a/workflow/engine/methods/services/Rest/CRUD.java +++ b/workflow/engine/methods/services/Rest/CRUD.java @@ -1,6 +1,4 @@ -//Archivo HolaMundo.java - -// Main class to sent differen kind of messages +// Main class to sent differen kind of messages to the http server import org.apache.http.impl.client.DefaultHttpClient; // Enter CRUD memebers @@ -12,189 +10,194 @@ import org.apache.http.client.methods.HttpDelete; // Used to set JSON or XML messages request import org.apache.http.entity.StringEntity; -// Needed for response goal +// Needed for response fetch goal import org.apache.http.HttpResponse; import org.apache.http.HttpEntity; import org.apache.http.util.EntityUtils; - +/** +* Single class containing functions to show how to use GET,POST,PUT,DELETE methods. +*/ public class CRUD { - private static void PostSample() - { - System.out.println("POST: Enter login params\n"); - + private static String m_user = "ralph"; // This member variable must be changed to its own dev username + + private static void PostSample() + { + System.out.println("POST: Enter login params\n"); + String loginParamsXML = "\n" - +"\n" - +"admin\n" - +"admin\n" - +""; - String URI = "http://ralph.pmos.colosa.net/rest/ralph/login/"; - - System.out.println( "Request: "+URI + "\n"+ loginParamsXML + "\n"); - + +"\n" + +"admin\n" + +"admin\n" + +""; + String URI = "http://"+m_user+".pmos.colosa.net/rest/"+m_user+"/login/"; + + System.out.println( "Request: "+URI + "\n"+ loginParamsXML + "\n"); + DefaultHttpClient httpClient = new DefaultHttpClient(); - HttpPost postRequest = new HttpPost(URI); - try - { - StringEntity input = new StringEntity( loginParamsXML); - input.setContentType("application/xml"); - postRequest.setEntity(input); - HttpResponse httpResponse = httpClient.execute(postRequest); - - HttpEntity responseEntity = httpResponse.getEntity(); - if( responseEntity != null) - { - String response = new String(); - response = EntityUtils.toString( responseEntity); - System.out.println( "Response: " + response + "\n"); - } - } - catch( java.io.IOException x) - { - throw new RuntimeException("I/O error" + x.toString()); - } - } - - private static void GetSample() - { - System.out.println("GET: Display TRANSLATION table row\n"); - - String URI = "http://ralph.pmos.colosa.net/rest/ralph/TRANSLATION/LABEL/LOGIN/en/"; - System.out.println( "Request: " + URI + "\n"); - + HttpPost postRequest = new HttpPost(URI); + try + { + StringEntity input = new StringEntity( loginParamsXML); + input.setContentType("application/xml"); + postRequest.setEntity(input); + HttpResponse httpResponse = httpClient.execute(postRequest); + + HttpEntity responseEntity = httpResponse.getEntity(); + if( responseEntity != null) + { + String response = new String(); + response = EntityUtils.toString( responseEntity); + System.out.println( "Response: " + response + "\n"); + } + } + catch( java.io.IOException x) + { + throw new RuntimeException("I/O error: " + x.toString()); + } + } + + private static void GetSample() + { + System.out.println("GET: Display TRANSLATION table row\n"); + + String URI = "http://"+m_user+".pmos.colosa.net/rest/"+m_user+"/TRANSLATION/LABEL/LOGIN/en/"; + System.out.println( "Request: " + URI + "\n"); + DefaultHttpClient httpClient = new DefaultHttpClient(); - HttpGet getRequest = new HttpGet(URI); - try - { - HttpResponse httpResponse = httpClient.execute(getRequest); - - HttpEntity responseEntity = httpResponse.getEntity(); - if( responseEntity != null) - { - String response = new String(); - response = EntityUtils.toString( responseEntity); - System.out.println( "Response: " + response + "\n"); - } - } - catch( java.io.IOException x) - { - throw new RuntimeException("I/O error" + x.toString()); - } - } - - private static void AnotherPostSample() - { - System.out.println("POST: Insert new row in TRANLATION\n"); - - String URI = "http://ralph.pmos.colosa.net/rest/ralph/TRANSLATION/"; - String newRow = "BUTTON/ESCAPE/en/sample/2012-05-05/"; - System.out.println( "Request: " + URI + " new row: " + newRow + "\n"); - URI = URI + newRow; - + HttpGet getRequest = new HttpGet(URI); + try + { + HttpResponse httpResponse = httpClient.execute(getRequest); + + HttpEntity responseEntity = httpResponse.getEntity(); + if( responseEntity != null) + { + String response = new String(); + response = EntityUtils.toString( responseEntity); + System.out.println( "Response: " + response + "\n"); + } + } + catch( java.io.IOException x) + { + throw new RuntimeException("I/O error: " + x.toString()); + } + } + + private static void AnotherPostSample() + { + System.out.println("POST: Insert new row in TRANLATION\n"); + + String URI = "http://"+m_user+".pmos.colosa.net/rest/"+m_user+"/TRANSLATION/"; + String newRow = "BUTTON/ESCAPE/en/sample/2012-05-05/"; + System.out.println( "Request: " + URI + " new row: " + newRow + "\n"); + URI = URI + newRow; + DefaultHttpClient httpClient = new DefaultHttpClient(); - HttpPost postRequest = new HttpPost(URI); - try - { - HttpResponse httpResponse = httpClient.execute(postRequest); - - HttpEntity responseEntity = httpResponse.getEntity(); - if( responseEntity != null) - { - String response = new String(); - if(response.isEmpty()) - { - System.out.println( "Response: Status code: " + httpResponse.getStatusLine().getStatusCode()+ "\n"); - return; - } - response = EntityUtils.toString( responseEntity); - System.out.println( "Response: " + response + "\n"); - } - } - catch( java.io.IOException x) - { - throw new RuntimeException("I/O error" + x.toString()); - } - } - - private static void PutSample() - { - System.out.println("POST: Update a row in TRANLATION\n"); - - String URI = "http://ralph.pmos.colosa.net/rest/ralph/TRANSLATION/"; - String index = "BUTTON/ESCAPE/en/"; - String updateData = "changesample/2011-07-06/"; - - System.out.println( "Request: " + URI + " index: " + index + " updateData: " + updateData + "\n"); - URI = URI + index + updateData; - + HttpPost postRequest = new HttpPost(URI); + try + { + HttpResponse httpResponse = httpClient.execute(postRequest); + + HttpEntity responseEntity = httpResponse.getEntity(); + if( responseEntity != null) + { + String response = new String(); + if(response.isEmpty()) + { + System.out.println( "Response: Status code: " + httpResponse.getStatusLine().getStatusCode()+ "\n"); + return; + } + response = EntityUtils.toString( responseEntity); + System.out.println( "Response: " + response + "\n"); + } + } + catch( java.io.IOException x) + { + throw new RuntimeException("I/O error: " + x.toString()); + } + } + + private static void PutSample() + { + System.out.println("POST: Update a row in TRANLATION\n"); + + String URI = "http://"+m_user+".pmos.colosa.net/rest/"+m_user+"/TRANSLATION/"; + String index = "BUTTON/ESCAPE/en/"; + String updateData = "changesample/2011-07-06/"; + + System.out.println( "Request: " + URI + " index: " + index + " updateData: " + updateData + "\n"); + URI = URI + index + updateData; + DefaultHttpClient httpClient = new DefaultHttpClient(); - HttpPut putRequest = new HttpPut(URI); - try - { - HttpResponse httpResponse = httpClient.execute(putRequest); - - HttpEntity responseEntity = httpResponse.getEntity(); - if( responseEntity != null) - { - String response = new String(); - if(response.isEmpty()) - { - System.out.println( "Response: Status code: " + httpResponse.getStatusLine().getStatusCode()+ "\n"); - return; - } - response = EntityUtils.toString( responseEntity); - System.out.println( "Response: " + response + "\n"); - } - } - catch( java.io.IOException x) - { - throw new RuntimeException("I/O error" + x.toString()); - } - } - - private static void DeleteSample() - { - System.out.println("DELETE: Remove a row in TRANLATION\n"); - - String URI = "http://ralph.pmos.colosa.net/rest/ralph/TRANSLATION/"; - String index = "BUTTON/ESCAPE/en/"; - - System.out.println( "Request: " + URI + "index:" + index + "\n"); - URI = URI + index; - + HttpPut putRequest = new HttpPut(URI); + try + { + HttpResponse httpResponse = httpClient.execute(putRequest); + + HttpEntity responseEntity = httpResponse.getEntity(); + if( responseEntity != null) + { + String response = new String(); + if(response.isEmpty()) + { + System.out.println( "Response: Status code: " + httpResponse.getStatusLine().getStatusCode()+ "\n"); + return; + } + response = EntityUtils.toString( responseEntity); + System.out.println( "Response: " + response + "\n"); + } + } + catch( java.io.IOException x) + { + throw new RuntimeException("I/O error: " + x.toString()); + } + } + + private static void DeleteSample() + { + System.out.println("DELETE: Remove a row in TRANLATION\n"); + + String URI = "http://"+m_user+".pmos.colosa.net/rest/"+m_user+"/TRANSLATION/"; + String index = "BUTTON/ESCAPE/en/"; + + System.out.println( "Request: " + URI + "index:" + index + "\n"); + URI = URI + index; + DefaultHttpClient httpClient = new DefaultHttpClient(); - HttpDelete deleteRequest = new HttpDelete(URI); - try - { - HttpResponse httpResponse = httpClient.execute(deleteRequest); - - HttpEntity responseEntity = httpResponse.getEntity(); - if( responseEntity != null) - { - String response = new String(); - if(response.isEmpty()) - { - System.out.println( "Response: Status code: " + httpResponse.getStatusLine().getStatusCode()+ "\n"); - return; - } - response = EntityUtils.toString( responseEntity); - System.out.println( "Response: " + response + "\n"); - } - } - catch( java.io.IOException x) - { - throw new RuntimeException("I/O error" + x.toString()); - } - } + HttpDelete deleteRequest = new HttpDelete(URI); + try + { + HttpResponse httpResponse = httpClient.execute(deleteRequest); + + HttpEntity responseEntity = httpResponse.getEntity(); + if( responseEntity != null) + { + String response = new String(); + if(response.isEmpty()) + { + System.out.println( "Response: Status code: " + httpResponse.getStatusLine().getStatusCode()+ "\n"); + return; + } + response = EntityUtils.toString( responseEntity); + System.out.println( "Response: " + response + "\n"); + } + } + catch( java.io.IOException x) + { + throw new RuntimeException("I/O error: " + x.toString()); + } + } public static void main(String args[]) { - System.out.println("CRUD sample."); - PostSample(); - GetSample(); - AnotherPostSample(); - PutSample(); - DeleteSample(); + System.out.println("CRUD samples."); + PostSample(); + GetSample(); + AnotherPostSample(); + PutSample(); + DeleteSample(); + } } \ No newline at end of file diff --git a/workflow/engine/methods/services/Rest/CURLMessage.php b/workflow/engine/methods/services/Rest/CURLMessage.php index 7ca2f992a..d31fcc4c7 100644 --- a/workflow/engine/methods/services/Rest/CURLMessage.php +++ b/workflow/engine/methods/services/Rest/CURLMessage.php @@ -1,116 +1,149 @@ restServer = PROTOCOL_HTTP.COLON.PATH_SEP.PATH_SEP; - $this->restServer .= $_SERVER['SERVER_NAME'].PATH_SEP; - $this->restServer .= $this->serviceTechnic.PATH_SEP.$user.PATH_SEP; - - $this->ch = curl_init(); - curl_setopt( $this->ch, CURLOPT_TIMEOUT, 2); - curl_setopt( $this->ch, CURLOPT_POST, 1); - curl_setopt( $this->ch, CURLOPT_RETURNTRANSFER, 1); - } - //set the message in order to follow the message format - abstract protected function format( array $message); - //Set properties used in a simpleMessage Class like a set in a URI, or formatted as a JSon msg. - abstract protected function setMoreProperties( $messageFormated); - - //attach the method to the restServer path, set the type of the message, and the message itself. - protected function setMessageProperties( $method, array $message) - { - $messageFormated = $this->format( $message); - $this->server_method = $this->restServer . $method; - $this->setMoreProperties( $messageFormated); - } - //Send or execute(curl notation) the message using a rest method - public function send( $method, array $message) - { - self::setMessageProperties( $method, $message); - $this->output = curl_exec( $this->ch); - return $this->output; - } - //set the message to GET method type - public function sendGET( $method, array $message) - { - curl_setopt($this->ch, CURLOPT_HTTPGET, true); - return $this->send( $method, $message); - } - //set the message to POST method type - public function sendPOST( $method, array $message) - { - curl_setopt($this->ch, CURLOPT_POST, true); - return $this->send( $method, $message); - } - //set the message to PUT method type - public function sendPUT( $method, array $message) - { - curl_setopt($this->ch, CURLOPT_PUT, true); - return $this->send( $method, $message); - } - //set the message to DELETE method type - public function sendDELETE( $method, array $message) - { - curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, "DELETE"); - return $this->send( $method, $message); - } - //Display all the data that the response could got. - public function displayResponse() - { - $error = curl_error($this->ch); + $this->restServer = PROTOCOL_HTTP . COLON.PATH_SEP . PATH_SEP; + $this->restServer .= $_SERVER['SERVER_NAME'] . PATH_SEP; + $this->restServer .= $this->serviceTechnic . PATH_SEP . $user . PATH_SEP; + + $this->ch = curl_init(); + curl_setopt($this->ch,CURLOPT_TIMEOUT, 2); + curl_setopt($this->ch,CURLOPT_POST, 1); + curl_setopt($this->ch,CURLOPT_RETURNTRANSFER, 1); + } + /** + * set the message in order to follow the message format + */ + abstract protected function format(array $message); + /** + * Set properties used in a simpleMessage Class like a set in a URI, or formatted as a JSon msg. + */ + abstract protected function setMoreProperties($messageFormated); + /** + * Attach the method to the restServer path, set the type of the message, and the message itself. + */ + protected function setMessageProperties($method,array $message) + { + $messageFormated = $this->format($message); + $this->server_method = $this->restServer . $method; + $this->setMoreProperties($messageFormated); + } + /** + * Send or execute(curl notation) the message using a rest method + **/ + public function send($method,array $message) + { + self::setMessageProperties($method,$message); + $this->output = curl_exec($this->ch); + return $this->output; + } + /** + * Set the message to GET method type + */ + public function sendGET($method,array $message) + { + curl_setopt($this->ch, CURLOPT_HTTPGET,true); + return $this->send($method,$message); + } + /** + * Set the message to POST method type + */ + public function sendPOST($method,array $message) + { + curl_setopt($this->ch,CURLOPT_POST,true); + return $this->send($method,$message); + } + /** + * Set the message to PUT method type + */ + public function sendPUT($method,array $message) + { + curl_setopt($this->ch,CURLOPT_PUT,true); + return $this->send($method,$message); + } + /** + * Set the message to DELETE method type + */ + public function sendDELETE($method,array $message) + { + curl_setopt($this->ch,CURLOPT_CUSTOMREQUEST,"DELETE"); + return $this->send($method,$message); + } + /** + * Display all the data that the response could got. + */ + public function displayResponse() + { + $error = curl_error($this->ch); $result = array( 'header' => '', 'body' => '', 'curl_error' => '', 'http_code' => '', 'last_url' => ''); - if ( $error != "" ) - { + if ($error != ""){ $result['curl_error'] = $error; return $result; } $response = $this->output; $header_size = curl_getinfo($this->ch,CURLINFO_HEADER_SIZE); - $result['header'] = substr($response, 0, $header_size); - $result['body'] = substr( $response, $header_size ); + $result['header'] = substr($response,0,$header_size); + $result['body'] = substr($response,$header_size); $result['http_code'] = curl_getinfo($this -> ch,CURLINFO_HTTP_CODE); $result['last_url'] = curl_getinfo($this -> ch,CURLINFO_EFFECTIVE_URL); - - echo $this->type." Response: ".$response."
"; - foreach($result as $index => $data) - { - if( $data != "") - { - echo $index."=".$data."
"; - } - } - echo "
"; - } - //Close the Curl session using the Curl Handle set by curl_init() function. - public function close() - { - curl_close( $this->ch); - } + + echo $this->type." Response: ".$response."
"; + foreach($result as $index => $data) + { + if($data != ""){ + echo $index . "=" . $data . "
"; + } + } + echo "
"; + } + /** + * Close the Curl session using the Curl Handle set by curl_init() function. + */ + public function close() + { + curl_close($this->ch); + } } ?> diff --git a/workflow/engine/methods/services/Rest/FormatedMessage.php b/workflow/engine/methods/services/Rest/FormatedMessage.php index 7909acfbc..ba1914e3f 100644 --- a/workflow/engine/methods/services/Rest/FormatedMessage.php +++ b/workflow/engine/methods/services/Rest/FormatedMessage.php @@ -1,29 +1,46 @@ server_method . PATH_SEP . $messageFormated."
"; - // - curl_setopt($this->ch, CURLOPT_URL, $this->server_method); - $contentSelected = $this->content . $this->type; - curl_setopt($this->ch, CURLOPT_HTTPHEADER, array($contentSelected)); - curl_setopt($this->ch, CURLOPT_POSTFIELDS, $messageFormated); - } + { + parent::__construct(); + } + /** + * Set the message in order to follow the message format, empty caused this class should not be instanced + */ + protected function format(array $message) + { + } + /** + * Setting CURL Url, Content and the message to be send + */ + protected function setMoreProperties($messageFormated) + { + //Please, remove this comment, is only for looging proposes. + // + echo "Request: " . $this->server_method . PATH_SEP . $messageFormated . "
"; + // + curl_setopt($this->ch,CURLOPT_URL,$this->server_method); + $contentSelected = $this->content . $this->type; + curl_setopt($this->ch,CURLOPT_HTTPHEADER,array($contentSelected)); + curl_setopt($this->ch,CURLOPT_POSTFIELDS,$messageFormated); + } } ?> \ No newline at end of file diff --git a/workflow/engine/methods/services/Rest/JsonMessage.php b/workflow/engine/methods/services/Rest/JsonMessage.php index 535657aa8..773fe0a37 100644 --- a/workflow/engine/methods/services/Rest/JsonMessage.php +++ b/workflow/engine/methods/services/Rest/JsonMessage.php @@ -1,29 +1,43 @@ type = "json"; - } - //Format the array parameter to a json format. - protected function format( array $message) - { - if ( empty( $message) ) - { - return ; - } - if ( is_array( $message) ) - { - $jsonMessage = json_encode( $message); - } - return $jsonMessage; - } + /** + * Call the parent Curl initialization and set the type of the message + */ + public function JsonMessage() + { + parent::__construct(); + $this->type = "json"; + } + /** + * Format the array parameter to a json format. + */ + protected function format(array $message) + { + if (empty($message)){ + return ; + } + if (is_array($message)){ + $jsonMessage = json_encode( $message); + } + return $jsonMessage; + } } ?> \ No newline at end of file diff --git a/workflow/engine/methods/services/Rest/RestMessage.php b/workflow/engine/methods/services/Rest/RestMessage.php index a12fd8ee1..c78fbc3b6 100644 --- a/workflow/engine/methods/services/Rest/RestMessage.php +++ b/workflow/engine/methods/services/Rest/RestMessage.php @@ -1,33 +1,47 @@ type = "rest"; - } - //Format the array parameter to a single rest line format separed by '/'. - protected function format( array $message) - { - $rest = ""; - if ( !empty( $message) ) - { - if ( is_array( $message) ) - { - foreach( $message as $index => $data) - { - $rest .= "/" . $data; - } - $rest .= "/"; - } - } - return $rest; - } + /** + * Call the parent Curl initialization and set the type of the message + */ + public function RestMessage() + { + parent::__construct(); + $this->type = "rest"; + } + /** + * Format the array parameter to a single rest line format separed by '/'. + */ + protected function format(array $message) + { + $rest = ""; + if (!empty($message)){ + if (is_array($message)){ + foreach($message as $index => $data) + { + $rest .= "/" . $data; + } + $rest .= "/"; + } + } + return $rest; + } } ?> diff --git a/workflow/engine/methods/services/Rest/SimpleMessage.php b/workflow/engine/methods/services/Rest/SimpleMessage.php index b9b26606b..7fe054951 100644 --- a/workflow/engine/methods/services/Rest/SimpleMessage.php +++ b/workflow/engine/methods/services/Rest/SimpleMessage.php @@ -1,26 +1,43 @@ server_method . PATH_SEP . $messageFormated."
"; - // - curl_setopt($this->ch, CURLOPT_URL, $this->server_method . $messageFormated); - } + public function SimpleMessage() + { + parent::__construct(); + } + /** + * Set the message in order to follow the message format, empty caused this class should not be instanced + */ + protected function format(array $message) + { + } + /** + * Setting CURL Url, enough to attach a message. + */ + protected function setMoreProperties($messageFormated) + { + //Please, remove this comment, is only for looging proposes. + // + echo "Request: " . $this->server_method . PATH_SEP . $messageFormated . "
"; + // + curl_setopt($this->ch,CURLOPT_URL,$this->server_method.$messageFormated); + } } ?> \ No newline at end of file diff --git a/workflow/engine/methods/services/Rest/XmlMessage.php b/workflow/engine/methods/services/Rest/XmlMessage.php index fdc96ca3e..447a420ae 100644 --- a/workflow/engine/methods/services/Rest/XmlMessage.php +++ b/workflow/engine/methods/services/Rest/XmlMessage.php @@ -1,34 +1,48 @@ type = "xml"; - } - //Format the array parameter to a xml valid format. TODO: Need to find out a better way to do it. - protected function format( array $message) - { - if ( empty( $message) ) - { - return ; - } - if ( is_array( $message) ) - { - $xml = ""; - foreach( $message as $index => $data) - { - $xml .= "<".$index.">".$data.""; - } - $xml .= ""; - } - return $xml; - } + /** + * Call the parent Curl initialization and set the type of the message + */ + public function XmlMessage() + { + parent::__construct(); + $this->type = "xml"; + } + /** + * Format the array parameter to a xml valid format. TODO: Need to find out a better way to do it. + */ + protected function format(array $message) + { + if (empty($message)){ + return ; + } + if (is_array($message)){ + $xml = ""; + foreach($message as $index => $data) + { + $xml .= "<" . $index . ">" . $data . ""; + } + $xml .= ""; + } + return $xml; + } } ?> diff --git a/workflow/engine/methods/services/Rest/testing.php b/workflow/engine/methods/services/Rest/testing.php index 86e3d85a1..3b93426e0 100644 --- a/workflow/engine/methods/services/Rest/testing.php +++ b/workflow/engine/methods/services/Rest/testing.php @@ -4,35 +4,34 @@ require_once("JsonMessage.php"); require_once("XmlMessage.php"); require_once("RestMessage.php"); -$msg = array( 'user'=>'admin', 'password'=>'admin'); +$msg = array( 'user'=>'admin' , 'password'=>'admin'); $method = "login"; $jsonm = new JsonMessage(); -$jsonm->send( $method, $msg); +$jsonm->send($method,$msg); $jsonm->displayResponse(); $xmlm = new XmlMessage(); -$xmlm->send( $method, $msg); +$xmlm->send($method, $msg); $xmlm->displayResponse(); -$msg = array("LABEL","LOGIN","en"); +$msg = array( "LABEL", "LOGIN", "en"); $table = "TRANSLATION"; $rest = new RestMessage(); -$rest->sendGET( $table, $msg); +$rest->sendGET($table,$msg); $rest->displayResponse(); -$msg = array("HOUSE","PUSHIN","en","maullidin","2012-06-06" ); -$rest->sendPOST( $table, $msg); +$msg = array( "HOUSE", "PUSHIN", "en", "sample", "2012-06-06" ); +$rest->sendPOST($table,$msg); $rest->displayResponse(); -$msg = array("HOUSE","PUSHIN","en","wacheneger","2012-07-06" ); -$rest->sendPUT( $table, $msg); +$msg = array( "HOUSE", "PUSHIN", "en", "samplemod", "2012-07-06" ); +$rest->sendPUT($table,$msg); $rest->displayResponse(); -$msg = array("HOUSE","PUSHIN","en" ); -$rest->sendDELETE( $table, $msg); +$msg = array( "HOUSE", "PUSHIN", "en"); +$rest->sendDELETE($table,$msg); $rest->displayResponse(); - ?> From 046cddc776b00520d13c635629ee4c27b0b4bc98 Mon Sep 17 00:00:00 2001 From: Hector Cortez Date: Tue, 2 Oct 2012 14:32:32 -0400 Subject: [PATCH 10/15] BUG 5720 Can not send Next Task Assignment Notifications with grid SOLVED - Can not send Next Task Assignment Notifications with grid variables. - Added and changed function filter for AppData values. --- gulliver/system/class.g.php | 63 ++++++++++++++++++++++++++ workflow/engine/classes/class.case.php | 4 +- 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index e32d94cd3..c18d1340c 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -2044,6 +2044,69 @@ $output = $outputHeader.$output; return $__textoEval; } + /** + * Replace Grid Values + * The tag @>GRID-NAME to open the grid and @])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]*(?:[\\\\][\w\W])?)*)\))((?:\s*\[[\'"]?\w+[\'"]?\])+)?/', $strContentAux, $arrayMatch1, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE); + + if ($iOcurrences) { + $arrayGrid = array(); + for ($i = 0; $i <= $iOcurrences - 1; $i++) { + $arrayGrid[] = $arrayMatch1[2][$i][0]; + } + + $arrayGrid = array_unique($arrayGrid); + + foreach ($arrayGrid as $index => $value) { + $grdName = $value; + $strContentAux1 = $strContentAux; + $strContentAux = null; + $ereg = "/^(.*)@>" . $grdName . "(.*)@<" . $grdName . "(.*)$/"; + + while (preg_match($ereg, $strContentAux1, $arrayMatch2)) { + $strData = null; + + if (isset($aFields[$grdName]) && is_array($aFields[$grdName])) { + foreach ($aFields[$grdName] as $aRow) { + foreach ($aRow as $sKey => $vValue) { + if (!is_array($vValue)) { + $aRow[$sKey] = nl2br($aRow[$sKey]); + } + } + $strData = $strData . G::replaceDataField($arrayMatch2[2], $aRow); + } + } + $strContentAux1 = $arrayMatch2[1]; + $strContentAux = $strData . $arrayMatch2[3] . $strContentAux; + } + $strContentAux = $strContentAux1 . $strContentAux; + } + } + $strContentAux = str_replace($nrthtml, $nrt, $strContentAux); + $sContent = $strContentAux; + + foreach ($aFields as $sKey => $vValue) { + if (!is_array($vValue)) { + $aFields[$sKey] = nl2br($aFields[$sKey]); + } + } + $sContent = G::replaceDataField($sContent, $aFields); + + return $sContent; + } + + /* Load strings from a XMLFile. * @author David Callizaya * @parameter $languageFile An xml language file. diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index 2dfa55a0b..be3323cc4 100755 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -4585,9 +4585,9 @@ class Cases throw (new Exception("Template file \"$fileTemplate\" does not exist.")); } - $sBody = G::replaceDataField(file_get_contents($fileTemplate), $aFields); + $sBody = G::replaceDataGridField(file_get_contents($fileTemplate), $aFields); } else { - $sBody = nl2br(G::replaceDataField($aTaskInfo["TAS_DEF_MESSAGE"], $aFields)); + $sBody = nl2br(G::replaceDataGridField($aTaskInfo["TAS_DEF_MESSAGE"], $aFields)); } G::LoadClass("tasks"); From 963c70b62c26f02bd95d48c6613066bce009e8e2 Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Date: Tue, 2 Oct 2012 15:21:06 -0400 Subject: [PATCH 11/15] BUG 8668 No se puede remover permisos del rol PROCESSMAKER_ADMIN SOLVED - The permits can not be removed for the role processmaker_admin. - We add a generic list of permissions for the role processmaker_admin located in class.rbac.php. - Was can remove permissions for the role processmaker_admin but other than those predefined in the list of RBAC. --- gulliver/system/class.rbac.php | 32 +++++++ .../methods/roles/rolesUsersPermission.php | 2 + .../templates/roles/rolesUsersPermission.js | 87 +++++++++++++------ 3 files changed, 95 insertions(+), 26 deletions(-) diff --git a/gulliver/system/class.rbac.php b/gulliver/system/class.rbac.php index 42c128e1d..58e4933cc 100755 --- a/gulliver/system/class.rbac.php +++ b/gulliver/system/class.rbac.php @@ -59,6 +59,7 @@ class RBAC var $currentSystemobj; var $rolesPermissionsObj; var $authSourcesObj; + var $permissionsAdmin; var $aUserInfo = array(); var $aRbacPlugins = array(); @@ -143,6 +144,37 @@ class RBAC } } + /** + * gets the Role and their permissions for Administrator Processmaker + * + * @access public + * @return $this->permissionsAdmin[ $permissionsAdmin ] + */ + function loadPermissionAdmin() { + $permissionsAdmin =array( + array("PER_UID"=>"00000000000000000000000000000001","PER_CODE"=>"PM_LOGIN"), + array("PER_UID"=>"00000000000000000000000000000002","PER_CODE"=>"PM_SETUP"), + array("PER_UID"=>"00000000000000000000000000000003","PER_CODE"=>"PM_USERS"), + array("PER_UID"=>"00000000000000000000000000000004","PER_CODE"=>"PM_FACTORY"), + array("PER_UID"=>"00000000000000000000000000000005","PER_CODE"=>"PM_CASES"), + array("PER_UID"=>"00000000000000000000000000000006","PER_CODE"=>"PM_ALLCASES"), + array("PER_UID"=>"00000000000000000000000000000007","PER_CODE"=>"PM_REASSIGNCASE"), + array("PER_UID"=>"00000000000000000000000000000008","PER_CODE"=>"PM_REPORTS"), + array("PER_UID"=>"00000000000000000000000000000009","PER_CODE"=>"PM_SUPERVISOR"), + array("PER_UID"=>"00000000000000000000000000000010","PER_CODE"=>"PM_SETUP_ADVANCE"), + array("PER_UID"=>"00000000000000000000000000000011","PER_CODE"=>"PM_DASHBOARD"), + array("PER_UID"=>"00000000000000000000000000000012","PER_CODE"=>"PM_WEBDAV"), + array("PER_UID"=>"00000000000000000000000000000013","PER_CODE"=>"PM_DELETECASE"), + array("PER_UID"=>"00000000000000000000000000000014","PER_CODE"=>"PM_EDITPERSONALINFO"), + array("PER_UID"=>"00000000000000000000000000000015","PER_CODE"=>"PM_FOLDERS_VIEW"), + array("PER_UID"=>"00000000000000000000000000000016","PER_CODE"=>"PM_FOLDERS_ADD_FOLDER"), + array("PER_UID"=>"00000000000000000000000000000017","PER_CODE"=>"PM_FOLDERS_ADD_FILE"), + array("PER_UID"=>"00000000000000000000000000000018","PER_CODE"=>"PM_CANCELCASE"), + array("PER_UID"=>"00000000000000000000000000000019","PER_CODE"=>"PM_FOLDER_DELETE") + ); + return $permissionsAdmin; + } + /** * Gets the roles and permission for one RBAC_user * diff --git a/workflow/engine/methods/roles/rolesUsersPermission.php b/workflow/engine/methods/roles/rolesUsersPermission.php index 168d8e626..78de694c1 100755 --- a/workflow/engine/methods/roles/rolesUsersPermission.php +++ b/workflow/engine/methods/roles/rolesUsersPermission.php @@ -61,8 +61,10 @@ $roles['ROL_UID'] = $_GET['rUID']; $roles['ROL_CODE'] = $RBAC->getRoleCode($_GET['rUID']); $roles['CURRENT_TAB'] = ($_GET['tab']=='permissions') ? 1 : 0; +$permissionsAdmin = $RBAC->loadPermissionAdmin(); $oHeadPublisher->assign('ROLES', $roles); +$oHeadPublisher->assign('permissionsAdmin', $permissionsAdmin); G::RenderPage('publish', 'extJs'); ?> \ No newline at end of file diff --git a/workflow/engine/templates/roles/rolesUsersPermission.js b/workflow/engine/templates/roles/rolesUsersPermission.js index 0c41dbc88..876a1cb18 100755 --- a/workflow/engine/templates/roles/rolesUsersPermission.js +++ b/workflow/engine/templates/roles/rolesUsersPermission.js @@ -150,14 +150,27 @@ Ext.onReady(function(){ selectSingle: false, listeners:{ selectionchange: function(sm){ - switch(sm.getCount()){ - case 0: Ext.getCmp('removeButton').disable(); break; - default: (ROLES.ROL_UID==pm_admin)? Ext.getCmp('removeButton').disable() : Ext.getCmp('removeButton').enable(); break; - } - } - } - }); - + switch (sm.getCount()) { + case 0: Ext.getCmp('removeButton').disable(); break; + default: + Ext.getCmp('removeButton').enable(); + if (ROLES.ROL_UID == pm_admin) { + var permissionUid = assignedGrid.getSelectionModel().getSelections(); + permissionUid = permissionUid[0].get('PER_UID'); + for (i=0; i', handler: AssignPermissionAction, id: 'assignButton', disabled: true}, {xtype:'button',text: '<', handler: RemovePermissionAction, id: 'removeButton', disabled: true}, {xtype:'button',text: '>>', handler: AssignAllPermissionsAction, id: 'assignButtonAll', disabled: false}, - {xtype:'button',text: '<<', handler: RemoveAllPermissionsAction, id: 'removeButtonAll', disabled: (ROLES.ROL_UID==pm_admin) ? true : false} + {xtype:'button',text: '<<', handler: RemoveAllPermissionsAction, id: 'removeButtonAll', disabled: false} ], hidden : true }); @@ -659,14 +672,24 @@ AssignPermissionAction = function(){ //RemoveButton Functionality RemovePermissionAction = function(){ - if (ROLES.ROL_UID != pm_admin){ - rowsSelected = assignedGrid.getSelectionModel().getSelections(); - var arrAux = new Array(); - for(var a=0; a < rowsSelected.length; a++){ - arrAux[a] = rowsSelected[a].get('PER_UID'); - } - DeletePermissionsRole(arrAux,RefreshPermissions,FailureProcess); - } + rowsSelected = assignedGrid.getSelectionModel().getSelections(); + var arrAux = new Array(); + for(var a=0; a < rowsSelected.length; a++){ + var sw = true; + if (ROLES.ROL_UID == pm_admin) { + for (i=0; i0){ - for (var r=0; r < allRows.getCount(); r++){ - row = allRows.getAt(r); - arrAux[r] = row.data['PER_UID']; - } - DeletePermissionsRole(arrAux,RefreshPermissions,FailureProcess); - } + var allRows = assignedGrid.getStore(); + var arrAux = new Array(); + if (allRows.getCount()>0){ + for (var r=0; r < allRows.getCount(); r++){ + row = allRows.getAt(r); + var sw = true; + if (ROLES.ROL_UID == pm_admin) { + for (i=0; i Date: Tue, 2 Oct 2012 15:28:00 -0400 Subject: [PATCH 12/15] BUG 9841 We can't search users by email SOLVED - Could not be performed by not having the search in the options. - Was add the parameter for search. --- workflow/engine/methods/users/users_Ajax.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/workflow/engine/methods/users/users_Ajax.php b/workflow/engine/methods/users/users_Ajax.php index 5d7affa5d..aed416375 100755 --- a/workflow/engine/methods/users/users_Ajax.php +++ b/workflow/engine/methods/users/users_Ajax.php @@ -373,7 +373,8 @@ try { if ($filter != ''){ $cc = $oCriteria->getNewCriterion(UsersPeer::USR_USERNAME,'%'.$filter.'%',Criteria::LIKE)->addOr( $oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME,'%'.$filter.'%',Criteria::LIKE)->addOr( - $oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME,'%'.$filter.'%',Criteria::LIKE))); + $oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME,'%'.$filter.'%',Criteria::LIKE)->addOr( + $oCriteria->getNewCriterion(UsersPeer::USR_EMAIL,'%'.$filter.'%',Criteria::LIKE)))); $oCriteria->add($cc); } $oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN); @@ -406,7 +407,8 @@ try { if ($filter != ''){ $cc = $oCriteria->getNewCriterion(UsersPeer::USR_USERNAME,'%'.$filter.'%',Criteria::LIKE)->addOr( $oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME,'%'.$filter.'%',Criteria::LIKE)->addOr( - $oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME,'%'.$filter.'%',Criteria::LIKE))); + $oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME,'%'.$filter.'%',Criteria::LIKE)->addOr( + $oCriteria->getNewCriterion(UsersPeer::USR_EMAIL,'%'.$filter.'%',Criteria::LIKE)))); $oCriteria->add($cc); } // $sw_add = false; From c07a78e9ea8cdba3450540e3687284604243f0de Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Date: Tue, 2 Oct 2012 16:22:51 -0400 Subject: [PATCH 13/15] BUG 8668 No se puede remover permisos del rol PROCESSMAKER_ADMIN SOLVED - The permits can not be removed for the role processmaker_admin. - We add a generic list of permissions for the role processmaker_admin located in class.rbac.php. - Was can remove permissions for the role processmaker_admin but other than those predefined in the list of RBAC. --- gulliver/system/class.rbac.php | 1 - .../engine/methods/roles/rolesUsersPermission.php | 4 +--- .../engine/templates/roles/rolesUsersPermission.js | 12 +++++++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/gulliver/system/class.rbac.php b/gulliver/system/class.rbac.php index 58e4933cc..0d24ad85d 100755 --- a/gulliver/system/class.rbac.php +++ b/gulliver/system/class.rbac.php @@ -59,7 +59,6 @@ class RBAC var $currentSystemobj; var $rolesPermissionsObj; var $authSourcesObj; - var $permissionsAdmin; var $aUserInfo = array(); var $aRbacPlugins = array(); diff --git a/workflow/engine/methods/roles/rolesUsersPermission.php b/workflow/engine/methods/roles/rolesUsersPermission.php index 78de694c1..46385144a 100755 --- a/workflow/engine/methods/roles/rolesUsersPermission.php +++ b/workflow/engine/methods/roles/rolesUsersPermission.php @@ -61,10 +61,8 @@ $roles['ROL_UID'] = $_GET['rUID']; $roles['ROL_CODE'] = $RBAC->getRoleCode($_GET['rUID']); $roles['CURRENT_TAB'] = ($_GET['tab']=='permissions') ? 1 : 0; -$permissionsAdmin = $RBAC->loadPermissionAdmin(); - $oHeadPublisher->assign('ROLES', $roles); -$oHeadPublisher->assign('permissionsAdmin', $permissionsAdmin); +$oHeadPublisher->assign('permissionsAdmin', $RBAC->loadPermissionAdmin()); G::RenderPage('publish', 'extJs'); ?> \ No newline at end of file diff --git a/workflow/engine/templates/roles/rolesUsersPermission.js b/workflow/engine/templates/roles/rolesUsersPermission.js index 876a1cb18..db7b0dcc6 100755 --- a/workflow/engine/templates/roles/rolesUsersPermission.js +++ b/workflow/engine/templates/roles/rolesUsersPermission.js @@ -157,7 +157,7 @@ Ext.onReady(function(){ if (ROLES.ROL_UID == pm_admin) { var permissionUid = assignedGrid.getSelectionModel().getSelections(); permissionUid = permissionUid[0].get('PER_UID'); - for (i=0; i0){ + var sw; for (var r=0; r < allRows.getCount(); r++){ row = allRows.getAt(r); - var sw = true; + sw = true; if (ROLES.ROL_UID == pm_admin) { - for (i=0; i Date: Tue, 2 Oct 2012 17:04:22 -0400 Subject: [PATCH 14/15] =?UTF-8?q?BUG=209720=20Proceso=20de=20actualizaci?= =?UTF-8?q?=C3=B3e=20ProcessMaker=20es=20lento=20IMPROVEMENT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ProcessMaker update process is slow for query. - Was optimized queries and was modified the rebuild "Table content". --- workflow/engine/classes/model/Content.php | 11 +++++++++++ workflow/engine/methods/setup/languages_Import.php | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/model/Content.php b/workflow/engine/classes/model/Content.php index a6923dd00..43ed87c76 100755 --- a/workflow/engine/classes/model/Content.php +++ b/workflow/engine/classes/model/Content.php @@ -382,6 +382,17 @@ class Content extends BaseContent { } } + function fastInsertContent ($ConCategory, $ConParent, $ConId, $ConLang, $ConValue) { + $con = new Content ( ); + $con->setConCategory ( $ConCategory ); + $con->setConParent ( $ConParent ); + $con->setConId ( $ConId ); + $con->setConLang ( $ConLang ); + $con->setConValue ( $ConValue ); + $res = $con->save (); + return $res; + } + function removeLanguageContent($lanId) { try { $c = new Criteria ( ); diff --git a/workflow/engine/methods/setup/languages_Import.php b/workflow/engine/methods/setup/languages_Import.php index 97b3e0630..17547f7c9 100755 --- a/workflow/engine/methods/setup/languages_Import.php +++ b/workflow/engine/methods/setup/languages_Import.php @@ -72,9 +72,9 @@ try { $importResults = $language->import($languageFile); G::LoadClass("wsTools"); - $renegerateContent = new workspaceTools(); + $renegerateContent = new workspaceTools(SYS_SYS); $renegerateContent->upgradeContent(); - + $result->msg = G::LoadTranslation('IMPORT_LANGUAGE_SUCCESS') . "\n"; $result->msg .= "PO File num. records: " . $importResults->recordsCount . "\n"; $result->msg .= "Success Records: " . $importResults->recordsCountSuccess . "\n"; From 2a416c6e318d4ae7faae31382fd1c9b82c941693 Mon Sep 17 00:00:00 2001 From: Ralph Asendeteufrer Date: Tue, 2 Oct 2012 17:28:12 -0400 Subject: [PATCH 15/15] BUG 9855 REST services for ProcessMaker Solved PROBLEM there were not any documentation of Rest using Curl, and using rest with Java. SOLVED There were add classes to help to use Rest by Curl, and examples to use rest with Java were added. --- workflow/engine/methods/services/Rest/CRUD.java | 2 +- workflow/engine/methods/services/Rest/CURLMessage.php | 8 ++++---- workflow/engine/methods/services/Rest/FormatedMessage.php | 2 +- workflow/engine/methods/services/Rest/JsonMessage.php | 2 +- workflow/engine/methods/services/Rest/RestMessage.php | 2 +- workflow/engine/methods/services/Rest/SimpleMessage.php | 2 +- workflow/engine/methods/services/Rest/XmlMessage.php | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/workflow/engine/methods/services/Rest/CRUD.java b/workflow/engine/methods/services/Rest/CRUD.java index 56262aef7..d26b07971 100644 --- a/workflow/engine/methods/services/Rest/CRUD.java +++ b/workflow/engine/methods/services/Rest/CRUD.java @@ -20,7 +20,7 @@ import org.apache.http.util.EntityUtils; */ public class CRUD { - private static String m_user = "ralph"; // This member variable must be changed to its own dev username + private static String m_user = "workflow"; // This member variable must be changed to its own dev workspace private static void PostSample() { diff --git a/workflow/engine/methods/services/Rest/CURLMessage.php b/workflow/engine/methods/services/Rest/CURLMessage.php index d31fcc4c7..ae2ed0dbe 100644 --- a/workflow/engine/methods/services/Rest/CURLMessage.php +++ b/workflow/engine/methods/services/Rest/CURLMessage.php @@ -7,7 +7,7 @@ * @category Zend * @package ProcessMaker * @subpackage workflow - * @copyright Copyright (c) ProcessMaker Colosa S.A. + * @copyright Copyright (c) ProcessMaker Colosa Inc. * @version Release: @2.0.44@ * @since Class available since Release 2.0.44 */ @@ -22,7 +22,7 @@ define('PROTOCOL_HTTP', 'http'); */ abstract class CURLMessage { - protected $restServer; // e.g. "http://ralph.pmos.colosa.net/rest/ralph/"; host + technich dir + user dir + protected $restServer; // e.g. "http://ralph.pmos.colosa.net/rest/ralph/"; host + technich dir + workspace protected $content = "Content-Type: application/"; //set the string used to attach next the kind of message to be handle. protected $serviceTechnic = "rest";// name of the current durectory where the rest methods are. protected $server_method; // used to set the name of the remote host and the Rest method to be called. @@ -37,11 +37,11 @@ abstract class CURLMessage { $serverDNS = explode(DOT,$_SERVER['SERVER_NAME']); $serverDNS = array_reverse($serverDNS); - $user = array_pop($serverDNS); //***aware this must contains user logged or enviroment name*** + $workspace = array_pop($serverDNS); //***aware this must contains the workspace name*** $this->restServer = PROTOCOL_HTTP . COLON.PATH_SEP . PATH_SEP; $this->restServer .= $_SERVER['SERVER_NAME'] . PATH_SEP; - $this->restServer .= $this->serviceTechnic . PATH_SEP . $user . PATH_SEP; + $this->restServer .= $this->serviceTechnic . PATH_SEP . $workspace . PATH_SEP; $this->ch = curl_init(); curl_setopt($this->ch,CURLOPT_TIMEOUT, 2); diff --git a/workflow/engine/methods/services/Rest/FormatedMessage.php b/workflow/engine/methods/services/Rest/FormatedMessage.php index ba1914e3f..191a693fe 100644 --- a/workflow/engine/methods/services/Rest/FormatedMessage.php +++ b/workflow/engine/methods/services/Rest/FormatedMessage.php @@ -6,7 +6,7 @@ * @category Zend * @package ProcessMaker * @subpackage workflow - * @copyright Copyright (c) ProcessMaker Colosa S.A. + * @copyright Copyright (c) ProcessMaker Colosa Inc. * @version Release: @2.0.44@ * @since Class available since Release 2.0.44 */ diff --git a/workflow/engine/methods/services/Rest/JsonMessage.php b/workflow/engine/methods/services/Rest/JsonMessage.php index 773fe0a37..2a8d8f332 100644 --- a/workflow/engine/methods/services/Rest/JsonMessage.php +++ b/workflow/engine/methods/services/Rest/JsonMessage.php @@ -6,7 +6,7 @@ * @category Zend * @package ProcessMaker * @subpackage workflow - * @copyright Copyright (c) ProcessMaker Colosa S.A. + * @copyright Copyright (c) ProcessMaker Colosa Inc. * @version Release: @2.0.44@ * @since Class available since Release 2.0.44 */ diff --git a/workflow/engine/methods/services/Rest/RestMessage.php b/workflow/engine/methods/services/Rest/RestMessage.php index c78fbc3b6..f6c7488b6 100644 --- a/workflow/engine/methods/services/Rest/RestMessage.php +++ b/workflow/engine/methods/services/Rest/RestMessage.php @@ -6,7 +6,7 @@ * @category Zend * @package ProcessMaker * @subpackage workflow - * @copyright Copyright (c) ProcessMaker Colosa S.A. + * @copyright Copyright (c) ProcessMaker Colosa Inc. * @version Release: @2.0.44@ * @since Class available since Release 2.0.44 */ diff --git a/workflow/engine/methods/services/Rest/SimpleMessage.php b/workflow/engine/methods/services/Rest/SimpleMessage.php index 7fe054951..94cfd3ec1 100644 --- a/workflow/engine/methods/services/Rest/SimpleMessage.php +++ b/workflow/engine/methods/services/Rest/SimpleMessage.php @@ -6,7 +6,7 @@ * @category Zend * @package ProcessMaker * @subpackage workflow - * @copyright Copyright (c) ProcessMaker Colosa S.A. + * @copyright Copyright (c) ProcessMaker Colosa Inc. * @version Release: @2.0.44@ * @since Class available since Release 2.0.44 */ diff --git a/workflow/engine/methods/services/Rest/XmlMessage.php b/workflow/engine/methods/services/Rest/XmlMessage.php index 447a420ae..9d33db4fd 100644 --- a/workflow/engine/methods/services/Rest/XmlMessage.php +++ b/workflow/engine/methods/services/Rest/XmlMessage.php @@ -6,7 +6,7 @@ * @category Zend * @package ProcessMaker * @subpackage workflow - * @copyright Copyright (c) ProcessMaker Colosa S.A. + * @copyright Copyright (c) ProcessMaker Colosa Inc. * @version Release: @2.0.44@ * @since Class available since Release 2.0.44 */