";
+
+ print '';
+
+ print ' ';
+
+ // Contacts lines (modules that overwrite templates must declare this into descriptor)
+ $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
+ foreach($dirtpls as $reldir)
+ {
+ $res=@include dol_buildpath($reldir.'/contacts.tpl.php');
+ if ($res) break;
+ }
}
llxFooter();
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 509ef57a856..579472db09c 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -525,8 +525,16 @@ else if ($action == 'addline' && $user->rights->commande->creer)
$error = false;
$idprod=GETPOST('idprod', 'int');
+ $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):'')));
+ $price_ht = GETPOST('price_ht');
+ $np_price = GETPOST('np_price');
- if ((empty($idprod) || GETPOST('update_price')) && (GETPOST('price_ht') < 0) && (GETPOST('qty') < 0))
+ if ($conf->global->MAIN_FEATURES_LEVEL > 1 && (empty($idprod) || GETPOST('update_price')) && ($price_ht < 0) && (GETPOST('qty') < 0))
+ {
+ setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors');
+ $error = true;
+ }
+ else if (empty($idprod) && ($np_price < 0) && (GETPOST('qty') < 0))
{
setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors');
$error = true;
@@ -536,27 +544,33 @@ else if ($action == 'addline' && $user->rights->commande->creer)
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors');
$error = true;
}
- if (empty($idprod) && (!(GETPOST('price_ht') >= 0) || GETPOST('price_ht') == '')) // Unit price can be 0 but not ''
+ if ($conf->global->MAIN_FEATURES_LEVEL > 1 && empty($idprod) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not ''
{
- setEventMessage($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPriceHT'))), 'errors');
- $error = true;
+ setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors');
+ $error++;
+ }
+ else if (empty($idprod) && (!($np_price >= 0) || $np_price == '')) // Unit price can be 0 but not ''
+ {
+ setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors');
+ $error++;
}
if (! GETPOST('qty') && GETPOST('qty') == '')
{
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors');
$error = true;
}
- if (empty($idprod) && ! GETPOST('product_desc'))
+ if (empty($idprod) && empty($product_desc))
{
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
$error = true;
}
- if (! $error && (GETPOST('qty') >= 0) && (GETPOST('product_desc') || ! empty($idprod)))
+ if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod)))
{
// Clean parameters
- $date_start=dol_mktime(0, 0, 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
- $date_end=dol_mktime(0, 0, 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
+ $predef=((! empty($idprod) && $conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : '');
+ $date_start=dol_mktime(0, 0, 0, GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
+ $date_end=dol_mktime(0, 0, 0, GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
$price_base_type = 'HT';
// Ecrase $pu par celui du produit
@@ -621,7 +635,7 @@ else if ($action == 'addline' && $user->rights->commande->creer)
if (GETPOST('update_desc')) {
- $desc = (GETPOST('product_desc')?GETPOST('product_desc'):'');
+ $desc = $product_desc;
} else {
@@ -645,8 +659,8 @@ else if ($action == 'addline' && $user->rights->commande->creer)
$desc = $prod->description;
}
- $desc.= ($desc && GETPOST('product_desc')) ? ((dol_textishtml($desc) || dol_textishtml(GETPOST('product_desc')))?" \n":"\n") : "";
- $desc.= GETPOST('product_desc');
+ $desc.= ($desc && ! empty($product_desc)) ? ((dol_textishtml($desc) || dol_textishtml($product_desc))?" \n":"\n") : "";
+ $desc.= $product_desc;
}
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label'):'');
@@ -655,17 +669,18 @@ else if ($action == 'addline' && $user->rights->commande->creer)
}
else
{
- $pu_ht=GETPOST('price_ht');
- $tva_tx=str_replace('*','',GETPOST('tva_tx'));
- $tva_npr=preg_match('/\*/',GETPOST('tva_tx'))?1:0;
+ $pu_ht=($price_ht?$price_ht:$np_price);
+ $rate=GETPOST('tva_tx')?GETPOST('tva_tx'):GETPOST('np_tva_tx');
+ $tva_tx=str_replace('*','',$rate);
+ $tva_npr=preg_match('/\*/',$rate)?1:0;
$label=(GETPOST('product_label')?GETPOST('product_label'):'');
- $desc=GETPOST('product_desc');
+ $desc=$product_desc;
$type=GETPOST('type');
}
// Margin
- $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
- $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):'');
+ $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):(GETPOST('np_fournprice')?GETPOST('np_fournprice'):''));
+ $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):(GETPOST('np_buying_price')?GETPOST('np_buying_price'):''));
// Local Taxes
$localtax1_tx= get_localtax($tva_tx, 1, $object->client);
@@ -739,6 +754,13 @@ else if ($action == 'addline' && $user->rights->commande->creer)
unset($_POST['product_desc']);
unset($_POST['fournprice']);
unset($_POST['buying_price']);
+
+ // old method
+ unset($_POST['np_price']);
+ unset($_POST['np_desc']);
+ unset($_POST['dp_desc']);
+ unset($_POST['np_fournprice']);
+ unset($_POST['np_buying_price']);
}
else
{
@@ -2145,7 +2167,23 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
{
$var=true;
- $object->formAddObjectLine(1,$mysoc,$soc,$hookmanager);
+ if ($conf->global->MAIN_FEATURES_LEVEL > 1)
+ {
+ // Add free or predefined products/services
+ $object->formAddObjectLine(1,$mysoc,$soc,$hookmanager);
+ }
+ else
+ {
+ // Add free products/services
+ $object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager);
+
+ // Add predefined products/services
+ if ($conf->product->enabled || $conf->service->enabled)
+ {
+ $var=!$var;
+ $object->formAddPredefinedProduct(1,$mysoc,$soc,$hookmanager);
+ }
+ }
$parameters=array();
$reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 8d7c10787b3..383e12e2ed8 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -948,10 +948,18 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
$error = false;
$idprod=GETPOST('idprod', 'int');
+ $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):'')));
+ $price_ht = GETPOST('price_ht');
+ $np_price = GETPOST('np_price');
- if ((empty($idprod) || GETPOST('update_price')) && (GETPOST('price_ht') < 0) && (GETPOST('qty') < 0))
+ if ($conf->global->MAIN_FEATURES_LEVEL > 1 && (empty($idprod) || GETPOST('update_price')) && ($price_ht < 0) && (GETPOST('qty') < 0))
{
- setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors');
+ setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors');
+ $error = true;
+ }
+ else if (empty($idprod) && ($np_price < 0) && (GETPOST('qty') < 0))
+ {
+ setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors');
$error = true;
}
if (empty($idprod) && GETPOST('type') < 0)
@@ -959,23 +967,28 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors');
$error = true;
}
- if (empty($idprod) && (!(GETPOST('price_ht') >= 0) || GETPOST('price_ht') == '')) // Unit price can be 0 but not ''
- {
- setEventMessage($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPriceHT'))), 'errors');
- $error = true;
- }
+ if ($conf->global->MAIN_FEATURES_LEVEL > 1 && empty($idprod) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not ''
+ {
+ setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors');
+ $error++;
+ }
+ else if (empty($idprod) && (!($np_price >= 0) || $np_price == '')) // Unit price can be 0 but not ''
+ {
+ setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors');
+ $error++;
+ }
if (! GETPOST('qty') && GETPOST('qty') == '')
{
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors');
$error = true;
}
- if (empty($idprod) && ! GETPOST('product_desc'))
+ if (empty($idprod) && empty($product_desc))
{
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
$error = true;
}
- if (! $error && (GETPOST('qty') >= 0) && (GETPOST('product_desc') || ! empty($idprod)))
+ if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod)))
{
$ret=$object->fetch($id);
if ($ret < 0)
@@ -986,8 +999,9 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
$ret=$object->fetch_thirdparty();
// Clean parameters
- $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
- $date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
+ $predef=((! empty($idprod) && $conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : '');
+ $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
+ $date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
$price_base_type = 'HT';
// Ecrase $pu par celui du produit
@@ -1052,7 +1066,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
if (GETPOST('update_desc')) {
- $desc = (GETPOST('product_desc')?GETPOST('product_desc'):'');
+ $desc = $product_desc;
} else {
@@ -1076,8 +1090,8 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
$desc = $prod->description;
}
- $desc.= ($desc && GETPOST('product_desc')) ? ((dol_textishtml($desc) || dol_textishtml(GETPOST('product_desc')))?" \n":"\n") : "";
- $desc.= GETPOST('product_desc');
+ $desc.= ($desc && ! empty($product_desc)) ? ((dol_textishtml($desc) || dol_textishtml($product_desc))?" \n":"\n") : "";
+ $desc.= $product_desc;
}
if (! empty($prod->customcode) || ! empty($prod->country_code))
@@ -1096,17 +1110,18 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
}
else
{
- $pu_ht=GETPOST('price_ht');
- $tva_tx=str_replace('*','',GETPOST('tva_tx'));
- $tva_npr=preg_match('/\*/',GETPOST('tva_tx'))?1:0;
+ $pu_ht=($price_ht?$price_ht:$np_price);
+ $rate=GETPOST('tva_tx')?GETPOST('tva_tx'):GETPOST('np_tva_tx');
+ $tva_tx=str_replace('*','',$rate);
+ $tva_npr=preg_match('/\*/',$rate)?1:0;
$label=(GETPOST('product_label')?GETPOST('product_label'):'');
- $desc=GETPOST('product_desc');
+ $desc=$product_desc;
$type=GETPOST('type');
}
// Margin
- $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
- $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):'');
+ $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):(GETPOST('np_fournprice')?GETPOST('np_fournprice'):''));
+ $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):(GETPOST('np_buying_price')?GETPOST('np_buying_price'):''));
// Local Taxes
$localtax1_tx= get_localtax($tva_tx, 1, $object->client);
@@ -1181,6 +1196,13 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
unset($_POST['product_desc']);
unset($_POST['fournprice']);
unset($_POST['buying_price']);
+
+ // old method
+ unset($_POST['np_price']);
+ unset($_POST['np_desc']);
+ unset($_POST['dp_desc']);
+ unset($_POST['np_fournprice']);
+ unset($_POST['np_buying_price']);
}
else
{
@@ -3009,7 +3031,23 @@ else if ($id > 0 || ! empty($ref))
{
$var=true;
- $object->formAddObjectLine(1,$mysoc,$soc,$hookmanager);
+ if ($conf->global->MAIN_FEATURES_LEVEL > 1)
+ {
+ // Add free or predefined products/services
+ $object->formAddObjectLine(1,$mysoc,$soc,$hookmanager);
+ }
+ else
+ {
+ // Add free products/services
+ $object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager);
+
+ // Add predefined products/services
+ if ($conf->product->enabled || $conf->service->enabled)
+ {
+ $var=!$var;
+ $object->formAddPredefinedProduct(1,$mysoc,$soc,$hookmanager);
+ }
+ }
$parameters=array();
$reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
diff --git a/htdocs/core/ajax/price.php b/htdocs/core/ajax/price.php
index 79f7d1f439b..306519fda94 100644
--- a/htdocs/core/ajax/price.php
+++ b/htdocs/core/ajax/price.php
@@ -49,18 +49,18 @@ if (! empty($output) && isset($amount) && isset($tva_tx))
if (is_numeric($amount) && $amount != '')
{
- if ($output == 'price_ttc') {
-
- $price = price2num($amount * (1 + ($tva_tx/100)), 'MU');
- $return['price_ht'] = $amount;
- $return['price_ttc'] = (isset($price) && $price != '' ? price($price) : '');
-
- }
- else if ($output == 'price_ht') {
-
- $price = price2num($amount / (1 + ($tva_tx/100)), 'MU');
- $return['price_ht'] = (isset($price) && $price != '' ? price($price) : '');
- $return['price_ttc'] = ($tva_tx == 0 ? $price : $amount);
+ if ($output == 'price_ttc') {
+
+ $price = price2num($amount * (1 + ($tva_tx/100)), 'MU');
+ $return['price_ht'] = $amount;
+ $return['price_ttc'] = (isset($price) && $price != '' ? price($price) : '');
+
+ }
+ else if ($output == 'price_ht') {
+
+ $price = price2num($amount / (1 + ($tva_tx/100)), 'MU');
+ $return['price_ht'] = (isset($price) && $price != '' ? price($price) : '');
+ $return['price_ttc'] = ($tva_tx == 0 ? $price : $amount);
}
}
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 0f536a7c746..1fc0023ac3a 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -2444,46 +2444,46 @@ abstract class CommonObject
/* This is to show add lines */
- /**
- * Show add predefined products/services form
- * TODO Edit templates to use global variables and include them directly in controller call
- * But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
- *
- * @param int $dateSelector 1=Show also date range input fields
- * @param Societe $seller Object thirdparty who sell
- * @param Societe $buyer Object thirdparty who buy
- * @param HookManager $hookmanager Hook manager instance
+ /**
+ * Show add predefined products/services form
+ * TODO Edit templates to use global variables and include them directly in controller call
+ * But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
+ *
+ * @param int $dateSelector 1=Show also date range input fields
+ * @param Societe $seller Object thirdparty who sell
+ * @param Societe $buyer Object thirdparty who buy
+ * @param HookManager $hookmanager Hook manager instance
* @return void
- * @deprecated
- */
- function formAddPredefinedProduct($dateSelector,$seller,$buyer,$hookmanager=false)
- {
- global $conf,$langs,$object;
- global $form,$bcnd,$var;
-
- // Use global variables + $dateSelector + $seller and $buyer
- include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_create.tpl.php');
- }
-
- /**
- * Show add free products/services form
- * TODO Edit templates to use global variables and include them directly in controller call
- * But for the moment we don't know if it'st possible as we keep a method available on overloaded objects.
- *
- * @param int $dateSelector 1=Show also date range input fields
- * @param Societe $seller Object thirdparty who sell
- * @param Societe $buyer Object thirdparty who buy
- * @param HookManager $hookmanager Hook manager instance
+ * @deprecated
+ */
+ function formAddPredefinedProduct($dateSelector,$seller,$buyer,$hookmanager=false)
+ {
+ global $conf,$langs,$object;
+ global $form,$bcnd,$var;
+
+ // Use global variables + $dateSelector + $seller and $buyer
+ include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_create.tpl.php');
+ }
+
+ /**
+ * Show add free products/services form
+ * TODO Edit templates to use global variables and include them directly in controller call
+ * But for the moment we don't know if it'st possible as we keep a method available on overloaded objects.
+ *
+ * @param int $dateSelector 1=Show also date range input fields
+ * @param Societe $seller Object thirdparty who sell
+ * @param Societe $buyer Object thirdparty who buy
+ * @param HookManager $hookmanager Hook manager instance
* @return void
- * @deprecated
- */
- function formAddFreeProduct($dateSelector,$seller,$buyer,$hookmanager=false)
- {
- global $conf,$langs,$object;
- global $form,$bcnd,$var;
-
- // Use global variables + $dateSelector + $seller and $buyer
- include(DOL_DOCUMENT_ROOT.'/core/tpl/freeproductline_create.tpl.php');
+ * @deprecated
+ */
+ function formAddFreeProduct($dateSelector,$seller,$buyer,$hookmanager=false)
+ {
+ global $conf,$langs,$object;
+ global $form,$bcnd,$var;
+
+ // Use global variables + $dateSelector + $seller and $buyer
+ include(DOL_DOCUMENT_ROOT.'/core/tpl/freeproductline_create.tpl.php');
}
@@ -2549,7 +2549,8 @@ abstract class CommonObject
print '
'.$langs->trans('Description').'
';
print '
'.$langs->trans('VAT').'
';
print '
'.$langs->trans('PriceUHT').'
';
- print '
';
+ if ($conf->global->MAIN_FEATURES_LEVEL > 1)
+ print '
';
print '
'.$langs->trans('Qty').'
';
print '
'.$langs->trans('ReductionShort').'
';
if (! empty($conf->margin->enabled)) {
diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php
index e3e39d92322..d97bedd0936 100644
--- a/htdocs/core/modules/dons/html_cerfafr.modules.php
+++ b/htdocs/core/modules/dons/html_cerfafr.modules.php
@@ -82,7 +82,7 @@ class html_cerfafr extends ModeleDon
$outputlangs->load("companies");
$outputlangs->load("bills");
$outputlangs->load("products");
- $outputlangs->load("donations");
+ $outputlangs->load("donations");
if (! empty($conf->don->dir_output))
{
@@ -143,17 +143,17 @@ class html_cerfafr extends ModeleDon
$form = str_replace('__DonationPaymentDate__',$outputlangs->trans("DonationPaymentDate"),$form);
$form = str_replace('__DonationPaymentMode__',$outputlangs->trans("DonationPaymentMode"),$form);
$form = str_replace('__Name__',$outputlangs->trans("Name"),$form);
- $form = str_replace('__Address__',$outputlangs->trans("Address"),$form);
- $form = str_replace('__Zip__',$outputlangs->trans("Zip"),$form);
- $form = str_replace('__Town__',$outputlangs->trans("Town"),$form);
- $form = str_replace('__Donor__',$outputlangs->trans("Donor"),$form);
- $form = str_replace('__Date__',$outputlangs->trans("Date"),$form);
- $form = str_replace('__Signature__',$outputlangs->trans("Signature"),$form);
+ $form = str_replace('__Address__',$outputlangs->trans("Address"),$form);
+ $form = str_replace('__Zip__',$outputlangs->trans("Zip"),$form);
+ $form = str_replace('__Town__',$outputlangs->trans("Town"),$form);
+ $form = str_replace('__Donor__',$outputlangs->trans("Donor"),$form);
+ $form = str_replace('__Date__',$outputlangs->trans("Date"),$form);
+ $form = str_replace('__Signature__',$outputlangs->trans("Signature"),$form);
$form = str_replace('__ThankYou__',$outputlangs->trans("ThankYou"),$form);
$form = str_replace('__IConfirmDonationReception__',$outputlangs->trans("IConfirmDonationReception"),$form);
$frencharticle='';
if (preg_match('/fr/i',$outputlangs->defaultlang)) $frencharticle='(Article 200-5 du Code Général des Impôts) + article 238 bis';
- $form = str_replace('__FrenchArticle__',$frencharticle,$form);
+ $form = str_replace('__FrenchArticle__',$frencharticle,$form);
// Sauve fichier sur disque
dol_syslog("html_cerfafr::write_file $file");
diff --git a/htdocs/core/modules/dons/modules_don.php b/htdocs/core/modules/dons/modules_don.php
index 1f7d3f5c965..c86a75652a5 100644
--- a/htdocs/core/modules/dons/modules_don.php
+++ b/htdocs/core/modules/dons/modules_don.php
@@ -156,10 +156,10 @@ function don_create($db, $id, $message, $modele, $outputlangs)
$eror=0;
- // Increase limit for PDF build
- $err=error_reporting();
- error_reporting(0);
- @set_time_limit(120);
+ // Increase limit for PDF build
+ $err=error_reporting();
+ error_reporting(0);
+ @set_time_limit(120);
error_reporting($err);
$srctemplatepath='';
@@ -178,34 +178,34 @@ function don_create($db, $id, $message, $modele, $outputlangs)
}
}
- // If selected modele is a filename template (then $modele="modelname:filename")
- $tmp=explode(':',$modele,2);
- if (! empty($tmp[1]))
- {
- $modele=$tmp[0];
- $srctemplatepath=$tmp[1];
- }
+ // If selected modele is a filename template (then $modele="modelname:filename")
+ $tmp=explode(':',$modele,2);
+ if (! empty($tmp[1]))
+ {
+ $modele=$tmp[0];
+ $srctemplatepath=$tmp[1];
+ }
- // Search template files
- $file=''; $classname=''; $filefound=0;
- $dirmodels=array('/');
- if (is_array($conf->modules_parts['models'])) $dirmodels=array_merge($dirmodels,$conf->modules_parts['models']);
- foreach($dirmodels as $reldir)
- {
- foreach(array('html','doc','pdf') as $prefix)
- {
- $file = $prefix."_".preg_replace('/^html_/','',$modele).".modules.php";
-
- // On verifie l'emplacement du modele
- $file=dol_buildpath($reldir."core/modules/dons/".$file,0);
- if (file_exists($file))
- {
- $filefound=1;
- $classname=$prefix.'_'.$modele;
- break;
- }
- }
- if ($filefound) break;
+ // Search template files
+ $file=''; $classname=''; $filefound=0;
+ $dirmodels=array('/');
+ if (is_array($conf->modules_parts['models'])) $dirmodels=array_merge($dirmodels,$conf->modules_parts['models']);
+ foreach($dirmodels as $reldir)
+ {
+ foreach(array('html','doc','pdf') as $prefix)
+ {
+ $file = $prefix."_".preg_replace('/^html_/','',$modele).".modules.php";
+
+ // On verifie l'emplacement du modele
+ $file=dol_buildpath($reldir."core/modules/dons/".$file,0);
+ if (file_exists($file))
+ {
+ $filefound=1;
+ $classname=$prefix.'_'.$modele;
+ break;
+ }
+ }
+ if ($filefound) break;
}
// Charge le modele
diff --git a/htdocs/core/tpl/freeproductline_edit.tpl.php b/htdocs/core/tpl/freeproductline_edit.tpl.php
deleted file mode 100644
index 6a5e6e7ef30..00000000000
--- a/htdocs/core/tpl/freeproductline_edit.tpl.php
+++ /dev/null
@@ -1,101 +0,0 @@
-
- * 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
- */
-?>
-
-
-
-
diff --git a/htdocs/core/tpl/freeproductline_view.tpl.php b/htdocs/core/tpl/freeproductline_view.tpl.php
deleted file mode 100644
index e5746c52d58..00000000000
--- a/htdocs/core/tpl/freeproductline_view.tpl.php
+++ /dev/null
@@ -1,142 +0,0 @@
-
- * 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 .
- *
- */
-?>
-
-
-
info_bits & 2) != 2) { ?>
@@ -122,6 +139,8 @@
-
-
diff --git a/htdocs/core/tpl/predefinedproductline_view.tpl.php b/htdocs/core/tpl/predefinedproductline_view.tpl.php
deleted file mode 100644
index 5aef6995f74..00000000000
--- a/htdocs/core/tpl/predefinedproductline_view.tpl.php
+++ /dev/null
@@ -1,111 +0,0 @@
-
- * 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 .
- *
- */
-?>
-
-
-