PageRenderTime 702ms CodeModel.GetById 17ms RepoModel.GetById 20ms app.codeStats 0ms

/htdocs/core/tpl/predefinedproductline_edit.tpl.php

https://github.com/asterix14/dolibarr
PHP | 103 lines | 68 code | 10 blank | 25 comment | 14 complexity | 2908eafb897f6a62df48eac0d5d1cc63 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 predefinedproductline_edit.tpl.php -->
  28. <form action="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'#'.$line->id; ?>" method="POST">
  29. <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
  30. <input type="hidden" name="action" value="updateligne" />
  31. <input type="hidden" name="id" value="<?php echo $this->id; ?>" />
  32. <input type="hidden" name="lineid" value="<?php echo $line->id; ?>" />
  33. <tr <?php echo $bc[$var]; ?>>
  34. <td>
  35. <a name="<?php echo $line->id; ?>"></a>
  36. <input type="hidden" name="productid" value="<?php echo $line->fk_product; ?>" />
  37. <a href="<?php echo DOL_URL_ROOT.'/product/fiche.php?id='.$line->fk_product; ?>">
  38. <?php
  39. if ($line->product_type==1) echo img_object($langs->trans('ShowService'),'service');
  40. else print img_object($langs->trans('ShowProduct'),'product');
  41. echo ' '.$line->ref;
  42. ?>
  43. </a>
  44. <?php
  45. echo ' - '.nl2br($line->product_label);
  46. echo '<br>';
  47. if (is_object($hookmanager))
  48. {
  49. $fk_parent_line = ($_POST["fk_parent_line"] ? $_POST["fk_parent_line"] : $line->fk_parent_line);
  50. $parameters=array('fk_parent_line'=>$fk_parent_line);
  51. echo $hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action);
  52. }
  53. // editeur wysiwyg
  54. $nbrows=ROWS_2;
  55. if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
  56. require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
  57. $doleditor=new DolEditor('desc',$line->description,'',164,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
  58. $doleditor->Create();
  59. ?>
  60. </td>
  61. <td align="right"><?php echo $form->load_tva('tva_tx',$line->tva_tx,$seller,$buyer,'',$line->info_bits); ?></td>
  62. <td align="right">
  63. <input size="6" type="text" class="flat" name="subprice" value="<?php echo price($line->subprice,0,'',0); ?>" />
  64. </td>
  65. <td align="right">
  66. <?php if (($line->info_bits & 2) != 2) { ?>
  67. <input size="2" type="text" class="flat" name="qty" value="<?php echo $line->qty; ?>" />
  68. <?php } else { ?> &nbsp; <?php } ?>
  69. </td>
  70. <td align="right" nowrap>
  71. <?php if (($line->info_bits & 2) != 2) { ?>
  72. <input size="1" type="text" class="flat" name="remise_percent" value="<?php echo $line->remise_percent; ?>" />%
  73. <?php } else { ?>
  74. &nbsp;
  75. <?php } ?>
  76. </td>
  77. <td align="center" colspan="5" valign="middle">
  78. <input type="submit" class="button" name="save" value="<?php echo $langs->trans("Save"); ?>"><br>
  79. <input type="submit" class="button" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
  80. </td>
  81. </tr>
  82. <?php if ($conf->service->enabled && $dateSelector && $line->product_type == 1) { ?>
  83. <tr <?php echo $bc[$var]; ?>>
  84. <td colspan="9"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?>
  85. <?php
  86. echo $form->select_date($line->date_start,'date_start',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$line->date_start?0:1,"updateligne");
  87. echo ' '.$langs->trans('to').' ';
  88. echo $form->select_date($line->date_end,'date_end',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$line->date_end?0:1,"updateligne");
  89. ?>
  90. </td>
  91. </tr>
  92. <?php } ?></form>
  93. <!-- END PHP TEMPLATE predefinedproductline_edit.tpl.php -->