dolibarr 18.0.6
objectline_view.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) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
10 * Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
11 * Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
12 * Copyright (C) 2021 Grégory BLEMAND <gregory.blemand@atm-consulting.fr>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program. If not, see <https://www.gnu.org/licenses/>.
26 *
27 * Need to have following variables defined:
28 * $object (invoice, order, ...)
29 * $conf
30 * $langs
31 * $dateSelector
32 * $forceall (0 by default, 1 for supplier invoices/orders)
33 * $element (used to test $user->rights->$element->creer)
34 * $permtoedit (used to replace test $user->rights->$element->creer)
35 * $senderissupplier (0 by default, 1 for supplier invoices/orders)
36 * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
37 * $outputalsopricetotalwithtax
38 * $usemargins (0 to disable all margins columns, 1 to show according to margin setup)
39 * $object_rights->creer initialized from = $object->getRights()
40 * $disableedit, $disablemove, $disableremove
41 *
42 * $text, $description, $line
43 */
44
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;
49}
50
51global $mysoc;
52global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax;
53
54// add html5 elements
55$domData = ' data-element="'.$line->element.'"';
56$domData .= ' data-id="'.$line->id.'"';
57$domData .= ' data-qty="'.$line->qty.'"';
58$domData .= ' data-product_type="'.$line->product_type.'"';
59
60$coldisplay = 0;
61?>
62<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->
63<tr id="row-<?php print $line->id?>" class="drag drop oddeven" <?php print $domData; ?> >
64<?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
65 <td class="linecolnum center"><span class="opacitymedium"><?php $coldisplay++; ?><?php print ($i + 1); ?></span></td>
66<?php } ?>
67 <td class="linecollabel"><?php $coldisplay++; ?><div id="line_<?php print $line->id; ?>"></div>
68<?php
69if ($line->fk_skill > 0) {
70 $skill = new Skill($this->db);
71 $resSkill = $skill->fetch($line->fk_skill);
72 if ($resSkill > 0) {
73 print Skill::typeCodeToLabel($skill->skill_type).'</td>';
74 print '<td>'.$skill->getNomUrl(1);
75 }
76}
77?>
78 </td>
79
80 <td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?>
81<?php
82
83// Add description in form
84if ($line->fk_skill > 0 && $resSkill > 0) {
85 print $skill->description;
86}
87
88print '</td>';
89
90?>
91 <td class="linecolrank nowrap right"><?php $coldisplay++; ?>
92
93<?php
94global $permissiontoadd;
95
96 print displayRankInfos($line->rankorder, $line->fk_skill, 'TNote', ($this->status == 0 && $permissiontoadd) ? 'edit' : 'view');
97
98?>
99
100 </td>
101
102<?php
103
104if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlines') {
105 $situationinvoicelinewithparent = 0;
106 if ($line->fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) {
107 if (!empty($object->situation_cycle_ref)) {
108 // Set constant to disallow editing during a situation cycle
109 $situationinvoicelinewithparent = 1;
110 }
111 }
112
113 print '<td class="linecoledit center">';
114 $coldisplay++;
115 if (($line->info_bits & 2) == 2 || !empty($disableedit)) {
116 } else { ?>
117 <a class="editfielda reposition" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#line_'.$line->id; ?>">
118 <?php print img_edit().'</a>';
119 }
120 print '</td>';
121
122 /*print '<td class="linecoldelete center">';
123 $coldisplay++;
124 if (!$situationinvoicelinewithparent && empty($disableremove)) { // For situation invoice, deletion is not possible if there is a parent company.
125 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=ask_deleteline&amp;lineid='.$line->id.'">';
126 print img_delete();
127 print '</a>';
128 }
129 print '</td>';
130
131 if ($num > 1 && $conf->browser->layout != 'phone' && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) {
132 print '<td class="linecolmove tdlineupdown center">';
133 $coldisplay++;
134 if ($i > 0) { ?>
135 <a class="lineupdown" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>">
136 <?php print img_up('default', 0, 'imgupforline'); ?>
137 </a>
138 <?php }
139 if ($i < $num - 1) { ?>
140 <a class="lineupdown" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=down&amp;rowid='.$line->id; ?>">
141 <?php print img_down('default', 0, 'imgdownforline'); ?>
142 </a>
143 <?php }
144 print '</td>';
145 } else {
146 print '<td '.(($conf->browser->layout != 'phone' && empty($disablemove)) ? ' class="linecolmove tdlineupdown center"' : ' class="linecolmove center"').'></td>';
147 $coldisplay++;
148 }*/
149} else {
150 //print '<td colspan="3"></td>';
151 $coldisplay = $coldisplay + 3;
152}
153
154if ($action == 'selectlines') { ?>
155 <td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php print $i + 1; ?>]" value="<?php print $line->id; ?>" ></td>
156<?php }
157
158print "</tr>\n";
159
160print "<!-- END PHP TEMPLATE objectline_view.tpl.php -->\n";
Class for Skill.
static typeCodeToLabel($code)
print $langs trans("Ref").' m m m statut
Definition index.php:152
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
displayRankInfos($selected_rank, $fk_skill, $inputname='TNote', $mode='view')
Used to print ranks of a skill into several case, view or edit pour js necessary to select a rank.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition repair.php:120
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:123