diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index b25785ae368..dcb5d02b260 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -275,303 +275,303 @@ if (empty($reshook)) { $object->calculateCosts(); } } +} +/* + * View + */ - /* - * View - */ - - $form = new Form($db); - $formfile = new FormFile($db); +$form = new Form($db); +$formfile = new FormFile($db); - $title = $langs->trans('BOM'); - $help_url ='EN:Module_BOM'; - llxHeader('', $title, $help_url); +$title = $langs->trans('BOM'); +$help_url ='EN:Module_BOM'; +llxHeader('', $title, $help_url); - // Part to create - if ($action == 'create') { - print load_fiche_titre($langs->trans("NewBOM"), '', 'bom'); +// Part to create +if ($action == 'create') { + print load_fiche_titre($langs->trans("NewBOM"), '', 'bom'); - print '
'; + print ''; +} + +// Part to edit record +if (($id || $ref) && $action == 'edit') { + print load_fiche_titre($langs->trans("BillOfMaterials"), '', 'cubes'); + + print ''; +} + +// Part to show record +if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { + $head = bomPrepareHead($object); + print dol_get_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom'); + + $formconfirm = ''; + + // Confirmation to delete + if ($action == 'delete') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBillOfMaterials'), $langs->trans('ConfirmDeleteBillOfMaterials'), 'confirm_delete', '', 0, 1); + } + // Confirmation to delete line + if ($action == 'deleteline') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); } - // Part to edit record - if (($id || $ref) && $action == 'edit') { - print load_fiche_titre($langs->trans("BillOfMaterials"), '', 'cubes'); - - print ''; - } - - // Part to show record - if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { - $head = bomPrepareHead($object); - print dol_get_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom'); - - $formconfirm = ''; - - // Confirmation to delete - if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBillOfMaterials'), $langs->trans('ConfirmDeleteBillOfMaterials'), 'confirm_delete', '', 0, 1); - } - // Confirmation to delete line - if ($action == 'deleteline') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); - } - - // Confirmation of validation - if ($action == 'validate') { - // We check that object has a temporary ref - $ref = substr($object->ref, 1, 4); - if ($ref == 'PROV') { - $object->fetch_product(); - $numref = $object->getNextNumRef($object->product); - } else { - $numref = $object->ref; - } - - $text = $langs->trans('ConfirmValidateBom', $numref); - /*if (isModEnabled('notification')) - { - require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; - $notify = new Notify($db); - $text .= '| '.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).' | '.price($object->total_cost).' |
| '.$langs->trans("UnitCost").' | '.price($object->unit_cost).' |