card_create.tpl.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. /* Copyright (C) 2010-2018 Regis Houssin <regis.houssin@inodbox.com>
  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. // Protection to avoid direct call of template
  18. if (empty($conf) || !is_object($conf)) {
  19. print "Error, template page can't be called as URL";
  20. exit;
  21. }
  22. $object = $GLOBALS['object'];
  23. $statutarray = array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell"));
  24. ?>
  25. <!-- BEGIN PHP TEMPLATE CREATE.TPL -->
  26. <?php
  27. print load_fiche_titre($langs->trans("NewService"), '', 'service');
  28. print dol_get_fiche_head('');
  29. ?>
  30. <?php dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']); ?>
  31. <?php dol_htmloutput_errors($GLOBALS['mesg'], $GLOBALS['mesgs']); ?>
  32. <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
  33. <input type="hidden" name="token" value="<?php echo newToken(); ?>">
  34. <input type="hidden" name="action" value="add">
  35. <input type="hidden" name="type" value="1">
  36. <input type="hidden" name="canvas" value="<?php echo $canvas; ?>">
  37. <table class="border allwidth">
  38. <tr>
  39. <td class="fieldrequired" width="20%"><?php echo $langs->trans("Ref"); ?></td>
  40. <td><input name="ref" size="40" maxlength="32" value="<?php echo $object->ref; ?>">
  41. <?php if ($refalreadyexists == 1) {
  42. echo $langs->trans("RefAlreadyExists");
  43. } ?>
  44. </td></tr>
  45. <tr>
  46. <td class="fieldrequired"><?php echo $langs->trans("Label"); ?></td>
  47. <td><input name="label" size="40" value="<?php echo $object->label; ?>"></td>
  48. </tr>
  49. <tr>
  50. <td class="fieldrequired"><?php echo $langs->trans("Status").' ('.$langs->trans("Sell").')'; ?></td>
  51. <td><?php echo $form->selectarray('statut', $statutarray, $object->status); ?></td>
  52. </tr>
  53. <tr>
  54. <td class="fieldrequired"><?php echo $langs->trans("Status").' ('.$langs->trans("Buy").')'; ?></td>
  55. <td><?php echo $form->selectarray('statut_buy', $statutarray, $object->status_buy); ?></td>
  56. </tr>
  57. <tr><td><?php echo $langs->trans("Duration"); ?></td>
  58. <td><input name="duration_value" size="6" maxlength="5" value="<?php echo $object->duration_value; ?>"> &nbsp;
  59. <?php echo $object->duration_unit; ?>
  60. </td></tr>
  61. <tr><td class="tdtop"><?php echo $langs->trans("NoteNotVisibleOnBill"); ?></td><td>
  62. <?php echo $object->textarea_note; ?>
  63. </td></tr>
  64. </table>
  65. <br>
  66. <?php if (!$conf->global->PRODUIT_MULTIPRICES) { ?>
  67. <table class="border allwidth">
  68. <tr><td><?php echo $langs->trans("SellingPrice"); ?></td>
  69. <td><input name="price" size="10" value="<?php echo $object->price; ?>">
  70. <?php echo $object->price_base_type; ?>
  71. </td></tr>
  72. <tr><td><?php echo $langs->trans("MinPrice"); ?></td>
  73. <td><input name="price_min" size="10" value="<?php echo $object->price_min; ?>">
  74. </td></tr>
  75. <tr><td width="20%"><?php echo $langs->trans("VATRate"); ?></td><td>
  76. <?php echo $object->tva_tx; ?>
  77. </td></tr>
  78. </table>
  79. <br>
  80. <?php } ?>
  81. <div align="center"><input type="submit" class="button" value="<?php echo $langs->trans("Create"); ?>"></div>
  82. </form>
  83. <!-- END PHP TEMPLATE -->