Skip to content

Commit

Permalink
NEW Can set isMandatory property in generic setup framework
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Feb 6, 2025
1 parent 0772222 commit adb455e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions htdocs/core/class/html.formsetup.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public function generateLineOutput($item, $editMode = false)
$this->setupNotEmpty++;
$out .= '<tr class="'.$trClass.'">';

$out .= '<td class="col-setup-title">';
$out .= '<td class="col-setup-title'.($item->fieldParams['isMandatory'] ? ' fieldrequired' : '').'">';
$out .= '<span id="helplink'.$item->confKey.'" class="spanforparamtooltip">';
$out .= $this->form->textwithpicto($item->getNameText(), $item->getHelpText(), 1, 'info', '', 0, 3, 'tootips'.$item->confKey);
$out .= '</span>';
Expand Down Expand Up @@ -931,7 +931,7 @@ public function generateInputField()
} elseif ($this->type == 'selectBankAccount') {
if (isModEnabled("bank")) {
$selected = (empty($this->fieldValue) ? '' : $this->fieldValue);
$out .= $this->form->select_comptes($selected, $this->confKey, 0, '', 0, '', 0, '', 1);
$out .= img_picto('', 'bank', 'class="pictofixedwidth"').$this->form->select_comptes($selected, $this->confKey, 0, '', 0, '', 0, '', 1);
}
} elseif ($this->type == 'password') {
$out .= $this->generateInputFieldPassword('dolibarr');
Expand Down Expand Up @@ -977,7 +977,6 @@ public function generateInputFieldTextarea()
*/
public function generateInputFieldHtml()
{
global $conf;
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
$doleditor = new DolEditor($this->confKey, $this->fieldValue, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
return $doleditor->Create(1);
Expand Down
1 change: 1 addition & 0 deletions htdocs/modulebuilder/template/admin/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@

// Setup conf for selection of an URL
$item = $formSetup->newItem('MYMODULE_MYPARAM1');
$item->fieldParams['isMandatory'] = 1;
$item->fieldAttr['placeholder'] = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'];
$item->cssClass = 'minwidth500';

Expand Down

0 comments on commit adb455e

Please sign in to comment.