dolibarr 21.0.0-beta
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 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
14 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 3 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program. If not, see <https://www.gnu.org/licenses/>.
28 *
29 * Need to have the following variables defined:
30 * $object (invoice, order, ...)
31 * $conf
32 * $langs
33 * $dateSelector
34 * $forceall (0 by default, 1 for supplier invoices/orders)
35 * $element (used to test $user->rights->$element->creer)
36 * $permtoedit (used to replace test $user->rights->$element->creer)
37 * $senderissupplier (0 by default, 1 for supplier invoices/orders)
38 * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
39 * $outputalsopricetotalwithtax
40 * $usemargins (0 to disable all margins columns, 1 to show according to margin setup)
41 * $disableedit, $disablemove, $disableremove
42 *
43 * $text, $description, $line
44 */
45
51// Protection to avoid direct call of template
52if (empty($object) || !is_object($object)) {
53 print "Error, template page can't be called as URL";
54 exit(1);
55}
56
57global $mysoc;
58global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax;
59
60// add html5 elements
61$domData = ' data-element="'.$line->element.'"';
62$domData .= ' data-id="'.$line->id.'"';
63$domData .= ' data-qty="'.$line->qty.'"';
64$domData .= ' data-product_type="'.$line->product_type.'"';
65
66$coldisplay = 0;
67?>
68<!-- BEGIN PHP TEMPLATE htm/core/tpl/objectline_view.tpl.php -->
69<tr id="row-<?php print $line->id?>" class="drag drop oddeven" <?php print $domData; ?> >
70<?php if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) { ?>
71 <td class="linecolnum center"><span class="opacitymedium"><?php $coldisplay++; ?><?php print($i + 1); ?></span></td>
72<?php } ?>
73 <td class="linecollabel"><?php $coldisplay++; ?><div id="line_<?php print $line->id; ?>"></div>
74<?php
75if ($line->fk_skill > 0) {
76 $skill = new Skill($this->db);
77 $resSkill = $skill->fetch($line->fk_skill);
78 if ($resSkill > 0) {
79 print Skill::typeCodeToLabel($skill->skill_type);
80 }
81}
82?>
83 </td>
84 <td>
85<?php
86if ($line->fk_skill > 0) {
87 print $skill->getNomUrl(1);
88}
89?>
90 </td>
91
92 <td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?>
93<?php
94
95// Add description in form
96if ($line->fk_skill > 0 && $resSkill > 0) {
97 //print $skill->description;
98}
99
100?>
101 </td>
102 <td class="linecolrank nowrap right"><?php $coldisplay++; ?>
103
104<?php
105 global $permissiontoadd;
106
107// Show evaluation boxes
108print displayRankInfos($line->rankorder, $line->fk_skill, 'TNote', ($this->status == 0 && $permissiontoadd) ? 'edit' : 'view');
109
110?>
111
112 </td>
113
114<?php
115$coldisplay += 3;
116
117if ($action == 'selectlines') { ?>
118 <td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php print $i + 1; ?>]" value="<?php print $line->id; ?>" ></td>
119<?php }
120
121print "</tr>\n";
122
123print "<!-- END PHP TEMPLATE objectline_view.tpl.php -->\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
Class for Skill.
static typeCodeToLabel($code)
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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:149
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:152