dolibarr 21.0.0-alpha
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 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program. If not, see <https://www.gnu.org/licenses/>.
27 *
28 * Need to have the following variables defined:
29 * $object (invoice, order, ...)
30 * $conf
31 * $langs
32 * $dateSelector
33 * $forceall (0 by default, 1 for supplier invoices/orders)
34 * $element (used to test $user->rights->$element->creer)
35 * $permtoedit (used to replace test $user->rights->$element->creer)
36 * $senderissupplier (0 by default, 1 for supplier invoices/orders)
37 * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
38 * $outputalsopricetotalwithtax
39 * $usemargins (0 to disable all margins columns, 1 to show according to margin setup)
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(1);
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 htm/core/tpl/objectline_view.tpl.php -->
63<tr id="row-<?php print $line->id?>" class="drag drop oddeven" <?php print $domData; ?> >
64<?php if (getDolGlobalString('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);
74 }
75}
76?>
77 </td>
78 <td>
79<?php
80if ($line->fk_skill > 0) {
81 print $skill->getNomUrl(1);
82}
83?>
84 </td>
85
86 <td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?>
87<?php
88
89// Add description in form
90if ($line->fk_skill > 0 && $resSkill > 0) {
91 //print $skill->description;
92}
93
94?>
95 </td>
96 <td class="linecolrank nowrap right"><?php $coldisplay++; ?>
97
98<?php
99 global $permissiontoadd;
100
101// Show evaluation boxes
102print displayRankInfos($line->rankorder, $line->fk_skill, 'TNote', ($this->status == 0 && $permissiontoadd) ? 'edit' : 'view');
103
104?>
105
106 </td>
107
108<?php
109$coldisplay += 3;
110
111if ($action == 'selectlines') { ?>
112 <td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php print $i + 1; ?>]" value="<?php print $line->id; ?>" ></td>
113<?php }
114
115print "</tr>\n";
116
117print "<!-- END PHP TEMPLATE objectline_view.tpl.php -->\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
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:137
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:140