own_add.tpl.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /* Copyright (C) 2014 Maxime Kohlhaas <support@atm-consulting.fr>
  3. * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. *
  18. * Need to have following variables defined:
  19. * $object (invoice, order, ...)
  20. * $action
  21. * $conf
  22. * $langs
  23. *
  24. * $parameters
  25. * $cols
  26. */
  27. // Protection to avoid direct call of template
  28. if (empty($conf) || !is_object($conf)) {
  29. print "Error, template page can't be called as URL";
  30. exit;
  31. }
  32. ?>
  33. <!-- BEGIN PHP TEMPLATE extrafields_add.tpl.php -->
  34. <?php
  35. // Other attributes
  36. print '<tr id="freeUsers" style="display:none;"><td>' . $langs->trans('freeusers') . '</td><td class="valuefieldcreate">
  37. <select id="fk_user" class="flat minwidth300imp" name="fk_user" data-select2-id="fk_user" tabindex="-1" aria-hidden="true">
  38. <option value="" data-select2-id="100">&nbsp;</option>';
  39. foreach($freeUsers['freeUsers'] as $user){
  40. print '<option value="' . $user['rowid'] . '">' . $user['lastname'] . ' ' . $user['firstname']. ' (' .$user['login']. ')</option>';
  41. }
  42. print '</select>
  43. </td></tr>';
  44. print '<tr id="freeHotels" style="display:none;"><td>' . $langs->trans('freehotels') . '</td><td class="valuefieldcreate">
  45. <select id="hotel" class="flat minwidth300imp" name="hotel" data-select2-id="hotel" tabindex="-1" aria-hidden="true">
  46. <option value="" data-select2-id="100">&nbsp;</option>';
  47. foreach($freeHotels['freeHotels'] as $hotel){
  48. print '<option value="' . $hotel['rowid'] . '">' . $hotel['label'] . '</option>';
  49. }
  50. print '</select>
  51. </td></tr>';
  52. ?>
  53. <!-- END PHP TEMPLATE extrafields_add.tpl.php -->