forked from Wavyzz/dolibarr
Fix: no required class for not mandatory fields
This commit is contained in:
@@ -31,14 +31,14 @@
|
||||
{
|
||||
print 'jQuery("#value_choice").hide();';
|
||||
}
|
||||
|
||||
|
||||
if (GETPOST('type') == "separate")
|
||||
{
|
||||
print "jQuery('#size, #unique, #required, #default_value').val('').attr('disabled','disabled');";
|
||||
print 'jQuery("#value_choice").hide();';
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
if (type == 'date') { size.val('').attr('disabled','disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); }
|
||||
else if (type == 'datetime') { size.val('').attr('disabled','disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); }
|
||||
else if (type == 'double') { size.val('24,8').removeAttr('disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); }
|
||||
@@ -67,17 +67,19 @@
|
||||
<input type="hidden" name="rowid" value="<?php echo $rowid ?>">
|
||||
|
||||
<table summary="listofattributes" class="border centpercent">
|
||||
<!-- Type -->
|
||||
<tr><td class="fieldrequired"><?php echo $langs->trans("Type"); ?></td><td class="valeur">
|
||||
<?php print $form->selectarray('type',$type2label,GETPOST('type')); ?>
|
||||
</td></tr>
|
||||
<!-- Position -->
|
||||
<tr><td class="fieldrequired"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo GETPOST('pos'); ?>"></td></tr>
|
||||
<!-- Label -->
|
||||
<tr><td class="fieldrequired"><?php echo $langs->trans("Label"); ?></td><td class="valeur"><input type="text" name="label" size="40" value="<?php echo GETPOST('label'); ?>"></td></tr>
|
||||
<!-- Code -->
|
||||
<tr><td class="fieldrequired"><?php echo $langs->trans("AttributeCode"); ?> (<?php echo $langs->trans("AlphaNumOnlyCharsAndNoSpace"); ?>)</td><td class="valeur"><input type="text" name="attrname" id="attrname" size="10" value="<?php echo GETPOST('attrname'); ?>"></td></tr>
|
||||
<!-- Value (for select list / radio/ checkbox) -->
|
||||
<!-- Type -->
|
||||
<tr><td class="fieldrequired"><?php echo $langs->trans("Type"); ?></td><td class="valeur">
|
||||
<?php print $form->selectarray('type',$type2label,GETPOST('type')); ?>
|
||||
</td></tr>
|
||||
<!-- Size -->
|
||||
<tr><td class="fieldrequired"><?php echo $langs->trans("Size"); ?></td><td class="valeur"><input id="size" type="text" name="size" size="5" value="<?php echo (GETPOST('size')?GETPOST('size'):''); ?>"></td></tr>
|
||||
<!-- Position -->
|
||||
<tr><td><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo GETPOST('pos'); ?>"></td></tr>
|
||||
<!-- Default Value (for select list / radio/ checkbox) -->
|
||||
<tr id="value_choice">
|
||||
|
||||
<td>
|
||||
@@ -95,8 +97,6 @@
|
||||
</tr>
|
||||
<!-- Default Value -->
|
||||
<tr><td><?php echo $langs->trans("DefaultValue"); ?></td><td class="valeur"><input id="default_value" type="text" name="default_value" size="5" value="<?php echo (GETPOST('"default_value"')?GETPOST('"default_value"'):''); ?>"></td></tr>
|
||||
<!-- Size -->
|
||||
<tr><td class="fieldrequired"><?php echo $langs->trans("Size"); ?></td><td class="valeur"><input id="size" type="text" name="size" size="5" value="<?php echo (GETPOST('size')?GETPOST('size'):''); ?>"></td></tr>
|
||||
<!-- Unique -->
|
||||
<tr><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique" <?php echo (GETPOST('unique')?' checked="true"':''); ?>></td></tr>
|
||||
<!-- Required -->
|
||||
|
||||
@@ -73,8 +73,6 @@ elseif ($type== 'sellist')
|
||||
$param_chain = $paramlist[0];
|
||||
}
|
||||
?>
|
||||
<!-- Position -->
|
||||
<tr><td class="fieldrequired"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo $extrafields->attribute_pos[$attrname]; ?>"></td></tr>
|
||||
<!-- Label -->
|
||||
<tr><td class="fieldrequired"><?php echo $langs->trans("Label"); ?></td><td class="valeur"><input type="text" name="label" size="40" value="<?php echo $extrafields->attribute_label[$attrname]; ?>"></td></tr>
|
||||
<!-- Code -->
|
||||
@@ -84,6 +82,10 @@ elseif ($type== 'sellist')
|
||||
<?php print $type2label[$type]; ?>
|
||||
<input type="hidden" name="type" id="type" value="<?php print $type; ?>">
|
||||
</td></tr>
|
||||
<!-- Size -->
|
||||
<tr><td class="fieldrequired"><?php echo $langs->trans("Size"); ?></td><td><input id="size" type="text" name="size" size="5" value="<?php echo $size; ?>"></td></tr>
|
||||
<!-- Position -->
|
||||
<tr><td><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo $extrafields->attribute_pos[$attrname]; ?>"></td></tr>
|
||||
<!-- Value (for select list / radio) -->
|
||||
<?php
|
||||
if(($type == 'select') || ($type == 'sellist') || ($type == 'checkbox') ||(($type == 'radio')))
|
||||
@@ -104,8 +106,6 @@ if(($type == 'select') || ($type == 'sellist') || ($type == 'checkbox') ||(($typ
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<!-- Size -->
|
||||
<tr><td class="fieldrequired"><?php echo $langs->trans("Size"); ?></td><td><input id="size" type="text" name="size" size="5" value="<?php echo $size; ?>"></td></tr>
|
||||
<!-- Unique -->
|
||||
<tr><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique" <?php echo ($unique?' checked="true"':''); ?>></td></tr>
|
||||
<!-- Required -->
|
||||
|
||||
Reference in New Issue
Block a user