objectline_title.tpl.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 following variables defined:
  24. * $object (invoice, order, ...)
  25. * $conf
  26. * $langs
  27. * $element (used to test $user->rights->$element->creer)
  28. * $permtoedit (used to replace test $user->rights->$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. // Protection to avoid direct call of template
  36. if (empty($object) || !is_object($object)) {
  37. print "Error, template page can't be called as URL";
  38. exit;
  39. }
  40. global $filtertype;
  41. if (empty($filtertype)) {
  42. $filtertype = 0;
  43. }
  44. print "<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->\n";
  45. // Title line
  46. print "<thead>\n";
  47. print '<tr class="liste_titre nodrag nodrop">';
  48. // Adds a line numbering column
  49. if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) {
  50. print '<td class="linecolnum center">&nbsp;</td>';
  51. }
  52. // Product or sub-bom
  53. print '<td class="linecoldescription">'.$langs->trans('Description');
  54. if (getDolGlobalString('BOM_SUB_BOM') && $filtertype != 1) {
  55. print ' &nbsp; <a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a>&nbsp;&nbsp;';
  56. print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>&nbsp;';
  57. }
  58. print '</td>';
  59. // Qty
  60. print '<td class="linecolqty right">'.$form->textwithpicto($langs->trans('Qty'), ($filtertype != 1) ? $langs->trans("QtyRequiredIfNoLoss") : '').'</td>';
  61. if ($filtertype != 1) {
  62. if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
  63. print '<td class="linecoluseunit left">' . $langs->trans('Unit') . '</td>';
  64. }
  65. // Qty frozen
  66. print '<td class="linecolqtyfrozen right">' . $form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '</td>';
  67. // Disable stock change
  68. print '<td class="linecoldisablestockchange right">' . $form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')) . '</td>';
  69. // Efficiency
  70. print '<td class="linecolefficiency right">' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '</td>';
  71. // Cost
  72. print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).'</td>';
  73. } else {
  74. print '<td class="linecolunit right">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>';
  75. if (isModEnabled('workstation')) {
  76. print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . '</td>';
  77. }
  78. // Cost
  79. print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCostService")).'</td>';
  80. }
  81. print '<td class="linecoledit"></td>'; // No width to allow autodim
  82. print '<td class="linecoldelete" style="width: 10px"></td>';
  83. print '<td class="linecolmove" style="width: 10px"></td>';
  84. if ($action == 'selectlines') {
  85. print '<td class="linecolcheckall center">';
  86. print '<input type="checkbox" class="linecheckboxtoggle" />';
  87. print '<script>$(document).ready(function() {$(".linecheckboxtoggle").click(function() {var checkBoxes = $(".linecheckbox");checkBoxes.prop("checked", this.checked);})});</script>';
  88. print '</td>';
  89. }
  90. print "</tr>\n";
  91. print "</thead>\n";
  92. print "<!-- END PHP TEMPLATE objectline_title.tpl.php -->\n";