Fix: no required class for not mandatory fields
This commit is contained in:
parent
ef2f8ea67d
commit
3c87e1e20d
@ -31,14 +31,14 @@
|
|||||||
{
|
{
|
||||||
print 'jQuery("#value_choice").hide();';
|
print 'jQuery("#value_choice").hide();';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('type') == "separate")
|
if (GETPOST('type') == "separate")
|
||||||
{
|
{
|
||||||
print "jQuery('#size, #unique, #required, #default_value').val('').attr('disabled','disabled');";
|
print "jQuery('#size, #unique, #required, #default_value').val('').attr('disabled','disabled');";
|
||||||
print 'jQuery("#value_choice").hide();';
|
print 'jQuery("#value_choice").hide();';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
if (type == 'date') { size.val('').attr('disabled','disabled'); unique.removeAttr('disabled','disabled'); 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 == '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(); }
|
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 ?>">
|
<input type="hidden" name="rowid" value="<?php echo $rowid ?>">
|
||||||
|
|
||||||
<table summary="listofattributes" class="border centpercent">
|
<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 -->
|
<!-- 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>
|
<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 -->
|
<!-- 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>
|
<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">
|
<tr id="value_choice">
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
@ -95,8 +97,6 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<!-- Default Value -->
|
<!-- 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>
|
<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 -->
|
<!-- 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>
|
<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 -->
|
<!-- Required -->
|
||||||
|
|||||||
@ -73,8 +73,6 @@ elseif ($type== 'sellist')
|
|||||||
$param_chain = $paramlist[0];
|
$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 -->
|
<!-- 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>
|
<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 -->
|
<!-- Code -->
|
||||||
@ -84,6 +82,10 @@ elseif ($type== 'sellist')
|
|||||||
<?php print $type2label[$type]; ?>
|
<?php print $type2label[$type]; ?>
|
||||||
<input type="hidden" name="type" id="type" value="<?php print $type; ?>">
|
<input type="hidden" name="type" id="type" value="<?php print $type; ?>">
|
||||||
</td></tr>
|
</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) -->
|
<!-- Value (for select list / radio) -->
|
||||||
<?php
|
<?php
|
||||||
if(($type == 'select') || ($type == 'sellist') || ($type == 'checkbox') ||(($type == 'radio')))
|
if(($type == 'select') || ($type == 'sellist') || ($type == 'checkbox') ||(($type == 'radio')))
|
||||||
@ -104,8 +106,6 @@ if(($type == 'select') || ($type == 'sellist') || ($type == 'checkbox') ||(($typ
|
|||||||
<?php
|
<?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 -->
|
<!-- 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>
|
<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 -->
|
<!-- Required -->
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user