productattributevalueline_create.tpl.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. * $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders)
  24. * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
  25. */
  26. // Protection to avoid direct call of template
  27. if (empty($object) || !is_object($object)) {
  28. print "Error: this template page cannot be called directly as an URL";
  29. exit;
  30. }
  31. global $forcetoshowtitlelines;
  32. // Define colspan for the button 'Add'
  33. $colspan = 3; // Columns: col edit + col delete + move button
  34. // Lines for extrafield
  35. $objectline = null;
  36. print "<!-- BEGIN PHP TEMPLATE productattributevalueline_create.tpl.php -->\n";
  37. $nolinesbefore = (count($this->lines) == 0 || $forcetoshowtitlelines);
  38. ?>
  39. <tr class="pair nodrag nodrop nohoverpair<?php echo $nolinesbefore ? '' : ' liste_titre_create'; ?>">
  40. <?php
  41. $coldisplay = 0;
  42. // Adds a line numbering column
  43. if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) {
  44. $coldisplay++;
  45. echo '<td class="nobottom linecolnum center"></td>';
  46. }
  47. $coldisplay++;
  48. ?>
  49. <td class="nobottom linecolref">
  50. <?php $coldisplay++; if ($nolinesbefore) {
  51. echo $langs->trans('Ref') . ': ';
  52. } ?>
  53. <input type="text" name="line_ref" id="line_ref" class="flat" value="<?php echo(GETPOSTISSET("line_ref") ? GETPOST("line_ref", 'alpha', 2) : ''); ?>" autofocus>
  54. <?php
  55. if (is_object($hookmanager)) {
  56. $parameters = array();
  57. $reshook = $hookmanager->executeHooks('formCreateValueOptions', $parameters, $object, $action);
  58. if (!empty($hookmanager->resPrint)) {
  59. print $hookmanager->resPrint;
  60. }
  61. }
  62. ?>
  63. </td>
  64. <td class="nobottom linecolvalue"><?php $coldisplay++; ?>
  65. <input type="text" name="line_value" id="line_value" class="flat" value="<?php echo(GETPOSTISSET("line_value") ? GETPOST("line_value", 'alpha', 2) : ''); ?>">
  66. </td>
  67. <td class="nobottom linecoledit center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay += $colspan; ?>
  68. <input type="submit" class="button reposition small" value="<?php echo $langs->trans('Add'); ?>" name="addline" id="addline">
  69. </td>
  70. </tr>
  71. <!-- END PHP TEMPLATE productattributevalueline_create.tpl.php -->