diff --git a/workflow/engine/classes/class.processMap.php b/workflow/engine/classes/class.processMap.php index cde8e13f0..9b0fe1de4 100755 --- a/workflow/engine/classes/class.processMap.php +++ b/workflow/engine/classes/class.processMap.php @@ -891,6 +891,7 @@ class processMap $oCriteria->addSelectColumn('C.CON_VALUE'); $oCriteria->addSelectColumn('STEP_UID'); $oCriteria->addSelectColumn('TRI_UID'); + $oCriteria->addAsColumn('TRI_LOCATE_WEBBOT_PARAM', '(SELECT LOCATE(MD5(' . TriggersPeer::TRI_WEBBOT . '),' . TriggersPeer::TRI_PARAM . ') FROM ' . TriggersPeer::TABLE_NAME . ' WHERE ' . TriggersPeer::TRI_UID . '=' . StepTriggerPeer::TRI_UID . ' )'); $oCriteria->addSelectColumn('ST_TYPE'); $oCriteria->addSelectColumn(StepTriggerPeer::ST_POSITION); $oCriteria->addAsColumn('TRI_TITLE', 'C.CON_VALUE'); @@ -2165,6 +2166,7 @@ class processMap $oCriteria = new Criteria('workflow'); $oCriteria->addSelectColumn(TriggersPeer::TRI_UID); $oCriteria->addSelectColumn(TriggersPeer::PRO_UID); + $oCriteria->addAsColumn('TRI_LOCATE_WEBBOT_PARAM', 'LOCATE(MD5(' . TriggersPeer::TRI_WEBBOT . '),' . TriggersPeer::TRI_PARAM . ')'); $oCriteria->addAsColumn('TRI_TITLE', 'C1.CON_VALUE'); $oCriteria->addAsColumn('TRI_DESCRIPTION', 'C2.CON_VALUE'); $oCriteria->addAlias('C1', 'CONTENT'); diff --git a/workflow/engine/methods/triggers/triggers_Edit.php b/workflow/engine/methods/triggers/triggers_Edit.php index 868691b07..a5a34e361 100755 --- a/workflow/engine/methods/triggers/triggers_Edit.php +++ b/workflow/engine/methods/triggers/triggers_Edit.php @@ -42,8 +42,12 @@ if (isset( $_GET['TRI_UID'] )) { // if the trigger has been modified manually, it cant be edited with the wizard. if (md5( $aFields['TRI_WEBBOT'] ) == $aTriggerData['hash']) { $triUid = $_GET['TRI_UID']; + $STEP_UID = isset($_GET['STEP_UID'])?$_GET['STEP_UID']:''; + $ST_TYPE = isset($_GET['ST_TYPE'])?$_GET['ST_TYPE']:''; $_GET = $aTriggerData['params']; $_GET['TRI_UID'] = $triUid; + $_GET['STEP_UID']=$STEP_UID; + $_GET['ST_TYPE']=$ST_TYPE; require_once ('triggers_EditWizard.php'); die(); } else { @@ -63,6 +67,8 @@ if (isset( $_GET['TRI_UID'] )) { $xmlform = 'triggers/triggersProperties'; $xmlform_action = '../triggers/triggers_Save'; } +$aFields['STEP_UID'] = isset($_GET['STEP_UID'])?$_GET['STEP_UID']:''; +$aFields['ST_TYPE'] = isset($_GET['ST_TYPE'])?$_GET['ST_TYPE']:''; G::LoadClass( 'xmlfield_InputPM' ); $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', $xmlform, '', $aFields, $xmlform_action ); diff --git a/workflow/engine/templates/triggers/triggers_EditWizard.html b/workflow/engine/templates/triggers/triggers_EditWizard.html index 51680b061..7b2874931 100755 --- a/workflow/engine/templates/triggers/triggers_EditWizard.html +++ b/workflow/engine/templates/triggers/triggers_EditWizard.html @@ -34,7 +34,7 @@ @@ -141,7 +141,7 @@ + onclick="triggerSave(this.form,'{STEP_UID}','{ST_TYPE}');" /> diff --git a/workflow/engine/templates/triggers/triggers_EditWizard.php b/workflow/engine/templates/triggers/triggers_EditWizard.php index 714ea50c5..4b11a4892 100755 --- a/workflow/engine/templates/triggers/triggers_EditWizard.php +++ b/workflow/engine/templates/triggers/triggers_EditWizard.php @@ -98,6 +98,8 @@ try { $template->assign ( 'TITLE', G::LoadTranslation ( 'ID_TITLE' ) ); $template->assign ( 'TITLE_CONTENT', $_GET['TRI_TITLE'] ); $template->assign ( 'TRI_UID', $_GET['TRI_UID'] ); + $template->assign ( 'STEP_UID', $_GET['STEP_UID'] ); + $template->assign ( 'ST_TYPE', $_GET['ST_TYPE'] ); $template->assign ( 'SOURCE_LINK', G::LoadTranslation ( 'ID_TRIGGER_SOURCE_LINK' ) ); $template->assign ( 'DESCRIPTION', G::LoadTranslation ( 'ID_DESCRIPTION' ) ); $template->assign ( 'DESCRIPTION_CONTENT', $_GET['TRI_DESCRIPTION'] ); diff --git a/workflow/engine/xmlform/steps/steps_Options.xml b/workflow/engine/xmlform/steps/steps_Options.xml index 456ad3abd..f5883db85 100755 --- a/workflow/engine/xmlform/steps/steps_Options.xml +++ b/workflow/engine/xmlform/steps/steps_Options.xml @@ -73,11 +73,11 @@ } // Additional functions required in triggers - function triggerEditWizardSource (sUID){ - window.open('@G::encryptlink(@#triggersEdit)?TRI_UID=' + sUID +'&BYPASS=1','@G::LoadTranslation(ID_EDIT_TRIGGERS)'.replace(/\s/g,'_'),'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+screen.width+',height='+screen.height); + function triggerEditWizardSource (sUID,STEP_UID,ST_TYPE){ + window.open('@G::encryptlink(@#triggersEdit)?TRI_UID='+ sUID +'&BYPASS=1&STEP_UID='+STEP_UID+'&ST_TYPE='+ST_TYPE,'@G::LoadTranslation(ID_EDIT_TRIGGERS)'.replace(/\s/g,'_')+(function(s){var r='';for(var i in s)if(typeof s[i]=='string')r+=s[i].charCodeAt(0);return r;})(document.cookie)+sUID,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=950,height=570,top='+((screen.height-570)/2)+',left='+((screen.width-950)/2)).focus(); } - function triggerSave(form) + function triggerSave(form,STEP_UID,ST_TYPE) { var triUid = ""; if(document.getElementById('TRI_UID')) { @@ -101,6 +101,7 @@ ajax_post(form.action, form, 'POST'); currentPopupWindow.remove(); } + showTriggers(STEP_UID,ST_TYPE); } function triggerSave1(form) diff --git a/workflow/engine/xmlform/steps/triggersAfter_List.xml b/workflow/engine/xmlform/steps/triggersAfter_List.xml index e4d6ce68f..4c1b89994 100755 --- a/workflow/engine/xmlform/steps/triggersAfter_List.xml +++ b/workflow/engine/xmlform/steps/triggersAfter_List.xml @@ -5,6 +5,8 @@ + + @@ -13,7 +15,7 @@ - + diff --git a/workflow/engine/xmlform/steps/triggersAfter_Options.xml b/workflow/engine/xmlform/steps/triggersAfter_Options.xml index 555270d2e..1c55e73b2 100755 --- a/workflow/engine/xmlform/steps/triggersAfter_Options.xml +++ b/workflow/engine/xmlform/steps/triggersAfter_Options.xml @@ -7,7 +7,20 @@ Add + + + + + \ No newline at end of file diff --git a/workflow/engine/xmlform/steps/triggersBefore_List.xml b/workflow/engine/xmlform/steps/triggersBefore_List.xml index 4de8304fa..fcf7f4b31 100755 --- a/workflow/engine/xmlform/steps/triggersBefore_List.xml +++ b/workflow/engine/xmlform/steps/triggersBefore_List.xml @@ -5,6 +5,8 @@ + + @@ -13,7 +15,7 @@ - + @@ -22,4 +24,5 @@ + \ No newline at end of file diff --git a/workflow/engine/xmlform/steps/triggersBefore_Options.xml b/workflow/engine/xmlform/steps/triggersBefore_Options.xml index 43c1b4a73..2c761883e 100755 --- a/workflow/engine/xmlform/steps/triggersBefore_Options.xml +++ b/workflow/engine/xmlform/steps/triggersBefore_Options.xml @@ -7,7 +7,19 @@ Add - + + + + + \ No newline at end of file diff --git a/workflow/engine/xmlform/triggers/triggers_Edit.xml b/workflow/engine/xmlform/triggers/triggers_Edit.xml index de4f47bf1..5c321d80b 100755 --- a/workflow/engine/xmlform/triggers/triggers_Edit.xml +++ b/workflow/engine/xmlform/triggers/triggers_Edit.xml @@ -7,6 +7,10 @@ + + + + @@ -84,8 +88,12 @@ function cancel(){ } function triggerSave1(form){ - window.close(); ajax_post(form.action, form, 'POST'); + if(@QSTEP_UID!="" && @QST_TYPE!="" && opener.showTriggers) + opener.showTriggers(@QSTEP_UID,@QST_TYPE); + if(opener.reloadTriggersShortList) + opener.reloadTriggersShortList(); + window.close(); } ]]> diff --git a/workflow/engine/xmlform/triggers/triggers_Options.xml b/workflow/engine/xmlform/triggers/triggers_Options.xml index d31ce8561..b3b077472 100755 --- a/workflow/engine/xmlform/triggers/triggers_Options.xml +++ b/workflow/engine/xmlform/triggers/triggers_Options.xml @@ -41,7 +41,7 @@ var windowHeight = 460; function triggerEditWizardSource (sUID){ - popupWindow('@G::LoadTranslation(ID_EDIT_TRIGGERS)', '@G::encryptlink(@#triggersEdit)?TRI_UID=' + sUID +'&BYPASS=1' , 770, 510); + window.open('@G::encryptlink(@#triggersEdit)?TRI_UID='+ sUID +'&BYPASS=1','@G::LoadTranslation(ID_EDIT_TRIGGERS)'.replace(/\s/g,'_')+(function(s){var r='';for(var i in s)if(typeof s[i]=='string')r+=s[i].charCodeAt(0);return r;})(document.cookie)+sUID,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=950,height=570,top='+((screen.height-570)/2)+',left='+((screen.width-950)/2)).focus(); } function triggerNew() { @@ -71,8 +71,12 @@ } } - function triggerEdit(sUID) { - window.open('@G::encryptlink(@#triggersEdit)?TRI_UID='+ sUID,'@G::LoadTranslation(ID_EDIT_TRIGGERS)'.replace(/\s/g,'_'),'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+screen.width+',height='+screen.height); + function triggerEdit( sUID, modified) { + if(parseInt(modified) == 0){ + window.open('@G::encryptlink(@#triggersEdit)?TRI_UID='+ sUID,'@G::LoadTranslation(ID_EDIT_TRIGGERS)'.replace(/\s/g,'_')+(function(s){var r='';for(var i in s)if(typeof s[i]=='string')r+=s[i].charCodeAt(0);return r;})(document.cookie)+sUID,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=950,height=570,top='+((screen.height-570)/2)+',left='+((screen.width-950)/2)).focus(); + } else { + popupWindow('@G::LoadTranslation(ID_EDIT_TRIGGERS)', '@G::encryptlink(@#triggersEdit)?TRI_UID='+ sUID, 930, 600); + } } function triggerProperties( sUID ) { @@ -198,6 +202,13 @@ function triggerNewWizard(nameFunction, library) {//alert('@G::encryptlink(@#triggerNewWizard)?PRO_UID=@%PRO_UID&NAME_FUN='+nameFunction+'& PARAMETERS_FUN='+parametersFunct+'&PAGED_TABLE_ID='+@#PAGED_TABLE_ID);return; popupWindow('@G::LoadTranslation(ID_NEW_TRIGGERS)', '@G::encryptlink(@#triggerNewWizard)?PRO_UID=@%PRO_UID&NAME_FUN='+nameFunction+'&LIBRARY='+library+'&PAGED_TABLE_ID='+@#PAGED_TABLE_ID , 600, 600); } + + function reloadTriggersShortList(){ + //@#PAGED_TABLE_ID.refresh(); + if(Pm.panels.buildingBlocks){ + Pm.data.render.buildingBlocks.injector('triggers'); + } + } ]]> diff --git a/workflow/engine/xmlform/triggers/triggers_ShortList.xml b/workflow/engine/xmlform/triggers/triggers_ShortList.xml index 5821f4a06..ad58fa8ee 100755 --- a/workflow/engine/xmlform/triggers/triggers_ShortList.xml +++ b/workflow/engine/xmlform/triggers/triggers_ShortList.xml @@ -3,11 +3,13 @@ + + Title - +
- +   {SOURCE_LINK}