From 7ca0aa8a784a9141662f1aa131088bc8768aa5f7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 27 Aug 2012 17:23:35 +0200 Subject: [PATCH] Fix: restore deprecated files --- .../core/tpl/freeproductline_create.tpl.php | 127 +++++++++++++ htdocs/core/tpl/freeproductline_edit.tpl.php | 101 ++++++++++ htdocs/core/tpl/freeproductline_view.tpl.php | 142 ++++++++++++++ .../tpl/predefinedproductline_create.tpl.php | 173 ++++++++++++++++++ .../tpl/predefinedproductline_edit.tpl.php | 164 +++++++++++++++++ .../tpl/predefinedproductline_view.tpl.php | 111 +++++++++++ 6 files changed, 818 insertions(+) create mode 100644 htdocs/core/tpl/freeproductline_create.tpl.php create mode 100644 htdocs/core/tpl/freeproductline_edit.tpl.php create mode 100644 htdocs/core/tpl/freeproductline_view.tpl.php create mode 100644 htdocs/core/tpl/predefinedproductline_create.tpl.php create mode 100644 htdocs/core/tpl/predefinedproductline_edit.tpl.php create mode 100644 htdocs/core/tpl/predefinedproductline_view.tpl.php diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php new file mode 100644 index 00000000000..dd2014df079 --- /dev/null +++ b/htdocs/core/tpl/freeproductline_create.tpl.php @@ -0,0 +1,127 @@ + + * Copyright (C) 2010-2011 Laurent Destailleur + * Copyright (C) 2012 Christophe Battarel + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + * Need to have following variables defined: + * $conf + * $langs + * $dateSelector + * $this (invoice, order, ...) + * $line defined + */ +?> + + + + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
trans('AddNewLine').' - '.$langs->trans("FreeZone"); ?> + trans('VAT'); ?> + trans('PriceUHT'); ?> + trans('Qty'); ?> + trans('ReductionShort'); ?> +margin->enabled)) { +?> + trans('BuyingPrice'); ?> +global->DISPLAY_MARGIN_RATES) + $colspan++; + if($conf->global->DISPLAY_MARK_RATES) + $colspan++; +} +?> +   + + +
" /> + + + +> + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> + select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1); + if (($conf->product->enabled && $conf->service->enabled) || (empty($conf->product->enabled) && empty($conf->service->enabled))) echo '
'; + + if (is_object($hookmanager)) + { + $parameters=array(); + $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); + } + + // Editor wysiwyg + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $nbrows=ROWS_2; + if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; + $doleditor=new DolEditor('dp_desc',$_POST["dp_desc"],'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); + $doleditor->Create(); + ?> + + + + tva_assuj == "0") echo '0'; + else echo $form->load_tva('np_tva_tx', (isset($_POST["np_tva_tx"])?$_POST["np_tva_tx"]:-1), $seller, $buyer); + ?> + + "> + "> + % +margin->enabled)) { +?> + "> +global->DISPLAY_MARGIN_RATES) + $colspan++; + if($conf->global->DISPLAY_MARK_RATES) + $colspan++; +} +?> + + + + +service->enabled && $dateSelector) { +if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) + $colspan = 10; +else + $colspan = 9; +if (! empty($conf->margin->enabled)) { + if($conf->global->DISPLAY_MARGIN_RATES) + $colspan++; + if($conf->global->DISPLAY_MARK_RATES) + $colspan++; +} +?> +> + + trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; + echo $form->select_date('','date_start',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addproduct"); + echo ' '.$langs->trans('to').' '; + echo $form->select_date('','date_end',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addproduct"); + ?> + + + + + + diff --git a/htdocs/core/tpl/freeproductline_edit.tpl.php b/htdocs/core/tpl/freeproductline_edit.tpl.php new file mode 100644 index 00000000000..6a5e6e7ef30 --- /dev/null +++ b/htdocs/core/tpl/freeproductline_edit.tpl.php @@ -0,0 +1,101 @@ + + * Copyright (C) 2010-2012 Laurent Destailleur + * Copyright (C) 2012 Christophe Battarel + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + * Need to have following variables defined: + * $conf + * $langs + * $dateSelector + * $this (invoice, order, ...) + * $line defined + */ +?> + + +
id; ?>" method="POST"> + + + + + + +> + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> +
+ + $line,'fk_parent_line'=>$line->fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer); + $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); + } + + // editeur wysiwyg + $nbrows=ROWS_2; + if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor('desc',$line->description,'',164,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); + $doleditor->Create(); + ?> + + + load_tva('tva_tx',$line->tva_tx,$seller,$buyer,0,$line->info_bits,$line->product_type); ?> + + + + + info_bits & 2) != 2) { ?> + + +   + + + + + info_bits & 2) != 2) { ?> + % + +   + + + +margin->enabled)) { +?> + + + "> +
"> + + +service->enabled && $dateSelector && $line->product_type == 1) { ?> +> + trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> + 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"); + echo ' '.$langs->trans('to').' '; + 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"); + ?> + + + + + + diff --git a/htdocs/core/tpl/freeproductline_view.tpl.php b/htdocs/core/tpl/freeproductline_view.tpl.php new file mode 100644 index 00000000000..e5746c52d58 --- /dev/null +++ b/htdocs/core/tpl/freeproductline_view.tpl.php @@ -0,0 +1,142 @@ + + * Copyright (C) 2010-2011 Laurent Destailleur + * Copyright (C) 2012 Christophe Battarel + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +?> + + +> + global->MAIN_VIEW_LINE_NUMBER)) { ?> + + +
+ info_bits & 2) == 2) { ?> + + trans("ShowReduc"),'reduc').' '; + if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); + //else $txt=$langs->trans("Discount"); + print $txt; + ?> + + description) + { + if ($line->description == '(CREDIT_NOTE)') + { + $discount=new DiscountAbsolute($this->db); + $discount->fetch($line->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); + } + elseif ($line->description == '(DEPOSIT)') + { + $discount=new DiscountAbsolute($this->db); + $discount->fetch($line->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); + // Add date of deposit + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; + } + else + { + echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); + } + } + } + else + { + if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); + if ($type==1) $text = img_object($langs->trans('Service'),'service'); + else $text = img_object($langs->trans('Product'),'product'); + echo $text.' '.dol_htmlentitiesbr($line->description); + // Show range + print_date_range($line->date_start,$line->date_end); + } + ?> + + + tva_tx,'%',$line->info_bits); ?> + + subprice); ?> + + + info_bits & 2) != 2) && $line->special_code != 3) echo $line->qty; + else echo ' '; ?> + + + remise_percent) && $line->special_code != 3) { ?> + remise_percent,$langs); ?> + +   + margin->enabled)) { + ?> + pa_ht); ?> + global->DISPLAY_MARGIN_RATES) {?> + pa_ht == 0)?'n/a':price($line->marge_tx).'%'); ?> + global->DISPLAY_MARK_RATES) {?> + marque_tx).'%'; ?> + + + special_code == 3) { ?> + trans('Option'); ?> + + total_ht); ?> + + + statut == 0 && $user->rights->$element->creer) { ?> + + info_bits & 2) == 2) { ?> + + id.'#'.$line->id; ?>"> + + + + + + + id; ?>"> + + + + + 1) { ?> + + 0) { ?> + id; ?>"> + + + + + id; ?>"> + + + + + +   + + +   + + + + diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php new file mode 100644 index 00000000000..35ca0e16cf3 --- /dev/null +++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php @@ -0,0 +1,173 @@ + + * Copyright (C) 2010-2011 Laurent Destailleur + * Copyright (C) 2012 Christophe Battarel + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + * Need to have following variables defined: + * $conf + * $langs + * $dateSelector + * $this (invoice, order, ...) + * $line defined + */ +?> + + + + + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="4"' : ' colspan="3"'); ?>> + trans("AddNewLine").' - '; + if ($conf->service->enabled) + echo $langs->trans('RecordedProductsAndServices'); + else + echo $langs->trans('RecordedProducts'); + ?> + + trans('Qty'); ?> + trans('ReductionShort'); ?> +margin->enabled)) { +?> + trans('BuyingPrice'); ?> +global->DISPLAY_MARGIN_RATES) + $colspan++; + if($conf->global->DISPLAY_MARK_RATES) + $colspan++; +} +?> +   + + +
" /> + + + + + +> + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="4"' : ' colspan="3"'); ?>> + select_produits('','idprod','',$conf->product->limit_size,$buyer->price_level); + + if (is_object($hookmanager)) + { + $parameters=array('fk_parent_line'=>$_POST["fk_parent_line"]); + $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); + } + + // Editor wysiwyg + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $nbrows=ROWS_2; + if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; + $doleditor=new DolEditor('np_desc',$_POST["np_desc"],'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); + $doleditor->Create(); + ?> + + + % +margin->enabled)) { +?> + + + "> + +global->DISPLAY_MARGIN_RATES) + $colspan++; + if($conf->global->DISPLAY_MARK_RATES) + $colspan++; +} +?> + " name="addline"> + + +service->enabled) && $dateSelector) { +if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) + $colspan = 10; +else + $colspan = 9; +if (! empty($conf->margin->enabled)) { + if($conf->global->DISPLAY_MARGIN_RATES) + $colspan++; + if($conf->global->DISPLAY_MARK_RATES) + $colspan++; +} +?> +> + + trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; + echo $form->select_date('','date_start_predef',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addpredefinedproduct"); + echo ' '.$langs->trans('to').' '; + echo $form->select_date('','date_end_predef',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addpredefinedproduct"); + ?> + + + + + +margin->enabled)) { +?> + + + diff --git a/htdocs/core/tpl/predefinedproductline_edit.tpl.php b/htdocs/core/tpl/predefinedproductline_edit.tpl.php new file mode 100644 index 00000000000..4c9cd208eee --- /dev/null +++ b/htdocs/core/tpl/predefinedproductline_edit.tpl.php @@ -0,0 +1,164 @@ + + * Copyright (C) 2010-2011 Laurent Destailleur + * Copyright (C) 2012 Christophe Battarel + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + * Need to have following variables defined: + * $conf + * $langs + * $dateSelector + * $this (invoice, order, ...) + * $line defined + */ +?> + + +
id; ?>" method="POST"> + + + + + +> + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> +
+ + + product_type==1) echo img_object($langs->trans('ShowService'),'service'); + else print img_object($langs->trans('ShowProduct'),'product'); + echo ' '.$line->ref; + ?> + + product_label); + echo '
'; + + if (is_object($hookmanager)) + { + $fk_parent_line = ($_POST["fk_parent_line"] ? $_POST["fk_parent_line"] : $line->fk_parent_line); + $parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer); + $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); + } + + // editeur wysiwyg + $nbrows=ROWS_2; + if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor('desc',$line->description,'',164,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); + $doleditor->Create(); + ?> + + + load_tva('tva_tx',$line->tva_tx,$seller,$buyer,'',$line->info_bits); ?> + + + + + + + info_bits & 2) != 2) { ?> + +   + + + + info_bits & 2) != 2) { ?> + % + +   + + +margin->enabled)) { +?> + + + + + + + + ">
+ "> + + + +service->enabled && $dateSelector && $line->product_type == 1) { ?> +> + trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> + 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"); + echo ' '.$langs->trans('to').' '; + 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"); + ?> + + + +margin->enabled)) { +?> + + + diff --git a/htdocs/core/tpl/predefinedproductline_view.tpl.php b/htdocs/core/tpl/predefinedproductline_view.tpl.php new file mode 100644 index 00000000000..5aef6995f74 --- /dev/null +++ b/htdocs/core/tpl/predefinedproductline_view.tpl.php @@ -0,0 +1,111 @@ + + * Copyright (C) 2010-2011 Laurent Destailleur + * Copyright (C) 2012 Christophe Battarel + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +?> + + +> + global->MAIN_VIEW_LINE_NUMBER)) { ?> + + +
+ textwithtooltip($text,$description,3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):'')); + + // Show range + print_date_range($line->date_start, $line->date_end); + + // Add description in form + if ($conf->global->PRODUIT_DESC_IN_FORM) + { + print ($line->description && $line->description!=$line->product_label)?'
'.dol_htmlentitiesbr($line->description):''; + } + ?> + + + tva_tx,'%',$line->info_bits); ?> + + subprice); ?> + + + info_bits & 2) != 2) && $line->special_code != 3) echo $line->qty; + else echo ' '; ?> + + + remise_percent) && $line->special_code != 3) { ?> + remise_percent,$langs); ?> + +   + margin->enabled)) { + ?> + pa_ht); ?> + global->DISPLAY_MARGIN_RATES) {?> + pa_ht == 0)?'n/a':price($line->marge_tx).'%'); ?> + global->DISPLAY_MARK_RATES) {?> + marque_tx).'%'; ?> + + + special_code == 3) { ?> + trans('Option'); ?> + + total_ht); ?> + + + statut == 0 && $user->rights->$element->creer) { ?> + + info_bits & 2) == 2) { ?> + + id.'#'.$line->id; ?>"> + + + + + + + id; ?>"> + + + + + 1) { ?> + + 0) { ?> + id; ?>"> + + + + + id; ?>"> + + + + + +   + + +   + + + +