Merge pull request #895 from jfefe/develop
Fix : use standard method to show extrafields on propal
This commit is contained in:
commit
e86800516e
@ -1837,65 +1837,37 @@ else
|
|||||||
|
|
||||||
if ($action == 'edit_extras')
|
if ($action == 'edit_extras')
|
||||||
{
|
{
|
||||||
|
print '</table>';
|
||||||
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formsoc">';
|
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formsoc">';
|
||||||
print '<input type="hidden" name="action" value="update_extras">';
|
print '<input type="hidden" name="action" value="update_extras">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO : use showOptionals($extrafields) function
|
print $object->showOptionals($extrafields,'edit');
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
|
||||||
{
|
|
||||||
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
|
|
||||||
if ($extrafields->attribute_type[$key] == 'separate')
|
|
||||||
{
|
|
||||||
print $extrafields->showSeparator($key);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<tr><td';
|
|
||||||
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
|
|
||||||
print '>'.$label.'</td><td colspan="3">';
|
|
||||||
|
|
||||||
// Convert date into timestamp format
|
|
||||||
if (in_array($extrafields->attribute_type[$key],array('date','datetime')))
|
|
||||||
{
|
|
||||||
$value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$object->array_options['options_'.$key];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == 'edit_extras' && $user->rights->propal->creer)
|
|
||||||
{
|
|
||||||
print $extrafields->showInputField($key,$value);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print $extrafields->showOutputField($key,$value);
|
|
||||||
}
|
|
||||||
print '</td></tr>'."\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(count($extrafields->attribute_label) > 0) {
|
if(count($extrafields->attribute_label) > 0) {
|
||||||
|
|
||||||
if ($action == 'edit_extras' && $user->rights->propal->creer)
|
if ($action == 'edit_extras' && $user->rights->propal->creer)
|
||||||
{
|
{
|
||||||
print '<tr><td></td><td>';
|
print '<tr><td width="25%"></td><td>';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||||
print '</form>';
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
print '</table></form>';
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ($object->statut == 0 && $user->rights->propal->creer)
|
if ($object->statut == 0 && $user->rights->propal->creer)
|
||||||
{
|
{
|
||||||
print '<tr><td></td><td><a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras">'.img_picto('','edit').' '.$langs->trans('Modify').'</a></td></tr>';
|
print '<tr><td width="25%"></td><td><a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras">'.img_picto('','edit').' '.$langs->trans('Modify').'</a></td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Amount HT
|
// Amount HT
|
||||||
print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>';
|
print '<tr><td height="10" width="25%">'.$langs->trans('AmountHT').'</td>';
|
||||||
print '<td align="right" nowrap><b>'.price($object->total_ht).'</b></td>';
|
print '<td align="right" nowrap><b>'.price($object->total_ht).'</b></td>';
|
||||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td>';
|
print '<td>'.$langs->trans("Currency".$conf->currency).'</td>';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user