BUG Adjustment for standardization of code SOLVED

This commit is contained in:
Hector Cortez
2012-07-02 18:35:54 -04:00
parent fe06353ef7
commit 9b1f2ced57
3 changed files with 1428 additions and 1337 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,149 +1,164 @@
<?php <?php
/** /**
* triggers_CreateWizard.php * triggers_CreateWizard.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* 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 ( 'triggerLibrary' ); G::LoadClass ( 'triggerLibrary' );
$triggerLibrary = triggerLibrary::getSingleton (); $triggerLibrary = triggerLibrary::getSingleton ();
$libraryClassName = $_GET ['LIBRARY']; $libraryClassName = $_GET ['LIBRARY'];
$libraryMethod = $_GET ['NAME_FUN']; $libraryMethod = $_GET ['NAME_FUN'];
$sProUid = $_GET ['PRO_UID']; $sProUid = $_GET ['PRO_UID'];
$libraryO = $triggerLibrary->getLibraryDefinition ( $libraryClassName ); $libraryO = $triggerLibrary->getLibraryDefinition ( $libraryClassName );
$libraryName = $libraryO->info ['name']; $libraryName = $libraryO->info ['name'];
$libraryDescription = trim ( str_replace ( "*", "", implode ( " ", $libraryO->info ['description'] ) ) ); $libraryDescription = trim ( str_replace ( "*", "", implode ( " ", $libraryO->info ['description'] ) ) );
$libraryIcon = isset ( $libraryO->info ['icon'] ) && ($libraryO->info ['icon'] != "") ? $libraryO->info ['icon'] : "/images/browse.gif"; $libraryIcon = isset ( $libraryO->info ['icon'] ) && ($libraryO->info ['icon'] != "")
$aDataTrigger = $_GET; ? $libraryO->info ['icon'] : "/images/browse.gif";
$aDataTrigger = $_GET;
$sProUid = $aDataTrigger ['PRO_UID'];
$sNameFun = $aDataTrigger ['NAME_FUN']; $sProUid = $aDataTrigger ['PRO_UID'];
$sNameFun = $aDataTrigger ['NAME_FUN'];
$methodObject = $libraryO->methods [$sNameFun];
$methodObject = $libraryO->methods [$sNameFun];
$methodName = $methodObject->info ['name'];
$methodLabel = $methodObject->info ['label']; $methodName = $methodObject->info ['name'];
$methodDescription = trim ( str_replace ( "*", "", implode ( " ", $methodObject->info ['description'] ) ) ); $methodLabel = $methodObject->info ['label'];
$methodReturn = $methodObject->info ['return']; $methodDescription = trim ( str_replace ( "*", "", implode ( " ", $methodObject->info ['description'] ) ) );
$methodParameters = array_keys ( $methodObject->params ); $methodReturn = $methodObject->info ['return'];
$methodLink = isset ( $methodObject->info ['link'] ) && ($methodObject->info ['link'] != "") ? $methodObject->info ['link'] : ""; $methodParameters = array_keys ( $methodObject->params );
$methodreturnA = explode ( "|", $methodReturn ); $methodLink = isset ( $methodObject->info ['link'] ) && ($methodObject->info ['link'] != "")
? $methodObject->info ['link'] : "";
$bReturnValue = true;
$displayMode = 'display:block'; $methodreturnA = explode ( "|", $methodReturn );
$methodreturnDescription = (trim(strtoupper($methodreturnA [3])) == strtoupper(G::LoadTranslation ( 'ID_NONE')) )? G::LoadTranslation ( 'ID_NOT_REQUIRED') : $methodreturnA [3];
$methodReturnLabel = isset ( $methodreturnA [3] ) ? $methodreturnDescription : $methodReturn; $bReturnValue = true;
if ( (isset($methodreturnA[0]) && isset($methodreturnA[1])) && (trim(strtoupper($methodreturnA[0]) ) != strtoupper(G::LoadTranslation ( 'ID_NONE')) ) ) { $displayMode = 'display:block';
$methodReturnLabelRequired = (trim( $methodreturnA[1] ) != "" )? G::LoadTranslation ( "ID_REQUIRED_FIELD" ) : $methodreturnA[1]; $methodreturnDescription = (trim(strtoupper($methodreturnA [3])) == strtoupper(G::LoadTranslation ( 'ID_NONE')) )
$methodReturnLabel .= "<br>" . trim( $methodReturnLabelRequired ) . " | " . trim($methodreturnA[0]); ? G::LoadTranslation ( 'ID_NOT_REQUIRED') : $methodreturnA [3];
} $methodReturnLabel = isset ( $methodreturnA [3] ) ? $methodreturnDescription : $methodReturn;
else { if ( (isset($methodreturnA[0]) && isset($methodreturnA[1]))
$bReturnValue = false; && (trim(strtoupper($methodreturnA[0]) ) != strtoupper(G::LoadTranslation ( 'ID_NONE')) ) ) {
$displayMode = 'display:none'; $methodReturnLabelRequired = (trim( $methodreturnA[1] ) != "" )
} ? G::LoadTranslation ( "ID_REQUIRED_FIELD" ) : $methodreturnA[1];
$aParametersFun = $methodParameters; $methodReturnLabel .= "<br>" . trim( $methodReturnLabelRequired ) . " | " . trim($methodreturnA[0]);
$triggerWizardTemplate = PATH_TPL . 'triggers' . PATH_SEP . 'triggers_CreateWizard.html'; } else {
$template = new TemplatePower ( $triggerWizardTemplate ); $bReturnValue = false;
$template->prepare (); $displayMode = 'display:none';
}
$tds = ''; $aParametersFun = $methodParameters;
$nrows = 2; $triggerWizardTemplate = PATH_TPL . 'triggers' . PATH_SEP . 'triggers_CreateWizard.html';
$template = new TemplatePower ( $triggerWizardTemplate );
$template->assign ( 'LIBRARY_NAME', $libraryName ); $template->prepare ();
$template->assign ( 'LIBRARY_DESCRIPTION', $libraryDescription );
$template->assign ( 'LIBRARY_ICON', $libraryIcon ); $tds = '';
$template->assign ( 'LIBRARY_CLASS', $libraryClassName ); $nrows = 2;
if ($methodLink != "") {
$template->newBlock ( 'methodLink' ); $template->assign ( 'LIBRARY_NAME', $libraryName );
$template->assign ( 'LIBRARY_METHOD_LINK', $methodLink ); $template->assign ( 'LIBRARY_DESCRIPTION', $libraryDescription );
$template->assign ( 'MORE_INFO', G::LoadTranslation ( 'ID_MORE_INFO' ) ); $template->assign ( 'LIBRARY_ICON', $libraryIcon );
$template->gotoBlock ( '_ROOT' ); $template->assign ( 'LIBRARY_CLASS', $libraryClassName );
} if ($methodLink != "") {
$template->newBlock ( 'methodLink' );
$template->assign ( 'PMFUNTION', $sNameFun ); $template->assign ( 'LIBRARY_METHOD_LINK', $methodLink );
$template->assign ( 'PMFUNTION_LABEL', $methodLabel ); $template->assign ( 'MORE_INFO', G::LoadTranslation ( 'ID_MORE_INFO' ) );
$template->assign ( 'PMFUNTION_DESCRIPTION', $methodDescription ); $template->gotoBlock ( '_ROOT' );
$template->assign ( 'TITLE', G::LoadTranslation ( 'ID_TITLE' ) ); }
$template->assign ( 'DESCRIPTION', G::LoadTranslation ( 'ID_DESCRIPTION' ) );
$template->assign ( 'DETAILS_LABEL', G::LoadTranslation ( 'ID_DETAILS' ) ); $template->assign ( 'PMFUNTION', $sNameFun );
$template->assign ( 'RETURN_TITLE', G::LoadTranslation ( 'ID_TRIGGER_RETURN_TITLE' ) ); $template->assign ( 'PMFUNTION_LABEL', $methodLabel );
if ( $bReturnValue ) { $template->assign ( 'PMFUNTION_DESCRIPTION', $methodDescription );
$template->assign ( 'RETURN_LABEL', G::LoadTranslation ( 'ID_TRIGGER_RETURN_LABEL' ) ); $template->assign ( 'TITLE', G::LoadTranslation ( 'ID_TITLE' ) );
} $template->assign ( 'DESCRIPTION', G::LoadTranslation ( 'ID_DESCRIPTION' ) );
$template->assign ( 'METHOD_LABEL', G::LoadTranslation ( 'ID_METHOD' ) ); $template->assign ( 'DETAILS_LABEL', G::LoadTranslation ( 'ID_DETAILS' ) );
$template->assign ( 'ROWS', sizeof ( $aParametersFun ) + 3 ); $template->assign ( 'RETURN_TITLE', G::LoadTranslation ( 'ID_TRIGGER_RETURN_TITLE' ) );
$template->assign ( 'TRIGGER_INFORMATION', 'Trigger Information' ); if ( $bReturnValue ) {
$template->assign ( 'TRIGGER_ACTION', '../triggers/triggers_WizardSave' ); $template->assign ( 'RETURN_LABEL', G::LoadTranslation ( 'ID_TRIGGER_RETURN_LABEL' ) );
$template->assign ( 'PRO_UID', $sProUid ); }
$template->assign ( 'PAGED_TABLE_ID', $aDataTrigger ['PAGED_TABLE_ID'] ); $template->assign ( 'METHOD_LABEL', G::LoadTranslation ( 'ID_METHOD' ) );
$template->assign ( 'RETURN_DESCRIPTION', $methodReturnLabel ); $template->assign ( 'ROWS', sizeof ( $aParametersFun ) + 3 );
$template->assign ( 'ID_SAVE', G::LoadTranslation ( 'ID_SAVE' ) ); $template->assign ( 'TRIGGER_INFORMATION', 'Trigger Information' );
$template->assign ( 'ID_CANCEL', G::LoadTranslation ( 'ID_CANCEL' ) ); $template->assign ( 'TRIGGER_ACTION', '../triggers/triggers_WizardSave' );
$template->assign ( 'DISPLAY_MODE', $displayMode ); $template->assign ( 'PRO_UID', $sProUid );
$template->assign ( 'PAGED_TABLE_ID', $aDataTrigger ['PAGED_TABLE_ID'] );
$sPMfunction = $sNameFun . " ("; $template->assign ( 'RETURN_DESCRIPTION', $methodReturnLabel );
$methodParametersOnlyNames = array (); $template->assign ( 'ID_SAVE', G::LoadTranslation ( 'ID_SAVE' ) );
if (count ( $aParametersFun ) > 0) { $template->assign ( 'ID_CANCEL', G::LoadTranslation ( 'ID_CANCEL' ) );
$template->newBlock ( 'paremetersTriggersGroup' ); $template->assign ( 'DISPLAY_MODE', $displayMode );
$template->assign ( 'PARAMETERS_LABEL', G::LoadTranslation ( 'ID_PARAMETERS' ) );
foreach ( $aParametersFun as $k => $v ) { $sPMfunction = $sNameFun . " (";
if ($v != '') { $methodParametersOnlyNames = array ();
$aParametersFunA = explode ( "|", $v ); if (count ( $aParametersFun ) > 0) {
$paramType = $aParametersFunA [0]; $template->newBlock ( 'paremetersTriggersGroup' );
$paramDefinition = $aParametersFunA [1]; $template->assign ( 'PARAMETERS_LABEL', G::LoadTranslation ( 'ID_PARAMETERS' ) );
$paramDefinitionA = explode ( "=", $paramDefinition ); foreach ($aParametersFun as $k => $v) {
$paramName = $paramDefinitionA [0]; if ($v != '') {
$methodParametersOnlyNames [] = $paramName; $aParametersFunA = explode ( "|", $v );
$paramDefaultValue = isset ( $paramDefinitionA [1] ) ? $paramDefinitionA [1] : ""; $paramType = $aParametersFunA [0];
$paramLabel = isset ( $aParametersFunA [2] ) ? $aParametersFunA [2] : $paramName; $paramDefinition = $aParametersFunA [1];
$paramDescription = isset ( $aParametersFunA [3] ) ? $aParametersFunA [3] : ""; $paramDefinitionA = explode ( "=", $paramDefinition );
$sPMfunction .= ($nrows != 2) ? ', "' . trim ( str_replace ( "$", "", $paramName ) ) . '"' : '"' . trim ( str_replace ( "$", "", $paramName ) . '"' ); $paramName = $paramDefinitionA [0];
$template->newBlock ( 'paremetersTriggers' ); $methodParametersOnlyNames [] = $paramName;
$template->assign ( 'LABEL_PARAMETER', $paramLabel ); $paramDefaultValue = isset ( $paramDefinitionA [1] ) ? $paramDefinitionA [1] : "";
$template->assign ( 'OPT_PARAMETER', trim ( str_replace ( "$", "", $paramName ) ) ); $paramLabel = isset ( $aParametersFunA [2] ) ? $aParametersFunA [2] : $paramName;
$sNameTag = 'form.' . trim ( str_replace ( "$", "", $paramName ) ) . '.name'; $paramDescription = isset ( $aParametersFunA [3] ) ? $aParametersFunA [3] : "";
$sNameTag = trim ( $sNameTag ); $sPMfunction .= ($nrows != 2)
$template->assign ( 'SNAMETAG', $sNameTag ); ? ', "' . trim ( str_replace ( "$", "", $paramName ) ) . '"'
$tri_Button = "<input type='button' name='INSERT_VARIABLE' value='@@' onclick='showDynaformsFormVars($sNameTag , \"../controls/varsAjax\" , \"$sProUid\" , \"@@\");return;' >"; : '"' . trim ( str_replace ( "$", "", $paramName ) . '"' );
$template->assign ( 'ADD_TRI_VARIABLE', $tri_Button );
$template->assign ( 'ADD_TRI_VALUE', str_replace ( "'", "", str_replace ( '"', '', $paramDefaultValue ) ) ); $template->newBlock ( 'paremetersTriggers' );
$fieldDescription = ($paramDescription!="")?$paramDescription . "<br>":""; $template->assign ( 'LABEL_PARAMETER', $paramLabel );
$fieldDescription .= $paramDefaultValue != "" ? $paramDefaultValue . " | " . $paramType : G::LoadTranslation ( "ID_REQUIRED_FIELD" ) . " | " . $paramType; $template->assign ( 'OPT_PARAMETER', trim ( str_replace ( "$", "", $paramName ) ) );
$template->assign ( 'ADD_TRI_DESCRIPTION', $fieldDescription ); $sNameTag = 'form.' . trim ( str_replace ( "$", "", $paramName ) ) . '.name';
$nrows ++; $sNameTag = trim ( $sNameTag );
} $template->assign ( 'SNAMETAG', $sNameTag );
} $tri_Button = "<input type='button' name='INSERT_VARIABLE' value='@@' "
. "onclick='showDynaformsFormVars($sNameTag , \"../controls/varsAjax\" , "
} . " \"$sProUid\" , \"@@\");return;' >";
$template->gotoBlock ( '_ROOT' );
$template->assign ( 'ALLFUNCTION', implode ( ",", $methodParametersOnlyNames ) ); $template->assign ( 'ADD_TRI_VARIABLE', $tri_Button );
$sPMfunction .= ");"; $template->assign ( 'ADD_TRI_VALUE',
$content = $template->getOutputContent (); str_replace ( "'", "", str_replace ( '"', '', $paramDefaultValue ) ) );
print $content;
$fieldDescription = ($paramDescription!="")?$paramDescription . "<br>":"";
} catch ( Exception $oException ) { $fieldDescription .= $paramDefaultValue != ""
die ( $oException->getMessage () ); ? $paramDefaultValue . " | " . $paramType
} : G::LoadTranslation ( "ID_REQUIRED_FIELD" ) . " | " . $paramType;
unset ( $_SESSION ['PROCESS'] ); $template->assign ( 'ADD_TRI_DESCRIPTION', $fieldDescription );
?> $nrows ++;
}
}
}
$template->gotoBlock ( '_ROOT' );
$template->assign ( 'ALLFUNCTION', implode ( ",", $methodParametersOnlyNames ) );
$sPMfunction .= ");";
$content = $template->getOutputContent ();
print $content;
} catch ( Exception $oException ) {
die ( $oException->getMessage () );
}
unset ($_SESSION ['PROCESS']);

View File

@@ -1,154 +1,168 @@
<?php <?php
/** /**
* triggers_CreateWizard.php * triggers_CreateWizard.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* 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 ( 'triggerLibrary' ); G::LoadClass ( 'triggerLibrary' );
$triggerLibrary = triggerLibrary::getSingleton (); $triggerLibrary = triggerLibrary::getSingleton ();
$libraryClassName = $_GET ['LIBRARY_CLASS']; $libraryClassName = $_GET ['LIBRARY_CLASS'];
$libraryMethod = $_GET ['PMFUNTION_NAME']; $libraryMethod = $_GET ['PMFUNTION_NAME'];
$sProUid = $_GET ['PRO_UID']; $sProUid = $_GET ['PRO_UID'];
$libraryO = $triggerLibrary->getLibraryDefinition ( $libraryClassName ); $libraryO = $triggerLibrary->getLibraryDefinition ( $libraryClassName );
$libraryName = $libraryO->info ['name']; $libraryName = $libraryO->info ['name'];
$libraryDescription = trim ( str_replace ( "*", "", implode ( " ", $libraryO->info ['description'] ) ) ); $libraryDescription = trim ( str_replace ( "*", "", implode ( " ", $libraryO->info ['description'] ) ) );
$libraryIcon = isset ( $libraryO->info ['icon'] ) && ($libraryO->info ['icon'] != "") ? $libraryO->info ['icon'] : "/images/browse.gif"; $libraryIcon = isset ( $libraryO->info ['icon'] ) && ($libraryO->info ['icon'] != "")
$aDataTrigger = $_GET; ? $libraryO->info ['icon'] : "/images/browse.gif";
$aDataTrigger = $_GET;
$sProUid = $aDataTrigger ['PRO_UID'];
$sNameFun = $aDataTrigger ['PMFUNTION_NAME']; $sProUid = $aDataTrigger ['PRO_UID'];
$sNameFun = $aDataTrigger ['PMFUNTION_NAME'];
$methodObject = $libraryO->methods [$sNameFun];
$methodObject = $libraryO->methods [$sNameFun];
$methodName = $methodObject->info ['name'];
$methodLabel = $methodObject->info ['label']; $methodName = $methodObject->info ['name'];
$methodDescription = trim ( str_replace ( "*", "", implode ( " ", $methodObject->info ['description'] ) ) ); $methodLabel = $methodObject->info ['label'];
$methodReturn = $methodObject->info ['return']; $methodDescription = trim ( str_replace ( "*", "", implode ( " ", $methodObject->info ['description'] ) ) );
$methodParameters = array_keys ( $methodObject->params ); $methodReturn = $methodObject->info ['return'];
$methodLink = isset ( $methodObject->info ['link'] ) && ($methodObject->info ['link'] != "") ? $methodObject->info ['link'] : ""; $methodParameters = array_keys ( $methodObject->params );
$methodreturnA = explode ( "|", $methodReturn ); $methodLink = isset ( $methodObject->info ['link'] ) && ($methodObject->info ['link'] != "")
? $methodObject->info ['link'] : "";
$bReturnValue = true; $methodreturnA = explode ( "|", $methodReturn );
$displayMode = 'display:block';
$methodreturnDescription = (trim(strtoupper($methodreturnA [3])) == strtoupper(G::LoadTranslation ( 'ID_NONE')) )? G::LoadTranslation ( 'ID_NOT_REQUIRED') : $methodreturnA [3]; $bReturnValue = true;
$methodReturnLabel = isset ( $methodreturnA [3] ) ? $methodreturnDescription : $methodReturn; $displayMode = 'display:block';
if ( (isset($methodreturnA[0]) && isset($methodreturnA[1])) && (trim(strtoupper($methodreturnA[0]) ) != strtoupper(G::LoadTranslation ( 'ID_NONE')) ) ) { $methodreturnDescription = (trim(strtoupper($methodreturnA [3])) == strtoupper(G::LoadTranslation ( 'ID_NONE')) )
$methodReturnLabelRequired = (trim( $methodreturnA[1] ) != "" )? G::LoadTranslation ( "ID_REQUIRED_FIELD" ) : $methodreturnA[1]; ? G::LoadTranslation ( 'ID_NOT_REQUIRED') : $methodreturnA [3];
$methodReturnLabel .= "<br>" . trim( $methodReturnLabelRequired ) . " | " . trim($methodreturnA[0]); $methodReturnLabel = isset ( $methodreturnA [3] ) ? $methodreturnDescription : $methodReturn;
} if ( (isset($methodreturnA[0]) && isset($methodreturnA[1]))
else { && (trim(strtoupper($methodreturnA[0]) ) != strtoupper(G::LoadTranslation ( 'ID_NONE')) ) ) {
$bReturnValue = false; $methodReturnLabelRequired = (trim( $methodreturnA[1] ) != "" )
$displayMode = 'display:none'; ? G::LoadTranslation ( "ID_REQUIRED_FIELD" ) : $methodreturnA[1];
} $methodReturnLabel .= "<br>" . trim( $methodReturnLabelRequired ) . " | " . trim($methodreturnA[0]);
$aParametersFun = $methodParameters; } else {
$triggerWizardTemplate = PATH_TPL . 'triggers' . PATH_SEP . 'triggers_EditWizard.html'; $bReturnValue = false;
$template = new TemplatePower ( $triggerWizardTemplate ); $displayMode = 'display:none';
$template->prepare (); }
$aParametersFun = $methodParameters;
$tds = ''; $triggerWizardTemplate = PATH_TPL . 'triggers' . PATH_SEP . 'triggers_EditWizard.html';
$nrows = 2; $template = new TemplatePower ( $triggerWizardTemplate );
$template->prepare ();
$template->assign ( 'LIBRARY_NAME', $libraryName );
$template->assign ( 'LIBRARY_DESCRIPTION', $libraryDescription ); $tds = '';
$template->assign ( 'LIBRARY_ICON', $libraryIcon ); $nrows = 2;
$template->assign ( 'LIBRARY_CLASS', $libraryClassName );
if ($methodLink != "") { $template->assign ( 'LIBRARY_NAME', $libraryName );
$template->newBlock ( 'methodLink' ); $template->assign ( 'LIBRARY_DESCRIPTION', $libraryDescription );
$template->assign ( 'LIBRARY_METHOD_LINK', $methodLink ); $template->assign ( 'LIBRARY_ICON', $libraryIcon );
$template->gotoBlock ( '_ROOT' ); $template->assign ( 'LIBRARY_CLASS', $libraryClassName );
} if ($methodLink != "") {
$template->newBlock ( 'methodLink' );
$template->assign ( 'PMFUNTION', $sNameFun ); $template->assign ( 'LIBRARY_METHOD_LINK', $methodLink );
$template->assign ( 'PMFUNTION_LABEL', $methodLabel ); $template->gotoBlock ( '_ROOT' );
$template->assign ( 'PMFUNTION_DESCRIPTION', $methodDescription ); }
$template->assign ( 'TITLE', G::LoadTranslation ( 'ID_TITLE' ) );
$template->assign ( 'TITLE_CONTENT', $_GET['TRI_TITLE'] ); $template->assign ( 'PMFUNTION', $sNameFun );
$template->assign ( 'TRI_UID', $_GET['TRI_UID'] ); $template->assign ( 'PMFUNTION_LABEL', $methodLabel );
$template->assign ( 'SOURCE_LINK', G::LoadTranslation ( 'ID_TRIGGER_SOURCE_LINK' ) ); $template->assign ( 'PMFUNTION_DESCRIPTION', $methodDescription );
$template->assign ( 'DESCRIPTION', G::LoadTranslation ( 'ID_DESCRIPTION' ) ); $template->assign ( 'TITLE', G::LoadTranslation ( 'ID_TITLE' ) );
$template->assign ( 'DESCRIPTION_CONTENT', $_GET['TRI_DESCRIPTION'] ); $template->assign ( 'TITLE_CONTENT', $_GET['TRI_TITLE'] );
$template->assign ( 'DETAILS_LABEL', G::LoadTranslation ( 'ID_DETAILS' ) ); $template->assign ( 'TRI_UID', $_GET['TRI_UID'] );
$template->assign ( 'RETURN_TITLE', G::LoadTranslation ( 'ID_TRIGGER_RETURN_TITLE' ) ); $template->assign ( 'SOURCE_LINK', G::LoadTranslation ( 'ID_TRIGGER_SOURCE_LINK' ) );
if ( $bReturnValue ) { $template->assign ( 'DESCRIPTION', G::LoadTranslation ( 'ID_DESCRIPTION' ) );
$template->assign ( 'RETURN_LABEL', G::LoadTranslation ( 'ID_TRIGGER_RETURN_LABEL' ) ); $template->assign ( 'DESCRIPTION_CONTENT', $_GET['TRI_DESCRIPTION'] );
} $template->assign ( 'DETAILS_LABEL', G::LoadTranslation ( 'ID_DETAILS' ) );
$template->assign ( 'RETURN_VALUE', $_GET['TRI_ANSWER'] ); $template->assign ( 'RETURN_TITLE', G::LoadTranslation ( 'ID_TRIGGER_RETURN_TITLE' ) );
$template->assign ( 'METHOD_LABEL', G::LoadTranslation ( 'ID_METHOD' ) ); if ( $bReturnValue ) {
$template->assign ( 'ROWS', sizeof ( $aParametersFun ) + 3 ); $template->assign ( 'RETURN_LABEL', G::LoadTranslation ( 'ID_TRIGGER_RETURN_LABEL' ) );
$template->assign ( 'TRIGGER_INFORMATION', 'Triggers Edit Form' ); }
$template->assign ( 'TRIGGER_ACTION', '../triggers/triggers_WizardUpdate' ); $template->assign ( 'RETURN_VALUE', $_GET['TRI_ANSWER'] );
$template->assign ( 'PRO_UID', $sProUid ); $template->assign ( 'METHOD_LABEL', G::LoadTranslation ( 'ID_METHOD' ) );
$template->assign ( 'PAGED_TABLE_ID', $aDataTrigger ['PAGED_TABLE_ID'] ); $template->assign ( 'ROWS', sizeof ( $aParametersFun ) + 3 );
$template->assign ( 'RETURN_DESCRIPTION', $methodReturnLabel ); $template->assign ( 'TRIGGER_INFORMATION', 'Triggers Edit Form' );
$template->assign ( 'ID_SAVE', G::LoadTranslation ( 'ID_SAVE' ) ); $template->assign ( 'TRIGGER_ACTION', '../triggers/triggers_WizardUpdate' );
$template->assign ( 'ID_CANCEL', G::LoadTranslation ( 'ID_CANCEL' ) ); $template->assign ( 'PRO_UID', $sProUid );
$template->assign ( 'DISPLAY_MODE', $displayMode ); $template->assign ( 'PAGED_TABLE_ID', $aDataTrigger ['PAGED_TABLE_ID'] );
$template->assign ( 'RETURN_DESCRIPTION', $methodReturnLabel );
$sPMfunction = $sNameFun . " ("; $template->assign ( 'ID_SAVE', G::LoadTranslation ( 'ID_SAVE' ) );
$methodParametersOnlyNames = array (); $template->assign ( 'ID_CANCEL', G::LoadTranslation ( 'ID_CANCEL' ) );
if (count ( $aParametersFun ) > 0) { $template->assign ( 'DISPLAY_MODE', $displayMode );
$template->newBlock ( 'paremetersTriggersGroup' );
$template->assign ( 'PARAMETERS_LABEL', G::LoadTranslation ( 'ID_PARAMETERS' ) ); $sPMfunction = $sNameFun . " (";
foreach ( $aParametersFun as $k => $v ) { $methodParametersOnlyNames = array ();
if ($v != '') { if (count ( $aParametersFun ) > 0) {
$aParametersFunA = explode ( "|", $v ); $template->newBlock ( 'paremetersTriggersGroup' );
$paramType = $aParametersFunA [0]; $template->assign ( 'PARAMETERS_LABEL', G::LoadTranslation ( 'ID_PARAMETERS' ) );
$paramDefinition = $aParametersFunA [1]; foreach ($aParametersFun as $k => $v) {
$paramDefinitionA = explode ( "=", $paramDefinition ); if ($v != '') {
$paramName = $paramDefinitionA [0]; $aParametersFunA = explode ( "|", $v );
$methodParametersOnlyNames [] = $paramName; $paramType = $aParametersFunA [0];
$paramDefaultValue = isset ( $paramDefinitionA [1] ) ? $paramDefinitionA [1] : ""; $paramDefinition = $aParametersFunA [1];
$paramLabel = isset ( $aParametersFunA [2] ) ? $aParametersFunA [2] : $paramName; $paramDefinitionA = explode ( "=", $paramDefinition );
$paramDescription = isset ( $aParametersFunA [3] ) ? $aParametersFunA [3] : ""; $paramName = $paramDefinitionA [0];
$sPMfunction .= ($nrows != 2) ? ', "' . trim ( str_replace ( "$", "", $paramName ) ) . '"' : '"' . trim ( str_replace ( "$", "", $paramName ) . '"' ); $methodParametersOnlyNames [] = $paramName;
$template->newBlock ( 'paremetersTriggers' ); $paramDefaultValue = isset ( $paramDefinitionA [1] ) ? $paramDefinitionA [1] : "";
$template->assign ( 'LABEL_PARAMETER', $paramLabel ); $paramLabel = isset ( $aParametersFunA [2] ) ? $aParametersFunA [2] : $paramName;
$template->assign ( 'OPT_PARAMETER', trim ( str_replace ( "$", "", $paramName ) ) ); $paramDescription = isset ( $aParametersFunA [3] ) ? $aParametersFunA [3] : "";
$sNameTag = 'form.' . trim ( str_replace ( "$", "", $paramName ) ) . '.name'; $sPMfunction .= ($nrows != 2)
$sNameTag = trim ( $sNameTag ); ? ', "' . trim ( str_replace ( "$", "", $paramName ) ) . '"'
$template->assign ( 'SNAMETAG', $sNameTag ); : '"' . trim ( str_replace ( "$", "", $paramName ) . '"' );
$tri_Button = "<input type='button' name='INSERT_VARIABLE' value='@@' onclick='showDynaformsFormVars($sNameTag , \"../controls/varsAjax\" , \"$sProUid\" , \"@@\");return;' >";
$template->assign ( 'ADD_TRI_VARIABLE', $tri_Button ); $template->newBlock ( 'paremetersTriggers' );
// $template->assign ( 'ADD_TRI_VALUE', str_replace ( "'", "", str_replace ( '"', '', $paramDefaultValue ) ) ); $template->assign ( 'LABEL_PARAMETER', $paramLabel );
$paramValue = $_GET[trim( str_replace( "$", "", $paramName ) )]; $template->assign ( 'OPT_PARAMETER', trim ( str_replace ( "$", "", $paramName ) ) );
$template->assign ( 'ADD_TRI_VALUE', str_replace("\'", "&apos;", $paramValue) ); $sNameTag = 'form.' . trim ( str_replace ( "$", "", $paramName ) ) . '.name';
$fieldDescription = ($paramDescription!="")?$paramDescription . "<br>":""; $sNameTag = trim ( $sNameTag );
$fieldDescription .= $paramDefaultValue != "" ? $paramDefaultValue . " | " . $paramType : G::LoadTranslation ( "ID_REQUIRED_FIELD" ) . " | " . $paramType; $template->assign ( 'SNAMETAG', $sNameTag );
$template->assign ( 'ADD_TRI_DESCRIPTION', $fieldDescription ); $tri_Button = "<input type='button' name='INSERT_VARIABLE' value='@@' "
$nrows ++; . "onclick='showDynaformsFormVars($sNameTag , \"../controls/varsAjax\" , "
} . " \"$sProUid\" , \"@@\");return;' >";
}
$template->assign ( 'ADD_TRI_VARIABLE', $tri_Button );
} // $template->assign ( 'ADD_TRI_VALUE', str_replace ( "'", "",
$template->gotoBlock ( '_ROOT' ); // str_replace ( '"', '', $paramDefaultValue ) ) );
$template->assign ( 'ALLFUNCTION', implode ( ",", $methodParametersOnlyNames ) ); $paramValue = $_GET[trim( str_replace( "$", "", $paramName ) )];
$sPMfunction .= ");"; $template->assign ( 'ADD_TRI_VALUE', str_replace("\'", "&apos;", $paramValue) );
$content = $template->getOutputContent (); $fieldDescription = ($paramDescription!="")?$paramDescription . "<br>":"";
print $content; $fieldDescription .= $paramDefaultValue != ""
? $paramDefaultValue . " | " . $paramType
} catch ( Exception $oException ) { : G::LoadTranslation ( "ID_REQUIRED_FIELD" ) . " | " . $paramType;
die ( $oException->getMessage () );
} $template->assign ( 'ADD_TRI_DESCRIPTION', $fieldDescription );
unset ( $_SESSION ['PROCESS'] ); $nrows ++;
?> }
}
}
$template->gotoBlock ( '_ROOT' );
$template->assign ( 'ALLFUNCTION', implode ( ",", $methodParametersOnlyNames ) );
$sPMfunction .= ");";
$content = $template->getOutputContent ();
print $content;
} catch ( Exception $oException ) {
die ( $oException->getMessage () );
}
unset ( $_SESSION ['PROCESS'] );