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