BUG 9548 "Agregar la posibilidad de copiar triggers" SOLVED

- New feature
- Add the ability to copy triggers
- Copy trigger option was added in DESIGNER>TRIGGERS
* Available from version 2.0.46
This commit is contained in:
Victor Saisa Lopez
2012-11-07 16:59:48 -04:00
parent c8379820db
commit ba6c87b9f2
7 changed files with 300 additions and 87 deletions

View File

@@ -0,0 +1,30 @@
<?php
if (($RBAC_Response = $RBAC->userCanAccess("PM_FACTORY")) != 1) {
return $RBAC_Response;
}
require_once ("classes/model/Triggers.php");
$arrayField = array();
$arrayField["LANG"] = SYS_LANG;
$arrayField["PRO_UID"] = $_GET["PRO_UID"];
$arrayField["TRI_TYPE"] = "SCRIPT";
if (isset($_GET["TRI_UID"]) && !empty($_GET["TRI_UID"])) {
$oTrigger = new Triggers();
$arrayField = $oTrigger->load($_GET["TRI_UID"]);
}
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent("xmlform", "xmlform", "triggers/triggerCopy", "", $arrayField, "../triggers/triggers_Save");
G::RenderPage("publish", "raw");

View File

@@ -1,4 +1,4 @@
<?php <?php
/** /**
* triggers_Tree.php * triggers_Tree.php
* *
@@ -21,57 +21,62 @@
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* *
*/ */
try { try {
G::LoadClass ( 'tree' ); G::LoadClass("tree");
G::LoadClass("triggerLibrary");
G::LoadClass ( 'triggerLibrary' );
$triggerLibrary = triggerLibrary::getSingleton (); $triggerLibrary = triggerLibrary::getSingleton();
$triggerLibraryO = $triggerLibrary->getRegisteredClasses (); $triggerLibraryO = $triggerLibrary->getRegisteredClasses();
$oTree = new Tree ( );
$oTree->nodeType = 'blank'; $oTree = new Tree();
$oTree->name = 'Triggers'; $oTree->nodeType = "blank";
$oTree->showSign = false; $oTree->name = "Triggers";
$oTree->showSign = false;
$oNode = & $oTree->addChild ( 'TRI_CUSTOM', '&nbsp;&nbsp;<table border="0" cellpadding="0" cellspacing="0"><tr><td nowrap valign="top"><span onclick="currentPopupWindow.remove();triggerNewCustom();" style="cursor: pointer;" >' . "<img src='/images/50px-Edit.png' width='15px' heigth='15px' valing='middle'>&nbsp;&nbsp;<b>" .G::LoadTranslation('ID_CUSTOM_TRIGGER') . "&nbsp;</b></td></tr><tr><td class=''><span onclick='currentPopupWindow.remove();triggerNewCustom();' style='cursor: pointer;' ><small><i>".G::LoadTranslation('ID_CUSTOM_TRIGGER_DESCRIPTION')."</i></small></span></td></tr></table>", array ('nodeType' => 'parent' ) );
$div1Style = (strpos($_SERVER["HTTP_USER_AGENT"], "MSIE") !== false)? " style=\"margin-top: 0.65em;\"" : null;
$triggerLibraryOCount=count($triggerLibraryO);
foreach ( $triggerLibraryO as $keyLibrary => $libraryObj ) { $oNode = &$oTree->addChild("TRI_CUSTOM", "<div" . $div1Style . "><span onclick=\"currentPopupWindow.remove(); triggerNewCustom();\" style=\"cursor: pointer;\"><img src=\"/images/50px-Edit.png\" width=\"15px\" heigth=\"15px\" valing=\"middle\" alt=\"\" />&nbsp;&nbsp;<strong>" . G::LoadTranslation("ID_CUSTOM_TRIGGER") . "</strong></span><br /><span onclick=\"currentPopupWindow.remove(); triggerNewCustom();\" style=\"cursor: pointer;\"><small><em>" . G::LoadTranslation("ID_CUSTOM_TRIGGER_DESCRIPTION") . "</em></small></span></div>", array("nodeType" => "parent"));
$libraryName = $libraryObj->info ['name']; $oNode = &$oTree->addChild("TRI_COPY", "<div style=\"margin-top: 1.25em;\"><span onclick=\"currentPopupWindow.remove(); triggerCopy();\" style=\"cursor: pointer;\"><img src=\"/images/documents/_editcopy.png\" width=\"15px\" heigth=\"15px\" valing=\"middle\" alt=\"\" />&nbsp;&nbsp;<strong>" . G::LoadTranslation("ID_TRIGGER_COPY_OPTION") . "</strong></span><br /><span onclick=\"currentPopupWindow.remove(); triggerCopy();\" style=\"cursor: pointer;\"><small><em>" . G::LoadTranslation("ID_TRIGGER_COPY_OPTION_DESCRIPTION") . "</em></small></span></div>", array("nodeType" => "parent"));
$libraryIcon = isset ( $libraryObj->info ['icon'] ) && ($libraryObj->info ['icon'] != "") ? $libraryObj->info ['icon'] : "/images/browse.gif";
$libraryDescription = trim ( str_replace ( "*", "", implode ( " ", $libraryObj->info ['description'] ) ) ); $triggerLibraryOCount = count($triggerLibraryO);
$triggerCount = count ( $libraryObj->methods );
if ($triggerCount > 0) { foreach ($triggerLibraryO as $keyLibrary => $libraryObj) {
//Sort alpha $libraryName = $libraryObj->info["name"];
ksort($libraryObj->methods,SORT_STRING); $libraryIcon = (isset($libraryObj->info["icon"]) && ($libraryObj->info["icon"]!= ""))? $libraryObj->info["icon"] : "/images/browse.gif";
//Now the Triggers $libraryDescription = trim(str_replace("*", "", implode(" ", $libraryObj->info["description"])));
//Library Father (Name + Description) $triggerCount = count($libraryObj->methods);
$oNode = & $oTree->addChild ( $keyLibrary, '&nbsp;&nbsp;<table border="0" cellpadding="0" cellspacing="0"><tr><td nowrap valign="top"><span onclick="tree.expand(this.parentNode);" style="cursor: pointer;" >' . "<img src='" . $libraryIcon . "' width='15px' heigth='15px' valing='middle'>&nbsp;&nbsp;<b>" . $libraryName . "&nbsp;($triggerCount)</b></td></tr><tr><td class=''><span onclick='tree.expand(this.parentNode);' style='cursor: pointer;' ><small><i>$libraryDescription</i></small></span></td></tr></table>", array ('nodeType' => 'parent' ) );
$oNode->contracted = $triggerLibraryOCount==1?false:true; if ($triggerCount > 0) {
//Library Childs (available methods) //Sort alpha
foreach ( $libraryObj->methods as $methodName => $methodObject ) { ksort($libraryObj->methods, SORT_STRING);
$methodName = $methodObject->info ['name']; //Now the Triggers
$methodLabel = $methodObject->info ['label']; //Library Father (Name + Description)
$methodDescription = trim ( str_replace ( "*", "", implode ( " ", $methodObject->info ['description'] ) ) ); $oNode = &$oTree->addChild($keyLibrary, "&nbsp;&nbsp;<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td nowrap=\"nowrap\" valign=\"top\"><span onclick=\"tree.expand(this.parentNode);\" style=\"cursor: pointer;\"><img src=\"" . $libraryIcon . "\" width=\"15px\" heigth=\"15px\" valing=\"middle\" alt=\"\" />&nbsp;&nbsp;<b>" . $libraryName . "&nbsp;($triggerCount)</b></td></tr><tr><td class=\"\"><span onclick=\"tree.expand(this.parentNode);\" style=\"cursor: pointer;\"><small><i>$libraryDescription</i></small></span></td></tr></table>", array("nodeType" => "parent"));
$oNode->contracted = ($triggerLibraryOCount == 1)? false : true;
$oAux1 = & $oNode->addChild ( $keyLibrary . "-" . $methodName, '<table><tr><td nowrap ><span style="cursor: pointer;">' . " <a class='linkInBlue' href='#' onclick='currentPopupWindow.remove();triggerNewWizard( \"$methodName\" , \"$keyLibrary\" );return;'> " . $methodLabel . ' (' . $methodName . ')' . '</a></span></td></tr><tr><td><i>' . $methodDescription . '</i><br></span></td></tr></table>', array ('nodeType' => 'child' ) );
//$oAux1->plus = "<span style='cursor:pointer;display:block;width:15;height:10px;' onclick='tree.expand(this.parentNode);'></span>"; //Library Childs (available methods)
foreach ($libraryObj->methods as $methodName => $methodObject) {
$methodName = $methodObject->info["name"];
//$oAux2 =& $oAux1->addChild($keyLibrary."-".$methodName."-desc", "$methodParameters", array('nodeType'=>'parent')); $methodLabel = $methodObject->info["label"];
$methodDescription = trim(str_replace("*", "", implode(" ", $methodObject->info["description"])));
} $oAux1 = &$oNode->addChild($keyLibrary . "-" . $methodName, "<table><tr><td nowrap=\"nowrap\"><span style=\"cursor: pointer;\"><a class=\"linkInBlue\" href=\"javascript:;\" onclick=\"currentPopupWindow.remove(); triggerNewWizard('$methodName' , '$keyLibrary'); return false;\">" . $methodLabel . " (" . $methodName . ")</a></span></td></tr><tr><td><i>" . $methodDescription . "</i><br></span></td></tr></table>", array("nodeType" => "child"));
} //$oAux1->plus = "<span style='cursor:pointer;display:block;width:15;height:10px;' onclick='tree.expand(this.parentNode);'></span>";
//$oAux2 =& $oAux1->addChild($keyLibrary."-".$methodName."-desc", "$methodParameters", array('nodeType'=>'parent'));
} }
echo $oTree->render (); }
}
} catch ( Exception $oException ) { error_log("\n*****\n", 3, "/home/victor/MyLog.log");
die ( $oException->getMessage () ); error_log(print_r($oTree, true), 3, "/home/victor/MyLog.log");
}
unset ( $_SESSION ['PROCESS'] ); echo $oTree->render();
?> } catch (Exception $e) {
die($e->getMessage());
}
unset($_SESSION["PROCESS"]);

View File

@@ -0,0 +1,62 @@
<form id="{$form_id}" name="" action="{$form_action}" class="{$form_className}" method="post" encType="multipart/form-data" style="margin:0px;" onsubmit="return validateForm('{$form_objectRequiredFields}');"> <div class="borderForm" style="width:{$form_width}; padding-left:0; padding-right:0; border-width:{$form_border};">
<div class="boxTop"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="content" style="height:{$form_height};" >
<table width="99%">
<tr>
<td valign='top'>
<input type="hidden" class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="{$form_objectRequiredFields}" />
<input type="hidden" name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" />
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr style="display: none">
<td colspan="2">{$form.PRO_UID}</td>
</tr>
<tr style="display: none">
<td colspan="2">{$form.TRI_UID}</td>
</tr>
<tr style="display: none">
<td colspan="2">{$form.TRI_PARAM}</td>
</tr>
<tr style="display: none">
<td colspan="2">{$form.TRI_TYPE}</td>
</tr>
<tr style="display: none">
<td colspan="2">{$form.FIELDS_REQUIRED}</td>
</tr>
<tr>
<td class='FormTitle' colspan="2" align="">{$form.LBLTITLE1}</td>
</tr>
<tr>
<td class='FormLabel' width="{$form_labelWidth}">{$PROCESS_UID}</td>
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.PROCESS_UID}</td>
</tr>
<tr>
<td class='FormLabel' width="{$form_labelWidth}">{$TRIGGER_UID}</td>
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.TRIGGER_UID}</td>
</tr>
<tr>
<td class='FormLabel' width="{$form_labelWidth}"><font color="red">* </font>{$TRI_TITLE}</td>
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.TRI_TITLE}</td>
</tr>
<tr>
<td class='FormLabel' width="{$form_labelWidth}">{$TRI_DESCRIPTION}</td>
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.TRI_DESCRIPTION}</td>
</tr>
<tr>
<td class='FormLabel' width="{$form_labelWidth}">{$TRI_WEBBOT}</td>
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.TRI_WEBBOT}</td>
</tr>
<tr>
<td class='FormButton' colspan="2" align="center">{$form.BTNCOPYSAVE}&nbsp;{$form.BTNCANCEL}</td>
</tr>
</table>
</td>
</tr>
</table>
<div class="FormRequiredTextMessage"><font color="red">* </font>Required Field</div> </div>
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
</div>
<script type="text/javascript">
{$form.JS}
</script>
</form>

View File

@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm mode="edit" width="100%" labelWidth="28%" enableTemplate="1">
<PRO_UID type="hidden"/>
<TRI_UID type="hidden"/>
<TRI_PARAM type="hidden"/>
<TRI_TYPE type="hidden"/>
<FIELDS_REQUIRED type="hidden"/>
<LANG type="private"/>
<LBLTITLE1 type="title">
<en>Trigger Information</en>
</LBLTITLE1>
<PROCESS_UID type="dropdown" dependentfields="TRIGGER_UID">
SELECT PRO.PRO_UID, CON.CON_VALUE
FROM PROCESS AS PRO, CONTENT AS CON
WHERE PRO.PRO_UID = CON.CON_ID AND CON.CON_CATEGORY = 'PRO_TITLE' AND CON.CON_LANG = '@#LANG'
ORDER BY CON.CON_VALUE ASC
<en>
Process
<option name="">- Select a process -</option>
</en>
</PROCESS_UID>
<TRIGGER_UID type="dropdown" dependentfields="TRI_DESCRIPTION,TRI_WEBBOT">
SELECT TGR.TRI_UID, CON.CON_VALUE
FROM TRIGGERS AS TGR, CONTENT AS CON
WHERE TGR.PRO_UID = '@#PROCESS_UID' AND
TGR.TRI_UID = CON.CON_ID AND CON.CON_CATEGORY = 'TRI_TITLE' AND CON.CON_LANG = '@#LANG'
ORDER BY CON.CON_VALUE ASC
<en>
Trigger
<option name="">- Select a trigger -</option>
</en>
</TRIGGER_UID>
<TRI_TITLE type="text" size="70" maxlength="100" required="1">
<en>Title of the new trigger</en>
</TRI_TITLE>
<TRI_DESCRIPTION type="textarea" rows="3" cols="67">
SELECT CON.CON_VALUE
FROM CONTENT AS CON
WHERE CON.CON_ID = '@#TRIGGER_UID' AND CON.CON_CATEGORY = 'TRI_DESCRIPTION' AND CON.CON_LANG = '@#LANG'
<en>Description of the new trigger</en>
</TRI_DESCRIPTION>
<TRI_WEBBOT type="textarea" rows="10" cols="67" readonly="1">
SELECT TGR.TRI_WEBBOT
FROM TRIGGERS AS TGR
WHERE TGR.TRI_UID = '@#TRIGGER_UID'
<en>Script</en>
</TRI_WEBBOT>
<BTNCOPYSAVE type="button" onclick="triggerSave1(this.form);">
<en>Copy/Import and Save</en>
</BTNCOPYSAVE>
<BTNCANCEL type="button" onclick="cancel(); triggerFromLibrary();">
<en>Cancel</en>
</BTNCANCEL>
<JS type="javascript">
<![CDATA[
function cancel()
{
currentPopupWindow.remove();
}
var cboTriggerUid = getField("TRIGGER_UID");
var txtTgrTitle = getField("TRI_TITLE");
leimnud.event.add(
getField("PROCESS_UID"),
"change",
function ()
{
txtTgrTitle.value = "";
}
);
leimnud.event.add(
cboTriggerUid,
"change",
function ()
{
txtTgrTitle.value = "";
if (cboTriggerUid.value != "") {
txtTgrTitle.value = cboTriggerUid.options[cboTriggerUid.selectedIndex].text;
}
}
);
txtTgrTitle.form.onsubmit = function () { return false; };
]]>
</JS>
</dynaForm>

View File

@@ -19,7 +19,7 @@
<tr> <tr>
<td class='FormLabel' width="{$form_labelWidth}">{$TRI_TITLE}</td> <td class='FormLabel' width="{$form_labelWidth}">{$TRI_TITLE}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.TRI_TITLE} </td> //--> <!-- <td class='FormFieldContent' width="{$form_width}" >{$form.TRI_TITLE} </td> //-->
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.TRI_TITLE}</td> <td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.TRI_TITLE}</td>
</tr> </tr>
<tr style="display: none"> <tr style="display: none">
<td colspan="2">{$form.TRI_PARAM}</td> <td colspan="2">{$form.TRI_PARAM}</td>
@@ -30,17 +30,17 @@
<tr> <tr>
<td class='FormLabel' width="{$form_labelWidth}">{$TRI_DESCRIPTION}</td> <td class='FormLabel' width="{$form_labelWidth}">{$TRI_DESCRIPTION}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.TRI_DESCRIPTION} </td> //--> <!-- <td class='FormFieldContent' width="{$form_width}" >{$form.TRI_DESCRIPTION} </td> //-->
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.TRI_DESCRIPTION}</td> <td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.TRI_DESCRIPTION}</td>
</tr> </tr>
<tr> <tr>
<td class='FormLabel' width="{$form_labelWidth}">{$TRI_WEBBOT}</td> <td class='FormLabel' width="{$form_labelWidth}">{$TRI_WEBBOT}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.TRI_WEBBOT} </td> //--> <!-- <td class='FormFieldContent' width="{$form_width}" >{$form.TRI_WEBBOT} </td> //-->
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.TRI_WEBBOT}</td> <td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.TRI_WEBBOT}</td>
</tr> </tr>
<tr> <tr>
<td class='FormButton' colspan="2" align="center">{$form.SAVE}{$form.BTN_CANCEL}</td> <td class='FormButton' colspan="2" align="center">{$form.SAVE}&nbsp;{$form.BTN_CANCEL}</td>
</tr> </tr>
</table> </table>
</td> </td>
</tr> </tr>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="triggersProperties" type="xmlform" width="100%" labelWidth="20%" enableTemplate="1"> <dynaForm name="triggersProperties" type="xmlform" width="100%" labelWidth="20%" enableTemplate="1">
<PRO_UID type="hidden"/> <PRO_UID type="hidden"/>
<FIELDS_REQUIRED type="hidden"/> <FIELDS_REQUIRED type="hidden"/>
@@ -19,7 +19,7 @@
<en>Description</en> <en>Description</en>
</TRI_DESCRIPTION> </TRI_DESCRIPTION>
<TRI_WEBBOT type="textareapm" class="formLabel" cols="60" rows="15" width="100%" height="380px" showVars="1" process="@#PRO_UID"> <TRI_WEBBOT type="textareapm" class="formLabel" cols="55" rows="13" width="100%" height="380px" showVars="1" process="@#PRO_UID">
</TRI_WEBBOT> </TRI_WEBBOT>
<SAVE type="button" onclick="triggerSave1(this.form);"> <SAVE type="button" onclick="triggerSave1(this.form);">
<en>Save</en> <en>Save</en>

View File

@@ -15,6 +15,8 @@
<triggersEditCustom type="private" defaultValue="../triggers/triggers_EditCustom"/> <triggersEditCustom type="private" defaultValue="../triggers/triggers_EditCustom"/>
<triggerCopy type="private" defaultValue="../triggers/triggerCopy"/>
<triggersDelete type="private" defaultValue="../triggers/triggers_Delete"/> <triggersDelete type="private" defaultValue="../triggers/triggers_Delete"/>
<triggersProperties type="private" defaultValue="../triggers/triggersProperties"/> <triggersProperties type="private" defaultValue="../triggers/triggersProperties"/>
@@ -29,7 +31,7 @@
<triggerNewGoogleCreateEvent type="private" defaultValue="../triggers/triggers_CreateGoogleEvent"/> <triggerNewGoogleCreateEvent type="private" defaultValue="../triggers/triggers_CreateGoogleEvent"/>
<PAGED_TABLE_ID type="private"/> <PAGED_TABLE_ID type="private" />
<PAGED_TABLE_FAST_SEARCH type="FastSearch" label="@G::LoadTranslation(ID_SEARCH)"/> <PAGED_TABLE_FAST_SEARCH type="FastSearch" label="@G::LoadTranslation(ID_SEARCH)"/>
<JS type="javascript" replaceTags="1"> <JS type="javascript" replaceTags="1">
@@ -44,6 +46,9 @@
} }
} }
*/ */
var windowWidth = 600;
var windowHeight = 460;
function triggerEditWizardSource (sUID){ function triggerEditWizardSource (sUID){
popupWindow('@G::LoadTranslation(ID_EDIT_TRIGGERS)', '@G::encryptlink(@#triggersEdit)?TRI_UID=' + sUID +'&BYPASS=1' , 770, 510); popupWindow('@G::LoadTranslation(ID_EDIT_TRIGGERS)', '@G::encryptlink(@#triggersEdit)?TRI_UID=' + sUID +'&BYPASS=1' , 770, 510);
} }
@@ -51,23 +56,30 @@
function triggerNew() { function triggerNew() {
popupWindow('@G::LoadTranslation(ID_NEW_TRIGGERS)', '@G::encryptlink(@#triggersEdit)?PRO_UID=@%PRO_UID' , 600, 340); popupWindow('@G::LoadTranslation(ID_NEW_TRIGGERS)', '@G::encryptlink(@#triggersEdit)?PRO_UID=@%PRO_UID' , 600, 340);
} }
function triggerNewCustom() {
popupWindow('@G::LoadTranslation(ID_NEW_TRIGGERS)', '@G::encryptlink(@#triggersEditCustom)?PRO_UID=@%PRO_UID' , 600, 460); function triggerNewCustom()
{
popupWindow("@G::LoadTranslation(ID_NEW_TRIGGERS)", "@G::encryptlink(@#triggersEditCustom)?PRO_UID=@%PRO_UID" , windowWidth, windowHeight);
} }
function triggerCopy()
{
popupWindow("@G::LoadTranslation(ID_TRIGGER_COPY_TITLE)", "@G::encryptlink(@#triggerCopy)?PRO_UID=@%PRO_UID" , windowWidth, windowHeight);
}
function triggerFromLibrary() { function triggerFromLibrary() {
popupWindow('@G::LoadTranslation(ID_NEW_TRIGGERS)', '@G::encryptlink(@#triggersOptionList)?PRO_UID=@%PRO_UID' , 600, 400); popupWindow('@G::LoadTranslation(ID_NEW_TRIGGERS)', '@G::encryptlink(@#triggersOptionList)?PRO_UID=@%PRO_UID' , 600, 460);
if (navigator.appName != "Microsoft Internet Explorer") { if (navigator.appName != "Microsoft Internet Explorer") {
try { try {
var oAllPs = document.querySelectorAll("div.panel_content___processmaker"); var oAllPs = document.querySelectorAll("div.panel_content___processmaker");
oAllPs[3].style.height = "340px"; oAllPs[3].style.height = "410px";
} }
catch(e) { catch(e) {
// nothing to do // nothing to do
} }
} }
} }
function triggerEdit(sUID) { function triggerEdit(sUID) {
popupWindow('@G::LoadTranslation(ID_EDIT_TRIGGERS)', '@G::encryptlink(@#triggersEdit)?TRI_UID='+ sUID , 930, 600); popupWindow('@G::LoadTranslation(ID_EDIT_TRIGGERS)', '@G::encryptlink(@#triggersEdit)?TRI_UID='+ sUID , 930, 600);
} }
@@ -75,18 +87,18 @@
function triggerProperties( sUID ) { function triggerProperties( sUID ) {
popupWindow('@G::LoadTranslation(ID_TRIGGERS)', '@G::encryptlink(@#triggersProperties)?TRI_UID='+ sUID , 600, 340); popupWindow('@G::LoadTranslation(ID_TRIGGERS)', '@G::encryptlink(@#triggersProperties)?TRI_UID='+ sUID , 600, 340);
} }
function triggerPropertiesSave( form ) { function triggerPropertiesSave( form ) {
var doc = getField("OUT_DOC_FILENAME"); var doc = getField("OUT_DOC_FILENAME");
if(doc.value=='') if(doc.value=='')
{ alert(G_STRINGS.ID_FILEGENERATED); { alert(G_STRINGS.ID_FILEGENERATED);
} }
else else
{ ajax_post( form.action, form, 'POST' ); { ajax_post( form.action, form, 'POST' );
currentPopupWindow.remove(); currentPopupWindow.remove();
@#PAGED_TABLE_ID.refresh(); @#PAGED_TABLE_ID.refresh();
} }
} }
function triggerSave(form) function triggerSave(form)
{ {
@@ -94,7 +106,7 @@
if(document.getElementById('TRI_UID')) { if(document.getElementById('TRI_UID')) {
var triUid = document.getElementById('TRI_UID').value; var triUid = document.getElementById('TRI_UID').value;
} }
var triTitle =document.getElementById('TRI_TITLE').value; var triTitle =document.getElementById('TRI_TITLE').value;
if(triTitle==''){ if(triTitle==''){
alert(G_STRINGS.ID_REQUIRED_NAME_TRIGGERS);return false; alert(G_STRINGS.ID_REQUIRED_NAME_TRIGGERS);return false;
} }
@@ -109,7 +121,7 @@
} }
} }
if(triUid==''){ if(triUid==''){
reqName=ajax_function("../triggers/triggers_Save",'lookforNameTrigger','NAMETRIGGER='+encodeURIComponent(triTitle)+'&proUid='+(document.getElementById('PRO_UID').value),'POST') ; reqName=ajax_function("../triggers/triggers_Save",'lookforNameTrigger','NAMETRIGGER='+encodeURIComponent(triTitle)+'&proUid='+(document.getElementById('PRO_UID').value),'POST') ;
if(!reqName){ if(!reqName){
alert(G_STRINGS.ID_EXIST_TRIGGERS);return false; alert(G_STRINGS.ID_EXIST_TRIGGERS);return false;
}else{ }else{
@@ -123,22 +135,22 @@
@#PAGED_TABLE_ID.refresh(); @#PAGED_TABLE_ID.refresh();
} }
} }
//with this function, we are removing the spaces after and before of a string //with this function, we are removing the spaces after and before of a string
String.prototype.trim = function() { String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, ""); return this.replace(/^\s+|\s+$/g, "");
}; };
//for trigger no wizard //for trigger no wizard
function triggerSave1(form) function triggerSave1(form)
{ {
var triUid = ""; var triUid = "";
if(getField('TRI_UID')) { if(getField('TRI_UID')) {
var triUid = getField('TRI_UID').value; var triUid = getField('TRI_UID').value;
} }
if(triUid==''){ if(triUid==''){
var triTitle =getField('TRI_TITLE').value.trim(); var triTitle =getField('TRI_TITLE').value.trim();
if(triTitle==''){ if(triTitle==''){
alert(G_STRINGS.ID_REQUIRED_NAME_TRIGGERS);return false; alert(G_STRINGS.ID_REQUIRED_NAME_TRIGGERS);return false;
} }
reqName=ajax_function("../triggers/triggers_Save",'lookforNameTrigger','NAMETRIGGER='+encodeURIComponent(triTitle)+'&proUid='+(getField('PRO_UID').value),'POST') ; reqName=ajax_function("../triggers/triggers_Save",'lookforNameTrigger','NAMETRIGGER='+encodeURIComponent(triTitle)+'&proUid='+(getField('PRO_UID').value),'POST') ;
if(!reqName){ if(!reqName){
alert(G_STRINGS.ID_EXIST_TRIGGERS);return false; alert(G_STRINGS.ID_EXIST_TRIGGERS);return false;
@@ -157,7 +169,7 @@
function triggerDelete(sUID) { function triggerDelete(sUID) {
var validateResult; var validateResult;
oRPC = XHRequest(); oRPC = XHRequest();
oRPC.options = { oRPC.options = {
url : '../triggers/triggers_Ajax', url : '../triggers/triggers_Ajax',
@@ -184,11 +196,11 @@
}.extend(this); }.extend(this);
oRPC.make(); oRPC.make();
} }
function triggerNewWizard(nameFunction, library) {//alert('@G::encryptlink(@#triggerNewWizard)?PRO_UID=@%PRO_UID&amp;NAME_FUN='+nameFunction+'&amp; PARAMETERS_FUN='+parametersFunct+'&amp;PAGED_TABLE_ID='+@#PAGED_TABLE_ID);return; function triggerNewWizard(nameFunction, library) {//alert('@G::encryptlink(@#triggerNewWizard)?PRO_UID=@%PRO_UID&amp;NAME_FUN='+nameFunction+'&amp; PARAMETERS_FUN='+parametersFunct+'&amp;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); 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);
} }
]]> ]]>
</JS> </JS>