PMCORE-4255 Dynaform, trigger, DB Connection not listed in classic process

This commit is contained in:
Julio Cesar Laura Avendaño
2023-06-27 16:57:01 +00:00
parent 42a53e4522
commit 573f239377
16 changed files with 39 additions and 61 deletions

View File

@@ -251,7 +251,7 @@ class Form extends XmlForm
if ((sizeof( $this->values[$k] ) === 1) && ($v->type !== 'grid') && isset( $this->values[$k][0] )) {
$this->values[$k] = $this->values[$k][0];
}
if (sizeof( $this->values[$k] ) === 0) {
if (is_countable($this->values[$k]) && sizeof( $this->values[$k] ) === 0) {
$this->values[$k] = '';
}
} else {

View File

@@ -79,6 +79,8 @@ class xmlformTemplate extends Smarty
}
$hasRequiredFields = false;
$ft->fields = [];
foreach ($form->fields as $k => $v) {
$ft->fields[$k] = $v->cloneObject();
$ft->fields[$k]->label = '{' . $varPrefix . $k . '}';

View File

@@ -1,12 +1,5 @@
<?php
/**
* Created on 21/12/2007
* Dynaform - Dynaform
/**
*
* @package workflow.engine.classes
*/
class DynaformEditor extends WebResource
{
private $isOldCopy = false;
@@ -112,11 +105,11 @@ class DynaformEditor extends WebResource
$sName = 'dynaformEditor';
$G_PUBLISH->publisherId = $sName;
$oHeadPublisher = headPublisher::getSingleton();
$oHeadPublisher->setTitle(G::LoadTranslation('ID_DYNAFORM_EDITOR') . ' - ' . $Properties['DYN_TITLE']);
$oHeadPublisher->setTitle(G::LoadTranslation('ID_DYNAFORM_EDITOR') . ' - ' . ($Properties['DYN_TITLE'] ?? ''));
$G_PUBLISH->AddContent('blank');
$this->panelConf['title'] = '';
$G_PUBLISH->AddContent('panel-init', 'mainPanel', $this->panelConf);
if ($Properties['DYN_TYPE'] == 'xmlform') {
if (isset($Properties['DYN_TYPE']) && $Properties['DYN_TYPE'] == 'xmlform') {
$G_PUBLISH->AddContent('xmlform', 'toolbar', 'dynaforms/fields_Toolbar', 'display:none', $Parameters, '', '');
} else {
$G_PUBLISH->AddContent('xmlform', 'toolbar', 'dynaforms/fields_ToolbarGrid', 'display:none', $Parameters, '', '');
@@ -155,17 +148,17 @@ class DynaformEditor extends WebResource
$G_PUBLISH->AddContent('blank');
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_PREVIEW"), $sName . '[3]', 'dynaformEditor.changeToPreview', 'dynaformEditor.saveCurrentView');
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_XML"), $sName . '[4]', 'dynaformEditor.changeToXmlCode', 'dynaformEditor.saveCurrentView');
if ($Properties['DYN_TYPE'] != 'grid') {
if (isset($Properties['DYN_TYPE']) && $Properties['DYN_TYPE'] != 'grid') {
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_HTML"), $sName . '[5]', 'dynaformEditor.changeToHtmlCode', 'dynaformEditor.saveCurrentView');
}
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_FIELDS_LIST"), $sName . '[6]', 'dynaformEditor.changeToFieldsList', 'dynaformEditor.saveCurrentView');
if ($Properties["DYN_TYPE"] != "grid") {
if (isset($Properties['DYN_TYPE']) && $Properties["DYN_TYPE"] != "grid") {
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_JAVASCRIPTS"), $sName . '[7]', 'dynaformEditor.changeToJavascripts', 'dynaformEditor.saveCurrentView');
}
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_PROPERTIES"), $sName . '[8]', 'dynaformEditor.changeToProperties', 'dynaformEditor.saveCurrentView');
//for showHide tab option @Neyek
if ($Properties["DYN_TYPE"] != "grid") {
if (isset($Properties['DYN_TYPE']) && $Properties["DYN_TYPE"] != "grid") {
$G_PUBLISH->AddContent("panel-tab", G::LoadTranslation("ID_CONDITIONS_EDITOR"), $sName . "[9]", "dynaformEditor.changeToShowHide", "dynaformEditor.saveShowHide");
}
@@ -234,7 +227,7 @@ class DynaformEditor extends WebResource
* @param $data
* @return void
*/
public function _setTmpData($data)
public static function _setTmpData($data)
{
G::verifyPath(PATH_C . 'dynEditor/', true);
$fp = fopen(PATH_C . 'dynEditor/' . session_id() . '.php', 'w');
@@ -248,7 +241,7 @@ class DynaformEditor extends WebResource
* @param string $filename
* @return array
*/
public function _getTmpData()
public static function _getTmpData()
{
$tmpData = array();
$file = PATH_C . 'dynEditor/' . session_id() . '.php';

View File

@@ -1,13 +1,5 @@
<?php
/**
* Created on 21/12/2007
* Dynaform - Dynaform
/**
* DynaformEditorAjax - DynaformEditorAjax class
*
* @package workflow.engine.classes
*/
class DynaformEditorAjax extends DynaformEditor implements IDynaformEditorAjax
{
@@ -361,6 +353,7 @@ class DynaformEditorAjax extends DynaformEditor implements IDynaformEditorAjax
{
$file = G::decrypt($fileA, URL_KEY);
$tmp = self::_getTmpData();
$Properties = [];
if (!(isset($tmp['Properties']) && isset($tmp['useTmpCopy']))) {
$dynaform = new Dynaform();
$dynaform->load($dynUid);

View File

@@ -13,7 +13,7 @@ class XMLDB
* @param string $dsn
* @return array $options
*/
public function &connect ($dsn, $options = array())
public static function &connect ($dsn, $options = array())
{
//Needed for $mysql_real_escape_string
$mresdbc = new DBConnection();

View File

@@ -30,9 +30,10 @@ class XmlFormFieldToolButton extends XmlFormField
* Prints the components of the toolBar
*
* @param string $value
* @param string $paramDummy2
* @return string
*/
public function render($value)
public function render($value = null, $paramDummy2 = null)
{
$url = $this->file;
if ($this->home === "methods") {

View File

@@ -5,12 +5,14 @@
<div class="content" style="{$form->scrollStyle};">
<table class="" width="100%" cellpadding="0" cellspacing="0">
<tr>
<th>{$form->label}</th>
<th>{if (isset($form->label))}
{$form->label}
{/if}</th>
</tr>
</table>
<table class="tableGrid" align="center" id="form[{$form->name}]" cellpadding="0" cellspacing="0">
<tr><td valign='top'>
{if ($form->addRow) }
{if (isset($form->addRow) && $form->addRow) }
<table class='Record'>
<tr><td></td>
<td><img id="form[{$form->name}][bullet]" src="/images/bulletButton.gif" />&nbsp;<a id="form[{$form->name}][addLink]" class="GridLink" href="javascript:;" value="Insert" onclick="form_{$form->owner->id}.getElementByName('{$form->name}').addGridRow(); return false;">{$form->NewLabel}</a></td>
@@ -31,6 +33,7 @@
</tr>
{literal}
{if isset($form_rows)}
{section name=row loop=$form_rows}
{if ($smarty.section.row.index==0)}
<tr id="firstRow_{$form_name}" onmouseout="highlightRow(this, '#fff')" onmouseover="highlightRow(this, '#D9E8FF')">
@@ -48,15 +51,16 @@
{/if}
{/foreach}
{if $form->deleteRow == '1' }
{if isset($form->deleteRow) && $form->deleteRow == '1' }
<td align="center"><A class="GridLink" href="javascript:;" onclick="form_{$form->owner->id}.getElementByName('{$form->name}').deleteGridRow('[{literal}{$smarty.section.row.index+1}{/literal}]'); return false;">{$form->DeleteLabel}</A>&nbsp;</td>
{/if}
{if ($form->editRow=='1')}
{if (isset($form->editRow) && $form->editRow=='1')}
<td>edit"{$form->editRow}"</td>
{/if}
{literal}
</tr>
{/section}
{/if}
{* TOTALIZABLE ROW *}
<tr>
<td></td>
@@ -65,7 +69,7 @@
{foreach from=$form->fields item=field}
{if ($field->type != "hidden")}
<td>
{if (isset($field->function) && $field->function != "") }
{if (isset($field->function) && $field->function != "" && isset($field->aggregate)) }
{if $field->function == "sum"}
<font color="black">Σ = </font><span id="form[SYS_GRID_AGGREGATE_{$form->name}__{$field->name}]">{$field->aggregate}</span><input type="hidden" name="form[SYS_GRID_AGGREGATE_{$form->name}_{$field->name}]" id="form[SYS_GRID_AGGREGATE_{$form->name}_{$field->name}]" value="{$field->aggregate}" />
{elseif $field->function == "avg"}

View File

@@ -5,13 +5,14 @@
<div class="content" style="{$form->scrollStyle};">
<table class="FormSubTitle" width="100%" cellpadding="0" cellspacing="0">
<tr>
<th>{$form->label}
</th>
<th>{if (isset($form->label))}
{$form->label}
{/if}</th>
</tr>
</table>
<table class="tableGrid" align="center" id="form[{$form->name}]" cellpadding="0" cellspacing="0">
<tr><td valign='top'>
{if ($form->addRow) }
{if (isset($form->addRow) && $form->addRow) }
<table class='Record'>
<tr><td></td>
<td><img id="form[{$form->name}][bullet]" src="/images/bulletButton.gif" />&nbsp;<a class="GridLink" href="javascript:;" value="Insert" onclick="form_{$form->owner->id}.getElementByName('{$form->name}').addGridRow(); return false;">{$form->NewLabel}</a></td>
@@ -38,10 +39,10 @@
{foreach from=$form->fields item=field}
<td style="">{$field->field}</td>
{/foreach}
{if $form->deleteRow == '1' }
{if isset($form->deleteRow) && $form->deleteRow == '1' }
<td align="center"><A class="GridLink" href="javascript:;" onclick="form_{$form->owner->id}.getElementByName('{$form->name}').deleteGridRow('[{literal}{$smarty.section.row.index+1}{/literal}]'); return false;">{$form->DeleteLabel}</A>&nbsp;</td>
{/if}
{if ($form->editRow=='1')}
{if (isset($form->editRow) && $form->editRow=='1')}
<td>edit"{$form->editRow}"</td>
{/if}
{literal}
@@ -53,7 +54,7 @@
{/literal}
{foreach from=$form->fields item=field}
<td>
{if isset($field->function) && $field->function!=='' }
{if isset($field->function) && $field->function!=='' && isset($field->aggregate) }
{if $field->function=='sum'}
Σ = <span id="form[SYS_GRID_AGGREGATE_{$form->name}__{$field->name}]">{$field->aggregate}</span><input type="hidden" name="form[SYS_GRID_AGGREGATE_{$form->name}_{$field->name}]" id="form[SYS_GRID_AGGREGATE_{$form->name}_{$field->name}]" value="{$field->aggregate}" />
{elseif $field->function=='avg'}

View File

@@ -32,7 +32,8 @@ try {
$libraryO = $triggerLibrary->getLibraryDefinition ( $libraryClassName );
$libraryName = $libraryO->info ['name'];
$libraryDescription = trim ( str_replace ( "*", "", implode ( " ", $libraryO->info ['description'] ) ) );
$libraryDescription = $libraryO->info ['description'] ?? '';
$libraryDescription = trim ( str_replace ( "*", "", implode ( " ", (is_array($libraryDescription) ? $libraryDescription : [$libraryDescription]) ) ) );
$libraryIcon = isset ( $libraryO->info ['icon'] ) && ($libraryO->info ['icon'] != "")
? $libraryO->info ['icon'] : "/images/browse.gif";
$aDataTrigger = $_GET;
@@ -44,7 +45,8 @@ try {
$methodName = $methodObject->info ['name'];
$methodLabel = $methodObject->info ['label'];
$methodDescription = trim ( str_replace ( "*", "", implode ( " ", $methodObject->info ['description'] ) ) );
$methodDescription = $methodObject->info ['description'] ?? '';
$methodDescription = trim ( str_replace ( "*", "", implode ( " ", (is_array($methodDescription) ? $methodDescription : [$methodDescription]) ) ) );
$methodReturn = $methodObject->info ['return'];
$methodParameters = array_keys ( $methodObject->params );
$methodLink = isset ( $methodObject->info ['link'] ) && ($methodObject->info ['link'] != "")

View File

@@ -10,9 +10,6 @@
<input name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" type="hidden">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td colspan="2" class="withoutLabel">{$form.__DYNAFORM_OPTIONS}</td>
</tr>
<tr>
<td colspan="2" class="withoutLabel">{$form.menuUser}</td>
</tr>
<tr>

View File

@@ -36,7 +36,7 @@
<td class="FormButton" colspan="2" align="center"></td>
</tr>
<tr>
<td class="FormButton" colspan="2" align="center">{$form.SAVE_FROM_PMTABLE} &nbsp; {$form.SAVE_AND_OPEN_FROM_PMTABLE} &nbsp; {$form.BTN_CANCEL} </td>
<td class="FormButton" colspan="2" align="center">{$form.SAVE_FROM_PMTABLE} &nbsp; {$form.SAVE_AND_OPEN_FROM_PMTABLE}</td>
</tr>
</tbody></table>
</td>

View File

@@ -15,9 +15,6 @@
<SAVE_AND_OPEN_FROM_PMTABLE type="button" onclick="validatePKFields (this.form,'saveAndOpen');">
<en><![CDATA[Save & Open]]></en>
</SAVE_AND_OPEN_FROM_PMTABLE>
<!-- BTN_CANCEL type="button" onclick="cancel();">
<en>Cancel</en>
</BTN_CANCEL //-->
<JSCRIPT type="javascript"><![CDATA[
// function that validates the primary keys in a grid for the Elements
function validatePKFields (formElement, value){

View File

@@ -8,10 +8,7 @@
<input class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="" type="hidden">
<input name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" type="hidden">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td colspan="2" class="withoutLabel">{$form.__DYNAFORM_OPTIONS}</td>
</tr>
<tr style="display: none;">
<tbody><tr style="display: none;">
<td colspan="2">{$form.PME_A}</td>
</tr>
<tr style="display: none;">

View File

@@ -9,10 +9,7 @@
<input class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="" type="hidden">
<input name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" type="hidden">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td colspan="2" class="withoutLabel">{$form.__DYNAFORM_OPTIONS}</td>
</tr>
<tr style="display: none;">
<tbody><tr style="display: none;">
<td colspan="2">{$form.PME_A}</td>
</tr>
<tr style="display: none;">

View File

@@ -9,10 +9,7 @@
<input class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="" type="hidden">
<input name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" type="hidden">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td colspan="2" class="withoutLabel">{$form.__DYNAFORM_OPTIONS}</td>
</tr>
<tr style="display: none;">
<tbody><tr style="display: none;">
<td colspan="2">{$form.PME_A}</td>
</tr>
<tr style="display: none;">

View File

@@ -8,10 +8,7 @@
<input class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="" type="hidden">
<input name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" type="hidden">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td colspan="2" class="withoutLabel">{$form.__DYNAFORM_OPTIONS}</td>
</tr>
<tr style="display: none;">
<tbody><tr style="display: none;">
<td colspan="2">{$form.PRO_UID}</td>
</tr>
<tr style="display: none;">