productattributevalueline_view.tpl.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. /* Copyright (C) 2022 Open-Dsi <support@open-dsi.fr>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. *
  17. * Need to have following variables defined:
  18. * $object (invoice, order, ...)
  19. * $conf
  20. * $langs
  21. * $dateSelector
  22. * $forceall (0 by default, 1 for supplier invoices/orders)
  23. * $element (used to test $user->rights->$element->creer)
  24. * $permtoedit (used to replace test $user->rights->$element->creer)
  25. * $senderissupplier (0 by default, 1 for supplier invoices/orders)
  26. * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
  27. * $outputalsopricetotalwithtax
  28. * $usemargins (0 to disable all margins columns, 1 to show according to margin setup)
  29. * $object_rights->creer initialized from = $object->getRights()
  30. * $disableedit, $disablemove, $disableremove
  31. *
  32. * $text, $description, $line
  33. */
  34. // Protection to avoid direct call of template
  35. if (empty($object) || !is_object($object)) {
  36. print "Error, template page can't be called as URL";
  37. exit;
  38. }
  39. // add html5 elements
  40. $domData = ' data-element="'.$line->element.'"';
  41. $domData .= ' data-id="'.$line->id.'"';
  42. $coldisplay = 0;
  43. ?>
  44. <!-- BEGIN PHP TEMPLATE productattributevalueline_view.tpl.php -->
  45. <tr id="row-<?php print $line->id?>" class="drag drop oddeven" <?php print $domData; ?> >
  46. <?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
  47. <td class="linecolnum center"><span class="opacitymedium"><?php $coldisplay++; ?><?php print ($i + 1); ?></span></td>
  48. <?php } ?>
  49. <td class="linecolref nowrap"><?php $coldisplay++; ?><div id="line_<?php print $line->id; ?>"></div>
  50. <?php print $line->ref ?>
  51. </td>
  52. <td class="linecolvalue nowrap"><?php $coldisplay++; print $line->value ?></td>
  53. <?php
  54. if (!empty($object_rights->write) && $action != 'selectlines') {
  55. print '<td class="linecoledit center width25">';
  56. $coldisplay++;
  57. if (empty($disableedit)) { ?>
  58. <a class="editfielda reposition" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#line_'.$line->id; ?>">
  59. <?php print img_edit().'</a>';
  60. }
  61. print '</td>';
  62. print '<td class="linecoldelete center width25">';
  63. $coldisplay++;
  64. if (empty($disableremove)) { // For situation invoice, deletion is not possible if there is a parent company.
  65. print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=ask_deleteline&amp;lineid='.$line->id.'">';
  66. print img_delete();
  67. print '</a>';
  68. }
  69. print '</td>';
  70. if ($num > 1 && $conf->browser->layout != 'phone' && empty($disablemove)) {
  71. print '<td class="linecolmove tdlineupdown center width25">';
  72. $coldisplay++;
  73. if ($i > 0) { ?>
  74. <a class="lineupdown" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>">
  75. <?php print img_up('default', 0, 'imgupforline'); ?>
  76. </a>
  77. <?php }
  78. if ($i < $num - 1) { ?>
  79. <a class="lineupdown" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=down&amp;rowid='.$line->id; ?>">
  80. <?php print img_down('default', 0, 'imgdownforline'); ?>
  81. </a>
  82. <?php }
  83. print '</td>';
  84. } else {
  85. print '<td '.(($conf->browser->layout != 'phone' && empty($disablemove)) ? ' class="linecolmove tdlineupdown center"' : ' class="linecolmove center"').'></td>';
  86. $coldisplay++;
  87. }
  88. } else {
  89. print '<td colspan="3"></td>';
  90. $coldisplay = $coldisplay + 3;
  91. }
  92. if ($action == 'selectlines') { ?>
  93. <td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php print $i + 1; ?>]" value="<?php print $line->id; ?>" ></td>
  94. <?php }
  95. print "</tr>\n";
  96. print "<!-- END PHP TEMPLATE productattributevalueline_view.tpl.php -->\n";