PageRenderTime 38ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/htdocs/core/tpl/freeproductline_create.tpl.php

https://github.com/asterix14/dolibarr
PHP | 90 lines | 57 code | 8 blank | 25 comment | 11 complexity | 87823d628ccff2e79494016df17e63fb MD5 | raw file
Possible License(s): LGPL-2.0
  1. <?php
  2. /* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
  3. * Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
  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 2 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 <http://www.gnu.org/licenses/>.
  17. *
  18. *
  19. * Need to have following variables defined:
  20. * $conf
  21. * $langs
  22. * $dateSelector
  23. * $this (invoice, order, ...)
  24. * $line defined
  25. */
  26. ?>
  27. <!-- BEGIN PHP TEMPLATE freeproductline_create.tpl.php -->
  28. <tr class="liste_titre nodrag nodrop">
  29. <td><a name="add"></a><?php echo $langs->trans('AddNewLine').' - '.$langs->trans("FreeZone"); ?></td>
  30. <td align="right"><?php echo $langs->trans('VAT'); ?></td>
  31. <td align="right"><?php echo $langs->trans('PriceUHT'); ?></td>
  32. <td align="right"><?php echo $langs->trans('Qty'); ?></td>
  33. <td align="right"><?php echo $langs->trans('ReductionShort'); ?></td>
  34. <td colspan="4">&nbsp;</td>
  35. </tr>
  36. <form name="addproduct" id="addproduct" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id; ?>#add" method="POST">
  37. <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
  38. <input type="hidden" name="action" value="addline" />
  39. <input type="hidden" name="id" value="<?php echo $this->id; ?>" />
  40. <tr <?php echo $bcnd[$var]; ?>>
  41. <td>
  42. <?php
  43. echo $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1);
  44. if (($conf->product->enabled && $conf->service->enabled) || (empty($conf->product->enabled) && empty($conf->service->enabled))) echo '<br>';
  45. if (is_object($hookmanager))
  46. {
  47. $parameters=array();
  48. echo $hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
  49. }
  50. // Editor wysiwyg
  51. require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
  52. $nbrows=ROWS_2;
  53. if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
  54. $doleditor=new DolEditor('dp_desc',$_POST["dp_desc"],'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
  55. $doleditor->Create();
  56. ?>
  57. </td>
  58. <td align="right">
  59. <?php
  60. if ($buyer->tva_assuj == "0") echo '<input type="hidden" name="np_tva_tx" value="0">0';
  61. else echo $form->load_tva('np_tva_tx', (isset($_POST["np_tva_tx"])?$_POST["np_tva_tx"]:-1), $seller, $buyer);
  62. ?>
  63. </td>
  64. <td align="right"><input type="text" size="5" name="np_price" value="<?php echo (isset($_POST["np_price"])?$_POST["np_price"]:''); ?>"></td>
  65. <td align="right"><input type="text" size="2" name="qty" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>"></td>
  66. <td align="right" nowrap><input type="text" size="1" value="<?php echo $buyer->remise_client; ?>" name="remise_percent">%</td>
  67. <td align="center" valign="middle" colspan="4"><input type="submit" class="button" value="<?php echo $langs->trans('Add'); ?>" name="addline"></td>
  68. </tr>
  69. <?php if ($conf->service->enabled && $dateSelector) { ?>
  70. <tr <?php echo $bcnd[$var]; ?>>
  71. <td colspan="9">
  72. <?php
  73. echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
  74. echo $form->select_date('','date_start',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addproduct");
  75. echo ' '.$langs->trans('to').' ';
  76. echo $form->select_date('','date_end',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addproduct");
  77. ?>
  78. </td>
  79. </tr>
  80. <?php } ?>
  81. </form>
  82. <!-- END PHP TEMPLATE freeproductline_create.tpl.php -->