productattributevalueline_edit.tpl.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. * $seller, $buyer
  22. * $dateSelector
  23. * $forceall (0 by default, 1 for supplier invoices/orders)
  24. * $senderissupplier (0 by default, 1 for supplier invoices/orders)
  25. * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
  26. * $canchangeproduct (0 by default, 1 to allow to change the product if it is a predefined product)
  27. */
  28. // Protection to avoid direct call of template
  29. if (empty($object) || !is_object($object)) {
  30. print "Error, template page can't be called as URL";
  31. exit;
  32. }
  33. // Define colspan for the button 'Add'
  34. $colspan = 3; // Column: col edit + col delete + move button
  35. print "<!-- BEGIN PHP TEMPLATE productattributevalueline_edit.tpl.php -->\n";
  36. $coldisplay = 0;
  37. ?>
  38. <tr class="oddeven tredited">
  39. <?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
  40. <td class="linecolnum center"><?php $coldisplay++; ?><?php echo ($i + 1); ?></td>
  41. <?php }
  42. $coldisplay++;
  43. ?>
  44. <td class="nobottom linecolref">
  45. <div id="line_<?php echo $line->id; ?>"></div>
  46. <input type="hidden" name="lineid" value="<?php echo $line->id; ?>">
  47. <?php $coldisplay++; ?>
  48. <input type="text" name="line_ref" id="line_ref" class="flat" value="<?php echo (GETPOSTISSET("line_ref") ? GETPOST("line_ref", 'alpha', 2) : $line->ref); ?>">
  49. <?php
  50. if (is_object($hookmanager)) {
  51. $parameters = array('line'=>$line);
  52. $reshook = $hookmanager->executeHooks('formEditProductOptions', $parameters, $object, $action);
  53. if (!empty($hookmanager->resPrint)) {
  54. print $hookmanager->resPrint;
  55. }
  56. }
  57. ?>
  58. </td>
  59. <td class="nobottom linecolvalue"><?php $coldisplay++; ?>
  60. <input type="text" name="line_value" id="line_value" class="flat" value="<?php echo (GETPOSTISSET("line_value") ? GETPOST("line_value", 'alpha', 2) : $line->value); ?>">
  61. </td>
  62. <!-- colspan for this td because it replace td for buttons+... -->
  63. <td class="center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay += $colspan; ?>
  64. <input type="submit" class="button buttongen marginbottomonly button-save" id="savelinebutton marginbottomonly" name="save" value="<?php echo $langs->trans("Save"); ?>"><br>
  65. <input type="submit" class="button buttongen marginbottomonly button-cancel" id="cancellinebutton" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
  66. </td>
  67. </tr>
  68. <!-- END PHP TEMPLATE productattributevalueline_edit.tpl.php -->