dolibarr 21.0.0-beta
objectline_title.tpl.php
1<?php
2/* Copyright (C) 2010-2013 Regis Houssin <regis.houssin@inodbox.com>
3 * Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
5 * Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
6 * Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
7 * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
8 * Copyright (C) 2017 Juanjo Menent <jmenent@2byte.es>
9 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23 *
24 * Need to have the following variables defined:
25 * $object (invoice, order, ...)
26 * $conf
27 * $langs
28 * $element (used to test $user->hasRight($element, 'creer'))
29 * $permtoedit (used to replace test $user->hasRight($element, 'creer'))
30 * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
31 * $outputalsopricetotalwithtax
32 * $usemargins (0 to disable all margins columns, 1 to show according to margin setup)
33 *
34 * $type, $text, $description, $line
35 */
45// Protection to avoid direct call of template
46if (empty($object) || !is_object($object)) {
47 print "Error, template page can't be called as URL";
48 exit(1);
49}
50
51'@phan-var-force CommonObject $this
52 @phan-var-force CommonObject $object';
53
54global $filtertype;
55if (empty($filtertype)) {
56 $filtertype = 0;
57}
58
59print "<!-- BEGIN PHP TEMPLATE bom/tpl/objectline_title.tpl.php -->\n";
60
61
62// Title line
63print "<thead>\n";
64
65print '<tr class="liste_titre nodrag nodrop">';
66
67// Adds a line numbering column
68if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) {
69 print '<td class="linecolnum center">&nbsp;</td>';
70}
71
72// Product or sub-bom
73print '<td class="linecoldescription bomline">'.$langs->trans('Description');
74if (getDolGlobalString('BOM_SUB_BOM') && $filtertype != 1) {
75 print ' &nbsp; <a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a>&nbsp;&nbsp;';
76 print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>&nbsp;';
77}
78print '</td>';
79
80// Qty
81print '<td class="linecolqty width100 right">'.$form->textwithpicto($langs->trans('Qty'), ($filtertype != 1) ? $langs->trans("QtyRequiredIfNoLoss") : '').'</td>';
82
83if ($filtertype != 1) { // Product
84 if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
85 print '<td class="linecoluseunit"></td>';
86 }
87} else { // Service
88 print '<td class="linecolunit"></td>';
89}
90if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active
91 // Qty frozen
92 print '<td class="linecolqtyfrozen right">' . $form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '</td>';
93
94 // Disable stock change
95 print '<td class="linecoldisablestockchange right">' . $form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')) . '</td>';
96
97 // Efficiency
98 print '<td class="linecolefficiency right">' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '</td>';
99}
100
101// Service and workstations are active
102if ($filtertype == 1 && isModEnabled('workstation')) {
103 // Workstation
104 if (isModEnabled('workstation')) {
105 print '<td class="linecolworkstation">' .img_picto('', 'workstation', 'class="pictofixedwidth"'). $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . '</td>';
106 }
107}
108
109// Cost
110print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).'</td>';
111
112print '<td class="linecoledit" style="width: 10px"></td>'; // No width to allow autodim
113
114print '<td class="linecoldelete" style="width: 10px"></td>';
115
116print '<td class="linecolmove" style="width: 10px"></td>';
117
118if ($action == 'selectlines') {
119 print '<td class="linecolcheckall center">';
120 print '<input type="checkbox" class="linecheckboxtoggle" />';
121 print '<script>$(document).ready(function() {$(".linecheckboxtoggle").click(function() {var checkBoxes = $(".linecheckbox");checkBoxes.prop("checked", this.checked);})});</script>';
122 print '</td>';
123}
124
125print "</tr>\n";
126print "</thead>\n";
127
128print "<!-- END PHP TEMPLATE objectline_title.tpl.php -->\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.