Fix: uniform code

This commit is contained in:
Regis Houssin 2012-01-13 17:46:15 +01:00
parent d328fd94dd
commit 9fe45c4f4f
6 changed files with 125 additions and 127 deletions

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
@ -45,12 +45,12 @@ $langs->load('bills');
$langs->load('orders'); $langs->load('orders');
$langs->load('products'); $langs->load('products');
$id=GETPOST('id'); $id=GETPOST('id','int');
$ref=GETPOST('ref'); $ref=GETPOST('ref','alpha');
$socid=GETPOST('socid'); $socid=GETPOST('socid','int');
$action=GETPOST('action'); $action=GETPOST('action','alpha');
$confirm=GETPOST('confirm'); $confirm=GETPOST('confirm','alpha');
$lineid=GETPOST('lineid'); $lineid=GETPOST('lineid','int');
$search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha'); $search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha');
$search_societe=GETPOST('search_societe','alpha'); $search_societe=GETPOST('search_societe','alpha');
@ -124,7 +124,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
} }
// Suppression de la propale // Suppression de la propale
if ($action == 'confirm_delete' && $confirm == 'yes') else if ($action == 'confirm_delete' && $confirm == 'yes')
{ {
if ($user->rights->propale->supprimer) if ($user->rights->propale->supprimer)
{ {
@ -148,7 +148,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes')
} }
// Remove line // Remove line
if ($action == 'confirm_deleteline' && $confirm == 'yes') else if ($action == 'confirm_deleteline' && $confirm == 'yes')
{ {
if ($user->rights->propale->creer) if ($user->rights->propale->creer)
{ {
@ -184,7 +184,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes')
} }
// Validation // Validation
if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->propale->valider) else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->propale->valider)
{ {
$object->fetch($id); $object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -214,7 +214,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->propale
} }
} }
if ($_POST['action'] == 'setdate') else if ($action == 'setdate')
{ {
$datep=dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $datep=dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
@ -231,20 +231,20 @@ if ($_POST['action'] == 'setdate')
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
} }
} }
if ($_POST['action'] == 'setecheance') else if ($action == 'setecheance')
{ {
$object->fetch($id); $object->fetch($id);
$result=$object->set_echeance($user,dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear'])); $result=$object->set_echeance($user,dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']));
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
} }
if ($_POST['action'] == 'setdate_livraison') else if ($action == 'setdate_livraison')
{ {
$object->fetch($id); $object->fetch($id);
$result=$object->set_date_livraison($user,dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year'])); $result=$object->set_date_livraison($user,dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']));
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
} }
if ($_POST['action'] == 'setaddress' && $user->rights->propale->creer) else if ($action == 'setaddress' && $user->rights->propale->creer)
{ {
$object->fetch($id); $object->fetch($id);
$result=$object->set_adresse_livraison($user,$_POST['fk_address']); $result=$object->set_adresse_livraison($user,$_POST['fk_address']);
@ -252,14 +252,14 @@ if ($_POST['action'] == 'setaddress' && $user->rights->propale->creer)
} }
// Positionne ref client // Positionne ref client
if ($_POST['action'] == 'set_ref_client' && $user->rights->propale->creer) else if ($action == 'set_ref_client' && $user->rights->propale->creer)
{ {
$object->fetch($id); $object->fetch($id);
$object->set_ref_client($user, $_POST['ref_client']); $object->set_ref_client($user, $_POST['ref_client']);
} }
// Create proposal // Create proposal
if ($_POST['action'] == 'add' && $user->rights->propale->creer) else if ($action == 'add' && $user->rights->propale->creer)
{ {
$object->socid=$socid; $object->socid=$socid;
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -400,14 +400,14 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer)
} }
// Classify billed // Classify billed
if ($action == 'classifybilled') else if ($action == 'classifybilled')
{ {
$object->fetch($id); $object->fetch($id);
$object->cloture($user, 4, ''); $object->cloture($user, 4, '');
} }
// Reopen proposal // Reopen proposal
if ($action == 'confirm_reopen' && $user->rights->propale->cloturer) else if ($action == 'confirm_reopen' && $user->rights->propale->cloturer)
{ {
if (! $_POST['cancel']) if (! $_POST['cancel'])
{ {
@ -421,7 +421,7 @@ if ($action == 'confirm_reopen' && $user->rights->propale->cloturer)
} }
// Close proposal // Close proposal
if ($action == 'setstatut' && $user->rights->propale->cloturer) else if ($action == 'setstatut' && $user->rights->propale->cloturer)
{ {
if (! $_POST['cancel']) if (! $_POST['cancel'])
{ {
@ -481,7 +481,7 @@ if (! empty($_POST['removedfile']))
/* /*
* Send mail * Send mail
*/ */
if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_POST['cancel']) if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_POST['cancel'])
{ {
$langs->load('mails'); $langs->load('mails');
@ -653,7 +653,7 @@ if ($action == 'modif' && $user->rights->propale->creer)
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
} }
if ($_POST['action'] == "setabsolutediscount" && $user->rights->propale->creer) else if ($action == "setabsolutediscount" && $user->rights->propale->creer)
{ {
if ($_POST["remise_id"]) if ($_POST["remise_id"])
{ {
@ -674,10 +674,8 @@ if ($_POST['action'] == "setabsolutediscount" && $user->rights->propale->creer)
} }
} }
/* //Ajout d'une ligne produit dans la propale
* Ajout d'une ligne produit dans la propale else if ($action == "addline" && $user->rights->propale->creer)
*/
if ($_POST['action'] == "addline" && $user->rights->propale->creer)
{ {
$result=0; $result=0;
@ -746,23 +744,26 @@ if ($_POST['action'] == "addline" && $user->rights->propale->creer)
$pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU');
} }
} }
// Define output language // Define output language
if ($conf->global->PRODUIT_DESC_IN_CLIENT_LANGUAGE) { if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_DESC_IN_THIRDPARTY_LANGUAGE))
$outputlangs = $langs; {
$newlang=''; $outputlangs = $langs;
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; $newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if (! empty($newlang)) if (empty($newlang)) $newlang=$object->client->default_lang;
{ if (! empty($newlang))
$outputlangs = new Translate("",$conf); {
$outputlangs->setDefaultLang($newlang); $outputlangs = new Translate("",$conf);
} $outputlangs->setDefaultLang($newlang);
}
$desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"]))?$prod->multilangs[$outputlangs->defaultlang]["description"]:$prod->description;
} $desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description;
else }
$desc = $prod->description; else
{
$desc = $prod->description;
}
$desc.= ($desc && $_POST['np_desc']) ? ((dol_textishtml($desc) || dol_textishtml($_POST['np_desc']))?"<br />\n":"\n") : ""; $desc.= ($desc && $_POST['np_desc']) ? ((dol_textishtml($desc) || dol_textishtml($_POST['np_desc']))?"<br />\n":"\n") : "";
$desc.= $_POST['np_desc']; $desc.= $_POST['np_desc'];
@ -840,10 +841,8 @@ if ($_POST['action'] == "addline" && $user->rights->propale->creer)
} }
} }
/* // Mise a jour d'une ligne dans la propale
* Mise a jour d'une ligne dans la propale if ($action == 'updateligne' && $user->rights->propale->creer && $_POST["save"] == $langs->trans("Save"))
*/
if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST["save"] == $langs->trans("Save"))
{ {
if (! $object->fetch($_POST["id"]) > 0) if (! $object->fetch($_POST["id"]) > 0)
{ {
@ -915,10 +914,8 @@ if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST
} }
} }
/* // Generation doc (depuis lien ou depuis cartouche doc)
* Generation doc (depuis lien ou depuis cartouche doc) else if ($action == 'builddoc' && $user->rights->propale->creer)
*/
if ($action == 'builddoc' && $user->rights->propale->creer)
{ {
$object->fetch($id); $object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -952,63 +949,57 @@ if ($action == 'builddoc' && $user->rights->propale->creer)
} }
// Set project // Set project
if ($_POST['action'] == 'classin') else if ($action == 'classin')
{ {
$object->fetch($id); $object->fetch($id);
$object->setProject($_POST['projectid']); $object->setProject($_POST['projectid']);
} }
// Delai de livraison // Delai de livraison
if ($_POST["action"] == 'setavailability') else if ($action == 'setavailability')
{ {
$object->fetch($_REQUEST['id']); $object->fetch($id);
$result = $object->availability($_POST['availability_id']); $result = $object->availability($_POST['availability_id']);
$id=$_REQUEST['id'];
} }
// Origine de la propale // Origine de la propale
if ($_POST["action"] == 'setdemandreason') else if ($action == 'setdemandreason')
{ {
$object->fetch($_REQUEST['id']); $object->fetch($id);
$result = $object->demand_reason($_POST['demand_reason_id']); $result = $object->demand_reason($_POST['demand_reason_id']);
$id=$_REQUEST['id'];
} }
// Conditions de reglement // Conditions de reglement
if ($_POST["action"] == 'setconditions') else if ($action == 'setconditions')
{ {
$object->fetch($_REQUEST['id']); $object->fetch($id);
$result = $object->cond_reglement($_POST['cond_reglement_id']); $result = $object->cond_reglement($_POST['cond_reglement_id']);
$id=$_REQUEST['id'];
} }
if ($action == 'setremisepercent' && $user->rights->propale->creer) else if ($action == 'setremisepercent' && $user->rights->propale->creer)
{ {
$object->fetch($_REQUEST["id"]); $object->fetch($id);
$result = $object->set_remise_percent($user, $_POST['remise_percent']); $result = $object->set_remise_percent($user, $_POST['remise_percent']);
$id=$_REQUEST["id"];
} }
if ($action == 'setremiseabsolue' && $user->rights->propale->creer) else if ($action == 'setremiseabsolue' && $user->rights->propale->creer)
{ {
$object->fetch($_REQUEST["id"]); $object->fetch($id);
$result = $object->set_remise_absolue($user, $_POST['remise_absolue']); $result = $object->set_remise_absolue($user, $_POST['remise_absolue']);
$id=$_REQUEST["id"];
} }
// Mode de reglement // Mode de reglement
if ($_POST["action"] == 'setmode') else if ($action == 'setmode')
{ {
$object->fetch($_REQUEST["id"]); $object->fetch($id);
$result = $object->mode_reglement($_POST['mode_reglement_id']); $result = $object->mode_reglement($_POST['mode_reglement_id']);
$id=$_REQUEST["id"];
} }
/* /*
* Ordonnancement des lignes * Ordonnancement des lignes
*/ */
if ($action == 'up' && $user->rights->propale->creer) else if ($action == 'up' && $user->rights->propale->creer)
{ {
$object->fetch($id); $object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -1030,7 +1021,7 @@ if ($action == 'up' && $user->rights->propale->creer)
exit; exit;
} }
if ($action == 'down' && $user->rights->propale->creer) else if ($action == 'down' && $user->rights->propale->creer)
{ {
$object->fetch($id); $object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -1066,9 +1057,6 @@ $companystatic=new Societe($db);
$now=dol_now(); $now=dol_now();
$id = GETPOST('id');
$ref= GETPOST('ref');
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {
/* /*

View File

@ -551,23 +551,26 @@ if ($action == 'addline' && $user->rights->commande->creer)
$pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU');
} }
} }
// Define output language // Define output language
if ($conf->global->PRODUIT_DESC_IN_CLIENT_LANGUAGE) { if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_DESC_IN_THIRDPARTY_LANGUAGE))
$outputlangs = $langs; {
$newlang=''; $outputlangs = $langs;
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; $newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if (! empty($newlang)) if (empty($newlang)) $newlang=$object->client->default_lang;
{ if (! empty($newlang))
$outputlangs = new Translate("",$conf); {
$outputlangs->setDefaultLang($newlang); $outputlangs = new Translate("",$conf);
} $outputlangs->setDefaultLang($newlang);
}
$desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"]))?$prod->multilangs[$outputlangs->defaultlang]["description"]:$prod->description;
} $desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description;
else }
$desc = $prod->description; else
{
$desc = $prod->description;
}
$desc.= ($desc && $_POST['np_desc']) ? ((dol_textishtml($desc) || dol_textishtml($_POST['np_desc']))?"<br />\n":"\n") : ""; $desc.= ($desc && $_POST['np_desc']) ? ((dol_textishtml($desc) || dol_textishtml($_POST['np_desc']))?"<br />\n":"\n") : "";
$desc.= $_POST['np_desc']; $desc.= $_POST['np_desc'];

View File

@ -995,23 +995,26 @@ if (($action == 'addline' || $action == 'addline_predef') && $user->rights->fact
$pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU');
} }
} }
// Define output language // Define output language
if ($conf->global->PRODUIT_DESC_IN_CLIENT_LANGUAGE) { if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_DESC_IN_THIRDPARTY_LANGUAGE))
$outputlangs = $langs; {
$newlang=''; $outputlangs = $langs;
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; $newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if (! empty($newlang)) if (empty($newlang)) $newlang=$object->client->default_lang;
{ if (! empty($newlang))
$outputlangs = new Translate("",$conf); {
$outputlangs->setDefaultLang($newlang); $outputlangs = new Translate("",$conf);
} $outputlangs->setDefaultLang($newlang);
}
$desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"]))?$prod->multilangs[$outputlangs->defaultlang]["description"]:$prod->description;
} $desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description;
else }
$desc = $prod->description; else
{
$desc = $prod->description;
}
$desc.= ($desc && $_POST['np_desc']) ? ((dol_textishtml($desc) || dol_textishtml($_POST['np_desc']))?"<br>\n":"\n") : ""; $desc.= ($desc && $_POST['np_desc']) ? ((dol_textishtml($desc) || dol_textishtml($_POST['np_desc']))?"<br>\n":"\n") : "";
$desc.= $_POST['np_desc']; $desc.= $_POST['np_desc'];

View File

@ -1111,7 +1111,7 @@ NumberOfProductShowInSelect=Max number of products in combos select lists (0=no
ConfirmDeleteProductLineAbility=Confirmation when removing product lines in forms ConfirmDeleteProductLineAbility=Confirmation when removing product lines in forms
ModifyProductDescAbility=Personalization of product descriptions in forms ModifyProductDescAbility=Personalization of product descriptions in forms
ViewProductDescInFormAbility=Visualization of product descriptions in the forms (otherwise as popup tooltip) ViewProductDescInFormAbility=Visualization of product descriptions in the forms (otherwise as popup tooltip)
ViewProductDescInClientLanguageAbility=Visualization of product descriptions in the customer language ViewProductDescInThirdpartyLanguageAbility=Visualization of products descriptions in the thirdparty language
UseSearchToSelectProduct=Use a search form to choose a product (instead of using a list box).<br>Also if you have a large number of product (> 100 000), you can increase speed by setting constant PRODUCT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. UseSearchToSelectProduct=Use a search form to choose a product (instead of using a list box).<br>Also if you have a large number of product (> 100 000), you can increase speed by setting constant PRODUCT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
UseEcoTaxeAbility=Support Eco-Taxe (WEEE) UseEcoTaxeAbility=Support Eco-Taxe (WEEE)
SetDefaultBarcodeTypeProducts=Default barcode type to use for products SetDefaultBarcodeTypeProducts=Default barcode type to use for products

View File

@ -1119,7 +1119,7 @@ NumberOfProductShowInSelect= Nombre de produits max dans les listes déroulantes
ConfirmDeleteProductLineAbility= Confirmation de suppression d'une ligne produit dans les formulaires ConfirmDeleteProductLineAbility= Confirmation de suppression d'une ligne produit dans les formulaires
ModifyProductDescAbility= Personnalisation des descriptions produits dans les formulaires ModifyProductDescAbility= Personnalisation des descriptions produits dans les formulaires
ViewProductDescInFormAbility= Visualisation des descriptions produits dans les formulaires (sinon en tant que tooltip) ViewProductDescInFormAbility= Visualisation des descriptions produits dans les formulaires (sinon en tant que tooltip)
ViewProductDescInClientLanguageAbility= Visualisation des descriptions produits dans la langue du client ViewProductDescInThirdpartyLanguageAbility= Visualisation des descriptions produits dans la langue du tiers
UseSearchToSelectProduct= Utiliser un formulaire de recherche pour le choix d'un produit (plutôt qu'une liste déroulante).<br>Notez que si vous avez un nombre important de produits ou services (> 100 000), vous pouvez améliorer les performances en définissant la constante PRODUCT_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine. UseSearchToSelectProduct= Utiliser un formulaire de recherche pour le choix d'un produit (plutôt qu'une liste déroulante).<br>Notez que si vous avez un nombre important de produits ou services (> 100 000), vous pouvez améliorer les performances en définissant la constante PRODUCT_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine.
UseEcoTaxeAbility= Prise en charge des éco-taxes (DEEE) UseEcoTaxeAbility= Prise en charge des éco-taxes (DEEE)
SetDefaultBarcodeTypeProducts= Type de code-barres utilisé par défaut pour les produits SetDefaultBarcodeTypeProducts= Type de code-barres utilisé par défaut pour les produits

View File

@ -3,7 +3,7 @@
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2006-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2006-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Auguria SARL <info@auguria.org> * Copyright (C) 2007 Auguria SARL <info@auguria.org>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -69,10 +69,10 @@ else if ($action == 'viewProdDescInForm')
$view = GETPOST("activate_viewProdDescInForm"); $view = GETPOST("activate_viewProdDescInForm");
$res = dolibarr_set_const($db, "PRODUIT_DESC_IN_FORM", $view,'chaine',0,'',$conf->entity); $res = dolibarr_set_const($db, "PRODUIT_DESC_IN_FORM", $view,'chaine',0,'',$conf->entity);
} }
else if ($action == 'viewProdDescInClientLanguage') else if ($action == 'viewProdDescInThirdpartyLanguage')
{ {
$view = GETPOST("activate_viewProdDescInClientLanguage"); $view = GETPOST("activate_viewProdDescInThirdpartyLanguage");
$res = dolibarr_set_const($db, "PRODUIT_DESC_IN_CLIENT_LANGUAGE", $view,'chaine',0,'',$conf->entity); $res = dolibarr_set_const($db, "PRODUIT_DESC_IN_THIRDPARTY_LANGUAGE", $view,'chaine',0,'',$conf->entity);
} }
else if ($action == 'usesearchtoselectproduct') else if ($action == 'usesearchtoselectproduct')
{ {
@ -254,20 +254,23 @@ print '</td>';
print '</tr>'; print '</tr>';
print '</form>'; print '</form>';
// Visualiser description produit dans la langue du client // View product description in thirdparty language
$var=!$var; if (! empty($conf->global->MAIN_MULTILANGS))
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">'; {
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; $var=!$var;
print '<input type="hidden" name="action" value="viewProdDescInClientLanguage">'; print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<tr '.$bc[$var].'>'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<td>'.$langs->trans("ViewProductDescInClientLanguageAbility").'</td>'; print '<input type="hidden" name="action" value="viewProdDescInThirdpartyLanguage">';
print '<td width="60" align="right">'; print '<tr '.$bc[$var].'>';
print $form->selectyesno("activate_viewProdDescInClientLanguage",$conf->global->PRODUIT_DESC_IN_CLIENT_LANGUAGE,1); print '<td>'.$langs->trans("ViewProductDescInThirdpartyLanguageAbility").'</td>';
print '</td><td align="right">'; print '<td width="60" align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print $form->selectyesno("activate_viewProdDescInThirdpartyLanguage",$conf->global->PRODUIT_DESC_IN_THIRDPARTY_LANGUAGE,1);
print '</td>'; print '</td><td align="right">';
print '</tr>'; print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>'; print '</td>';
print '</tr>';
print '</form>';
}
if ($conf->global->PRODUCT_CANVAS_ABILITY) if ($conf->global->PRODUCT_CANVAS_ABILITY)
@ -340,7 +343,8 @@ if ($conf->global->PRODUCT_CANVAS_ABILITY)
dol_htmloutput_mesg($mesg); dol_htmloutput_mesg($mesg);
llxFooter();
$db->close(); $db->close();
llxFooter();
?> ?>