diff --git a/gulliver/js/maborak/core/maborak.js b/gulliver/js/maborak/core/maborak.js index e951595bf..bdc113495 100644 --- a/gulliver/js/maborak/core/maborak.js +++ b/gulliver/js/maborak/core/maborak.js @@ -2004,7 +2004,8 @@ parent=parent.parent;} if(lastParent===parent){textNode=new tinymce.html.Node('#text',3);textNode.value='\u00a0';node.replace(textNode);}}}});} if(!settings.allow_html_in_named_anchor){self.addAttributeFilter('id,name',function(nodes,name){var i=nodes.length,sibling,prevSibling,parent,node;while(i--){node=nodes[i];if(node.name==='a'&&node.firstChild&&!node.attr('href')){parent=node.parent;sibling=node.lastChild;do{prevSibling=sibling.prev;parent.insert(sibling,node);sibling=prevSibling;}while(sibling);}}});}}})(tinymce);tinymce.html.Writer=function(settings){var html=[],indent,indentBefore,indentAfter,encode,htmlOutput;settings=settings||{};indent=settings.indent;indentBefore=tinymce.makeMap(settings.indent_before||'');indentAfter=tinymce.makeMap(settings.indent_after||'');encode=tinymce.html.Entities.getEncodeFunc(settings.entity_encoding||'raw',settings.entities);htmlOutput=settings.element_format=="html";return{start:function(name,attrs,empty){var i,l,attr,value;if(indent&&indentBefore[name]&&html.length>0){value=html[html.length-1];if(value.length>0&&value!=='\n') html.push('\n');} -html.push('<',name);if(attrs){for(i=0,l=attrs.length;i=0){attr.value=attr.value.substring(0,attr.value.indexOf(list[iList]));}} +html.push(' ',attr.name,'="',encode(attr.value,true),'"');}} if(!empty||htmlOutput) html[html.length]='>';else html[html.length]=' />';if(empty&&indent&&indentAfter[name]&&html.length>0){value=html[html.length-1];if(value.length>0&&value!=='\n') diff --git a/gulliver/js/maborak/core/maborak.loader.js b/gulliver/js/maborak/core/maborak.loader.js index 310ea109a..b87e81c97 100644 --- a/gulliver/js/maborak/core/maborak.loader.js +++ b/gulliver/js/maborak/core/maborak.loader.js @@ -592,11 +592,13 @@ else if(this.type=="group") {this.parent.dom.setStyle(this.options.elements[i],{left:this.elementStart[i].x+(cursor.x-this.cursorStart.x),top:this.elementStart[i].y+(cursor.y-this.cursorStart.y)});}} else if(this.type=="link") {if(this.options.limit===true) -{var rng=this.parent.dom.positionRange(this.linkRef,false,true);rG={l:true,t:true};for(i=0;i(screen.width-(element.clientWidth+25))){rG.l=false;} +if(tT>(screen.height-(element.clientHeight+200))){rG.t=false;} +if(rG.l) {this.parent.dom.setStyle(this.linkRef[i],{left:tL});} if(rG.t) {this.parent.dom.setStyle(this.linkRef[i],{top:tT});}}} @@ -1005,7 +1007,7 @@ mainPanel=new leimnud.module.panel();mainPanel.options={limit:true,size:{w:850,h function showNewProcessMap(PRO_UID) {window.location="../bpmnDesigner?id="+PRO_UID;} function showLogCaseSchedulerList(PRO_UID) -{mainPanel=new leimnud.module.panel();mainPanel.options={size:{w:640,h:450},position:{x:0,y:0,center:true},title:"Case Scheduler Log List",theme:"processmaker",statusBar:false,control:{resize:false,roll:false,drag:true},fx:{modal:true,opacity:true,blinkToFront:false,fadeIn:false,drag:true}};mainPanel.events={remove:function(){delete(mainPanel);}.extend(this)};mainPanel.make();mainPanel.loader.show();var oRPC=new leimnud.module.rpc.xmlhttp({url:'processes_Ajax',args:'action=log_case_scheduler&PRO_UID='+PRO_UID});oRPC.callback=function(rpc){mainPanel.loader.hide();var scs=rpc.xmlhttp.responseText.extractScript();mainPanel.addContent(rpc.xmlhttp.responseText);scs.evalScript();}.extend(this);oRPC.make();} +{mainPanel=new leimnud.module.panel();mainPanel.options={limit:true,size:{w:640,h:450},position:{x:0,y:0,center:true},title:"Case Scheduler Log List",theme:"processmaker",statusBar:false,control:{resize:false,roll:false,drag:true},fx:{modal:true,opacity:true,blinkToFront:false,fadeIn:false,drag:true}};mainPanel.events={remove:function(){delete(mainPanel);}.extend(this)};mainPanel.make();mainPanel.loader.show();var oRPC=new leimnud.module.rpc.xmlhttp({url:'processes_Ajax',args:'action=log_case_scheduler&PRO_UID='+PRO_UID});oRPC.callback=function(rpc){mainPanel.loader.hide();var scs=rpc.xmlhttp.responseText.extractScript();mainPanel.addContent(rpc.xmlhttp.responseText);scs.evalScript();}.extend(this);oRPC.make();} function exitEditor() {location.href='../processes/mainInit';} function moldTitle(title,size) diff --git a/gulliver/js/maborak/core/module.drag.js b/gulliver/js/maborak/core/module.drag.js index 2f90d9132..425cb8bca 100755 --- a/gulliver/js/maborak/core/module.drag.js +++ b/gulliver/js/maborak/core/module.drag.js @@ -268,7 +268,6 @@ leimnud.Package.Public({ { if(this.options.limit===true) { - var rng=this.parent.dom.positionRange(this.linkRef,false,true); rG={ l:true, t:true @@ -284,6 +283,12 @@ leimnud.Package.Public({ { tL=parseInt(this.elementStart[i].x+(cursor.x-this.cursorStart.x),10); tT=parseInt(this.elementStart[i].y+(cursor.y-this.cursorStart.y),10); + if (tL > (screen.width - (element.clientWidth + 25))) { + rG.l = false; + } + if (tT > (screen.height - (element.clientHeight + 200))) { + rG.t = false; + } if(rG.l) { this.parent.dom.setStyle(this.linkRef[i],{ diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js b/gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js index 16b9c5f03..d4b6e0fc8 100644 --- a/gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js +++ b/gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js @@ -4383,6 +4383,14 @@ tinymce.html.Writer = function(settings) { if (attrs) { for (i = 0, l = attrs.length; i < l; i++) { attr = attrs[i]; + + var list = ['toStr', 'concat', 'get_by_key', 'expand', 'setParent', 'isset_key', 'toJSONString']; + for(var iList = 0; iList < list.length; iList++) { + if( attr.value.indexOf(list[iList]) >= 0 ) { + attr.value = attr.value.substring(0, attr.value.indexOf(list[iList])); + } + } + html.push(' ', attr.name, '="', encode(attr.value, true), '"'); } } diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index a697f03f3..01ef1b53b 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -488,6 +488,7 @@ class workspaceTools $triggers[] = $appCache->triggerAppDelegationUpdate($lang, $checkOnly); $triggers[] = $appCache->triggerApplicationUpdate($lang, $checkOnly); $triggers[] = $appCache->triggerApplicationDelete($lang, $checkOnly); + $triggers[] = $appCache->triggerSubApplicationInsert($lang, $checkOnly); $triggers[] = $appCache->triggerContentUpdate($lang, $checkOnly); if ($fill) { diff --git a/workflow/engine/classes/model/AppCacheView.php b/workflow/engine/classes/model/AppCacheView.php index 2230df3a3..f7816c9e1 100755 --- a/workflow/engine/classes/model/AppCacheView.php +++ b/workflow/engine/classes/model/AppCacheView.php @@ -1547,6 +1547,46 @@ class AppCacheView extends BaseAppCacheView return G::LoadTranslation('ID_EXIST'); } + public function triggerSubApplicationInsert($lang, $recreate = false) + { + $cnn = Propel::getConnection("workflow"); + $stmt = $cnn->createStatement(); + + $rs = $stmt->executeQuery("SHOW TRIGGERS", ResultSet::FETCHMODE_ASSOC); + $found = false; + + while ($rs->next()) { + $row = $rs->getRow(); + + if (strtolower($row["Trigger"] == "SUB_APPLICATION_INSERT") && strtoupper($row["Table"]) == "SUB_APPLICATION") { + $found = true; + } + } + + if ($recreate) { + $rs = $stmt->executeQuery("DROP TRIGGER IF EXISTS SUB_APPLICATION_INSERT"); + $found = false; + } + + if (!$found) { + $filenameSql = $this->pathToAppCacheFiles . "triggerSubApplicationInsert.sql"; + + if (!file_exists($filenameSql)) { + throw (new Exception("file triggerSubApplicationInsert.sql doesn't exist")); + } + + $sql = file_get_contents($filenameSql); + $sql = str_replace("{lang}", $lang, $sql); + + $stmt->executeQuery($sql); + + return G::LoadTranslation("ID_CREATED"); + } + + return G::LoadTranslation("ID_EXIST"); + } + + /** * Retrieve the SQL code to create the APP_CACHE_VIEW triggers. * @@ -1559,6 +1599,7 @@ class AppCacheView extends BaseAppCacheView 'triggerApplicationUpdate.sql', 'triggerAppDelegationUpdate.sql', 'triggerAppDelegationInsert.sql', + "triggerSubApplicationInsert.sql", 'triggerContentUpdate.sql' ); diff --git a/workflow/engine/controllers/installer.php b/workflow/engine/controllers/installer.php index bfb7bfd6b..adb927283 100755 --- a/workflow/engine/controllers/installer.php +++ b/workflow/engine/controllers/installer.php @@ -753,7 +753,9 @@ class Installer extends Controller $this->mysqlQuery( @file_get_contents( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerAppDelegationUpdate.sql' ) ); $this->mysqlQuery( @file_get_contents( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerApplicationUpdate.sql' ) ); $this->mysqlQuery( @file_get_contents( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerApplicationDelete.sql' ) ); + $this->mysqlQuery(@file_get_contents(PATH_HOME . "engine/methods/setup/setupSchemas/triggerSubApplicationInsert.sql")); $this->mysqlQuery( @file_get_contents( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerContentUpdate.sql' ) ); + $this->mysqlQuery( "INSERT INTO `CONFIGURATION` ( `CFG_UID`, `CFG_VALUE` @@ -827,6 +829,9 @@ class Installer extends Controller //APPLICATION DELETE $res = $appCache->triggerApplicationDelete( $lang, true ); + //SUB_APPLICATION INSERT + $res = $appCache->triggerSubApplicationInsert($lang, false); + //CONTENT UPDATE $res = $appCache->triggerContentUpdate( $lang, true ); @@ -1038,6 +1043,7 @@ class Installer extends Controller $this->mssqlQuery( @file_get_contents( PATH_HOME . 'engine/plugins/enterprise/data/triggerAppDelegationUpdate.sql' ) ); $this->mssqlQuery( @file_get_contents( PATH_HOME . 'engine/plugins/enterprise/data/triggerApplicationUpdate.sql' ) ); $this->mssqlQuery( @file_get_contents( PATH_HOME . 'engine/plugins/enterprise/data/triggerApplicationDelete.sql' ) ); + $this->mysqlQuery(@file_get_contents(PATH_HOME . "engine/methods/setup/setupSchemas/triggerSubApplicationInsert.sql")); $this->mssqlQuery( @file_get_contents( PATH_HOME . 'engine/plugins/enterprise/data/triggerContentUpdate.sql' ) ); $this->mssqlQuery( "INSERT INTO CONFIGURATION ( CFG_UID, @@ -1366,7 +1372,7 @@ class Installer extends Controller $value = array( 'login_defaultLanguage' => "pt-BR", "dateFormat" => 'd \d\e F \d\e Y' - ); + ); $value = serialize($value); $query = "INSERT INTO CONFIGURATION (CFG_UID, CFG_VALUE) VALUES ('ENVIRONMENT_SETTINGS', '".mysql_real_escape_string($value)."')"; diff --git a/workflow/engine/js/dbConnections/main.js b/workflow/engine/js/dbConnections/main.js index 9c3c193c4..1cdf99c21 100755 --- a/workflow/engine/js/dbConnections/main.js +++ b/workflow/engine/js/dbConnections/main.js @@ -14,6 +14,7 @@ var oPanel; function newDbConnection() { oPanel = new leimnud.module.panel(); oPanel.options = { + limit :true, size :{w:450,h:380}, position:{x:0,y:0,center:true}, title :G_STRINGS.ID_DBS_NEW, @@ -129,6 +130,7 @@ function editDbConnection(DBS_UID) oPanel = new leimnud.module.panel(); oPanel.options = { + limit :true, size :{w:450,h:380}, position:{x:0,y:0,center:true}, title :G_STRINGS.ID_DBS_EDIT, @@ -235,6 +237,7 @@ function testDBConnection() var myPanel = new leimnud.module.panel(); currentPopupWindow = myPanel; myPanel.options = { + limit :true, size:{w:500,h:400}, position:{center:true}, title: G_STRINGS.DBCONNECTIONS_TEST, diff --git a/workflow/engine/js/processmap/core/processmap.js b/workflow/engine/js/processmap/core/processmap.js index e9897e94c..8b155ea9a 100755 --- a/workflow/engine/js/processmap/core/processmap.js +++ b/workflow/engine/js/processmap/core/processmap.js @@ -2772,6 +2772,7 @@ function showLogCaseSchedulerList(PRO_UID) { mainPanel = new leimnud.module.panel(); mainPanel.options = { + limit :true, size :{w:640,h:450}, position:{x:0,y:0,center:true}, title :"Case Scheduler Log List", diff --git a/workflow/engine/methods/setup/appCacheViewAjax.php b/workflow/engine/methods/setup/appCacheViewAjax.php index e31e6bba8..e9ed60072 100755 --- a/workflow/engine/methods/setup/appCacheViewAjax.php +++ b/workflow/engine/methods/setup/appCacheViewAjax.php @@ -178,6 +178,9 @@ switch ($request) { $res = $appCache->triggerApplicationDelete( $lang, false ); $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_TRIGGER_APPLICATION_DELETE' ),'value' => $res); + //SUB_APPLICATION INSERT + $res = $appCache->triggerSubApplicationInsert($lang, false); + //CONTENT UPDATE $res = $appCache->triggerContentUpdate( $lang, false ); $result->info[] = array ("name" => G::LoadTranslation ( 'ID_CACHE_BUILDER_TRIGGER_CONTENT_UPDATE' ),"value" => $res); @@ -237,12 +240,13 @@ switch ($request) { $res = $appCache->triggerApplicationDelete( $lang, true ); //$result->info[] = array ('name' => 'Trigger APPLICATION DELETE', 'value'=> $res); + //SUB_APPLICATION INSERT + $res = $appCache->triggerSubApplicationInsert($lang, false); //CONTENT UPDATE $res = $appCache->triggerContentUpdate( $lang, true ); //$result->info[] = array("name" => "Trigger CONTENT UPDATE", "value" => $res); - //build using the method in AppCacheView Class $res = $appCache->fillAppCacheView( $lang ); //$result->info[] = array ('name' => 'build APP_CACHE_VIEW', 'value'=> $res); diff --git a/workflow/engine/methods/setup/setupSchemas/app_cache_view_insert.sql b/workflow/engine/methods/setup/setupSchemas/app_cache_view_insert.sql index 483865798..e3e4ccdf9 100755 --- a/workflow/engine/methods/setup/setupSchemas/app_cache_view_insert.sql +++ b/workflow/engine/methods/setup/setupSchemas/app_cache_view_insert.sql @@ -42,7 +42,17 @@ SELECT APPLICATION.APP_NUMBER, APPLICATION.APP_STATUS, APP_DELEGATION.USR_UID, - APP_LAST_USER.USR_UID, + IF ( + APP_DELEGATION.DEL_PREVIOUS = 0 AND (SELECT SUBAPP.APP_UID FROM SUB_APPLICATION AS SUBAPP WHERE SUBAPP.APP_UID = APP_DELEGATION.APP_UID LIMIT 1) IS NOT NULL, + (SELECT APPDEL2.USR_UID + FROM SUB_APPLICATION AS SUBAPP, APP_DELEGATION AS APPDEL1, APP_DELEGATION AS APPDEL2 + WHERE SUBAPP.APP_UID = APP_DELEGATION.APP_UID AND + SUBAPP.APP_PARENT = APPDEL1.APP_UID AND SUBAPP.DEL_INDEX_PARENT = APPDEL1.DEL_INDEX AND + APPDEL1.APP_UID = APPDEL2.APP_UID AND APPDEL1.DEL_PREVIOUS = APPDEL2.DEL_INDEX + LIMIT 1 + ), + APP_LAST_USER.USR_UID + ) AS PREVIOUS_USR_UID, APP_DELEGATION.TAS_UID, APP_DELEGATION.PRO_UID, substring(APP_DELEGATION.DEL_DELEGATE_DATE,1,19), diff --git a/workflow/engine/methods/setup/setupSchemas/triggerSubApplicationInsert.sql b/workflow/engine/methods/setup/setupSchemas/triggerSubApplicationInsert.sql new file mode 100644 index 000000000..1829f405e --- /dev/null +++ b/workflow/engine/methods/setup/setupSchemas/triggerSubApplicationInsert.sql @@ -0,0 +1,29 @@ +CREATE TRIGGER SUB_APPLICATION_INSERT BEFORE INSERT ON SUB_APPLICATION +FOR EACH ROW +BEGIN + DECLARE PREVIOUS_USR_UID VARCHAR(32); + + SET @PREVIOUS_USR_UID = ''; + + SET @PREVIOUS_USR_UID = ( + SELECT APPDEL2.USR_UID + FROM APP_DELEGATION AS APPDEL1, APP_DELEGATION AS APPDEL2 + WHERE APPDEL1.APP_UID = NEW.APP_PARENT AND APPDEL1.DEL_INDEX = NEW.DEL_INDEX_PARENT AND + APPDEL1.APP_UID = APPDEL2.APP_UID AND APPDEL1.DEL_PREVIOUS = APPDEL2.DEL_INDEX + LIMIT 1 + ); + + IF (@PREVIOUS_USR_UID IS NULL) THEN + SET @PREVIOUS_USR_UID = ''; + END IF; + + -- Update record in APP_CACHE_VIEW + UPDATE APP_CACHE_VIEW + SET PREVIOUS_USR_UID = @PREVIOUS_USR_UID + WHERE APP_UID = NEW.APP_UID AND DEL_INDEX = (SELECT APPDEL.DEL_INDEX + FROM APP_DELEGATION AS APPDEL + WHERE APPDEL.APP_UID = NEW.APP_UID AND APPDEL.DEL_PREVIOUS = 0 + LIMIT 1 + ); + +END \ No newline at end of file