From c0774485f99c8e9a895d29d15992f7b57266a576 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Nov 2011 12:55:28 +0100 Subject: [PATCH 01/21] Qual: Uniformize code --- htdocs/fourn/commande/fiche.php | 41 +++++++++------------------------ 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index f4a76a7eeb3..77b08dae967 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -126,18 +126,8 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer) { if (($_POST['qty'] || $_POST['pqty']) && (($_POST['pu'] && ($_POST['np_desc'] || $_POST['dp_desc'])) || $_POST['idprodfournprice'])) { - $ret=$object->fetch($id); - if ($ret < 0) - { - dol_print_error($db,$object->error); - exit; - } - - if ($object->socid) - { - $societe=new Societe($db); - $societe->fetch($object->socid); - } + if ($object->fetch($id) < 0) dol_print_error($db,$object->error); + if ($object->fetch_thirdparty() < 0) dol_print_error($db,$object->error); // Ecrase $pu par celui du produit // Ecrase $desc par celui du produit @@ -149,13 +139,6 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer) $productsupplier = new ProductFournisseur($db); $idprod=$productsupplier->get_buyprice($_POST['idprodfournprice'], $qty); - //$societe=''; - /*if ($object->socid) - { - $societe=new Societe($db); - $societe->fetch($object->socid); - }*/ - if ($idprod > 0) { $res=$productsupplier->fetch($idprod); @@ -170,12 +153,12 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer) $remise_percent = $_POST["remise_percent"] ? $_POST["remise_percent"] : $_POST["p_remise_percent"]; - $tva_tx = get_default_tva($societe,$mysoc,$productsupplier->id); + $tva_tx = get_default_tva($object->thirdparty,$mysoc,$productsupplier->id); $type = $productsupplier->type; // Local Taxes - $localtax1_tx= get_localtax($tva_tx, 1, $societe); - $localtax2_tx= get_localtax($tva_tx, 2, $societe); + $localtax1_tx= get_localtax($tva_tx, 1, $object->thirdparty); + $localtax2_tx= get_localtax($tva_tx, 2, $object->thirdparty); $result=$object->addline( $desc, @@ -206,8 +189,8 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer) $tva_tx = price2num($_POST['tva_tx']); // Local Taxes - $localtax1_tx= get_localtax($tva_tx, 1, $societe); - $localtax2_tx= get_localtax($tva_tx, 2, $societe); + $localtax1_tx= get_localtax($tva_tx, 1, $object->thirdparty); + $localtax2_tx= get_localtax($tva_tx, 2, $object->thirdparty); if (! $_POST['dp_desc']) { @@ -271,13 +254,11 @@ if ($action == 'updateligne' && $user->rights->fournisseur->commande->creer && $ if ($product->fetch($_POST["elrowid"]) < 0) dol_print_error($db); } - if ($object->fetch($id) < 0) dol_print_error($db); + if ($object->fetch($id) < 0) dol_print_error($db,$object->error); + if ($object->fetch_thirdparty() < 0) dol_print_error($db,$object->error); - $societe=new Societe($db); - $societe->fetch($object->socid); - - $localtax1_tx=get_localtax($_POST['tva_tx'],1,$societe); - $localtax2_tx=get_localtax($_POST['tva_tx'],2,$societe); + $localtax1_tx=get_localtax($_POST['tva_tx'],1,$object->thirdparty); + $localtax2_tx=get_localtax($_POST['tva_tx'],2,$object->thirdparty); $result = $object->updateline( $_POST['elrowid'], From 1770a46519aaf4105c0170008357a39d6bb03c2d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Nov 2011 14:00:03 +0100 Subject: [PATCH 02/21] Qual: Removed tons of warning --- htdocs/adherents/class/adherent.class.php | 3 +- htdocs/comm/propal/class/propal.class.php | 1 + htdocs/commande/class/commande.class.php | 5 ++- htdocs/compta/facture/class/facture.class.php | 2 ++ .../class/bon-prelevement.class.php | 6 ++-- htdocs/core/class/commonobject.class.php | 1 + htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/company.lib.php | 15 ++++---- htdocs/core/lib/pdf.lib.php | 9 +++++ htdocs/core/lib/usergroups.lib.php | 27 ++++++--------- htdocs/core/menus/standard/empty.php | 4 +-- .../pdf/pdf_muscadet.modules.php | 2 +- htdocs/ftp/pre.inc.php | 15 +++++--- .../service/actions_card_service.class.php | 3 +- htdocs/societe/class/societe.class.php | 34 ------------------- 15 files changed, 57 insertions(+), 72 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 18673422697..694e696d6ee 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -435,7 +435,8 @@ class Adherent extends CommonObject include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); $hookmanager->callHooks(array('memberdao')); - $parameters=array('socid'=>$socid); + $parameters=array('id'=>$this->id); + $action=''; $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 4a3d30f1bd2..6450eab568f 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -921,6 +921,7 @@ class Propal extends CommonObject if (is_object($hookmanager)) { $parameters=array('objFrom'=>$objFrom); + $action=''; $reshook=$hookmanager->executeHooks('createfrom',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) $error++; } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 1c8214cd583..4734a881ed0 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -829,6 +829,7 @@ class Commande extends CommonObject if (is_object($hookmanager)) { $parameters=array('objFrom'=>$objFrom); + $action=''; $reshook=$hookmanager->executeHooks('createfrom',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) $error++; } @@ -924,6 +925,7 @@ class Commande extends CommonObject $hookmanager->callHooks(array('orderdao')); $parameters=array('objFrom'=>$object); + $action=''; $reshook=$hookmanager->executeHooks('createfrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) $error++; @@ -1580,7 +1582,8 @@ class Commande extends CommonObject $this->stocks = array(); // Tableau des id de produit de la commande - + $array_of_product=array(); + // Recherche total en stock pour chaque produit if (count($array_of_product)) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 6a7c2a2116b..899f5e49c04 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -570,6 +570,7 @@ class Facture extends CommonObject if (is_object($hookmanager)) { $parameters=array('objFrom'=>$objFrom); + $action=''; $reshook=$hookmanager->executeHooks('createfrom',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) $error++; } @@ -665,6 +666,7 @@ class Facture extends CommonObject $hookmanager->callHooks(array('invoicedao')); $parameters=array('objFrom'=>$object); + $action=''; $reshook=$hookmanager->executeHooks('createfrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) $error++; diff --git a/htdocs/compta/prelevement/class/bon-prelevement.class.php b/htdocs/compta/prelevement/class/bon-prelevement.class.php index 2f496754c29..8176aa153f9 100644 --- a/htdocs/compta/prelevement/class/bon-prelevement.class.php +++ b/htdocs/compta/prelevement/class/bon-prelevement.class.php @@ -715,15 +715,15 @@ class BonPrelevement extends CommonObject * Create a withdraw * * @param int $banque code of bank - * @param int $guichet code of banck office + * @param int $agence code of bank office (guichet) * @param string $mode real=do action, simu=test only * @return int <0 if KO, nbre of invoice withdrawed if OK */ - function Create($banque=0, $guichet=0, $mode='real') + function Create($banque=0, $agence=0, $mode='real') { global $conf,$langs; - dol_syslog("BonPrelevement::Create banque=$banque guichet=$guichet"); + dol_syslog("BonPrelevement::Create banque=$banque agence=$agence"); require_once (DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); require_once (DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e23d5694880..476d683c68e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2127,6 +2127,7 @@ abstract class CommonObject if (empty($line->fk_parent_line)) { $parameters=array('line'=>$line,'var'=>$var,'i'=>$i); + $action=''; $reshook=$hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 27289b06b2b..9087c5bbd48 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1810,7 +1810,7 @@ class Form $tmparray[$obj->rowid]['label']=$label; $i++; } - $this->cache_demand_reason=dol_sort_array($tmparray,'label', $order='asc', $natsort, $case_sensitive); + $this->cache_demand_reason=dol_sort_array($tmparray,'label', $order='asc'); unset($tmparray); return 1; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 16059e6fbe3..17ed5593e2d 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -480,11 +480,12 @@ function show_projects($conf,$langs,$db,$object,$backtopage='') /** * Show html area for list of contacts - * @param conf Object conf - * @param langs Object langs - * @param db Database handler - * @param object Third party object - * @param backtopage Url to go once contact is created + * + * @param Conf $conf Object conf + * @param Translate $langs Object langs + * @param DoliDB $db Database handler + * @param Object $object Third party object + * @param string $backtopage Url to go once contact is created */ function show_contacts($conf,$langs,$db,$object,$backtopage='') { @@ -743,6 +744,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) /** * Show html area with actions done + * * @param conf Object conf * @param langs Object langs * @param db Object db @@ -837,6 +839,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) $numaction++; $i++; } + $db->free($resql); } else { @@ -967,8 +970,6 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) } $out.="\n"; $out.="
\n"; - - $db->free($result); } if ($noprint) return $out; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3db6fe164c8..7c94b19b66c 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -685,6 +685,7 @@ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hide $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('pdf'=>$pdf,'i'=>$i,'outputlangs'=>$outputlangs,'w'=>$w,'h'=>$h,'posx'=>$posx,'posy'=>$posy,'hideref'=>$hideref,'hidedesc'=>$hidedesc,'issupplierline'=>$issupplierline,'special_code'=>$special_code); + $action=''; $reshook=$hookmanager->executeHooks('pdf_writelinedesc',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -929,6 +930,7 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0,$hookmanager= $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlinevatrate',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -959,6 +961,7 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0,$hookmanage $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlineupexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -985,6 +988,7 @@ function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0,$hookmanager=fals $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -1013,6 +1017,7 @@ function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0,$hookmanage $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -1041,6 +1046,7 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0,$hookmana $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -1069,6 +1075,7 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0,$hookm $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -1099,6 +1106,7 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0,$hookma $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -1136,6 +1144,7 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0,$hookman $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index ed5b6bfeed1..001c1ca6c18 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -142,9 +142,10 @@ function group_prepare_head($object) /** * Show list of themes. Show all thumbs of themes - * @param fuser User concerned or '' for global theme - * @param edit 1 to add edit form - * @param foruserprofile Show for user profile view + * + * @param User $fuser User concerned or '' for global theme + * @param int $edit 1 to add edit form + * @param boolean $foruserprofile Show for user profile view */ function show_theme($fuser,$edit=0,$foruserprofile=false) { @@ -166,21 +167,21 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) // Title if ($foruserprofile) { - print ''.$langs->trans("Parameter").''.$langs->trans("DefaultValue").''; - print ' '; + print ''.$langs->trans("Parameter").''.$langs->trans("DefaultValue").''; + print ' '; print ''; } else { - print ''.$langs->trans("DefaultSkin").''; - print ''; + print ''.$langs->trans("DefaultSkin").''; + print ''; $url='http://www.dolistore.com/lang-en/4-skins'; if (preg_match('/fr/i',$langs->defaultlang)) $url='http://www.dolistore.com/lang-fr/4-themes'; //if (preg_match('/es/i',$langs->defaultlang)) $url='http://www.dolistore.com/lang-es/4-themes'; print ''; print $langs->trans('DownloadMoreSkins'); print ''; - print ''; + print ''; } $var=false; @@ -190,8 +191,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print ''; print ''.$langs->trans("DefaultSkin").''; print ''.$conf->global->MAIN_THEME.''; - print ' '.$langs->trans("UsePersonalValue").''; - print ' '; + print ' '.$langs->trans("UsePersonalValue").''; + print ' '; print ''; } @@ -203,12 +204,6 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print ''; } - if ($edit) - { - if ($subdir == $conf->global->MAIN_THEME) $title=$langs->trans("ThemeCurrentlyActive"); - else $title=$langs->trans("ShowPreview"); - } - $var=!$var; print ''; diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index e7ac7d0e6f4..6efd12367da 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -56,10 +56,10 @@ class MenuTop { $classname='class="tmenu"'; print_start_menu_entry_empty($idsel); - print ''; + print 'atarget?' target="'.$this->atarget.'"':'').'>'; print ''; print ''; - print ''; + print 'atarget?' target="'.$this->atarget.'"':'').'>'; print_text_menu_entry_empty($langs->trans("Home")); print ''; print_end_menu_entry_empty(); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 625dbdee60c..bd78be5eb83 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -358,7 +358,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if ($deja_regle || $amount_credit_notes_included || $amount_deposits_included) { - $this->_tableau_versements($pdf, $fac, $posy); + $this->_tableau_versements($pdf, $object, $posy); } // Pied de page diff --git a/htdocs/ftp/pre.inc.php b/htdocs/ftp/pre.inc.php index 2fd4c498d2d..fac2eefa0fe 100644 --- a/htdocs/ftp/pre.inc.php +++ b/htdocs/ftp/pre.inc.php @@ -28,13 +28,18 @@ $user->getrights('ecm'); /** * Replace the default llxHeader function * - * @param string $head Optionnal head lines - * @param string $title HTML title - * @param string $help_url Link to online url help - * @param string $morehtml More content into html header + * @param string $head Optionnal head lines + * @param string $title HTML title + * @param string $help_url Link to online url help + * @param string $morehtml More content into html header + * @param string $target Force target on menu links + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files * @return none */ -function llxHeader($head = '', $title='', $help_url='', $morehtml='') +function llxHeader($head = '', $title='', $help_url='', $morehtml='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='') { global $conf,$langs,$user; $langs->load("ftp"); diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index f43399e4670..dd3b7e1e98c 100755 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -282,7 +282,7 @@ class ActionsCardService extends Product } else { - dol_print_error($db,$sql); + dol_print_error($this->db,$sql); } } @@ -298,6 +298,7 @@ class ActionsCardService extends Product function LoadListDatas($limit, $offset, $sortfield, $sortorder) { global $conf; + global $search_categ,$sall,$sref,$sbarcode,$snom,$catid; $this->getFieldList(); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index f36853e6bae..3d1b5ac9f70 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1005,40 +1005,6 @@ class Societe extends CommonObject } - /** - * \brief Retournes les factures impayees de la societe - * \return array tableau des id de factures impayees - * - */ - function factures_impayes() - { - $facimp = array(); - /* - * Lignes - */ - $sql = "SELECT f.rowid"; - $sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = '".$this->id . "'"; - $sql .= " AND f.fk_statut = '1' AND f.paye = '0'"; - - $resql=$this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i = 0; - - while ($i < $num) - { - $objp = $this->db->fetch_object($resql); - $array_push($facimp, $objp->rowid); - $i++; - print $i; - } - - $this->db->free(); - } - return $facimp; - } - /** * Update record to set prefix */ From 0d055690376bb898771375c8f43804d7fab8417f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Nov 2011 18:22:27 +0100 Subject: [PATCH 03/21] Qual: Removed tons of warning --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 17ed5593e2d..5eb45fcca67 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -565,7 +565,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) { - print ''; + print ''; print img_object($langs->trans("Rendez-Vous"),"action"); print ''; } From 2138f2290bd2869f01ca21eb5d23707a05185695 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 23 Nov 2011 08:23:10 +0100 Subject: [PATCH 04/21] Fix: remove obsolete test --- test/phpunit/SocieteTest.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index d61d3f26a66..5c41576dd75 100755 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -227,10 +227,6 @@ class SocieteTest extends PHPUnit_Framework_TestCase $langs=$this->savlangs; $db=$this->savdb; - $result=$localobject->factures_impayes(); - print __METHOD__." id=".$localobject->id." result=".join(',',$result)."\n"; - //$this->assertLessThan($result, 0); - $result=$localobject->set_as_client(); print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0); From a6119fb4b8e4d422c192f92453718470bef438b5 Mon Sep 17 00:00:00 2001 From: Carlos Nogueira Date: Tue, 22 Nov 2011 22:08:15 +0800 Subject: [PATCH 05/21] Update htdocs/langs/pt_PT/projects.lang --- htdocs/langs/pt_PT/projects.lang | 177 ++++++++++++++++--------------- 1 file changed, 89 insertions(+), 88 deletions(-) diff --git a/htdocs/langs/pt_PT/projects.lang b/htdocs/langs/pt_PT/projects.lang index 27119869d45..7acec13a463 100644 --- a/htdocs/langs/pt_PT/projects.lang +++ b/htdocs/langs/pt_PT/projects.lang @@ -1,97 +1,98 @@ -# Dolibarr language file - pt_PT - projects -CHARSET=UTF-8 -Project=Projecto -Projects=Projectos -SharedProject=Projecto Partilhado -Myprojects=Os Meus Projectos -ProjectsArea=Área de Projectos -NewProject=Novo Projecto -AddProject=Criar Projecto -DeleteAProject=Eliminar um Projecto -DeleteATask=Eliminar uma Tarefa -ConfirmDeleteAProject=¿Está seguro de querer eliminar este projecto? -ConfirmDeleteATask=¿Está seguro de querer eliminar esta tarefa? -OfficerProject=Responsável do Projecto -LastProjects=Os %s Ultimos Projectos -AllProjects=Todos os Projectos -ProjectsList=Lista de Projectos -ShowProject=Adicionar Projecto -SetProject=Definir Projecto -NoProject=Nenhum Projecto Definido -NbOpenTasks=Nº Tarefas Abertas -NbOfProjects=Nº de Projectos -TimeSpent=Tempo Dedicado -RefTask=Ref. Tarefa -LabelTask=Etiqueta de Tarefa -NewTimeSpent=Novo Tempo Dedicado -MyTimeSpent=O Meu Tempo Dedicado -MyTasks=As minhas Tarefas -Tasks=Tarefas -Task=Tarefa -NewTask=Nova Tarefa -AddTask=Adicionar Tarefa -AddDuration=Indicar Duração -Activity=Actividade -Activities=Tarefas/Actividades -MyActivity=A Minha Actividade -MyActivities=As Tarefas/Actividades -DurationEffective=Duração Efectiva -MyProjects=Os Meus Projectos -Time=Tempo -ListProposalsAssociatedProject=Lista de Orçamentos Associados ao Projecto -ListOrdersAssociatedProject=Lista de Pedidos Associados ao Projecto -ListInvoicesAssociatedProject=Lista de Facturas Associadas ao Projecto -ListPredefinedInvoicesAssociatedProject=Lista de Facturas a Clientes Predefinidas Associadas ao Projecto -ListSupplierOrdersAssociatedProject=Lista de Pedidos a Fornecedores Associados ao Projecto -ListSupplierInvoicesAssociatedProject=Lista de Facturas de Fornecedor Associados ao Projecto -ListContractAssociatedProject=Lista de Contratos Associados ao Projecto -ActivityOnProjectThisWeek=Actividade ao Projecto esta Semana -ActivityOnProjectThisMonth=Actividade ao Projecto este Mês -ActivityOnProjectThisYear=Actividade ao Projecto este Ano -ChildOfTask=Link da Tarefa -NotOwnerOfProject=Não é responsável deste projecto privado -AffectedTo=Atribuido a -CantRemoveProject=Este projecto não pode ser eliminado porque está referenciado por muito objectos (facturas, pedidos e outros). ver a lista no separador referencias. - - - -// START - Lines generated via autotranslator.php tool (2010-09-04 01:33:40). -// Reference language: en_US -> pt_PT -PrivateProject=Contatos do projeto -MyProjectsDesc=Essa visão é limitada a projetos que você está um contato para (seja qual for o tipo). -ProjectsPublicDesc=Essa visão apresenta todos os projetos que estão autorizados a ler. -ProjectsDesc=Essa visão apresenta todos os projectos (as permissões de usuário conceder-lhe permissão para ver tudo). -MyTasksDesc=Essa visão é limitada a projetos ou tarefas que são de um contato para (seja qual for o tipo). -TasksPublicDesc=Essa visão apresenta todos os projectos e tarefas que têm permissão para ler. -TasksDesc=Essa visão apresenta todos os projectos e tarefas (as permissões de usuário conceder-lhe permissão para ver tudo). +# Dolibarr language file - pt_PT - projects +CHARSET=UTF-8 +Project=Projeto +Projects=Projetos +SharedProject=Todos +PrivateProject=Contactos do projeto +MyProjectsDesc=Essa visão é limitada a projetos onde você é o contacto(seja qual for o tipo). +ProjectsPublicDesc=Essa visão apresenta todos os projetos que está autorizado a ler. +ProjectsDesc=Essa visão apresenta todos os projetos (as permissões de usuário concedar-lhe-ao permissão para ver tudo). +MyTasksDesc=Essa visão é limitada a projetos ou tarefas que são de um contacto(seja qual for o tipo). +TasksPublicDesc=Essa visão apresenta todos os projetos e tarefas que têm permissão para ler. +TasksDesc=Essa visão apresenta todos os projetos e tarefas (as permissões de usuário concedar-lhe-ao permissão para ver tudo). +Myprojects=Meus Projetos +ProjectsArea=Área de Projetos +NewProject=Novo Projeto +AddProject=Adicionar Projeto +DeleteAProject=Eliminar um Projeto +DeleteATask=Eliminar uma Tarefa +ConfirmDeleteAProject=Tem a certeza que quer eliminar este projeto? +ConfirmDeleteATask=Tem a certeza que quer eliminar esta tarefa? +OfficerProject=Responsável pelo Projeto +LastProjects=Últimos Projetos +AllProjects=Todos os Projetos +ProjectsList=Lista de Projetos +ShowProject=Mostrar Projeto +SetProject=Definir Projeto +NoProject=Nenhum Projeto Definido +NbOpenTasks=Nº de Tarefas Abertas +NbOfProjects=Nº de Projetos +TimeSpent=Tempo Dispendido +TimesSpent=Tempos Dispendidos +RefTask=Ref. da Tarefa +LabelTask=Etiqueta de Tarefa +NewTimeSpent=Novo Tempo Dispendido +MyTimeSpent=Meu Tempo Dispendido +MyTasks=Minhas Tarefas +Tasks=Tarefas +Task=Tarefa +NewTask=Nova Tarefa +AddTask=Adicionar Tarefa +AddDuration=Adicionar Duração +Activity=Atividade +Activities=Tarefas/Atividades +MyActivity=Minha Actividade +MyActivities=Minhas Tarefas/Actividades +MyProjects=Meus Projetos +DurationEffective=Duração Efetiva Progress=Progresso -ListFichinterAssociatedProject=Lista de intervenções associadas ao projecto -ListTripAssociatedProject=Lista de viagens e as despesas associadas ao projecto -ListActionsAssociatedProject=Lista de acções associadas ao projecto -ValidateProject=Validar projet -ConfirmValidateProject=Tem certeza que deseja validar esse projeto? +Time=Tempo +ListProposalsAssociatedProject=Lista de Orçamentos Associados ao Projeto +ListOrdersAssociatedProject=Lista de Encomendas Associadas ao Projeto +ListInvoicesAssociatedProject=Lista de Faturas Associadas ao Projeto +ListPredefinedInvoicesAssociatedProject=Lista de Faturas a Clientes Predefinidas Associadas ao Projeto +ListSupplierOrdersAssociatedProject=Lista de Pedidos a Fornecedores Associados ao Projeto +ListSupplierInvoicesAssociatedProject=Lista de Faturas de Fornecedores Associados ao Projeto +ListContractAssociatedProject=Lista de Contratos Associados ao Projeto +ListFichinterAssociatedProject=Lista de intervenções associadas ao projeto +ListTripAssociatedProject=Lista de viagens e despesas associadas ao projeto +ListActionsAssociatedProject=Lista de eventos associados ao projeto +ActivityOnProjectThisWeek=Atividade do Projeto nesta Semana +ActivityOnProjectThisMonth=Actividade do Projecto neste Mês +ActivityOnProjectThisYear=Actividade do Projecto neste Ano +ChildOfTask=Link do Projeto/Tarefa +NotOwnerOfProject=Não é responsável por este projeto privado +AffectedTo=Atribuido a +CantRemoveProject=Este projeto não pode ser eliminado porque está referenciado por alguns objetos (faturas, pedidos e outros). ver lista de referencias. +ValidateProject=Validar Projeto +ConfirmValidateProject=Tem certeza que deseja validar este projeto? CloseAProject=Fechar projeto ConfirmCloseAProject=Tem certeza que quer fechar este projeto? -ReOpenAProject=projeto Open -ConfirmReOpenAProject=Tem certeza que quer reabrir esse projeto? -ProjectContact=contatos Project -ActionsOnProject=Ações sobre o projecto -YouAreNotContactOfProject=Você não é um contato deste projecto privado -DeleteATimeSpent=Excluir tempo gasto -ConfirmDeleteATimeSpent=Tem certeza que quer deletar este tempo? -DoNotShowMyTasksOnly=Veja também as tarefas que eu não sou afetado -ShowMyTasksOnly=Ver tarefas só sou afetado -TaskRessourceLinks=Ressources +ReOpenAProject=Abrir Projeto +ConfirmReOpenAProject=Tem certeza que quer reabrir este projeto? +ProjectContact=contatos do Projeto +ActionsOnProject=Ações sobre o projeto +YouAreNotContactOfProject=Não é um contato deste projeto privado +DeleteATimeSpent=Excluir o tempo gasto +ConfirmDeleteATimeSpent=Tem certeza que quer eliminar este tempo dispensado? +DoNotShowMyTasksOnly=Ver também as tarefas não atribuidas por mim +ShowMyTasksOnly=Ver tarefas atribuidas por mim +TaskRessourceLinks=Recursos ProjectsDedicatedToThisThirdParty=Projetos dedicados a este terceiro -NoTasks=As tarefas para este projeto -LinkedToAnotherCompany=Vinculado ao terceiro que -TypeContact_project_internal_PROJECTLEADER=O líder do projeto -TypeContact_project_external_PROJECTLEADER=O líder do projeto +NoTasks=Não existem tarefas para este projeto +LinkedToAnotherCompany=Vinculado a Terceiros +TaskIsNotAffectedToYou=Tarefa não atribuida a si +ErrorTimeSpentIsEmpty=Tempo dispensado está vazio +ThisWillAlsoRemoveTasks=Esta ação também vai excluir todas as tarefas do projeto (%s tarefas no momento) e todas as entradas de tempo dispensadas. +IfNeedToUseOhterObjectKeepEmpty=Caso alguns objetos (fatura, encomenda, ...), pertencentes a um terceiro, deve estar vinculado ao projeto para criar, manter este vazio para ter o projeto sendo multi-terceiros. +##### Types de contacts ##### +TypeContact_project_internal_PROJECTLEADER=Líder do projeto +TypeContact_project_external_PROJECTLEADER=Líder do projeto TypeContact_project_internal_CONTRIBUTOR=Contribuinte TypeContact_project_external_CONTRIBUTOR=Contribuinte -TypeContact_project_task_internal_TASKEXECUTIVE=executivo Task -TypeContact_project_task_external_TASKEXECUTIVE=executivo Task +TypeContact_project_task_internal_TASKEXECUTIVE=Tarefa executiva +TypeContact_project_task_external_TASKEXECUTIVE=Tarefa executiva TypeContact_project_task_internal_CONTRIBUTOR=Contribuinte TypeContact_project_task_external_CONTRIBUTOR=Contribuinte +# Documents models DocumentModelBaleine=modelo de um projeto completo do relatório (logo. ..) -// STOP - Lines generated via autotranslator.php tool (2010-09-04 01:37:05). From 31f198fa795b214b11b5f8e194328ae8d82d556b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Nov 2011 13:39:55 +0100 Subject: [PATCH 06/21] Clean invoice class from deprecated fields. Enhance initAsSpeciment function to contains all kind of lines. --- dev/examples/create_invoice.php | 2 +- htdocs/compta/facture/class/facture.class.php | 180 ++++++++++-------- 2 files changed, 103 insertions(+), 79 deletions(-) diff --git a/dev/examples/create_invoice.php b/dev/examples/create_invoice.php index 8ef49197055..0f99a5775ff 100755 --- a/dev/examples/create_invoice.php +++ b/dev/examples/create_invoice.php @@ -55,7 +55,6 @@ $user->getrights(); print "***** ".$script_file." (".$version.") *****\n"; - // Start of transaction $db->begin(); @@ -63,6 +62,7 @@ require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); // Create invoice object $obj = new Facture($db); +//$obj->initAsSpecimen(); $obj->ref = 'ABCDE'; $obj->socid = 4; // Put id of third party (rowid in llx_societe table) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 899f5e49c04..80ef51c9784 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -65,8 +65,10 @@ class Facture extends CommonObject var $ref_int; //! 0=Standard invoice, 1=Replacement invoice, 2=Credit note invoice, 3=Deposit invoice, 4=Proforma invoice var $type; - var $amount; - var $remise; + + //var $amount; + var $remise_absolue; + var $remise_percent; var $total_ht; var $total_tva; var $total_ttc; @@ -102,27 +104,26 @@ class Facture extends CommonObject var $nbtodo; var $nbtodolate; var $specimen; - //! Numero d'erreur de 512 a 1023 - var $errno = 0; + /** * Constructor * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function Facture($DB) + function Facture($db) { - $this->db = $DB; + $this->db = $db; - $this->amount = 0; - $this->remise = 0; + //$this->amount = 0; + //$this->remise = 0; $this->remise_percent = 0; + $this->remise_absolue = 0; $this->total_ht = 0; $this->total_tva = 0; $this->total_ttc = 0; $this->propalid = 0; $this->fk_project = 0; - $this->remise_exceptionnelle = 0; } /** @@ -144,7 +145,7 @@ class Facture extends CommonObject $this->ref_client=trim($this->ref_client); $this->note=trim($this->note); $this->note_public=trim($this->note_public); - if (! $this->remise) $this->remise = 0; + //if (! $this->remise) $this->remise = 0; if (! $this->cond_reglement_id) $this->cond_reglement_id = 0; if (! $this->mode_reglement_id) $this->mode_reglement_id = 0; $this->brouillon = 1; @@ -183,17 +184,17 @@ class Facture extends CommonObject $this->cond_reglement_id = $_facrec->cond_reglement_id; $this->mode_reglement = $_facrec->mode_reglement_id; $this->mode_reglement_id = $_facrec->mode_reglement_id; - $this->amount = $_facrec->amount; + //$this->amount = $_facrec->amount; $this->remise_absolue = $_facrec->remise_absolue; $this->remise_percent = $_facrec->remise_percent; - $this->remise = $_facrec->remise; + //$this->remise = $_facrec->remise; // Clean parametres if (! $this->type) $this->type = 0; $this->ref_client=trim($this->ref_client); $this->note=trim($this->note); $this->note_public=trim($this->note_public); - if (! $this->remise) $this->remise = 0; + //if (! $this->remise) $this->remise = 0; if (! $this->mode_reglement_id) $this->mode_reglement_id = 0; $this->brouillon = 1; } @@ -203,8 +204,8 @@ class Facture extends CommonObject // Insert into database $socid = $this->socid; - $amount = $this->amount; - $remise = $this->remise; + //$amount = $this->amount; + //$remise = $this->remise; $totalht = ($amount - $remise); @@ -214,7 +215,7 @@ class Facture extends CommonObject $sql.= ", type"; $sql.= ", fk_soc"; $sql.= ", datec"; - $sql.= ", amount"; + //$sql.= ", amount"; $sql.= ", remise_absolue"; $sql.= ", remise_percent"; $sql.= ", datef"; @@ -230,7 +231,7 @@ class Facture extends CommonObject $sql.= ", '".$this->type."'"; $sql.= ", '".$socid."'"; $sql.= ", '".$this->db->idate($now)."'"; - $sql.= ", '".$totalht."'"; + //$sql.= ", '".$totalht."'"; $sql.= ",".($this->remise_absolue>0?$this->remise_absolue:'NULL'); $sql.= ",".($this->remise_percent>0?$this->remise_percent:'NULL'); $sql.= ", '".$this->db->idate($this->date)."'"; @@ -484,7 +485,7 @@ class Facture extends CommonObject if ($invertdetail) { $facture->lines[$i]->subprice = -$facture->lines[$i]->subprice; - $facture->lines[$i]->price = -$facture->lines[$i]->price; + //$facture->lines[$i]->price = -$facture->lines[$i]->price; $facture->lines[$i]->total_ht = -$facture->lines[$i]->total_ht; $facture->lines[$i]->total_tva = -$facture->lines[$i]->total_tva; $facture->lines[$i]->total_localtax1 = -$facture->lines[$i]->total_localtax1; @@ -619,7 +620,7 @@ class Facture extends CommonObject $line->libelle = $object->lines[$i]->libelle; $line->desc = $object->lines[$i]->desc; - $line->price = $object->lines[$i]->price; + //$line->price = $object->lines[$i]->price; $line->subprice = $object->lines[$i]->subprice; $line->total_ht = $object->lines[$i]->total_ht; $line->total_tva = $object->lines[$i]->total_tva; @@ -774,7 +775,7 @@ class Facture extends CommonObject $this->amount = $obj->amount; $this->remise_percent = $obj->remise_percent; $this->remise_absolue = $obj->remise_absolue; - $this->remise = $obj->remise; + //$this->remise = $obj->remise; $this->total_ht = $obj->total; $this->total_tva = $obj->tva; $this->total_localtax1 = $obj->localtax1; @@ -897,8 +898,8 @@ class Facture extends CommonObject $line->fk_parent_line = $objp->fk_parent_line; // Ne plus utiliser - $line->price = $objp->price; - $line->remise = $objp->remise; + //$line->price = $objp->price; + //$line->remise = $objp->remise; $this->lines[$i] = $line; @@ -939,7 +940,7 @@ class Facture extends CommonObject if (isset($this->amount)) $this->amount=trim($this->amount); if (isset($this->remise_percent)) $this->remise_percent=trim($this->remise_percent); if (isset($this->remise_absolue)) $this->remise_absolue=trim($this->remise_absolue); - if (isset($this->remise)) $this->remise=trim($this->remise); + //if (isset($this->remise)) $this->remise=trim($this->remise); if (isset($this->close_code)) $this->close_code=trim($this->close_code); if (isset($this->close_note)) $this->close_note=trim($this->close_note); if (isset($this->total_tva)) $this->tva=trim($this->total_tva); @@ -977,7 +978,7 @@ class Facture extends CommonObject $sql.= " amount=".(isset($this->amount)?$this->amount:"null").","; $sql.= " remise_percent=".(isset($this->remise_percent)?$this->remise_percent:"null").","; $sql.= " remise_absolue=".(isset($this->remise_absolue)?$this->remise_absolue:"null").","; - $sql.= " remise=".(isset($this->remise)?$this->remise:"null").","; + //$sql.= " remise=".(isset($this->remise)?$this->remise:"null").","; $sql.= " close_code=".(isset($this->close_code)?"'".$this->db->escape($this->close_code)."'":"null").","; $sql.= " close_note=".(isset($this->close_note)?"'".$this->db->escape($this->close_note)."'":"null").","; $sql.= " tva=".(isset($this->total_tva)?$this->total_tva:"null").","; @@ -1078,8 +1079,8 @@ class Facture extends CommonObject $facligne->info_bits=2; // Ne plus utiliser - $facligne->price=-$remise->amount_ht; - $facligne->remise=0; + //$facligne->price=-$remise->amount_ht; + //$facligne->remise=0; $facligne->total_ht = -$remise->amount_ht; $facligne->total_tva = -$remise->amount_tva; @@ -2037,8 +2038,8 @@ class Facture extends CommonObject $this->line->skip_update_total = $skip_update_total; // A ne plus utiliser - $this->line->price=$price; - $this->line->remise=$remise; + //$this->line->price=$price; + //$this->line->remise=$remise; $result=$this->line->update(); if ($result > 0) @@ -3112,42 +3113,61 @@ class Facture extends CommonObject $line->desc=$langs->trans("Description")." ".$xnbp; $line->qty=1; $line->subprice=100; - $line->price=100; + //$line->price=100; $line->tva_tx=19.6; $line->localtax1_tx=0; $line->localtax2_tx=0; - if ($xnbp == 2) + $line->remise_percent=0; + if ($xnbp == 1) // Qty is negative (product line) { + $prodid = rand(1, $num_prods); + $line->fk_product=$prodids[$prodid]; + $line->qty=-1; + $line->total_ht=-100; + $line->total_ttc=-119.6; + $line->total_tva=-19.6; + } + else if ($xnbp == 2) // UP is negative (free line) + { + $line->subprice=-100; + $line->total_ht=-100; + $line->total_ttc=-119.6; + $line->total_tva=-19.6; + $line->remise_percent=0; + } + else if ($xnbp == 3) // Discount is 50% (product line) + { + $prodid = rand(1, $num_prods); + $line->fk_product=$prodids[$prodid]; $line->total_ht=50; $line->total_ttc=59.8; $line->total_tva=9.8; - $line->remise_percent=50; + $line->remise_percent=50; } - else + else // (product line) { + $prodid = rand(1, $num_prods); + $line->fk_product=$prodids[$prodid]; $line->total_ht=100; $line->total_ttc=119.6; $line->total_tva=19.6; $line->remise_percent=00; } - $prodid = rand(1, $num_prods); - $line->fk_product=$prodids[$prodid]; $this->lines[$xnbp]=$line; + $xnbp++; - $this->total_ht += $line->total_ht; + $this->total_ht += $line->total_ht; $this->total_tva += $line->total_tva; $this->total_ttc += $line->total_ttc; - - $xnbp++; } // Add a line "offered" $line=new FactureLigne($this->db); - $line->desc=$langs->trans("Description")." ".$xnbp; + $line->desc=$langs->trans("Description")." (offered line)"; $line->qty=1; $line->subprice=100; - $line->price=100; + //$line->price=100; $line->tva_tx=19.6; $line->localtax1_tx=0; $line->localtax2_tx=0; @@ -3159,8 +3179,7 @@ class Facture extends CommonObject $line->fk_product=$prodids[$prodid]; $this->lines[$xnbp]=$line; - - $xnbp++; + $xnbp++; } /** @@ -3277,7 +3296,7 @@ class Facture extends CommonObject /** * \class FactureLigne * \brief Classe permettant la gestion des lignes de factures - * \remarks Gere des lignes de la table llx_facturedet + * Gere des lignes de la table llx_facturedet */ class FactureLigne { @@ -3334,8 +3353,8 @@ class FactureLigne var $date_end; // Ne plus utiliser - var $price; // P.U. HT apres remise % de ligne (exemple 80) - var $remise; // Montant calcule de la remise % sur PU HT (exemple 20) + //var $price; // P.U. HT apres remise % de ligne (exemple 80) + //var $remise; // Montant calcule de la remise % sur PU HT (exemple 20) // From llx_product var $ref; // Product ref (deprecated) @@ -3348,17 +3367,19 @@ class FactureLigne /** - * \brief Constructeur d'objets ligne de facture - * \param DB handler d'acces base de donnee + * Constructeur d'objets ligne de facture + * + * @param DoliDB $db Database handler */ - function FactureLigne($DB) + function FactureLigne($db) { - $this->db= $DB ; + $this->db = $db; } /** - * \brief Recupere l'objet ligne de facture - * \param rowid id de la ligne de facture + * Recupere l'objet ligne de facture + * + * @param int $rowid id de la ligne de facture */ function fetch($rowid) { @@ -3403,8 +3424,8 @@ class FactureLigne $this->rang = $objp->rang; // Ne plus utiliser - $this->price = $objp->price; - $this->remise = $objp->remise; + //$this->price = $objp->price; + //$this->remise = $objp->remise; $this->ref = $objp->product_ref; // deprecated $this->product_ref = $objp->product_ref; @@ -3421,15 +3442,16 @@ class FactureLigne } /** - * \brief Insert line in database - * \param notrigger 1 no triggers - * \return int <0 if KO, >0 if OK + * Insert line in database + * + * @param int $notrigger 1 no triggers + * @return int <0 if KO, >0 if OK */ function insert($notrigger=0) { global $langs,$user,$conf; - dol_syslog("FactureLigne::Insert rang=".$this->rang, LOG_DEBUG); + dol_syslog(get_class($this)."::Insert rang=".$this->rang, LOG_DEBUG); // Clean parameters $this->desc=trim($this->desc); @@ -3439,11 +3461,11 @@ class FactureLigne if (empty($this->total_localtax1)) $this->total_localtax1=0; if (empty($this->total_localtax2)) $this->total_localtax2=0; if (empty($this->rang)) $this->rang=0; - if (empty($this->remise)) $this->remise=0; + //if (empty($this->remise)) $this->remise=0; if (empty($this->remise_percent)) $this->remise_percent=0; if (empty($this->info_bits)) $this->info_bits=0; if (empty($this->subprice)) $this->subprice=0; - if (empty($this->price)) $this->price=0; + //if (empty($this->price)) $this->price=0; if (empty($this->special_code)) $this->special_code=0; if (empty($this->fk_parent_line)) $this->fk_parent_line=0; @@ -3455,7 +3477,7 @@ class FactureLigne // Insertion dans base de la ligne $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facturedet'; $sql.= ' (fk_facture, fk_parent_line, description, qty, tva_tx, localtax1_tx, localtax2_tx,'; - $sql.= ' fk_product, product_type, remise_percent, subprice, price, remise, fk_remise_except,'; + $sql.= ' fk_product, product_type, remise_percent, subprice, fk_remise_except,'; $sql.= ' date_start, date_end, fk_code_ventilation, fk_export_compta, '; $sql.= ' rang, special_code,'; $sql.= ' info_bits, total_ht, total_tva, total_ttc, total_localtax1, total_localtax2)'; @@ -3471,8 +3493,8 @@ class FactureLigne $sql.= " ".$this->product_type.","; $sql.= " ".price2num($this->remise_percent).","; $sql.= " ".price2num($this->subprice).","; - $sql.= " ".price2num($this->price).","; - $sql.= " ".($this->remise?price2num($this->remise):'0').","; // Deprecated + //$sql.= " ".price2num($this->price).","; + //$sql.= " ".($this->remise?price2num($this->remise):'0').","; // Deprecated if ($this->fk_remise_except) $sql.= $this->fk_remise_except.","; else $sql.= 'null,'; if ($this->date_start) { $sql.= "'".$this->db->idate($this->date_start)."',"; } @@ -3491,7 +3513,7 @@ class FactureLigne $sql.= " ".price2num($this->total_localtax2); $sql.= ')'; - dol_syslog("FactureLigne::insert sql=".$sql); + dol_syslog(get_class($this)."::insert sql=".$sql); $resql=$this->db->query($sql); if ($resql) { @@ -3512,7 +3534,7 @@ class FactureLigne if ($discount->fk_facture) { $this->error=$langs->trans("ErrorDiscountAlreadyUsed",$discount->id); - dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } @@ -3522,7 +3544,7 @@ class FactureLigne if ($result < 0) { $this->error=$discount->error; - dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } @@ -3531,7 +3553,7 @@ class FactureLigne else { $this->error=$langs->trans("ErrorADiscountThatHasBeenRemovedIsIncluded"); - dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } @@ -3539,7 +3561,7 @@ class FactureLigne else { $this->error=$discount->error; - dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } @@ -3562,7 +3584,7 @@ class FactureLigne else { $this->error=$this->db->error(); - dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } @@ -3584,7 +3606,7 @@ class FactureLigne if (empty($this->localtax2_tx)) $this->localtax2_tx=0; if (empty($this->total_localtax1)) $this->total_localtax1=0; if (empty($this->total_localtax2)) $this->total_localtax2=0; - if (empty($this->remise)) $this->remise=0; + //if (empty($this->remise)) $this->remise=0; if (empty($this->remise_percent)) $this->remise_percent=0; if (empty($this->info_bits)) $this->info_bits=0; if (empty($this->product_type)) $this->product_type=0; @@ -3599,8 +3621,8 @@ class FactureLigne $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET"; $sql.= " description='".$this->db->escape($this->desc)."'"; $sql.= ",subprice=".price2num($this->subprice).""; - $sql.= ",price=".price2num($this->price).""; - $sql.= ",remise=".price2num($this->remise).""; + //$sql.= ",price=".price2num($this->price).""; + //$sql.= ",remise=".price2num($this->remise).""; $sql.= ",remise_percent=".price2num($this->remise_percent).""; if ($this->fk_remise_except) $sql.= ",fk_remise_except=".$this->fk_remise_except; else $sql.= ",fk_remise_except=null"; @@ -3653,7 +3675,8 @@ class FactureLigne /** * Delete line in database - * @return int <0 si ko, >0 si ok + * + * @return int <0 if KO, >0 if OK */ function delete() { @@ -3662,7 +3685,7 @@ class FactureLigne $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$this->rowid; - dol_syslog("FactureLigne::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); if ($this->db->query($sql) ) { // Appel des triggers @@ -3679,20 +3702,21 @@ class FactureLigne else { $this->error=$this->db->error()." sql=".$sql; - dol_syslog("FactureLigne::delete Error ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::delete Error ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } } /** - * \brief Mise a jour en base des champs total_xxx de ligne de facture - * \return int <0 si ko, >0 si ok + * Mise a jour en base des champs total_xxx de ligne de facture + * + * @return int <0 if KO, >0 if OK */ function update_total() { $this->db->begin(); - dol_syslog("FactureLigne::update_total", LOG_DEBUG); + dol_syslog(get_class($this)."::update_total", LOG_DEBUG); // Clean parameters if (empty($this->total_localtax1)) $this->total_localtax1=0; @@ -3718,7 +3742,7 @@ class FactureLigne else { $this->error=$this->db->error(); - dol_syslog("FactureLigne::update_total Error ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::update_total Error ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } From 839781dfbe431a8156d099dd62c571a1114ff830 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Nov 2011 14:55:36 +0100 Subject: [PATCH 07/21] Qual: Removed a TODO by renaming all ->monnaie into ->currency --- htdocs/adherents/card_subscriptions.php | 2 +- htdocs/cashdesk/tpl/facturation1.tpl.php | 4 +-- htdocs/cashdesk/tpl/liste_articles.tpl.php | 4 +-- htdocs/cashdesk/tpl/ticket.tpl.php | 8 ++--- htdocs/cashdesk/tpl/validation1.tpl.php | 10 +++---- htdocs/cashdesk/validation_verif.php | 4 +-- htdocs/comm/addpropal.php | 2 +- htdocs/comm/fiche.php | 2 +- htdocs/comm/propal.php | 18 +++++------ htdocs/comm/propal/apercu.php | 4 +-- htdocs/comm/propal/note.php | 2 +- htdocs/comm/remx.php | 8 ++--- htdocs/commande/apercu.php | 2 +- htdocs/commande/fiche.php | 20 ++++++------- htdocs/compta/bank/bankid_fr.php | 4 +-- htdocs/compta/bank/fiche.php | 14 ++++----- htdocs/compta/bank/ligne.php | 2 +- htdocs/compta/bank/virement.php | 2 +- htdocs/compta/dons/fiche.php | 6 ++-- htdocs/compta/facture.php | 30 +++++++++---------- htdocs/compta/facture/apercu.php | 16 +++++----- htdocs/compta/facture/fiche-rec.php | 6 ++-- htdocs/compta/facture/prelevement.php | 20 ++++++------- htdocs/compta/paiement.php | 2 +- htdocs/compta/paiement/fiche.php | 2 +- htdocs/compta/paiement_charge.php | 6 ++-- htdocs/compta/payment_sc/fiche.php | 2 +- htdocs/compta/prelevement/create.php | 4 +-- htdocs/compta/propal.php | 12 ++++---- htdocs/compta/sociales/charges.php | 8 ++--- htdocs/compta/stats/prev.php | 2 +- htdocs/contrat/contact.php | 2 +- htdocs/contrat/fiche.php | 6 ++-- htdocs/contrat/note.php | 2 +- htdocs/core/boxes/box_comptes.php | 2 +- htdocs/core/class/conf.class.php | 3 +- htdocs/core/class/html.form.class.php | 26 ++++++++-------- htdocs/core/class/smtps.class.php | 6 ---- htdocs/core/lib/pdf.lib.php | 2 +- .../modules/commande/pdf_edison.modules.php | 2 +- .../modules/commande/pdf_einstein.modules.php | 2 +- .../modules/dons/html_cerfafr.modules.php | 4 +-- .../modules/facture/doc/pdf_crabe.modules.php | 2 +- .../facture/doc/pdf_oursin.modules.php | 2 +- .../propale/pdf_propale_azur.modules.php | 2 +- .../propale/pdf_propale_jaune.modules.php | 2 +- .../pdf/pdf_canelle.modules.php | 2 +- .../pdf/pdf_muscadet.modules.php | 2 +- htdocs/expedition/shipment.php | 10 +++---- htdocs/fourn/commande/fiche.php | 10 +++---- htdocs/fourn/facture/fiche.php | 10 +++---- htdocs/fourn/paiement/fiche.php | 2 +- htdocs/paybox/lib/paybox.lib.php | 2 +- htdocs/paypal/lib/paypal.lib.php | 2 +- htdocs/product/stock/valo.php | 4 +-- htdocs/public/donations/donateurs_code.php | 2 +- htdocs/public/members/new.php | 2 +- htdocs/public/paybox/newpayment.php | 2 +- .../canvas/company/tpl/card_create.tpl.php | 2 +- .../canvas/company/tpl/card_edit.tpl.php | 2 +- .../canvas/company/tpl/card_view.tpl.php | 2 +- htdocs/societe/lien.php | 2 +- htdocs/societe/soc.php | 6 ++-- 63 files changed, 175 insertions(+), 182 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index aac2a88d044..6385aa43be1 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -854,7 +854,7 @@ if ($rowid) if ($adht->cotisation) { // Amount - print ''.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).''; // Label print ''.$langs->trans("Label").''; diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index 9555921ad13..d0c7c93947d 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -125,11 +125,11 @@ along with this program. If not, see . - monnaie; ?> + currency; ?> - monnaie; ?> + currency; ?>  '.$langs->trans("Currency".$conf->monnaie).''; + print ' '.$langs->trans("Currency".$conf->currency).''; print ''.$langs->trans("VAT").''; print ''; print $form->load_tva('tva_tx',GETPOST('tva_tx'),'',$mysoc,''); @@ -392,7 +392,7 @@ if ($socid > 0) array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5') ); $langs->load("dict"); - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$obj->rowid, $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($obj->amount_ttc),$langs->transnoentities("Currency".$conf->monnaie)), 'confirm_split', $formquestion, 0, 0); + $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$obj->rowid, $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($obj->amount_ttc),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); print ''; print ''; } diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php index a76fd8c2786..70561e6b8d4 100644 --- a/htdocs/commande/apercu.php +++ b/htdocs/commande/apercu.php @@ -191,7 +191,7 @@ if ($id > 0 || ! empty($ref)) // partie Gauche print ''.$langs->trans('AmountHT').''; print ''.price($object->total_ht).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; print ''; } else diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index f8df322e99a..1b02201d072 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -573,7 +573,7 @@ if ($action == 'addline' && $user->rights->commande->creer) if($price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min))) { //print "CantBeLessThanMinPrice ".$up_ht." - ".GETPOST('remise_percent')." - ".$product->price_min; - $mesg = '
'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'
' ; + $mesg = '
'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency)).'
' ; } else { @@ -676,7 +676,7 @@ if ($action == 'updateligne' && $user->rights->commande->creer && $_POST['save'] } if ($price_min && GETPOST('productid') && (price2num($up_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min))) { - $mesg = '
'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'
' ; + $mesg = '
'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency)).'
' ; $result=-1; } @@ -1241,7 +1241,7 @@ if ($action == 'create' && $user->rights->commande->creer) else print $langs->trans("CompanyHasNoRelativeDiscount"); print '. '; $absolute_discount=$soc->getAvailableDiscounts(); - if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie)); + if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency)); else print $langs->trans("CompanyHasNoAbsoluteDiscount"); print '.'; print ''; @@ -1643,7 +1643,7 @@ else { if ($object->statut > 0) { - print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie)); + print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); } else { @@ -1655,7 +1655,7 @@ else } if ($absolute_creditnote) { - print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie)).'. '; + print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'. '; } if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; print ''; @@ -1846,11 +1846,11 @@ else // Total HT print ''.$langs->trans('AmountHT').''; print ''.price($object->total_ht).''; - print ''.$langs->trans('Currency'.$conf->monnaie).''; + print ''.$langs->trans('Currency'.$conf->currency).''; // Total TVA print ''.$langs->trans('AmountVAT').''.price($object->total_tva).''; - print ''.$langs->trans('Currency'.$conf->monnaie).''; + print ''.$langs->trans('Currency'.$conf->currency).''; // Amount Local Taxes if ($mysoc->pays_code=='ES') @@ -1859,19 +1859,19 @@ else { print ''.$langs->transcountry("AmountLT1",$mysoc->pays_code).''; print ''.price($object->total_localtax1).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; } if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF { print ''.$langs->transcountry("AmountLT2",$mysoc->pays_code).''; print ''.price($object->total_localtax2).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; } } // Total TTC print ''.$langs->trans('AmountTTC').''.price($object->total_ttc).''; - print ''.$langs->trans('Currency'.$conf->monnaie).''; + print ''.$langs->trans('Currency'.$conf->currency).''; // Statut print ''.$langs->trans('Status').''; diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php index 346887d312d..d482be44d34 100644 --- a/htdocs/compta/bank/bankid_fr.php +++ b/htdocs/compta/bank/bankid_fr.php @@ -160,7 +160,7 @@ if (($_GET["id"] || $_GET["ref"]) && $_GET["action"] != 'edit') print ''.$langs->trans("Currency").''; print ''; $selectedcode=$account->account_currency_code; - if (! $selectedcode) $selectedcode=$conf->monnaie; + if (! $selectedcode) $selectedcode=$conf->currency; print $langs->trans("Currency".$selectedcode); print ''; @@ -295,7 +295,7 @@ if ($_GET["id"] && $_GET["action"] == 'edit' && $user->rights->banque->configure print ''.$langs->trans("Currency").''; print ''; $selectedcode=$account->account_currency_code; - if (! $selectedcode) $selectedcode=$conf->monnaie; + if (! $selectedcode) $selectedcode=$conf->currency; print $langs->trans("Currency".$selectedcode); print ''; diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index 2ba2d61417c..28d1bd7b4a4 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -244,10 +244,10 @@ if ($action == 'create') print ''.$langs->trans("Currency").''; print ''; $selectedcode=$account->account_currency_code; - if (! $selectedcode) $selectedcode=$conf->monnaie; + if (! $selectedcode) $selectedcode=$conf->currency; $form->select_currency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code'); - //print $langs->trans("Currency".$conf->monnaie); - //print ''; + //print $langs->trans("Currency".$conf->currency); + //print ''; print ''; // Status @@ -386,7 +386,7 @@ else print ''.$langs->trans("Currency").''; print ''; $selectedcode=$account->account_currency_code; - if (! $selectedcode) $selectedcode=$conf->monnaie; + if (! $selectedcode) $selectedcode=$conf->currency; print $langs->trans("Currency".$selectedcode); print ''; @@ -517,10 +517,10 @@ else print ''; print ''; $selectedcode=$account->account_currency_code; - if (! $selectedcode) $selectedcode=$conf->monnaie; + if (! $selectedcode) $selectedcode=$conf->currency; $form->select_currency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code'); - //print $langs->trans("Currency".$conf->monnaie); - //print ''; + //print $langs->trans("Currency".$conf->currency); + //print ''; print ''; // Status diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 0f0e16af275..f124b035245 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -478,7 +478,7 @@ if ($result) if ($user->rights->banque->modifier) { print ''; - print 'rappro?' disabled="disabled"':'').' value="'.price($objp->amount).'"> '.$langs->trans("Currency".$conf->monnaie); + print 'rappro?' disabled="disabled"':'').' value="'.price($objp->amount).'"> '.$langs->trans("Currency".$conf->currency); print ''; } else diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index ed05f6e067b..6b5771a2bec 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -106,7 +106,7 @@ if ($_POST["action"] == 'add') if (! $error) { $mesg.="
"; - $mesg.=$langs->trans("TransferFromToDone","id."\">".$accountfrom->label."","id."\">".$accountto->label."",$amount,$langs->transnoentities("Currency".$conf->monnaie)); + $mesg.=$langs->trans("TransferFromToDone","id."\">".$accountfrom->label."","id."\">".$accountto->label."",$amount,$langs->transnoentities("Currency".$conf->currency)); $mesg.="
"; $db->commit(); } diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index 4b41aabd622..ea41649d3bc 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -280,7 +280,7 @@ if ($_GET["action"] == 'create') print ""; // Amount - print "".''.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->monnaie).''; + print "".''.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).''; print ''.$langs->trans("PublicDonation").""; print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1); @@ -365,7 +365,7 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit') print ""; // Amount - print "".''.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->monnaie).''; + print "".''.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).''; print ''.$langs->trans("PublicDonation").""; print $form->selectyesno("public",1,1); @@ -455,7 +455,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit') print ''.$langs->trans("Comments").' :
'; print nl2br($don->note).''; - print "".''.$langs->trans("Amount").''.price($don->amount).' '.$langs->trans("Currency".$conf->monnaie).''; + print "".''.$langs->trans("Amount").''.price($don->amount).' '.$langs->trans("Currency".$conf->currency).''; print "".$langs->trans("PublicDonation").""; print yn($don->public); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 9b4b206bd55..44926e4ecf2 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1011,7 +1011,7 @@ if (($action == 'addline' || $action == 'addline_predef') && $user->rights->fact { if($price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min))) { - $object->error = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)); + $object->error = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency)); $result = -1 ; } else @@ -1118,7 +1118,7 @@ if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['save'] if ($object->type!=2 && $price_min && GETPOST('productid') && (price2num($up_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) { //print "CantBeLessThanMinPrice ".$up_ht." - ".GETPOST('remise_percent')." - ".$product->price_min; - $mesg = '
'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'
'; + $mesg = '
'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency)).'
'; $result=-1; } @@ -1726,7 +1726,7 @@ if ($action == 'create') print ' ('.$langs->trans("EditRelativeDiscount").')'; print '. '; print '
'; - if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",''.price($absolute_discount).'',$langs->trans("Currency".$conf->monnaie)); + if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",''.price($absolute_discount).'',$langs->trans("Currency".$conf->currency)); else print $langs->trans("CompanyHasNoAbsoluteDiscount"); print ' ('.$langs->trans("EditGlobalDiscounts").')'; print '.'; @@ -2064,8 +2064,8 @@ else $close[$i]['label']=$langs->trans("ConfirmClassifyPaidPartiallyReasonBadCustomerDesc");$i++; // Texte $i=0; - $close[$i]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonDiscountVat",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[$i]['label'],1);$i++; - $close[$i]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[$i]['label'],1);$i++; + $close[$i]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonDiscountVat",$resteapayer,$langs->trans("Currency".$conf->currency)),$close[$i]['label'],1);$i++; + $close[$i]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer",$resteapayer,$langs->trans("Currency".$conf->currency)),$close[$i]['label'],1);$i++; // arrayreasons[code]=reason foreach($close as $key => $val) { @@ -2249,19 +2249,19 @@ else { if ($object->statut == 0) { - print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie)); + print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); print '. '; } else { if ($object->statut < 1 || $object->type == 2 || $object->type == 3) { - $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie)); + $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); print '
'.$text.'.
'; } else { - $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie)); + $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); $text2=$langs->trans("AbsoluteDiscountUse"); print $form->textwithpicto($text,$text2); } @@ -2290,12 +2290,12 @@ else { if ($object->statut == 0 && $object->type != 3) { - $text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie)); + $text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)); print $form->textwithpicto($text,$langs->trans("CreditNoteDepositUse")); } else { - print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie)).'.'; + print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'.'; } } else @@ -2588,9 +2588,9 @@ else // Amount print ''.$langs->trans('AmountHT').''; print ''.price($object->total_ht).''; - print ''.$langs->trans('Currency'.$conf->monnaie).''; + print ''.$langs->trans('Currency'.$conf->currency).''; print ''.$langs->trans('AmountVAT').''.price($object->total_tva).''; - print ''.$langs->trans('Currency'.$conf->monnaie).''; + print ''.$langs->trans('Currency'.$conf->currency).''; // Amount Local Taxes if ($mysoc->pays_code=='ES') @@ -2599,18 +2599,18 @@ else { print ''.$langs->transcountry("AmountLT1",$mysoc->pays_code).''; print ''.price($object->total_localtax1).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; } if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF { print ''.$langs->transcountry("AmountLT2",$mysoc->pays_code).''; print ''.price($object->total_localtax2).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; } } print ''.$langs->trans('AmountTTC').''.price($object->total_ttc).''; - print ''.$langs->trans('Currency'.$conf->monnaie).''; + print ''.$langs->trans('Currency'.$conf->currency).''; // Statut print ''.$langs->trans('Status').''; diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php index b8f76d5c24b..6c07791e272 100644 --- a/htdocs/compta/facture/apercu.php +++ b/htdocs/compta/facture/apercu.php @@ -148,19 +148,19 @@ if ($id > 0 || ! empty($ref)) { if ($object->statut == 0) { - print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie)); + print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); print '. '; } else { if ($object->statut < 1 || $object->type == 2 || $object->type == 3) { - $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie)); + $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); print '
'.$text.'.
'; } else { - $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie)); + $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); $text2=$langs->trans("AbsoluteDiscountUse"); print $form->textwithpicto($text,$text2); } @@ -190,12 +190,12 @@ if ($id > 0 || ! empty($ref)) { if ($object->statut == 0 && $object->type != 3) { - $text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie)); + $text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)); print $form->textwithpicto($text,$langs->trans("CreditNoteDepositUse")); } else { - print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie)).'.'; + print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'.'; } } else @@ -344,12 +344,12 @@ if ($id > 0 || ! empty($ref)) print ''.$langs->trans("AmountHT").''; print ''.price($object->total_ht).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; print ''.$langs->trans('AmountVAT').''.price($object->total_tva).''; - print ''.$langs->trans('Currency'.$conf->monnaie).''; + print ''.$langs->trans('Currency'.$conf->currency).''; print ''.$langs->trans('AmountTTC').''.price($object->total_ttc).''; - print ''.$langs->trans('Currency'.$conf->monnaie).''; + print ''.$langs->trans('Currency'.$conf->currency).''; // Statut print ''.$langs->trans('Status').''.($object->getLibStatut(4,$totalpaye)).''; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index e227ff8ae7f..4bcf25ece22 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -373,12 +373,12 @@ else print ''.$langs->trans("AmountHT").''; print ''.price($fac->total_ht).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; print ''.$langs->trans("AmountVAT").''.price($fac->total_tva).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; print ''.$langs->trans("AmountTTC").''.price($fac->total_ttc).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; if ($fac->note) { print ''.$langs->trans("Note").' : '.nl2br($fac->note).""; diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 8291b5ab37e..100d8e31b32 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -214,18 +214,18 @@ if ($_REQUEST["facid"] > 0 || $_REQUEST["ref"]) { if ($fac->statut == 0) { - print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie)).'. '; + print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)).'. '; } else { if ($fac->statut < 1 || $fac->type == 2 || $fac->type == 3) { - $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie)); + $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); print '
'.$text.'.
'; } else { - $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie)); + $text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); $text2=$langs->trans("AbsoluteDiscountUse"); print $form->textwithpicto($text,$text2); } @@ -246,10 +246,10 @@ if ($_REQUEST["facid"] > 0 || $_REQUEST["ref"]) { if ($fac->statut == 0 && $fac->type != 3) { - $text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie)); + $text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)); print $form->textwithpicto($text,$langs->trans("CreditNoteDepositUse")); } - else print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie)).'.'; + else print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'.'; } else { @@ -361,9 +361,9 @@ if ($_REQUEST["facid"] > 0 || $_REQUEST["ref"]) // Montants print ''.$langs->trans('AmountHT').''; print ''.price($fac->total_ht).''; - print ''.$langs->trans('Currency'.$conf->monnaie).''; + print ''.$langs->trans('Currency'.$conf->currency).''; print ''.$langs->trans('AmountVAT').''.price($fac->total_tva).''; - print ''.$langs->trans('Currency'.$conf->monnaie).''; + print ''.$langs->trans('Currency'.$conf->currency).''; // Amount Local Taxes if ($mysoc->pays_code=='ES') @@ -372,18 +372,18 @@ if ($_REQUEST["facid"] > 0 || $_REQUEST["ref"]) { print ''.$langs->transcountry("AmountLT1",$mysoc->pays_code).''; print ''.price($fac->total_localtax1).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; } if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF { print ''.$langs->transcountry("AmountLT2",$mysoc->pays_code).''; print ''.price($fac->total_localtax2).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; } } print ''.$langs->trans('AmountTTC').''.price($fac->total_ttc).''; - print ''.$langs->trans('Currency'.$conf->monnaie).''; + print ''.$langs->trans('Currency'.$conf->currency).''; // Statut print ''.$langs->trans('Status').''; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 6eaccc3fa33..5d5604deb18 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -598,7 +598,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $preselectedchoice=$addwarning?'no':'yes'; print '
'; - $text=$langs->trans('ConfirmCustomerPayment',$totalpaiement,$langs->trans("Currency".$conf->monnaie)); + $text=$langs->trans('ConfirmCustomerPayment',$totalpaiement,$langs->trans("Currency".$conf->currency)); if (GETPOST('closepaidinvoices')) { $text.='
'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed"); diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php index 7e6e9fe06ce..5a8234c6970 100644 --- a/htdocs/compta/paiement/fiche.php +++ b/htdocs/compta/paiement/fiche.php @@ -233,7 +233,7 @@ print $form->editfieldval("Numero",'num',$paiement->numero,$paiement,$paiement-> print ''; // Amount -print ''.$langs->trans('Amount').''.price($paiement->montant).' '.$langs->trans('Currency'.$conf->monnaie).''; +print ''.$langs->trans('Amount').''.price($paiement->montant).' '.$langs->trans('Currency'.$conf->currency).''; // Note print ''.$form->editfieldkey("Note",'note',$paiement->note,$paiement,$user->rights->facture->paiement).''; diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 2e3d9df41dd..00ccd303408 100755 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -185,7 +185,7 @@ if ($_GET["action"] == 'create') print ''.$langs->trans("Label").''.$charge->lib."\n"; print ''.$langs->trans("DateDue")."".dol_print_date($charge->date_ech,'day')."\n"; - print ''.$langs->trans("AmountTTC")."".price($charge->amount).' '.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("AmountTTC")."".price($charge->amount).' '.$langs->trans("Currency".$conf->currency).''; $sql = "SELECT sum(p.amount) as total"; $sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p"; @@ -197,8 +197,8 @@ if ($_GET["action"] == 'create') $sumpaid = $obj->total; $db->free(); } - print ''.$langs->trans("AlreadyPaid").''.price($sumpaid).' '.$langs->trans("Currency".$conf->monnaie).''; - print "".$langs->trans("RemainderToPay")."".price($total - $sumpaid).' '.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("AlreadyPaid").''.price($sumpaid).' '.$langs->trans("Currency".$conf->currency).''; + print "".$langs->trans("RemainderToPay")."".price($total - $sumpaid).' '.$langs->trans("Currency".$conf->currency).''; print "".$langs->trans("Payment").''; diff --git a/htdocs/compta/payment_sc/fiche.php b/htdocs/compta/payment_sc/fiche.php index 6c4a53fbb51..ab14d509a85 100644 --- a/htdocs/compta/payment_sc/fiche.php +++ b/htdocs/compta/payment_sc/fiche.php @@ -182,7 +182,7 @@ print ''.$langs->trans('Mode').''.$lan print ''.$langs->trans('Numero').''.$paiement->num_paiement.''; // Montant -print ''.$langs->trans('Amount').''.price($paiement->amount).' '.$langs->trans('Currency'.$conf->monnaie).''; +print ''.$langs->trans('Amount').''.price($paiement->amount).' '.$langs->trans('Currency'.$conf->currency).''; // Note diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 606bc3600f2..9e9c71b390d 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -198,7 +198,7 @@ if ($resql) print $thirdpartystatic->getNomUrl(1,'customer'); print ''; print ''; - print price($obj->total_ttc).' '.$langs->trans("Currency".$conf->monnaie); + print price($obj->total_ttc).' '.$langs->trans("Currency".$conf->currency); print ''; // Date print ''; @@ -258,7 +258,7 @@ if ($result) print "\n"; print ''.dol_print_date($db->jdate($obj->datec),'day')."\n"; - print ''.price($obj->amount).' '.$langs->trans("Currency".$conf->monnaie)."\n"; + print ''.price($obj->amount).' '.$langs->trans("Currency".$conf->currency)."\n"; print "\n"; $i++; diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index a379d7a5791..3a9b51b7fc6 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -168,7 +168,7 @@ if ($id > 0 || ! empty($ref)) else print $langs->trans("CompanyHasNoRelativeDiscount"); $absolute_discount=$societe->getAvailableDiscounts(); print '. '; - if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie)); + if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency)); else print $langs->trans("CompanyHasNoAbsoluteDiscount"); print '.'; print ''; @@ -289,10 +289,10 @@ if ($id > 0 || ! empty($ref)) // Amount print ''.$langs->trans('AmountHT').''; print ''.price($object->total_ht).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; print ''.$langs->trans('AmountVAT').''.price($object->total_tva).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; // Amount Local Taxes if ($mysoc->pays_code=='ES') @@ -301,19 +301,19 @@ if ($id > 0 || ! empty($ref)) { print ''.$langs->transcountry("AmountLT1",$mysoc->pays_code).''; print ''.price($object->total_localtax1).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; } if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF { print ''.$langs->transcountry("AmountLT2",$mysoc->pays_code).''; print ''.price($object->total_localtax2).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; } } print ''.$langs->trans('AmountTTC').''.price($object->total_ttc).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; // Statut diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index 565f5a933bd..c45c1168c9b 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -351,7 +351,7 @@ if ($chid > 0) print ''.img_object($langs->trans("Payment"),"payment").' '; print dol_print_date($db->jdate($objp->dp),'day')."\n"; print "".$objp->paiement_type.' '.$objp->num_paiement."\n"; - print ''.price($objp->amount)." ".$langs->trans("Currency".$conf->monnaie)."\n"; + print ''.price($objp->amount)." ".$langs->trans("Currency".$conf->currency)."\n"; print ""; $totalpaye += $objp->amount; $i++; @@ -359,13 +359,13 @@ if ($chid > 0) if ($cha->paye == 0) { - print "".$langs->trans("AlreadyPaid")." :".price($totalpaye)." ".$langs->trans("Currency".$conf->monnaie)."\n"; - print "".$langs->trans("AmountExpected")." :".price($cha->amount)." ".$langs->trans("Currency".$conf->monnaie)."\n"; + print "".$langs->trans("AlreadyPaid")." :".price($totalpaye)." ".$langs->trans("Currency".$conf->currency)."\n"; + print "".$langs->trans("AmountExpected")." :".price($cha->amount)." ".$langs->trans("Currency".$conf->currency)."\n"; $resteapayer = $cha->amount - $totalpaye; print "".$langs->trans("RemainderToPay")." :"; - print "".price($resteapayer)." ".$langs->trans("Currency".$conf->monnaie)."\n"; + print "".price($resteapayer)." ".$langs->trans("Currency".$conf->currency)."\n"; } print ""; $db->free($resql); diff --git a/htdocs/compta/stats/prev.php b/htdocs/compta/stats/prev.php index 7a37369c55f..0b3e6e6bdcf 100644 --- a/htdocs/compta/stats/prev.php +++ b/htdocs/compta/stats/prev.php @@ -56,7 +56,7 @@ function pt ($db, $sql, $title) { $total = $total + $obj->amount; $i++; } - print "".$langs->trans("TotalHT").": ".price($total)." ".$langs->trans("Currency".$conf->monnaie).""; + print "".$langs->trans("TotalHT").": ".price($total)." ".$langs->trans("Currency".$conf->currency).""; $db->free(); } diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 938010289ee..cee7fd45353 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -157,7 +157,7 @@ if ($id > 0) else print $langs->trans("CompanyHasNoRelativeDiscount"); $absolute_discount=$contrat->societe->getAvailableDiscounts(); print '. '; - if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->monnaie)); + if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->currency)); else print $langs->trans("CompanyHasNoAbsoluteDiscount"); print '.'; print ''; diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 33496cef4a0..286a5239b23 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -290,7 +290,7 @@ if ($action == 'addline' && $user->rights->contrat->creer) if($price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min))) { - $object->error = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)); + $object->error = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency)); $result = -1 ; } else @@ -510,7 +510,7 @@ if ($action == 'create') else print $langs->trans("CompanyHasNoRelativeDiscount"); $absolute_discount=$soc->getAvailableDiscounts(); print '. '; - if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie)); + if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency)); else print $langs->trans("CompanyHasNoAbsoluteDiscount"); print '.'; print ''; @@ -657,7 +657,7 @@ else else print $langs->trans("CompanyHasNoRelativeDiscount"); $absolute_discount=$object->societe->getAvailableDiscounts(); print '. '; - if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie)); + if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency)); else print $langs->trans("CompanyHasNoAbsoluteDiscount"); print '.'; print ''; diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 6554e5ad8c1..4f758b4c327 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -119,7 +119,7 @@ if ($_GET["id"]) else print $langs->trans("CompanyHasNoRelativeDiscount"); $absolute_discount=$contrat->societe->getAvailableDiscounts(); print '. '; - if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->monnaie)); + if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->currency)); else print $langs->trans("CompanyHasNoAbsoluteDiscount"); print '.'; print ''; diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index fc70f640161..d2267e11562 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -130,7 +130,7 @@ class box_comptes extends ModeleBoxes { $this->info_box_contents[$i][2] = array('td' => 'align="right" class="liste_total"', 'text' => ' ' ); - $totalamount=price($solde_total).' '.$langs->trans("Currency".$conf->monnaie); + $totalamount=price($solde_total).' '.$langs->trans("Currency".$conf->currency); $this->info_box_contents[$i][3] = array('td' => 'align="right" class="liste_total"', 'text' => $totalamount ); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 24cca609cec..242d140dbaf 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -326,9 +326,8 @@ class Conf $this->global->PRODUIT_USE_SEARCH_TO_SELECT=0; } - // conf->monnaie + // conf->currency if (empty($this->global->MAIN_MONNAIE)) $this->global->MAIN_MONNAIE='EUR'; - $this->monnaie=$this->global->MAIN_MONNAIE; // TODO deprecated $this->currency=$this->global->MAIN_MONNAIE; // $this->global->COMPTA_MODE = Option des modules Comptabilites (simple ou expert). Defini le mode de calcul des etats comptables (CA,...) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9087c5bbd48..ed5615f79f9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1249,10 +1249,10 @@ class Form $outval.=$objRef.' - '.dol_trunc($label,32).' - '; $found=0; - $currencytext=$langs->trans("Currency".$conf->monnaie); - $currencytextnoent=$langs->transnoentities("Currency".$conf->monnaie); - if (dol_strlen($currencytext) > 10) $currencytext=$conf->monnaie; // If text is too long, we use the short code - if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->monnaie; // If text is too long, we use the short code + $currencytext=$langs->trans("Currency".$conf->currency); + $currencytextnoent=$langs->transnoentities("Currency".$conf->currency); + if (dol_strlen($currencytext) > 10) $currencytext=$conf->currency; // If text is too long, we use the short code + if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->currency; // If text is too long, we use the short code // Multiprice if ($price_level >= 1) // If we need a particular price level (from 1 to 6) @@ -1464,10 +1464,10 @@ class Form if ($objp->fprice != '') // Keep != '' { - $currencytext=$langs->trans("Currency".$conf->monnaie); - $currencytextnoent=$langs->transnoentities("Currency".$conf->monnaie); - if (dol_strlen($currencytext) > 10) $currencytext=$conf->monnaie; // If text is too long, we use the short code - if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->monnaie; // If text is too long, we use the short code + $currencytext=$langs->trans("Currency".$conf->currency); + $currencytextnoent=$langs->transnoentities("Currency".$conf->currency); + if (dol_strlen($currencytext) > 10) $currencytext=$conf->currency; // If text is too long, we use the short code + if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->currency; // If text is too long, we use the short code $opt.= price($objp->fprice).' '.$currencytext."/".$objp->quantity; $outval.= price($objp->fprice).' '.$currencytextnoent."/".$objp->quantity; @@ -1578,7 +1578,7 @@ class Form if ($objp->quantity == 1) { $opt.= price($objp->fprice); - $opt.= $langs->trans("Currency".$conf->monnaie)."/"; + $opt.= $langs->trans("Currency".$conf->currency)."/"; } $opt.= $objp->quantity.' '; @@ -1594,7 +1594,7 @@ class Form if ($objp->quantity > 1) { $opt.=" - "; - $opt.= price($objp->unitprice).$langs->trans("Currency".$conf->monnaie)."/".strtolower($langs->trans("Unit")); + $opt.= price($objp->unitprice).$langs->trans("Currency".$conf->currency)."/".strtolower($langs->trans("Unit")); } if ($objp->duration) $opt .= " - ".$objp->duration; $opt .= "\n"; @@ -2723,9 +2723,9 @@ class Form print ''; print ''; print ''; @@ -360,15 +360,15 @@ if ($id > 0 || ! empty($ref)) // Total HT print ''; print ''; - print ''; + print ''; // Total TVA print ''; - print ''; + print ''; // Total TTC print ''; - print ''; + print ''; // Statut print ''; diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 77b08dae967..e2d43151f07 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1028,10 +1028,10 @@ if ($id > 0 || ! empty($ref)) // Ligne de 3 colonnes print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; // Amount Local Taxes if ($mysoc->pays_code=='ES') @@ -1040,17 +1040,17 @@ if ($id > 0 || ! empty($ref)) { print ''; print ''; - print ''; + print ''; } if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF { print ''; print ''; - print ''; + print ''; } } print ''; - print ''; + print ''; print "
'; - //if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->monnaie)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice - if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->monnaie)).': '; - else print $langs->trans("CompanyHasCreditNote",price($amount),$langs->transnoentities("Currency".$conf->monnaie)).': '; + //if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice + if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->currency)).': '; + else print $langs->trans("CompanyHasCreditNote",price($amount),$langs->transnoentities("Currency".$conf->currency)).': '; $newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles if ($filter) $newfilter.=' AND ('.$filter.')'; $nbqualifiedlines=$this->select_remises($selected,$htmlname,$newfilter,$socid,$maxvalue); diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index d51685d2f56..96d9a5ed541 100755 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -1189,7 +1189,6 @@ class SMTPs //$content = 'Content-Type: multipart/related; boundary="' . $this->_getBoundary() . '"' . "\r\n"; $content = 'Content-Type: multipart/mixed; boundary="' . $this->_getBoundary() . '"' . "\r\n"; - // TODO Restore // . "\r\n" // . 'This is a multi-part message in MIME format.' . "\r\n"; $content .= "Content-Transfer-Encoding: 8bit" . "\r\n"; @@ -1203,8 +1202,6 @@ class SMTPs // loop through all attachments foreach ( $_content as $_file => $_data ) { - - // TODO Restore "\r\n" $content .= "--" . $this->_getBoundary() . "\r\n" . 'Content-Disposition: attachment; filename="' . $_data['fileName'] . '"' . "\r\n" . 'Content-Type: ' . $_data['mimeType'] . '; name="' . $_data['fileName'] . '"' . "\r\n" @@ -1225,7 +1222,6 @@ class SMTPs // loop through all images foreach ( $_content as $_image => $_data ) { - // TODO Restore "\r\n" $content .= "--" . $this->_getBoundary() . "\r\n"; $content .= 'Content-Type: ' . $_data['mimeType'] . '; name="' . $_data['imageName'] . '"' . "\r\n" @@ -1242,13 +1238,11 @@ class SMTPs } else { - // TODO Restore "\r\n" $content .= "--" . $this->_getBoundary() . "\r\n" . 'Content-Type: ' . $_content['mimeType'] . '; ' // . 'charset="' . $this->getCharSet() . '"'; . 'charset=' . $this->getCharSet() . ''; - // TODO Restore // $content .= ( $type == 'html') ? '; name="HTML Part"' : ''; $content .= "\r\n"; // $content .= 'Content-Transfer-Encoding: '; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 7c94b19b66c..f73d3f7be60 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -557,7 +557,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass // Capital if ($fromcompany->capital) { - $line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",$fromcompany->capital)." ".$outputlangs->transnoentities("Currency".$conf->monnaie); + $line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",$fromcompany->capital)." ".$outputlangs->transnoentities("Currency".$conf->currency); } // Prof Id 1 if ($fromcompany->idprof1 && ($fromcompany->pays_code != 'FR' || ! $fromcompany->idprof2)) diff --git a/htdocs/core/modules/commande/pdf_edison.modules.php b/htdocs/core/modules/commande/pdf_edison.modules.php index e293cae0ae1..f3bcde89aff 100644 --- a/htdocs/core/modules/commande/pdf_edison.modules.php +++ b/htdocs/core/modules/commande/pdf_edison.modules.php @@ -487,7 +487,7 @@ class pdf_edison extends ModelePDFCommandes $pdf->SetTextColor(0,0,0); $pdf->SetFont('','', $default_font_size-1); - $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie)); + $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency)); $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); } diff --git a/htdocs/core/modules/commande/pdf_einstein.modules.php b/htdocs/core/modules/commande/pdf_einstein.modules.php index b8292177a4f..6a9b444deae 100644 --- a/htdocs/core/modules/commande/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/pdf_einstein.modules.php @@ -774,7 +774,7 @@ class pdf_einstein extends ModelePDFCommandes $default_font_size = pdf_getPDFFontSize($outputlangs); $pdf->SetTextColor(0,0,0); $pdf->SetFont('','', $default_font_size - 2); - $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie)); + $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency)); $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index 2fff5557cfb..14bb9dc0846 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -119,8 +119,8 @@ class html_cerfafr extends ModeleDon $form = str_replace('__DATE__',dol_print_date($don->date,'day',false,$outputlangs),$form); $form = str_replace('__IP__',$user->ip,$form); $form = str_replace('__AMOUNT__',$don->amount,$form); - $form = str_replace('__CURRENCY__',$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie),$form); - $form = str_replace('__CURRENCYCODE__',$conf->monnaie,$form); + $form = str_replace('__CURRENCY__',$outputlangs->transnoentitiesnoconv("Currency".$conf->currency),$form); + $form = str_replace('__CURRENCYCODE__',$conf->currency,$form); $form = str_replace('__MAIN_INFO_SOCIETE_NOM__',$mysoc->name,$form); $form = str_replace('__MAIN_INFO_SOCIETE_ADRESSE__',$mysoc->address,$form); $form = str_replace('__MAIN_INFO_SOCIETE_CP__',$mysoc->zip,$form); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 1b9b26275b4..381de4009fb 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -933,7 +933,7 @@ class pdf_crabe extends ModelePDFFactures // Amount in (at tab_top - 1) $pdf->SetTextColor(0,0,0); $pdf->SetFont('','', $default_font_size - 2); - $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie)); + $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency)); $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); diff --git a/htdocs/core/modules/facture/doc/pdf_oursin.modules.php b/htdocs/core/modules/facture/doc/pdf_oursin.modules.php index cad37bf6e39..0cbb903cfda 100755 --- a/htdocs/core/modules/facture/doc/pdf_oursin.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_oursin.modules.php @@ -1013,7 +1013,7 @@ class pdf_oursin extends ModelePDFFactures // Amount in (at tab_top - 1) $pdf->SetTextColor(0,0,0); $pdf->SetFont('','', $default_font_size-1); - $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie)); + $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency)); $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), 90); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); } diff --git a/htdocs/core/modules/propale/pdf_propale_azur.modules.php b/htdocs/core/modules/propale/pdf_propale_azur.modules.php index 86db4b61f55..2a036aa8f0f 100644 --- a/htdocs/core/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/core/modules/propale/pdf_propale_azur.modules.php @@ -804,7 +804,7 @@ class pdf_propale_azur extends ModelePDFPropales // Montants exprimes en (en tab_top - 1) $pdf->SetTextColor(0,0,0); $pdf->SetFont('','',$default_font_size - 2); - $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie)); + $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency)); $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); diff --git a/htdocs/core/modules/propale/pdf_propale_jaune.modules.php b/htdocs/core/modules/propale/pdf_propale_jaune.modules.php index 7643b5c9ade..79c76a4c5c9 100644 --- a/htdocs/core/modules/propale/pdf_propale_jaune.modules.php +++ b/htdocs/core/modules/propale/pdf_propale_jaune.modules.php @@ -804,7 +804,7 @@ class pdf_propale_jaune extends ModelePDFPropales // Montants exprimes en (en tab_top - 1) $pdf->SetTextColor(0,0,0); $pdf->SetFont('','',$default_font_size - 2); - $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie)); + $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency)); $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index c80ad2266e4..26262e3bc96 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -587,7 +587,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Amount in (at tab_top - 1) $pdf->SetTextColor(0,0,0); $pdf->SetFont('','',$default_font_size - 2); - $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie)); + $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency)); $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index bd78be5eb83..71b8c244d50 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -591,7 +591,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Amount in (at tab_top - 1) $pdf->SetTextColor(0,0,0); $pdf->SetFont('','', $default_font_size - 2); - $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie)); + $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency)); $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index dc143d7c2e2..f92de82038f 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -214,7 +214,7 @@ if ($id > 0 || ! empty($ref)) { if ($commande->statut > 0) { - print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie)); + print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); } else { @@ -226,7 +226,7 @@ if ($id > 0 || ! empty($ref)) } if ($absolute_creditnote) { - print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie)).'. '; + print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'. '; } if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; print '
'.$langs->trans('AmountHT').''.price($commande->total_ht).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->trans('Currency'.$conf->currency).'
'.$langs->trans('AmountVAT').''.price($commande->total_tva).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->trans('Currency'.$conf->currency).'
'.$langs->trans('AmountTTC').''.price($commande->total_ttc).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->trans('Currency'.$conf->currency).'
'.$langs->trans('Status').'
'.$langs->trans("AmountHT").''.price($object->total_ht).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("AmountVAT").''.price($object->total_tva).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans("Currency".$conf->currency).'
'.$langs->transcountry("AmountLT1",$mysoc->pays_code).''.price($object->total_localtax1).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans("Currency".$conf->currency).'
'.$langs->transcountry("AmountLT2",$mysoc->pays_code).''.price($object->total_localtax2).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("AmountTTC").''.price($object->total_ttc).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans("Currency".$conf->currency).'

"; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 86d235922e2..ff10216fcfa 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1396,8 +1396,8 @@ else $alreadypaid=$object->getSommePaiement(); print ''.$langs->trans('Status').''.$object->getLibStatut(4,$alreadypaid).''; - print ''.$langs->trans('AmountHT').''.price($object->total_ht).''.$langs->trans('Currency'.$conf->monnaie).''; - print ''.$langs->trans('AmountVAT').''.price($object->total_tva).''.$langs->trans('Currency'.$conf->monnaie).''; + print ''.$langs->trans('AmountHT').''.price($object->total_ht).''.$langs->trans('Currency'.$conf->currency).''; + print ''.$langs->trans('AmountVAT').''.price($object->total_tva).''.$langs->trans('Currency'.$conf->currency).''; // Amount Local Taxes if ($mysoc->pays_code=='ES') @@ -1406,16 +1406,16 @@ else { print ''.$langs->transcountry("AmountLT1",$mysoc->pays_code).''; print ''.price($object->total_localtax1).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; } if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF { print ''.$langs->transcountry("AmountLT2",$mysoc->pays_code).''; print ''.price($object->total_localtax2).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->currency).''; } } - print ''.$langs->trans('AmountTTC').''.price($object->total_ttc).''.$langs->trans('Currency'.$conf->monnaie).''; + print ''.$langs->trans('AmountTTC').''.price($object->total_ttc).''.$langs->trans('Currency'.$conf->currency).''; // Project if ($conf->projet->enabled) diff --git a/htdocs/fourn/paiement/fiche.php b/htdocs/fourn/paiement/fiche.php index 40c2639ff9b..fa9af22b983 100644 --- a/htdocs/fourn/paiement/fiche.php +++ b/htdocs/fourn/paiement/fiche.php @@ -193,7 +193,7 @@ if ($result > 0) print ''; // Amount - print ''.$langs->trans('Amount').''.price($object->montant).' '.$langs->trans('Currency'.$conf->monnaie).''; + print ''.$langs->trans('Amount').''.price($object->montant).' '.$langs->trans('Currency'.$conf->currency).''; if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) { diff --git a/htdocs/paybox/lib/paybox.lib.php b/htdocs/paybox/lib/paybox.lib.php index b00e62e0db6..9182ed82d74 100755 --- a/htdocs/paybox/lib/paybox.lib.php +++ b/htdocs/paybox/lib/paybox.lib.php @@ -263,7 +263,7 @@ function html_print_paybox_footer($fromcompany,$langs) // Capital if ($fromcompany->capital) { - $line1.=($line1?" - ":"").$langs->transnoentities("CapitalOf",$fromcompany->capital)." ".$langs->transnoentities("Currency".$conf->monnaie); + $line1.=($line1?" - ":"").$langs->transnoentities("CapitalOf",$fromcompany->capital)." ".$langs->transnoentities("Currency".$conf->currency); } // Prof Id 1 if ($fromcompany->idprof1 && ($fromcompany->pays_code != 'FR' || ! $fromcompany->idprof2)) diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 6c7c086f897..643085d09a4 100755 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -91,7 +91,7 @@ function html_print_paypal_footer($fromcompany,$langs) // Capital if ($fromcompany->capital) { - $line1.=($line1?" - ":"").$langs->transnoentities("CapitalOf",$fromcompany->capital)." ".$langs->transnoentities("Currency".$conf->monnaie); + $line1.=($line1?" - ":"").$langs->transnoentities("CapitalOf",$fromcompany->capital)." ".$langs->transnoentities("Currency".$conf->currency); } // Prof Id 1 if ($fromcompany->idprof1 && ($fromcompany->pays_code != 'FR' || ! $fromcompany->idprof2)) diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php index 9f9bbe47be3..0533094b598 100644 --- a/htdocs/product/stock/valo.php +++ b/htdocs/product/stock/valo.php @@ -127,8 +127,8 @@ if ($result) print ''; print ''.$langs->trans("Total").''; - print ''.price(price2num($total,'MT')).' '.$langs->trans('Currency'.$conf->monnaie).''; - print ''.price(price2num($totalsell,'MT')).' '.$langs->trans('Currency'.$conf->monnaie).''; + print ''.price(price2num($total,'MT')).' '.$langs->trans('Currency'.$conf->currency).''; + print ''.price(price2num($totalsell,'MT')).' '.$langs->trans('Currency'.$conf->currency).''; print ' '; print "\n"; diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php index c85942d07fe..e2992904f12 100644 --- a/htdocs/public/donations/donateurs_code.php +++ b/htdocs/public/donations/donateurs_code.php @@ -81,7 +81,7 @@ if ($resql) print "Anonyme Anonyme\n"; } print "".dol_print_date($db->jdate($objp->datedon))."\n"; - print ''.number_format($objp->amount,2,'.',' ').' '.$langs->trans("Currency".$conf->monnaie).''; + print ''.number_format($objp->amount,2,'.',' ').' '.$langs->trans("Currency".$conf->currency).''; print ""; $i++; } diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index bb3da9ba07a..1923eff7c71 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -533,7 +533,7 @@ if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT) print ''; print ''; } - print ' '.$langs->trans("Currency".$conf->monnaie); + print ' '.$langs->trans("Currency".$conf->currency); print ''; } print "\n"; diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php index 880b69151fe..cb99d1404aa 100644 --- a/htdocs/public/paybox/newpayment.php +++ b/htdocs/public/paybox/newpayment.php @@ -115,7 +115,7 @@ if (GETPOST("action") == 'dopayment') { dol_syslog("newpayment.php call paybox api and do redirect", LOG_DEBUG); - print_paybox_redirect($PRICE, $conf->monnaie, $email, $urlok, $urlko, $FULLTAG); + print_paybox_redirect($PRICE, $conf->currency, $email, $urlok, $urlko, $FULLTAG); session_destroy(); exit; diff --git a/htdocs/societe/canvas/company/tpl/card_create.tpl.php b/htdocs/societe/canvas/company/tpl/card_create.tpl.php index 500760dcfd2..02faff3b9cc 100644 --- a/htdocs/societe/canvas/company/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_create.tpl.php @@ -140,7 +140,7 @@ trans('Capital'); ?> - trans("Currency".$conf->monnaie); ?> + trans("Currency".$conf->currency); ?> trans('Capital'); ?> - trans("Currency".$conf->monnaie); ?> + trans("Currency".$conf->currency); ?> diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index 6797a3eb3a0..d5921d91243 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -146,7 +146,7 @@ for ($i=1; $i<=4; $i++) { trans('Capital'); ?> control->tpl['capital']) echo $this->control->tpl['capital'].' '.$langs->trans("Currency".$conf->monnaie); + if ($this->control->tpl['capital']) echo $this->control->tpl['capital'].' '.$langs->trans("Currency".$conf->currency); else echo ' '; ?> diff --git a/htdocs/societe/lien.php b/htdocs/societe/lien.php index ee9cd90fb74..80ef3db594e 100644 --- a/htdocs/societe/lien.php +++ b/htdocs/societe/lien.php @@ -184,7 +184,7 @@ if ($socid) // Capital - print ''.$langs->trans("Capital").''.$soc->capital.' '.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Capital").''.$soc->capital.' '.$langs->trans("Currency".$conf->currency).''; // Societe mere print ''.$langs->trans("ParentCompany").''; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 731a5e14eb2..b8b5c36296f 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -895,7 +895,7 @@ else print ''; // Capital - print ''.$langs->trans('Capital').' '.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans('Capital').' '.$langs->trans("Currency".$conf->currency).''; // Local Taxes // TODO add specific function by country @@ -1358,7 +1358,7 @@ else print ''; // Capital - print ''.$langs->trans("Capital").' '.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Capital").' '.$langs->trans("Currency".$conf->currency).''; // Default language if ($conf->global->MAIN_MULTILANGS) @@ -1693,7 +1693,7 @@ else // Capital print ''.$langs->trans('Capital').''; - if ($object->capital) print $object->capital.' '.$langs->trans("Currency".$conf->monnaie); + if ($object->capital) print $object->capital.' '.$langs->trans("Currency".$conf->currency); else print ' '; print ''; From 1086e1a212451a95f9eda6c443a0de4024b523e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Nov 2011 15:08:03 +0100 Subject: [PATCH 08/21] Rename test --- test/phpunit/CommonObjectTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/CommonObjectTest.php b/test/phpunit/CommonObjectTest.php index cff65e239b6..639a0202624 100644 --- a/test/phpunit/CommonObjectTest.php +++ b/test/phpunit/CommonObjectTest.php @@ -173,7 +173,7 @@ class CommonObjectTest extends PHPUnit_Framework_TestCase /** * */ - public function testFetchClient() + public function testFetchThirdParty() { global $conf,$user,$langs,$db; $conf=$this->savconf; From 237cd163d9a48636f7dbe8ddff1cfdb1b991f776 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Nov 2011 15:19:44 +0100 Subject: [PATCH 09/21] Fix: Use correct case for class name --- htdocs/admin/tools/purge.php | 2 +- htdocs/ecm/class/ecmdirectory.class.php | 87 ++++++++++++++----------- htdocs/ecm/class/htmlecm.form.class.php | 2 +- htdocs/ecm/docdir.php | 2 +- htdocs/ecm/docfile.php | 4 +- htdocs/ecm/docmine.php | 4 +- htdocs/ecm/index.php | 8 +-- htdocs/ecm/search.php | 4 +- 8 files changed, 62 insertions(+), 51 deletions(-) diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index cafc98a2373..c770598ec83 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -97,7 +97,7 @@ if ($action=='purge' && ! preg_match('/^confirm/i',$choice) && ($choice != 'allf if ($conf->ecm->enabled && $choice=='allfiles') { require_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php"); - $ecmdirstatic = new ECMDirectory($db); + $ecmdirstatic = new EcmDirectory($db); $result = $ecmdirstatic->refreshcachenboffile(1); } } diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 31adb1bca7c..0c5f8c375f7 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -51,11 +51,11 @@ class EcmDirectory // extends CommonObject /** * Constructor * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function EcmDirectory($DB) + function EcmDirectory($db) { - $this->db = $DB; + $this->db = $db; return 1; } @@ -86,14 +86,14 @@ class EcmDirectory // extends CommonObject $relativepath=$this->label; if ($this->fk_parent) { - $parent = new ECMDirectory($this->db); + $parent = new EcmDirectory($this->db); $parent->fetch($this->fk_parent); $relativepath=$parent->getRelativePath().$relativepath; } $relativepath=preg_replace('/([\/])+/i','/',$relativepath); // Avoid duplicate / or \ //print $relativepath.'
'; - $cat = new ECMDirectory($this->db); + $cat = new EcmDirectory($this->db); $cate_arbo = $cat->get_full_arbo(1); $pathfound=0; foreach ($cate_arbo as $key => $categ) @@ -174,10 +174,11 @@ class EcmDirectory // extends CommonObject } /** - * \brief Update database - * \param user User that modify - * \param notrigger 0=no, 1=yes (no update trigger) - * \return int <0 if KO, >0 if OK + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=no, 1=yes (no update trigger) + * @return int <0 if KO, >0 if OK */ function update($user=0, $notrigger=0) { @@ -235,9 +236,10 @@ class EcmDirectory // extends CommonObject /** - * Update cache of nb of documents into database - * @param sign '+' or '-' - * @return int <0 if KO, >0 if OK + * Update cache of nb of documents into database + * + * @param string $sign '+' or '-' + * @return int <0 if KO, >0 if OK */ function changeNbOfFiles($sign) { @@ -262,9 +264,10 @@ class EcmDirectory // extends CommonObject /** - * \brief Load object in memory from database - * \param id id object - * \return int <0 if KO, 0 if not found, >0 if OK + * Load object in memory from database + * + * @param int $id Id of object + * @return int <0 if KO, 0 if not found, >0 if OK */ function fetch($id) { @@ -315,9 +318,10 @@ class EcmDirectory // extends CommonObject /** - * \brief Delete object on database and on disk - * \param user User that delete - * \return int <0 if KO, >0 if OK + * Delete object on database and on disk + * + * @param User $user User that delete + * @return int <0 if KO, >0 if OK */ function delete($user) { @@ -391,10 +395,12 @@ class EcmDirectory // extends CommonObject /** - * \brief Return directory name you can click (and picto) - * \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul - * \param option Sur quoi pointe le lien - * \return string Chaine avec URL + * Return directory name you can click (and picto) + * + * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul + * @param string $option Sur quoi pointe le lien + * @param int $max Max length + * @return string Chaine avec URL */ function getNomUrl($withpicto=0,$option='',$max=0) { @@ -423,8 +429,9 @@ class EcmDirectory // extends CommonObject /** * Return relative path of a directory on disk - * @param force Force reload of full arbo even if already loaded - * @return string Relative physical path + * + * @param int $force Force reload of full arbo even if already loaded + * @return string Relative physical path */ function getRelativePath($force=0) { @@ -461,8 +468,9 @@ class EcmDirectory // extends CommonObject } /** - * \brief Load this->motherof that is array(id_son=>id_parent, ...) - * \return int <0 if KO, >0 if OK + * Load this->motherof that is array(id_son=>id_parent, ...) + * + * @return int <0 if KO, >0 if OK */ function load_motherof() { @@ -488,7 +496,7 @@ class EcmDirectory // extends CommonObject } else { - dol_print_error ($this->db); + dol_print_error($this->db); return -1; } } @@ -509,8 +517,9 @@ class EcmDirectory // extends CommonObject * fullrelativename Full path name (Added by build_path_from_id_categ call) * fulllabel Full label (Added by build_path_from_id_categ call) * level Level of line (Added by build_path_from_id_categ call) - * @param force Force reload of full arbo even if already loaded in cache $this->cats - * @return array Tableau de array + * + * @param int $force Force reload of full arbo even if already loaded in cache $this->cats + * @return array Tableau de array */ function get_full_arbo($force=0) { @@ -576,7 +585,7 @@ class EcmDirectory // extends CommonObject } else { - dol_print_error ($this->db); + dol_print_error($this->db); return -1; } @@ -594,10 +603,12 @@ class EcmDirectory // extends CommonObject } /** - * \brief Calcule les proprietes fullpath, fullrelativename, fulllabel d'un repertoire - * du tableau this->cats et de toutes ces enfants - * \param id_categ id_categ entry to update - * \param protection Deep counter to avoid infinite loop + * Calcule les proprietes fullpath, fullrelativename, fulllabel d'un repertoire + * du tableau this->cats et de toutes ces enfants. + * + * @param int $id_categ id_categ entry to update + * @param int $protection Deep counter to avoid infinite loop + * @return void */ function build_path_from_id_categ($id_categ,$protection=0) { @@ -635,10 +646,10 @@ class EcmDirectory // extends CommonObject } /** - * \brief Refresh value for cachenboffile - * \param directory Directory to scan - * \param all 0=refresh this id , 1=refresh this entity - * \return int <0 if KO, Nb of files in directory if OK + * Refresh value for cachenboffile + * + * @param int $all 0=refresh this id , 1=refresh this entity + * @return int <0 if KO, Nb of files in directory if OK */ function refreshcachenboffile($all=0) { diff --git a/htdocs/ecm/class/htmlecm.form.class.php b/htdocs/ecm/class/htmlecm.form.class.php index efc6358c732..dcfc5bae44c 100644 --- a/htdocs/ecm/class/htmlecm.form.class.php +++ b/htdocs/ecm/class/htmlecm.form.class.php @@ -57,7 +57,7 @@ class FormEcm if ($select_name=="") $select_name="catParent"; - $cat = new ECMDirectory($this->db); + $cat = new EcmDirectory($this->db); $cate_arbo = $cat->get_full_arbo(); $output = ''; print ''; @@ -421,6 +422,7 @@ if ($resql) $logo=preg_replace("/^object_/i","",$box->boximg); } + print "\n".''."\n"; print ''; print ''.img_object("",$logo).' '.$box->boxlabel.''; print '' . ($obj->note?$obj->note:' ') . ''; diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index a5e8743de4c..623909b2ba8 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -33,19 +33,20 @@ require_once(DOL_DOCUMENT_ROOT."/compta/bank/class/bankcateg.class.php"); if ($user->societe_id) $socid=$user->societe_id; $result=restrictedArea($user,'banque'); -$description=$_REQUEST["description"]; -$debit=$_REQUEST["debit"]; -$credit=$_REQUEST["credit"]; -$type=$_REQUEST["type"]; -$account=$_REQUEST["account"]; +$description=GETPOST("description"); +$debit=GETPOST("debit"); +$credit=GETPOST("credit"); +$type=GETPOST("type"); +$account=GETPOST("account"); +$bid=GETPOST("bid"); $param=''; -if (! empty($_REQUEST["description"])) $param.='&description='.$_REQUEST["description"]; -if (! empty($_REQUEST["type"])) $param.='&type='.$_REQUEST["type"]; -if (! empty($_REQUEST["debit"])) $param.='&debit='.$_REQUEST["debit"]; -if (! empty($_REQUEST["credit"])) $param.='&credit='.$_REQUEST["credit"]; -if (! empty($_REQUEST["account"])) $param.='&account='.$_REQUEST["account"]; -if (! empty($_REQUEST["bid"])) $param.='&bid='.$_REQUEST["bid"]; +if ($description) $param.='&description='.$description; +if ($type) $param.='&type='.$type; +if ($debit) $param.='&debit='.$debit; +if ($credit) $param.='&credit='.$credit; +if ($account) $param.='&account='.$account; +if ($bid) $param.='&bid='.$bid; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index eab9105745c..e6d3ddd2e8c 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -32,10 +32,10 @@ $langs->load("products"); $langs->load("contracts"); $langs->load("companies"); -$mode = isset($_GET["mode"])?$_GET["mode"]:$_POST["mode"]; -$sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"]; -$sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"]; -$page = isset($_GET["page"])?$_GET["page"]:$_POST["page"]; +$mode = GETPOST("mode"); +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page"); if ($page == -1) { $page = 0 ; } $limit = $conf->liste_limit; $offset = $limit * $page ; @@ -43,15 +43,15 @@ $offset = $limit * $page ; if (! $sortfield) $sortfield="c.rowid"; if (! $sortorder) $sortorder="ASC"; -$filter=isset($_GET["filter"])?$_GET["filter"]:$_POST["filter"]; -$search_nom=isset($_GET["search_nom"])?$_GET["search_nom"]:$_POST["search_nom"]; -$search_contract=isset($_GET["search_contract"])?$_GET["search_contract"]:$_POST["search_contract"]; -$search_service=isset($_GET["search_service"])?$_GET["search_service"]:$_POST["search_service"]; +$filter=GETPOST("filter"); +$search_nom=GETPOST("search_nom"); +$search_contract=GETPOST("search_contract"); +$search_service=GETPOST("search_service"); $statut=isset($_GET["statut"])?$_GET["statut"]:1; -$socid=$_GET["socid"]; +$socid=GETPOST("socid"); // Security check -$contratid = isset($_GET["id"])?$_GET["id"]:''; +$contratid = GETPOST("id"); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'contrat',$contratid,''); @@ -152,15 +152,15 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; print ''; // Service label print ''; - print ''; + print ''; print ''; // Third party print ''; - print ''; + print ''; print ''; print ''; $arrayofoperators=array('<'=>'<','>'=>'>'); diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 223d9259d8f..de4a2347f2d 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -39,7 +39,7 @@ class box_contracts extends ModeleBoxes { /** - * \brief Constructeur de la classe + * Constructor */ function box_contracts() { @@ -51,8 +51,9 @@ class box_contracts extends ModeleBoxes { } /** - * \brief Charge les donnees en memoire pour affichage ulterieur - * \param $max Nombre maximum d'enregistrements a charger + * Load data for box to show them later + * + * @param int $max Maximum number of records to load */ function loadBox($max=5) { diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php new file mode 100644 index 00000000000..dc030a46a5a --- /dev/null +++ b/htdocs/core/boxes/box_services_expired.php @@ -0,0 +1,151 @@ + + * + * 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 . + */ + +/** + * \file htdocs/core/boxes/box_services_expired.php + * \ingroup contracts + * \brief Module to show the box of last expired services + */ + +include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); + + +class box_services_expired extends ModeleBoxes { + + var $boxcode="expiredservices"; + var $boximg="object_contract"; + var $boxlabel; + var $depends = array("contrat"); // conf->propal->enabled + + var $db; + var $param; + + var $info_box_head = array(); + var $info_box_contents = array(); + + + /** + * Constructor + */ + function box_services_expired() + { + global $langs; + + $langs->load("contracts"); + + $this->boxlabel=$langs->trans("BoxOldestExpiredServices"); + } + + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + */ + function loadBox($max=5) + { + global $user, $langs, $db, $conf; + + $this->max=$max; + + $now=dol_now('tzref'); + + $this->info_box_head = array('text' => $langs->trans("BoxLastExpiredServices",$max)); + + if ($user->rights->contrat->lire) + { + // Select contracts with at least one expired service + $sql = "SELECT "; + $sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat,"; + $sql.= " s.nom, s.rowid as socid,"; + $sql.= " MIN(cd.date_fin_validite) as date_line, COUNT(cd.rowid) as nb_services"; + $sql.= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe s, ".MAIN_DB_PREFIX."contratdet as cd"; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE cd.statut = 4 AND cd.date_fin_validite <= '".$db->idate($now)."'"; + $sql.= " AND c.fk_soc=s.rowid AND cd.fk_contrat=c.rowid AND c.statut > 0"; + if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + $sql.= " GROUP BY c.rowid, c.ref, c.statut, c.date_contrat, s.nom, s.rowid"; + $sql.= " ORDER BY date_line ASC"; + $sql.= $db->plimit($max, 0); + + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + + $i = 0; + + while ($i < $num) + { + $late=''; + + $objp = $db->fetch_object($resql); + + $dateline=$db->jdate($objp->date_line); + if (($dateline + $conf->contrat->services->expires->warning_delay) < $now) $late=img_warning($langs->trans("Late")); + + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', + 'logo' => $this->boximg, + 'url' => DOL_URL_ROOT."/contrat/fiche.php?id=".$objp->rowid); + + $this->info_box_contents[$i][1] = array('td' => 'align="left"', + 'text' => ($objp->ref?$objp->ref:$objp->rowid), // Some contracts have no ref + 'url' => DOL_URL_ROOT."/contrat/fiche.php?id=".$objp->rowid); + + $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"', + 'logo' => 'company', + 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid); + + $this->info_box_contents[$i][3] = array('td' => 'align="left"', + 'text' => dol_trunc($objp->nom,40), + 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid); + + $this->info_box_contents[$i][4] = array('td' => 'align="center"', + 'text' => dol_print_date($dateline,'day'), + 'text2'=> $late); + + $this->info_box_contents[$i][5] = array('td' => 'align="right"', + 'text' => $objp->nb_services); + + + $i++; + } + + if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoExpiredServices")); + } + else + { + dol_print_error($db); + } + + + } + else + { + $this->info_box_contents[0][0] = array('td' => 'align="left"', + 'text' => $langs->trans("ReadPermissionNotAllowed")); + } + } + + function showBox() + { + parent::showBox($this->info_box_head, $this->info_box_contents); + } + +} + +?> diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php index 0de06eb5e6a..7ba03b23c9e 100644 --- a/htdocs/core/modules/modContrat.class.php +++ b/htdocs/core/modules/modContrat.class.php @@ -79,6 +79,7 @@ class modContrat extends DolibarrModules // Boxes $this->boxes = array(); $this->boxes[0][1] = "box_contracts.php"; + $this->boxes[1][1] = "box_services_expired.php"; // Permissions $this->rights = array(); diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index e60083b6258..6644af2ece3 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -46,16 +46,18 @@ BoxTitleTotalUnpaidCustomerBills=Unpaid customer's invoices BoxTitleTotalUnpaidSuppliersBills=Unpaid supplier's invoices BoxTitleLastModifiedContacts=Last %s modified contacts/addresses BoxMyLastBookmarks=My last %s bookmarks +BoxOldestExpiredServices=Oldest active expired services +BoxLastExpiredServices=Last %s oldest contacts with active expired services +BoxTitleLastActionsToDo=Last %s actions to do +BoxTitleLastContracts=Last %s contracts +BoxTitleLastModifiedDonations=Last %s modified donations +BoxTitleLastModifiedExpenses=Last %s modified expenses FailedToRefreshDataInfoNotUpToDate=Failed to refresh RSS flux. Last successfull refresh date: %s LastRefreshDate=Last refresh date NoRecordedBookmarks=No bookmarks defined. ClickToAdd=Click here to add. NoRecordedCustomers=No recorded customers NoRecordedContacts=No recorded contacts -BoxTitleLastActionsToDo=Last %s actions to do -BoxTitleLastContracts=Last %s contracts -BoxTitleLastModifiedDonations=Last %s modified donations -BoxTitleLastModifiedExpenses=Last %s modified expenses NoActionsToDo=No actions to do NoRecordedOrders=No recorded customer's orders NoRecordedProposals=No recorded proposals @@ -67,4 +69,4 @@ NoModifiedSupplierBills=No recorded supplier's invoices NoRecordedProducts=No recorded products/services NoRecordedProspects=No recorded prospects NoContractedProducts=No products/services contracted -NoRecordedContracts=No recorded contracts \ No newline at end of file +NoRecordedContracts=No recorded contracts diff --git a/htdocs/langs/en_US/contracts.lang b/htdocs/langs/en_US/contracts.lang index d3f64feef96..c15fd25536d 100644 --- a/htdocs/langs/en_US/contracts.lang +++ b/htdocs/langs/en_US/contracts.lang @@ -85,6 +85,7 @@ ConfirmMoveToAnotherContractQuestion=Choose in which existing contract (of same PaymentRenewContractId=Renew contract line (number %s) ExpiredSince=Expiration date RelatedContracts=Related contracts +NoExpiredServices=No expired active services ##### Types de contacts ##### TypeContact_contrat_internal_SALESREPSIGN=Sales representative signing contract TypeContact_contrat_internal_SALESREPFOLL=Sales representative following-up contract diff --git a/htdocs/langs/fr_FR/boxes.lang b/htdocs/langs/fr_FR/boxes.lang index 9d027f04938..b70f098fc02 100644 --- a/htdocs/langs/fr_FR/boxes.lang +++ b/htdocs/langs/fr_FR/boxes.lang @@ -46,16 +46,18 @@ BoxTitleTotalUnpaidSuppliersBills=Impayés fournisseurs BoxTitleLastModifiedContacts=Les %s derniers contacts/adresses modifiés BoxTitleLastModifiedMembers=Les %s derniers adhérents modifiés BoxMyLastBookmarks=Mes %s derniers marque-pages +BoxOldestExpiredServices=Plus anciens services expirés +BoxLastExpiredServices=Les %s plus anciens contrats avec services actifs expirés +BoxTitleLastActionsToDo=Les %s derniers événements à réaliser +BoxTitleLastContracts=Les %s derniers contrats +BoxTitleLastModifiedDonations=Les %s derniers dons modifiés +BoxTitleLastModifiedExpenses=Les %s dernières note de frais modifiées FailedToRefreshDataInfoNotUpToDate=Échec du rafraichissement du flux RSS. Date du dernier rafraichissement: %s LastRefreshDate=Date dernier rafraichissement NoRecordedBookmarks=Pas de bookmarks personnels. ClickToAdd=Cliquer ici pour ajouter. NoRecordedCustomers=Pas de client enregistré NoRecordedContacts=Pas de contact enregistré -BoxTitleLastActionsToDo=Les %s derniers événements à réaliser -BoxTitleLastContracts=Les %s derniers contrats -BoxTitleLastModifiedDonations=Les %s derniers dons modifiés -BoxTitleLastModifiedExpenses=Les %s dernières note de frais modifiées NoActionsToDo=Pas d'événements à réaliser NoRecordedOrders=Pas de commande client enregistrée NoRecordedProposals=Pas de proposition commerciale enregistrée @@ -67,4 +69,4 @@ NoModifiedSupplierBills=Pas de facture fournisseur modifiée NoRecordedProducts=Pas de produit/service enregistré NoRecordedProspects=Pas de prospect enregistré NoContractedProducts=Pas de produit/service contracté -NoRecordedContracts=Pas de contrat enregistré \ No newline at end of file +NoRecordedContracts=Pas de contrat enregistré diff --git a/htdocs/langs/fr_FR/contracts.lang b/htdocs/langs/fr_FR/contracts.lang index 36e28880dac..48524434588 100644 --- a/htdocs/langs/fr_FR/contracts.lang +++ b/htdocs/langs/fr_FR/contracts.lang @@ -85,6 +85,7 @@ ConfirmMoveToAnotherContractQuestion=Choisissez vers quel autre contrat de ce m PaymentRenewContractId=Renouvellement service (numéro %s) ExpiredSince=Expiré le RelatedContracts=Contrats associés +NoExpiredServices=Pas de services actifs expirés ##### Types de contacts ##### TypeContact_contrat_internal_SALESREPSIGN=Commercial signataire du contrat TypeContact_contrat_internal_SALESREPFOLL=Commercial suivi du contrat From 6fb994d29655b6494d3f7cfefbcfe90ee4a869be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Nov 2011 18:28:14 +0100 Subject: [PATCH 12/21] Qual: Removed phpcs warnings --- htdocs/core/boxes/box_actions.php | 13 +++++++++++-- htdocs/core/boxes/box_bookmarks.php | 15 ++++++++++++--- htdocs/core/boxes/box_clients.php | 15 ++++++++++++--- htdocs/core/boxes/box_commandes.php | 15 ++++++++++++--- htdocs/core/boxes/box_comptes.php | 10 +++++++++- htdocs/core/boxes/box_contacts.php | 15 ++++++++++++--- htdocs/core/boxes/box_contracts.php | 8 ++++++++ htdocs/core/boxes/box_external_rss.php | 18 +++++++++++++----- htdocs/core/boxes/box_factures.php | 15 ++++++++++++--- htdocs/core/boxes/box_factures_fourn.php | 15 ++++++++++++--- htdocs/core/boxes/box_factures_fourn_imp.php | 15 ++++++++++++--- htdocs/core/boxes/box_factures_imp.php | 15 ++++++++++++--- htdocs/core/boxes/box_fournisseurs.php | 15 ++++++++++++--- htdocs/core/boxes/box_members.php | 15 ++++++++++++--- htdocs/core/boxes/box_osc_client.php | 15 ++++++++++++--- htdocs/core/boxes/box_produits.php | 15 ++++++++++++--- htdocs/core/boxes/box_propales.php | 15 ++++++++++++--- htdocs/core/boxes/box_prospect.php | 15 ++++++++++++--- htdocs/core/boxes/box_services_expired.php | 10 +++++++++- htdocs/core/boxes/box_services_vendus.php | 15 ++++++++++++--- htdocs/core/boxes/modules_boxes.php | 8 +++++--- 21 files changed, 235 insertions(+), 57 deletions(-) diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index d8a9548f73d..267d238d5ce 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -52,8 +52,10 @@ class box_actions extends ModeleBoxes { } /** - * Charge les donnees en memoire pour affichage ulterieur - * @param $max Nombre maximum d'enregistrements a charger + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -146,6 +148,13 @@ class box_actions extends ModeleBoxes { } } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_bookmarks.php b/htdocs/core/boxes/box_bookmarks.php index aa31aa3cf7d..89352d908aa 100644 --- a/htdocs/core/boxes/box_bookmarks.php +++ b/htdocs/core/boxes/box_bookmarks.php @@ -37,7 +37,7 @@ class box_bookmarks extends ModeleBoxes { var $info_box_contents = array(); /** - * \brief Constructeur de la classe + * Constructor */ function box_bookmarks() { @@ -48,8 +48,10 @@ class box_bookmarks extends ModeleBoxes { } /** - * \brief Charge les donnees en memoire pour affichage ulterieur - * \param $max Nombre maximum d'enregistrements a charger + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -121,6 +123,13 @@ class box_bookmarks extends ModeleBoxes { } } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index c9db0650c43..509641b7570 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -40,7 +40,7 @@ class box_clients extends ModeleBoxes { var $info_box_contents = array(); /** - * \brief Constructeur de la classe + * Constructor */ function box_clients() { @@ -51,8 +51,10 @@ class box_clients extends ModeleBoxes { } /** - * Load data of box into memory for a future usage - * @param $max Maximum number of records to show + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -125,6 +127,13 @@ class box_clients extends ModeleBoxes { } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 8aac9fada59..74da5a9ab39 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -40,7 +40,7 @@ class box_commandes extends ModeleBoxes { var $info_box_contents = array(); /** - * \brief Constructeur de la classe + * Constructor */ function box_commandes() { @@ -51,8 +51,10 @@ class box_commandes extends ModeleBoxes { } /** - * \brief Charge les donnees en memoire pour affichage ulterieur - * \param $max Nombre maximum d'enregistrements a charger + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -134,6 +136,13 @@ class box_commandes extends ModeleBoxes { } } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index d2267e11562..f988017338a 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -54,7 +54,8 @@ class box_comptes extends ModeleBoxes { /** * Load data into info_box_contents array to show array later. * - * @param $max Maximum number of records to load + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -147,6 +148,13 @@ class box_comptes extends ModeleBoxes { } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 0371e821d22..98c43b14f96 100755 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -41,7 +41,7 @@ class box_contacts extends ModeleBoxes { var $info_box_contents = array(); /** - * \brief Constructeur de la classe + * Constructor */ function box_contacts() { @@ -52,8 +52,10 @@ class box_contacts extends ModeleBoxes { } /** - * Load data of box into memory for a future usage - * @param $max Maximum number of records to show + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -123,6 +125,13 @@ class box_contacts extends ModeleBoxes { } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index de4a2347f2d..f92494b100a 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -54,6 +54,7 @@ class box_contracts extends ModeleBoxes { * Load data for box to show them later * * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -144,6 +145,13 @@ class box_contracts extends ModeleBoxes { } } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index dfaf342f5e8..9d4e59358b4 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -42,7 +42,7 @@ class box_external_rss extends ModeleBoxes { var $info_box_contents = array(); /** - * Constructeur de la classe + * Constructor */ function box_external_rss($DB,$param) { @@ -56,10 +56,11 @@ class box_external_rss extends ModeleBoxes { } /** - * Load information for box into memory to show them later with this->showBox method. - * - * @param int $max Max numbe rof records to load - * @param int $cachedelay Delay we accept for cache file + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @param int $cachedelay Delay we accept for cache file + * @return void */ function loadBox($max=5, $cachedelay=3600) { @@ -152,6 +153,13 @@ class box_external_rss extends ModeleBoxes { } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index b7359c19932..f801afb650f 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -39,7 +39,7 @@ class box_factures extends ModeleBoxes { var $info_box_contents = array(); /** - * \brief Constructeur de la classe + * Constructor */ function box_factures() { @@ -50,8 +50,10 @@ class box_factures extends ModeleBoxes { } /** - * \brief Charge les donnees en memoire pour affichage ulterieur - * \param $max Nombre maximum d'enregistrements a charger + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -149,6 +151,13 @@ class box_factures extends ModeleBoxes { } } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 5cbb0af5cd9..365c3a12a7f 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -39,7 +39,7 @@ class box_factures_fourn extends ModeleBoxes { var $info_box_contents = array(); /** - * \brief Constructeur de la classe + * Constructor */ function box_factures_fourn() { @@ -50,8 +50,10 @@ class box_factures_fourn extends ModeleBoxes { } /** - * \brief Charge les donnees en memoire pour affichage ulterieur - * \param $max Nombre maximum d'enregistrements a charger + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -143,6 +145,13 @@ class box_factures_fourn extends ModeleBoxes { } } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index 61363d2bcac..3a9a48bedbd 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -39,7 +39,7 @@ class box_factures_fourn_imp extends ModeleBoxes { /** - * \brief Constructeur de la classe + * Constructor */ function box_factures_fourn_imp() { @@ -50,8 +50,10 @@ class box_factures_fourn_imp extends ModeleBoxes { } /** - * \brief Charge les donnees en memoire pour affichage ulterieur - * \param $max Nombre maximum d'enregistrements a charger + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -143,6 +145,13 @@ class box_factures_fourn_imp extends ModeleBoxes { } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 57b0e2cb722..7eeac19a248 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -42,7 +42,7 @@ class box_factures_imp extends ModeleBoxes { /** - * \brief Constructeur de la classe + * Constructor */ function box_factures_imp() { @@ -53,8 +53,10 @@ class box_factures_imp extends ModeleBoxes { } /** - * \brief Charge les donnees en memoire pour affichage ulterieur - * \param $max Nombre maximum d'enregistrements a charger + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -145,6 +147,13 @@ class box_factures_imp extends ModeleBoxes { } } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index e93f60a84c3..9c02cab8462 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -39,7 +39,7 @@ class box_fournisseurs extends ModeleBoxes { var $info_box_contents = array(); /** - * \brief Constructeur de la classe + * Constructor */ function box_fournisseurs() { @@ -50,8 +50,10 @@ class box_fournisseurs extends ModeleBoxes { } /** - * Load data of box into memory for a future usage - * @param $max Maximum number of records to show + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -119,6 +121,13 @@ class box_fournisseurs extends ModeleBoxes { } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index 8b3cc143b33..094ccd07a98 100755 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -40,7 +40,7 @@ class box_members extends ModeleBoxes { var $info_box_contents = array(); /** - * \brief Constructeur de la classe + * Constructor */ function box_members() { @@ -51,8 +51,10 @@ class box_members extends ModeleBoxes { } /** - * Load data of box into memory for a future usage - * @param $max Maximum number of records to show + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -121,6 +123,13 @@ class box_members extends ModeleBoxes { } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_osc_client.php b/htdocs/core/boxes/box_osc_client.php index a2a539f22ac..a784a0c8774 100644 --- a/htdocs/core/boxes/box_osc_client.php +++ b/htdocs/core/boxes/box_osc_client.php @@ -39,7 +39,7 @@ class box_osc_clients extends ModeleBoxes { var $info_box_contents = array(); /** - * \brief Constructeur de la classe + * Constructor */ function box_osc_clients() { @@ -50,8 +50,10 @@ class box_osc_clients extends ModeleBoxes { } /** - * \brief Charge les donn�es en m�moire pour affichage ult�rieur - * \param $max Nombre maximum d'enregistrements � charger + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -97,6 +99,13 @@ class box_osc_clients extends ModeleBoxes { } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index 711ee033a8c..5c125cf421e 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -42,7 +42,7 @@ class box_produits extends ModeleBoxes { /** - * \brief Constructeur de la classe + * Constructor */ function box_produits() { @@ -53,8 +53,10 @@ class box_produits extends ModeleBoxes { } /** - * \brief Charge les donnees en memoire pour affichage ulterieur - * \param $max Nombre maximum d'enregistrements a charger + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -154,6 +156,13 @@ class box_produits extends ModeleBoxes { } } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 91bc157ea80..4752e0ffc70 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -41,7 +41,7 @@ class box_propales extends ModeleBoxes { /** - * \brief Constructeur de la classe + * Constructor */ function box_propales() { @@ -52,8 +52,10 @@ class box_propales extends ModeleBoxes { } /** - * \brief Charge les donnees en memoire pour affichage ulterieur - * \param $max Nombre maximum d'enregistrements a charger + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -139,6 +141,13 @@ class box_propales extends ModeleBoxes { } } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 3e4c3c67a0b..69bb2444008 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -42,7 +42,7 @@ class box_prospect extends ModeleBoxes { var $info_box_contents = array(); /** - * \brief Constructeur de la classe + * Constructor */ function box_prospect($DB,$param) { @@ -56,8 +56,10 @@ class box_prospect extends ModeleBoxes { } /** - * \brief Charge les donnees en memoire pour affichage ulterieur - * \param $max Nombre maximum d'enregistrements a charger + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -132,6 +134,13 @@ class box_prospect extends ModeleBoxes { } } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index dc030a46a5a..895fa7713a2 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -54,6 +54,7 @@ class box_services_expired extends ModeleBoxes { * Load data for box to show them later * * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -141,7 +142,14 @@ class box_services_expired extends ModeleBoxes { } } - function showBox() + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ + function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); } diff --git a/htdocs/core/boxes/box_services_vendus.php b/htdocs/core/boxes/box_services_vendus.php index 067deee6d1f..477cb6383f3 100644 --- a/htdocs/core/boxes/box_services_vendus.php +++ b/htdocs/core/boxes/box_services_vendus.php @@ -40,7 +40,7 @@ class box_services_vendus extends ModeleBoxes { var $info_box_contents = array(); /** - * \brief Constructeur de la classe + * Constructor */ function box_services_vendus() { @@ -51,8 +51,10 @@ class box_services_vendus extends ModeleBoxes { } /** - * \brief Charge les donnees en memoire pour affichage ulterieur - * \param $max Nombre maximum d'enregistrements a charger + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -159,6 +161,13 @@ class box_services_vendus extends ModeleBoxes { } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index e03ec6aa778..b38c37494fa 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -88,9 +88,11 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" /** - * \brief Standard method to show a box (usage by boxes not mandatory, a box can still use its own function) - * \param $head tableau des caracteristiques du titre - * \param $contents tableau des lignes de contenu + * Standard method to show a box (usage by boxes not mandatory, a box can still use its own function) + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void */ function showBox($head, $contents) { From 00ffbd5e9057cbcf0d0e5720a340455985409f57 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 23 Nov 2011 21:25:02 +0100 Subject: [PATCH 13/21] Fix: change the last database prefix --- htdocs/adherents/card_subscriptions.php | 2 +- htdocs/admin/accounting.php | 2 +- htdocs/admin/boxes.php | 8 ++++---- htdocs/boutique/admin/boutique.php | 4 ++-- htdocs/compta/localtax/class/localtax.class.php | 2 +- .../class/paymentsocialcontribution.class.php | 2 +- htdocs/compta/stats/index.php | 2 +- htdocs/compta/tva/class/tva.class.php | 2 +- htdocs/core/class/html.formcompany.class.php | 2 +- htdocs/core/lib/admin.lib.php | 2 +- htdocs/core/modules/mailings/framboise.modules.php | 13 ++++++++----- .../core/modules/mailings/thirdparties.modules.php | 13 ++++++++----- htdocs/product/stock/fiche.php | 2 +- htdocs/product/stock/mouvement.php | 2 +- htdocs/product/stock/product.php | 2 +- 15 files changed, 33 insertions(+), 27 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 6385aa43be1..69caf4eeb5f 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -403,7 +403,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ } // Update fk_bank for subscriptions - $sql = 'UPDATE llx_cotisation set fk_bank='.$bank_line_id; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'cotisation SET fk_bank='.$bank_line_id; $sql.= ' WHERE rowid='.$crowid; dol_syslog('sql='.$sql); $result = $db->query($sql); diff --git a/htdocs/admin/accounting.php b/htdocs/admin/accounting.php index 18a14a755fe..5fdfc965143 100644 --- a/htdocs/admin/accounting.php +++ b/htdocs/admin/accounting.php @@ -101,7 +101,7 @@ print "
\n"; // Cas des autres param�tres COMPTA_* /* $sql ="SELECT rowid, name, value, type, note"; -$sql.=" FROM llx_const"; +$sql.=" FROM ".MAIN_DB_PREFIX."const"; $sql.=" WHERE name like 'COMPTA_%' and name not in ('COMPTA_MODE')"; $result = $db->query($sql); if ($result) diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 106b6e4841c..1836de2c76b 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -217,13 +217,13 @@ if ($resql) if (preg_match("/[13579]{1}/",substr($record['box_order'],-1))) { $box_order = "A0".$record['box_order']; - $sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order']; + $sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE box_order = ".$record['box_order']; $resql = $db->query($sql); } else if (preg_match("/[02468]{1}/",substr($record['box_order'],-1))) { $box_order = "B0".$record['box_order']; - $sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order']; + $sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE box_order = ".$record['box_order']; $resql = $db->query($sql); } } @@ -232,13 +232,13 @@ if ($resql) if (preg_match("/[13579]{1}/",substr($record['box_order'],-1))) { $box_order = "A".$record['box_order']; - $sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order']; + $sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE box_order = ".$record['box_order']; $resql = $db->query($sql); } else if (preg_match("/[02468]{1}/",substr($record['box_order'],-1))) { $box_order = "B".$record['box_order']; - $sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order']; + $sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE box_order = ".$record['box_order']; $resql = $db->query($sql); } } diff --git a/htdocs/boutique/admin/boutique.php b/htdocs/boutique/admin/boutique.php index ce5e070b402..664a7041480 100644 --- a/htdocs/boutique/admin/boutique.php +++ b/htdocs/boutique/admin/boutique.php @@ -66,7 +66,7 @@ if ($_POST["save"]) } elseif ($_POST["test"]) { - //$resql=$db->query("select count(*) from llx_const"); + //$resql=$db->query("select count(*) from ".MAIN_DB_PREFIX."const"); //print "< ".$db." - ".$db->db." - ".$resql." - ".$db->error().">
\n"; // Test de la connexion a la database webcalendar @@ -111,7 +111,7 @@ elseif ($_POST["test"]) $mesg.=""; } - //$resql=$db->query("select count(*) from llx_const"); + //$resql=$db->query("select count(*) from ".MAIN_DB_PREFIX."const"); //print "< ".$db." - ".$db->db." - ".$resql." - ".$db->error().">
\n"; } diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index b6ac1e02af9..4e0c70f07fa 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -551,7 +551,7 @@ class localtax extends CommonObject */ function update_fk_bank($id) { - $sql = 'UPDATE llx_localtax set fk_bank = '.$id; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'localtax SET fk_bank = '.$id; $sql.= ' WHERE rowid = '.$this->id; $result = $this->db->query($sql); if ($result) diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 9e8c08c8e03..f481755a6d4 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -552,7 +552,7 @@ class PaymentSocialContribution extends CommonObject */ function update_fk_bank($id_bank) { - $sql = "UPDATE llx_paiementcharge set fk_bank = ".$id_bank." where rowid = ".$this->id; + $sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::update_fk_bank sql=".$sql); $result = $this->db->query($sql); diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index ebbec0f43af..420acbb93a2 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -451,7 +451,7 @@ print ""; En attendant correction. $sql = "SELECT sum(f.total) as tot_fht,sum(f.total_ttc) as tot_fttc, p.rowid, p.ref, s.nom, s.rowid as socid, p.total_ht, p.total_ttc - FROM ".MAIN_DB_PREFIX."commande AS p, llx_societe AS s + FROM ".MAIN_DB_PREFIX."commande AS p, ".MAIN_DB_PREFIX."societe AS s LEFT JOIN ".MAIN_DB_PREFIX."co_fa AS co_fa ON co_fa.fk_commande = p.rowid LEFT JOIN ".MAIN_DB_PREFIX."facture AS f ON co_fa.fk_facture = f.rowid WHERE p.fk_soc = s.rowid diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 13bd7a5d0f4..98b494120a2 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -579,7 +579,7 @@ class Tva extends CommonObject */ function update_fk_bank($id_bank) { - $sql = 'UPDATE llx_tva set fk_bank = '.$id_bank; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'tva SET fk_bank = '.$id_bank; $sql.= ' WHERE rowid = '.$this->id; $result = $this->db->query($sql); if ($result) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index f878dee86c3..41e570591a7 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -420,7 +420,7 @@ class FormCompany // On recherche les formes juridiques actives des pays actifs $sql = "SELECT f.rowid, f.code as code , f.libelle as nom, f.active, p.libelle as libelle_pays, p.code as code_pays"; - $sql .= " FROM llx_c_forme_juridique as f, llx_c_pays as p"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p"; $sql .= " WHERE f.fk_pays=p.rowid"; $sql .= " AND f.active = 1 AND p.active = 1"; if ($pays_code) $sql .= " AND p.code = '".$pays_code."'"; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 949df2d1e7b..b79072b0ada 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -448,7 +448,7 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not if (strcmp($value,'')) // true if different. Must work for $value='0' or $value=0 { - $sql = "INSERT INTO llx_const(name,value,type,visible,note,entity)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity)"; $sql.= " VALUES ("; $sql.= $db->encrypt($name,1); $sql.= ", ".$db->encrypt($value,1); diff --git a/htdocs/core/modules/mailings/framboise.modules.php b/htdocs/core/modules/mailings/framboise.modules.php index 6d689d7b081..3cc151abdda 100644 --- a/htdocs/core/modules/mailings/framboise.modules.php +++ b/htdocs/core/modules/mailings/framboise.modules.php @@ -63,14 +63,17 @@ class mailing_framboise extends MailingTargets // CHANGE THIS // Select the members from category $sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname,"; - if ($_POST['filter']) $sql.= " llx_categorie.label as label"; + if ($_POST['filter']) $sql.= " c.label"; else $sql.=" null as label"; - $sql.= " FROM llx_adherent as s"; - if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie_member ON llx_categorie_member.fk_member=s.rowid"; - if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie ON llx_categorie.rowid = llx_categorie_member.fk_categorie"; + $sql.= " FROM ".MAIN_DB_PREFIX."adherent as s"; + if ($_POST['filter']) + { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_member as cm ON cm.fk_member = s.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = cm.fk_categorie"; + } $sql.= " WHERE s.email != ''"; $sql.= " AND s.entity = ".$conf->entity; - if ($_POST['filter']) $sql.= " AND llx_categorie.rowid='".$_POST['filter']."'"; + if ($_POST['filter']) $sql.= " AND ".MAIN_DB_PREFIX."categorie.rowid='".$_POST['filter']."'"; $sql.= " ORDER BY s.email"; // Stocke destinataires dans cibles diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index afa6f987d35..b3d62e8fdbe 100755 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -63,14 +63,17 @@ class mailing_thirdparties extends MailingTargets // CHANGE THIS // Select the third parties from category $sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname,"; - if ($_POST['filter']) $sql.= " llx_categorie.label as label"; + if ($_POST['filter']) $sql.= " c.label"; else $sql.=" null as label"; - $sql.= " FROM llx_societe as s"; - if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie_societe ON llx_categorie_societe.fk_societe=s.rowid"; - if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie ON llx_categorie.rowid = llx_categorie_societe.fk_categorie"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + if ($_POST['filter']) + { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON cs.fk_societe = s.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = cs.fk_categorie"; + } $sql.= " WHERE s.email != ''"; $sql.= " AND s.entity = ".$conf->entity; - if ($_POST['filter']) $sql.= " AND llx_categorie.rowid='".$_POST['filter']."'"; + if ($_POST['filter']) $sql.= " AND c.rowid='".$_POST['filter']."'"; $sql.= " ORDER BY s.email"; // Stocke destinataires dans cibles diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index f8043f306d8..20ef429d4c8 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -292,7 +292,7 @@ else // Last movement $sql = "SELECT max(m.datem) as datem"; - $sql .= " FROM llx_stock_mouvement as m"; + $sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m"; $sql .= " WHERE m.fk_entrepot = '".$object->id."'"; $resqlbis = $db->query($sql); if ($resqlbis) diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index fdfc8a86f66..8eb06a963d5 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -208,7 +208,7 @@ if ($resql) // Last movement $sql = "SELECT max(m.datem) as datem"; - $sql .= " FROM llx_stock_mouvement as m"; + $sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m"; $sql .= " WHERE m.fk_entrepot = '".$entrepot->id."'"; $resqlbis = $db->query($sql); if ($resqlbis) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 873c27b1ff2..3f2e0bfb660 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -283,7 +283,7 @@ if ($_GET["id"] || $_GET["ref"]) // Last movement $sql = "SELECT max(m.datem) as datem"; - $sql.= " FROM llx_stock_mouvement as m"; + $sql.= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m"; $sql.= " WHERE m.fk_product = '".$product->id."'"; $resqlbis = $db->query($sql); if ($resqlbis) From 86a48c89624a382f6a4181200eeef4c3ae5ac4ce Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 23 Nov 2011 21:43:25 +0100 Subject: [PATCH 14/21] Fix: change the last database prefix --- htdocs/adherents/card_subscriptions.php | 2 +- htdocs/admin/accounting.php | 2 +- htdocs/admin/boxes.php | 8 ++++---- htdocs/boutique/admin/boutique.php | 4 ++-- htdocs/compta/localtax/class/localtax.class.php | 2 +- .../class/paymentsocialcontribution.class.php | 2 +- htdocs/compta/stats/index.php | 2 +- htdocs/compta/tva/class/tva.class.php | 2 +- htdocs/core/class/html.formcompany.class.php | 2 +- htdocs/core/lib/admin.lib.php | 2 +- .../core/modules/mailings/framboise.modules.php | 13 ++++++++----- .../modules/mailings/thirdparties.modules.php | 13 ++++++++----- htdocs/install/etape5.php | 16 ++++++++-------- htdocs/product/stock/fiche.php | 2 +- htdocs/product/stock/mouvement.php | 2 +- htdocs/product/stock/product.php | 2 +- 16 files changed, 41 insertions(+), 35 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 6385aa43be1..69caf4eeb5f 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -403,7 +403,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ } // Update fk_bank for subscriptions - $sql = 'UPDATE llx_cotisation set fk_bank='.$bank_line_id; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'cotisation SET fk_bank='.$bank_line_id; $sql.= ' WHERE rowid='.$crowid; dol_syslog('sql='.$sql); $result = $db->query($sql); diff --git a/htdocs/admin/accounting.php b/htdocs/admin/accounting.php index 18a14a755fe..5fdfc965143 100644 --- a/htdocs/admin/accounting.php +++ b/htdocs/admin/accounting.php @@ -101,7 +101,7 @@ print "
\n"; // Cas des autres param�tres COMPTA_* /* $sql ="SELECT rowid, name, value, type, note"; -$sql.=" FROM llx_const"; +$sql.=" FROM ".MAIN_DB_PREFIX."const"; $sql.=" WHERE name like 'COMPTA_%' and name not in ('COMPTA_MODE')"; $result = $db->query($sql); if ($result) diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 106b6e4841c..1836de2c76b 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -217,13 +217,13 @@ if ($resql) if (preg_match("/[13579]{1}/",substr($record['box_order'],-1))) { $box_order = "A0".$record['box_order']; - $sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order']; + $sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE box_order = ".$record['box_order']; $resql = $db->query($sql); } else if (preg_match("/[02468]{1}/",substr($record['box_order'],-1))) { $box_order = "B0".$record['box_order']; - $sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order']; + $sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE box_order = ".$record['box_order']; $resql = $db->query($sql); } } @@ -232,13 +232,13 @@ if ($resql) if (preg_match("/[13579]{1}/",substr($record['box_order'],-1))) { $box_order = "A".$record['box_order']; - $sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order']; + $sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE box_order = ".$record['box_order']; $resql = $db->query($sql); } else if (preg_match("/[02468]{1}/",substr($record['box_order'],-1))) { $box_order = "B".$record['box_order']; - $sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order']; + $sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE box_order = ".$record['box_order']; $resql = $db->query($sql); } } diff --git a/htdocs/boutique/admin/boutique.php b/htdocs/boutique/admin/boutique.php index ce5e070b402..664a7041480 100644 --- a/htdocs/boutique/admin/boutique.php +++ b/htdocs/boutique/admin/boutique.php @@ -66,7 +66,7 @@ if ($_POST["save"]) } elseif ($_POST["test"]) { - //$resql=$db->query("select count(*) from llx_const"); + //$resql=$db->query("select count(*) from ".MAIN_DB_PREFIX."const"); //print "< ".$db." - ".$db->db." - ".$resql." - ".$db->error().">
\n"; // Test de la connexion a la database webcalendar @@ -111,7 +111,7 @@ elseif ($_POST["test"]) $mesg.=""; } - //$resql=$db->query("select count(*) from llx_const"); + //$resql=$db->query("select count(*) from ".MAIN_DB_PREFIX."const"); //print "< ".$db." - ".$db->db." - ".$resql." - ".$db->error().">
\n"; } diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index b6ac1e02af9..4e0c70f07fa 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -551,7 +551,7 @@ class localtax extends CommonObject */ function update_fk_bank($id) { - $sql = 'UPDATE llx_localtax set fk_bank = '.$id; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'localtax SET fk_bank = '.$id; $sql.= ' WHERE rowid = '.$this->id; $result = $this->db->query($sql); if ($result) diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 9e8c08c8e03..f481755a6d4 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -552,7 +552,7 @@ class PaymentSocialContribution extends CommonObject */ function update_fk_bank($id_bank) { - $sql = "UPDATE llx_paiementcharge set fk_bank = ".$id_bank." where rowid = ".$this->id; + $sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::update_fk_bank sql=".$sql); $result = $this->db->query($sql); diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index ebbec0f43af..420acbb93a2 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -451,7 +451,7 @@ print ""; En attendant correction. $sql = "SELECT sum(f.total) as tot_fht,sum(f.total_ttc) as tot_fttc, p.rowid, p.ref, s.nom, s.rowid as socid, p.total_ht, p.total_ttc - FROM ".MAIN_DB_PREFIX."commande AS p, llx_societe AS s + FROM ".MAIN_DB_PREFIX."commande AS p, ".MAIN_DB_PREFIX."societe AS s LEFT JOIN ".MAIN_DB_PREFIX."co_fa AS co_fa ON co_fa.fk_commande = p.rowid LEFT JOIN ".MAIN_DB_PREFIX."facture AS f ON co_fa.fk_facture = f.rowid WHERE p.fk_soc = s.rowid diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 13bd7a5d0f4..98b494120a2 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -579,7 +579,7 @@ class Tva extends CommonObject */ function update_fk_bank($id_bank) { - $sql = 'UPDATE llx_tva set fk_bank = '.$id_bank; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'tva SET fk_bank = '.$id_bank; $sql.= ' WHERE rowid = '.$this->id; $result = $this->db->query($sql); if ($result) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index f878dee86c3..41e570591a7 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -420,7 +420,7 @@ class FormCompany // On recherche les formes juridiques actives des pays actifs $sql = "SELECT f.rowid, f.code as code , f.libelle as nom, f.active, p.libelle as libelle_pays, p.code as code_pays"; - $sql .= " FROM llx_c_forme_juridique as f, llx_c_pays as p"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p"; $sql .= " WHERE f.fk_pays=p.rowid"; $sql .= " AND f.active = 1 AND p.active = 1"; if ($pays_code) $sql .= " AND p.code = '".$pays_code."'"; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 949df2d1e7b..b79072b0ada 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -448,7 +448,7 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not if (strcmp($value,'')) // true if different. Must work for $value='0' or $value=0 { - $sql = "INSERT INTO llx_const(name,value,type,visible,note,entity)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity)"; $sql.= " VALUES ("; $sql.= $db->encrypt($name,1); $sql.= ", ".$db->encrypt($value,1); diff --git a/htdocs/core/modules/mailings/framboise.modules.php b/htdocs/core/modules/mailings/framboise.modules.php index 6d689d7b081..3cc151abdda 100644 --- a/htdocs/core/modules/mailings/framboise.modules.php +++ b/htdocs/core/modules/mailings/framboise.modules.php @@ -63,14 +63,17 @@ class mailing_framboise extends MailingTargets // CHANGE THIS // Select the members from category $sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname,"; - if ($_POST['filter']) $sql.= " llx_categorie.label as label"; + if ($_POST['filter']) $sql.= " c.label"; else $sql.=" null as label"; - $sql.= " FROM llx_adherent as s"; - if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie_member ON llx_categorie_member.fk_member=s.rowid"; - if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie ON llx_categorie.rowid = llx_categorie_member.fk_categorie"; + $sql.= " FROM ".MAIN_DB_PREFIX."adherent as s"; + if ($_POST['filter']) + { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_member as cm ON cm.fk_member = s.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = cm.fk_categorie"; + } $sql.= " WHERE s.email != ''"; $sql.= " AND s.entity = ".$conf->entity; - if ($_POST['filter']) $sql.= " AND llx_categorie.rowid='".$_POST['filter']."'"; + if ($_POST['filter']) $sql.= " AND ".MAIN_DB_PREFIX."categorie.rowid='".$_POST['filter']."'"; $sql.= " ORDER BY s.email"; // Stocke destinataires dans cibles diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index afa6f987d35..b3d62e8fdbe 100755 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -63,14 +63,17 @@ class mailing_thirdparties extends MailingTargets // CHANGE THIS // Select the third parties from category $sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname,"; - if ($_POST['filter']) $sql.= " llx_categorie.label as label"; + if ($_POST['filter']) $sql.= " c.label"; else $sql.=" null as label"; - $sql.= " FROM llx_societe as s"; - if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie_societe ON llx_categorie_societe.fk_societe=s.rowid"; - if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie ON llx_categorie.rowid = llx_categorie_societe.fk_categorie"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + if ($_POST['filter']) + { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON cs.fk_societe = s.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = cs.fk_categorie"; + } $sql.= " WHERE s.email != ''"; $sql.= " AND s.entity = ".$conf->entity; - if ($_POST['filter']) $sql.= " AND llx_categorie.rowid='".$_POST['filter']."'"; + if ($_POST['filter']) $sql.= " AND c.rowid='".$_POST['filter']."'"; $sql.= " ORDER BY s.email"; // Stocke destinataires dans cibles diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php index 2f49092703b..89859bff6ea 100644 --- a/htdocs/install/etape5.php +++ b/htdocs/install/etape5.php @@ -197,18 +197,18 @@ if ($action == "set" || preg_match('/upgrade/i',$action)) $db->begin(); dolibarr_install_syslog('install/etape5.php set MAIN_VERSION_LAST_INSTALL const to '.$targetversion, LOG_DEBUG); - $resql=$db->query("DELETE FROM llx_const WHERE ".$db->decrypt('name')."='MAIN_VERSION_LAST_INSTALL'"); + $resql=$db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_VERSION_LAST_INSTALL'"); if (! $resql) dol_print_error($db,'Error in setup program'); - $resql=$db->query("INSERT INTO llx_const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_VERSION_LAST_INSTALL',1).",".$db->encrypt($targetversion,1).",'chaine',0,'Dolibarr version when install',0)"); + $resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_VERSION_LAST_INSTALL',1).",".$db->encrypt($targetversion,1).",'chaine',0,'Dolibarr version when install',0)"); if (! $resql) dol_print_error($db,'Error in setup program'); $conf->global->MAIN_VERSION_LAST_INSTALL=$targetversion; if ($useforcedwizard) { dolibarr_install_syslog('install/etape5.php set MAIN_REMOVE_INSTALL_WARNING const to 1', LOG_DEBUG); - $resql=$db->query("DELETE FROM llx_const WHERE ".$db->decrypt('name')."='MAIN_REMOVE_INSTALL_WARNING'"); + $resql=$db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_REMOVE_INSTALL_WARNING'"); if (! $resql) dol_print_error($db,'Error in setup program'); - $resql=$db->query("INSERT INTO llx_const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_REMOVE_INSTALL_WARNING',1).",".$db->encrypt(1,1).",'chaine',1,'Disable install warnings',0)"); + $resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_REMOVE_INSTALL_WARNING',1).",".$db->encrypt(1,1).",'chaine',1,'Disable install warnings',0)"); if (! $resql) dol_print_error($db,'Error in setup program'); $conf->global->MAIN_REMOVE_INSTALL_WARNING=1; } @@ -235,7 +235,7 @@ if ($action == "set" || preg_match('/upgrade/i',$action)) } dolibarr_install_syslog('install/etape5.php Remove MAIN_NOT_INSTALLED const', LOG_DEBUG); - $resql=$db->query("DELETE FROM llx_const WHERE ".$db->decrypt('name')."='MAIN_NOT_INSTALLED'"); + $resql=$db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_NOT_INSTALLED'"); if (! $resql) dol_print_error($db,'Error in setup program'); $db->commit(); @@ -266,9 +266,9 @@ if ($action == "set" || preg_match('/upgrade/i',$action)) if ($tagdatabase) { dolibarr_install_syslog('install/etape5.php set MAIN_VERSION_LAST_UPGRADE const to value '.$targetversion, LOG_DEBUG); - $resql=$db->query("DELETE FROM llx_const WHERE ".$db->decrypt('name')."='MAIN_VERSION_LAST_UPGRADE'"); + $resql=$db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_VERSION_LAST_UPGRADE'"); if (! $resql) dol_print_error($db,'Error in setup program'); - $resql=$db->query("INSERT INTO llx_const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_VERSION_LAST_UPGRADE',1).",".$db->encrypt($targetversion,1).",'chaine',0,'Dolibarr version for last upgrade',0)"); + $resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) VALUES (".$db->encrypt('MAIN_VERSION_LAST_UPGRADE',1).",".$db->encrypt($targetversion,1).",'chaine',0,'Dolibarr version for last upgrade',0)"); if (! $resql) dol_print_error($db,'Error in setup program'); $conf->global->MAIN_VERSION_LAST_UPGRADE=$targetversion; } @@ -288,7 +288,7 @@ if ($action == "set" || preg_match('/upgrade/i',$action)) } // May fail if parameter already defined - $resql=$db->query("INSERT INTO llx_const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_LANG_DEFAULT',1).",".$db->encrypt($setuplang,1).",'chaine',0,'Default language',1)"); + $resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) VALUES (".$db->encrypt('MAIN_LANG_DEFAULT',1).",".$db->encrypt($setuplang,1).",'chaine',0,'Default language',1)"); //if (! $resql) dol_print_error($db,'Error in setup program'); print ''; diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index f8043f306d8..20ef429d4c8 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -292,7 +292,7 @@ else // Last movement $sql = "SELECT max(m.datem) as datem"; - $sql .= " FROM llx_stock_mouvement as m"; + $sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m"; $sql .= " WHERE m.fk_entrepot = '".$object->id."'"; $resqlbis = $db->query($sql); if ($resqlbis) diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index fdfc8a86f66..8eb06a963d5 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -208,7 +208,7 @@ if ($resql) // Last movement $sql = "SELECT max(m.datem) as datem"; - $sql .= " FROM llx_stock_mouvement as m"; + $sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m"; $sql .= " WHERE m.fk_entrepot = '".$entrepot->id."'"; $resqlbis = $db->query($sql); if ($resqlbis) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 873c27b1ff2..3f2e0bfb660 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -283,7 +283,7 @@ if ($_GET["id"] || $_GET["ref"]) // Last movement $sql = "SELECT max(m.datem) as datem"; - $sql.= " FROM llx_stock_mouvement as m"; + $sql.= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m"; $sql.= " WHERE m.fk_product = '".$product->id."'"; $resqlbis = $db->query($sql); if ($resqlbis) From d82a254e030b1ee943bcf22c9c34e391bbebcc29 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 23 Nov 2011 23:09:57 +0100 Subject: [PATCH 15/21] New: add prefix field in install form and in conf.php --- htdocs/conf/conf.php.example | 8 ++++++++ htdocs/install/etape1.php | 17 ++++++++++++++--- htdocs/install/fileconf.php | 34 ++++++++++++++++++++++------------ 3 files changed, 44 insertions(+), 15 deletions(-) diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index ff1cce52ee7..26ed4bb8c92 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -96,6 +96,14 @@ $dolibarr_main_db_port=''; $dolibarr_main_db_name=''; +# dolibarr_main_db_prefix +# This parameter contains prefix of Dolibarr database. +# Examples: +# $dolibarr_main_db_prefix='llx_'; +# +$dolibarr_main_db_prefix=''; + + # dolibarr_main_db_user # This parameter contains user name used to read and write into # Dolibarr database. diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index f1da07fa947..fe3278fb81d 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -84,6 +84,11 @@ if (empty($_POST["db_name"])) print '
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DatabaseName")).'
'; $error++; } +if (empty($_POST["db_prefix"])) +{ + print '
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DatabasePrefix")).'
'; + $error++; +} if (empty($_POST["db_user"])) { print '
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Login")).'
'; @@ -365,12 +370,15 @@ if (! $error && $db->connected && $action == "set") } } } + + // Table prefix + $main_db_prefix = ((GETPOST("db_prefix") && GETPOST("db_prefix") != '') ? GETPOST("db_prefix") : 'llx_'); // Force https - $main_force_https = ((GETPOST("main_force_https") && ( GETPOST("main_force_https") == "on" || GETPOST("main_force_https") == 1) ) ? '1' : '0'); + $main_force_https = ((GETPOST("main_force_https") && (GETPOST("main_force_https") == "on" || GETPOST("main_force_https") == 1)) ? '1' : '0'); // Use alternative directory - $main_use_alt_dir = ((GETPOST("main_use_alt_dir") && ( GETPOST("main_use_alt_dir") == "on" || GETPOST("main_use_alt_dir") == 1) ) ? '' : '#'); + $main_use_alt_dir = ((GETPOST("main_use_alt_dir") && (GETPOST("main_use_alt_dir") == "on" || GETPOST("main_use_alt_dir") == 1)) ? '' : '#'); // Alternative root directory name $main_alt_dir_name = ((GETPOST("main_alt_dir_name") && GETPOST("main_alt_dir_name") != '') ? GETPOST("main_alt_dir_name") : 'custom'); @@ -724,7 +732,7 @@ function write_master_file($masterfile,$main_dir) function write_conf_file($conffile) { global $conf,$langs; - global $_POST,$main_dir,$main_data_dir,$main_force_https,$main_use_alt_dir,$main_alt_dir_name; + global $_POST,$main_dir,$main_data_dir,$main_force_https,$main_use_alt_dir,$main_alt_dir_name,$main_db_prefix; global $dolibarr_main_url_root,$dolibarr_main_document_root,$dolibarr_main_data_root,$dolibarr_main_db_host; global $dolibarr_main_db_port,$dolibarr_main_db_name,$dolibarr_main_db_user,$dolibarr_main_db_pass; global $dolibarr_main_db_type,$dolibarr_main_db_character_set,$dolibarr_main_db_collation,$dolibarr_main_authentication; @@ -777,6 +785,9 @@ function write_conf_file($conffile) fputs($fp, '$dolibarr_main_db_name=\''.addslashes($_POST["db_name"]).'\';'); fputs($fp,"\n"); + + fputs($fp, '$dolibarr_main_db_prefix=\''.addslashes($main_db_prefix).'\';'); + fputs($fp,"\n"); fputs($fp, '$dolibarr_main_db_user=\''.addslashes($_POST["db_user"]).'\';'); fputs($fp,"\n"); diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 9c5e21fbf3e..b32d0e54a0a 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -40,16 +40,17 @@ $langs->load("errors"); // install.forced.php into directory htdocs/install (This is the case with some wizard // installer like DoliWamp, DoliMamp or DoliBuntu). // We first init "forced values" to nothing. -if (! isset($force_install_noedit)) $force_install_noedit=''; -if (! isset($force_install_type)) $force_install_type=''; -if (! isset($force_install_dbserver)) $force_install_dbserver=''; -if (! isset($force_install_port)) $force_install_port=''; -if (! isset($force_install_database)) $force_install_database=''; -if (! isset($force_install_createdatabase)) $force_install_createdatabase=''; -if (! isset($force_install_databaselogin)) $force_install_databaselogin=''; -if (! isset($force_install_databasepass)) $force_install_databasepass=''; -if (! isset($force_install_databaserootlogin)) $force_install_databaserootlogin=''; -if (! isset($force_install_databaserootpass)) $force_install_databaserootpass=''; +if (! isset($force_install_noedit)) $force_install_noedit=''; +if (! isset($force_install_type)) $force_install_type=''; +if (! isset($force_install_dbserver)) $force_install_dbserver=''; +if (! isset($force_install_port)) $force_install_port=''; +if (! isset($force_install_database)) $force_install_database=''; +if (! isset($force_install_prefix)) $force_install_prefix=''; +if (! isset($force_install_createdatabase)) $force_install_createdatabase=''; +if (! isset($force_install_databaselogin)) $force_install_databaselogin=''; +if (! isset($force_install_databasepass)) $force_install_databasepass=''; +if (! isset($force_install_databaserootlogin)) $force_install_databaserootlogin=''; +if (! isset($force_install_databaserootpass)) $force_install_databaserootpass=''; // Now we load forced value from install.forced.php file. $useforcedwizard=false; if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } @@ -80,8 +81,7 @@ if (! empty($force_install_message)) } ?> - +
+ + + + + + +
@@ -348,6 +348,16 @@ if (! empty($force_install_message)) value=""> trans("DatabaseName"); ?>
trans("DatabasePrefix"); ?> + trans("DatabasePrefix"); ?>
trans("CreateDatabase"); ?> From 89b521ccfef6cae078f6c52b40860445464c9c91 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 24 Nov 2011 07:38:34 +0100 Subject: [PATCH 16/21] Fix: W3C --- htdocs/install/fileconf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index b32d0e54a0a..4b2caef19dd 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -81,7 +81,7 @@ if (! empty($force_install_message)) } ?> - +
"; $requestnb++; if ($conf->file->character_set_client == "UTF-8") @@ -538,6 +550,12 @@ if ($action == "set") // We loop on each requests foreach($arrayofrequests as $buffer) { + // Replace the prefix tables + if ($dolibarr_main_db_prefix != 'llx_') + { + $buffer=preg_replace('/llx_/i',$dolibarr_main_db_prefix,$buffer); + } + //dolibarr_install_syslog("Request: ".$buffer,LOG_DEBUG); $resql=$db->query($buffer); if ($resql) From 919523f2e2f67f87a53108c054beb61a2dc76409 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 24 Nov 2011 08:23:16 +0100 Subject: [PATCH 18/21] Change default prefix if needed --- htdocs/core/lib/admin.lib.php | 6 ++++++ htdocs/core/modules/DolibarrModules.class.php | 2 +- htdocs/install/etape2.php | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index b79072b0ada..c8bf01a17c9 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -220,6 +220,12 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='') { if ($sql) { + // Replace the prefix tables + if (MAIN_DB_PREFIX != 'llx_') + { + $sql=preg_replace('/llx_/i',MAIN_DB_PREFIX,$sql); + } + if (!empty($handler)) $sql=preg_replace('/__HANDLER__/i',"'".$handler."'",$sql); $newsql=preg_replace('/__ENTITY__/i',(!empty($entity)?$entity:$conf->entity),$sql); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 463ae3c172f..59673f7971c 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -408,7 +408,7 @@ abstract class DolibarrModules $sql = "DELETE FROM ".MAIN_DB_PREFIX."dolibarr_modules"; $sql.= " WHERE numero = ".$this->numero; - $sql.= " AND entity in (0, ".$conf->entity.")"; + $sql.= " AND entity IN (0, ".$conf->entity.")"; dol_syslog(get_class($this)."::_dbunactive sql=".$sql, LOG_DEBUG); $this->db->query($sql); diff --git a/htdocs/install/etape2.php b/htdocs/install/etape2.php index 865989f9e61..8f81e55614c 100644 --- a/htdocs/install/etape2.php +++ b/htdocs/install/etape2.php @@ -188,6 +188,12 @@ if ($action == "set") { $buffer=preg_replace('/type=innodb/i','ENGINE=innodb',$buffer); } + + // Replace the prefix tables + if ($dolibarr_main_db_prefix != 'llx_') + { + $buffer=preg_replace('/llx_/i',$dolibarr_main_db_prefix,$buffer); + } //print ""; $requestnb++; if ($conf->file->character_set_client == "UTF-8") @@ -538,6 +550,12 @@ if ($action == "set") // We loop on each requests foreach($arrayofrequests as $buffer) { + // Replace the prefix tables + if ($dolibarr_main_db_prefix != 'llx_') + { + $buffer=preg_replace('/llx_/i',$dolibarr_main_db_prefix,$buffer); + } + //dolibarr_install_syslog("Request: ".$buffer,LOG_DEBUG); $resql=$db->query($buffer); if ($resql) From 6073705dde343b726e6727392534149b50ef9511 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 24 Nov 2011 08:58:52 +0100 Subject: [PATCH 19/21] Fix: check prefix validity --- htdocs/install/etape1.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index fe3278fb81d..ebfea90aa06 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -84,11 +84,6 @@ if (empty($_POST["db_name"])) print '
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DatabaseName")).'
'; $error++; } -if (empty($_POST["db_prefix"])) -{ - print '
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DatabasePrefix")).'
'; - $error++; -} if (empty($_POST["db_user"])) { print '
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Login")).'
'; @@ -99,6 +94,11 @@ if (! empty($_POST["db_port"]) && ! is_numeric($_POST["db_port"])) print '
'.$langs->trans("ErrorBadValueForParameter",$_POST["db_port"],$langs->transnoentities("Port")).'
'; $error++; } +if (! empty($_POST["db_prefix"]) && ! preg_match('/^[a-z0-9]+_$/i', $_POST["db_prefix"])) +{ + print '
'.$langs->trans("ErrorBadValueForParameter",$_POST["db_prefix"],$langs->transnoentities("DatabasePrefix")).'
'; + $error++; +} // Remove last / into dans main_dir From be0ed900bc0156aeac6bf135cc3d90415b21e059 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 24 Nov 2011 09:16:21 +0100 Subject: [PATCH 20/21] Fix: translation --- .../compta/sociales/class/paymentsocialcontribution.class.php | 2 +- htdocs/install/etape1.php | 1 + htdocs/langs/en_US/install.lang | 1 + htdocs/langs/fr_FR/install.lang | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index f481755a6d4..ab3dc275892 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -78,7 +78,7 @@ class PaymentSocialContribution extends CommonObject // Validate parametres if (! $this->datepaye) { - $this->error='ErrorBadValueForParameters'; + $this->error='ErrorBadValueForParameter'; return -1; } diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index ebfea90aa06..f10362dff79 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -35,6 +35,7 @@ $langs->setDefaultLang($setuplang); $langs->load("admin"); $langs->load("install"); +$langs->load("errors"); // Recuparation des information de connexion $userroot=isset($_POST["db_user_root"])?$_POST["db_user_root"]:""; diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index 437e11c0faa..700f4750687 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -51,6 +51,7 @@ ServerAddressDescription=Name or ip address for database server, usually 'localh ServerPortDescription=Database server port. Keep empty if unknown. DatabaseServer=Database server DatabaseName=Database name +DatabasePrefix=Database prefix table Login=Login AdminLogin=Login for Dolibarr database owner. Password=Password diff --git a/htdocs/langs/fr_FR/install.lang b/htdocs/langs/fr_FR/install.lang index 83619fd68aa..55872123ef4 100644 --- a/htdocs/langs/fr_FR/install.lang +++ b/htdocs/langs/fr_FR/install.lang @@ -51,6 +51,7 @@ ServerAddressDescription=Nom ou adresse ip du serveur de base de données, gén ServerPortDescription=Port du serveur. Ne rien mettre si inconnu. DatabaseServer=Serveur de la base de données DatabaseName=Nom de la base de données +DatabasePrefix=Préfixe des tables Login=Login AdminLogin=Login du propriétaire de la base de données Dolibarr. Password=Mot de passe From 6476a6e8bbf95c66c87dbe31c2da44c7e6199b9a Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 24 Nov 2011 17:04:24 +0100 Subject: [PATCH 21/21] Trad: Add ca_ES and es_ES translations --- htdocs/langs/ca_ES/bills.lang | 4 +++- htdocs/langs/ca_ES/boxes.lang | 10 ++++---- htdocs/langs/ca_ES/contracts.lang | 3 ++- htdocs/langs/ca_ES/errors.lang | 15 ++++++------ htdocs/langs/ca_ES/install.lang | 38 ++++++++++++++++--------------- htdocs/langs/es_ES/bills.lang | 4 +++- htdocs/langs/es_ES/boxes.lang | 12 ++++++---- htdocs/langs/es_ES/contracts.lang | 5 ++-- htdocs/langs/es_ES/errors.lang | 9 ++++---- htdocs/langs/es_ES/install.lang | 32 ++++++++++++++------------ 10 files changed, 72 insertions(+), 60 deletions(-) diff --git a/htdocs/langs/ca_ES/bills.lang b/htdocs/langs/ca_ES/bills.lang index 0bed48fefee..0c2333182d3 100644 --- a/htdocs/langs/ca_ES/bills.lang +++ b/htdocs/langs/ca_ES/bills.lang @@ -231,6 +231,7 @@ ReductionsShort=Dto. Discount=Descompte Discounts=Descomptes ShowDiscount=Veure el abonament +ShowReduc=Visualitzar la deducció RelativeDiscount=Descompte relatiu GlobalDiscount=Descompte fixe CreditNote=Abonament @@ -342,6 +343,7 @@ LawApplicationPart2=les mercaderies romanen en propietat de LawApplicationPart3=venedor fins al cobrament de LawApplicationPart4=els seus preus LimitedLiabilityCompanyCapital=SRL amb capital de +UseLine=Aplicar UseDiscount=Aplicar descompte UseCredit=Utilitzar crèdit UseCreditNoteInInvoicePayment=Reduir el pagament amb aquest crèdit @@ -384,4 +386,4 @@ PDFCrabeDescription=Model de factura complet (model recomanat per defecte) # oursin PDF Model PDFOursinDescription=Model de factura complet (model alternatiu) # NumRef Modules -TerreNumRefModelDesc1=Retorna el nombre sota el format %syymm-nnnn per a les factures i %syymm-nnnn per als abonaments on yy és l'any, mm. el mes i nnnn un comptador seqüencial sense ruptura i sense permanència a 0 +TerreNumRefModelDesc1=Retorna el nombre sota el format %syymm-nnnn per a les factures i %syymm-nnnn per als abonaments on yy és l'any, mm. el mes i nnnn un comptador seqüencial sense ruptura i sense permanència a 0 \ No newline at end of file diff --git a/htdocs/langs/ca_ES/boxes.lang b/htdocs/langs/ca_ES/boxes.lang index 5c1e38c97b7..f87373490c4 100644 --- a/htdocs/langs/ca_ES/boxes.lang +++ b/htdocs/langs/ca_ES/boxes.lang @@ -46,16 +46,18 @@ BoxTitleTotalUnpaidSuppliersBills=Pendent a proveïdors BoxTitleLastModifiedContacts=Els últims %s contactes/adreçes modificades BoxTitleLastModifiedMembers=Els %s últims membres modificats BoxMyLastBookmarks=Els meus %s darrers marcadors +BoxOldestExpiredServices=Serveis antics expirats +BoxLastExpiredServices=Els %s contractes més antics amb serveis actius expirats +BoxTitleLastActionsToDo=Les %s últims esdeveniments a realitzar +BoxTitleLastContracts=Els %s últims contractes +BoxTitleLastModifiedDonations=Les %s últimes subvencions modificades +BoxTitleLastModifiedExpenses=Els %s últims honoraris modificats FailedToRefreshDataInfoNotUpToDate=Error en el refresc del flux RSS. Data de l'últim refresc :%s LastRefreshDate=Data darrera actualització NoRecordedBookmarks=No hi ha marcadors personals. ClickToAdd=Haga feu clic aquí per afegir. NoRecordedCustomers=Cap client registrat NoRecordedContacts=Cap contacte registrat -BoxTitleLastActionsToDo=Les %s últims esdeveniments a realitzar -BoxTitleLastContracts=Els %s últims contractes -BoxTitleLastModifiedDonations=Les %s últimes subvencions modificades -BoxTitleLastModifiedExpenses=Els %s últims honoraris modificats NoActionsToDo=Sense esdeveniments a realitzar NoRecordedOrders=Sense comandes de clients registrats NoRecordedProposals=Sense pressupostos registrats diff --git a/htdocs/langs/ca_ES/contracts.lang b/htdocs/langs/ca_ES/contracts.lang index bfd921fc256..fdfb72003a4 100644 --- a/htdocs/langs/ca_ES/contracts.lang +++ b/htdocs/langs/ca_ES/contracts.lang @@ -1,4 +1,4 @@ -# Dolibarr language file - ca_ES - contracts +# Dolibarr language file - ca_ES - contracts CHARSET=UTF-8 ContractsArea=Àrea contractes ListOfContracts=Llistat de contractes @@ -84,6 +84,7 @@ ConfirmMoveToAnotherContractQuestion=Escolliu qualsevol altre contracte del mate PaymentRenewContractId=Renovació servei (número %s) ExpiredSince=Expirat des del RelatedContracts=Contractes associats +NoExpiredServices=Sense serveis actius expirats ##### Types de contacts ##### TypeContact_contrat_internal_SALESREPSIGN=Comercial signant del contracte TypeContact_contrat_internal_SALESREPFOLL=Comercial seguiment del contracte diff --git a/htdocs/langs/ca_ES/errors.lang b/htdocs/langs/ca_ES/errors.lang index 08be00bafa6..dd2057d7bd2 100644 --- a/htdocs/langs/ca_ES/errors.lang +++ b/htdocs/langs/ca_ES/errors.lang @@ -1,8 +1,7 @@ -# Dolibarr language file - ca_ES - errors +# Dolibarr language file - ca_ES - errors CHARSET=UTF-8 MenuManager=Gestor de menú - -# Errors +# Errors=undefined= Error=Error Errors=Errors ErrorBadEMail=e-mail %s incorrecte @@ -71,7 +70,7 @@ ErrorFileIsInfectedWithAVirus=L'antivirus no ha pogut validar aquest arxiu (és ErrorSpecialCharNotAllowedForField=Els caràcters especials no són admesos pel camp "%s" ErrorDatabaseParameterWrong=El paràmetre de configuració de la base de dades '%s' té un valor no compatible per una instal lació de Dolibarr (ha de tenir el valor '%s'). ErrorNumRefModel=Hi ha una referència a la base de dades (%s) i és incompatible amb aquesta numeració. Elimineu la línia o renomeneu la referència per activar aquest mòdul. -ErrorQtyTooLowForThisSupplier= Quantitat insuficient per aquest proveïdor +ErrorQtyTooLowForThisSupplier=Quantitat insuficient per aquest proveïdor ErrorModuleSetupNotComplete=La configuració del mòdul sembla incompleta. Aneu al àrea Configuració - Mòduls per corregir ErrorBadMask=Error en la màscara ErrorBadMaskFailedToLocatePosOfSequence=Error, sense número de seqüència en la màscara @@ -98,15 +97,15 @@ ErrorFailedToChangePassword=Error en la modificació de la contrasenya ErrorLoginDoesNotExists=El compte d'usuari de %s no s'ha trobat. ErrorLoginHasNoEmail=Aquest usuari no té e-mail. Impossible continuar. ErrorBadValueForCode=Valor no vàlid per al codi. Torneu a intentar-ho amb un nou valor ... - +ErrorBothFieldCantBeNegative=Els camps %s i %s no poden ser negatius # Warnings -WarningNoDocumentModelActivated=No hi ha cap model per a la generació del document activat. Es prendrà un model per defecte fins que es configuri el mòdul. -WarningsOnXLines=Alertes a %s línies font -WarningConfFileMustBeReadOnly=Atenció, el seu fitxer (htdocs/conf/conf.php) és accessible en escriptura al servidor web. Això representa un error seriós de seguretat. Modifiqueu els permisos per ser llegit únicament pel compte que executa el servidor Web.Si està executant Windows en undisco amb format FAT, sigui conscient que aquest sistema d'arxius no protegeix els arxius i no ofereix cap solució per reduir els riscos de manipulació d'aquest fitxer. WarningSafeModeOnCheckExecDir=Atenció, està activada l'opció PHP safe_mode, la comanda ha d'estar dins d'un directori declarat dins del paràmetre php safe_mode_exec_dir. WarningAllowUrlFopenMustBeOn=El paràmetre allow_url_fopen ha de ser especificat a on a l'arxiu php.ini per disposar d'aquest mòdul completament actiu. Ha de modificar aquest arxiu manualment WarningBuildScriptNotRunned=L'script %s encara no ha executat la construcció de gràfics. WarningBookmarkAlreadyExists=Ja existeix un marcador amb aquest títol o aquest URL. WarningPassIsEmpty=Atenció: La contrasenya de la base de dades està buida. Això és un forat de seguretat. Cal afegir una contrasenya a la seva base de dades i canviar el seu arxiu conf.php per reflectir això. +WarningConfFileMustBeReadOnly=Atenció, el seu fitxer (htdocs/conf/conf.php) és accessible en escriptura al servidor web. Això representa un error seriós de seguretat. Modifiqueu els permisos per ser llegit únicament pel compte que executa el servidor Web.Si està executant Windows en undisco amb format FAT, sigui conscient que aquest sistema d'arxius no protegeix els arxius i no ofereix cap solució per reduir els riscos de manipulació d'aquest fitxer. +WarningsOnXLines=Alertes a %s línies font +WarningNoDocumentModelActivated=No hi ha cap model per a la generació del document activat. Es prendrà un model per defecte fins que es configuri el mòdul. WarningInstallDirExists=Atenció: La carpeta install (htdocs/install) encara existeix. Una vegada finalitzada la instal·lació la seva presència no és necessària, i representa un error seriós de seguretat. Hauríeu eliminar-la el més aviat possible. WarningUntilDirRemoved=Aquesta alerta seguirà activa mentre la carpeta existeixi (alerta visible per als usuaris admin solament). \ No newline at end of file diff --git a/htdocs/langs/ca_ES/install.lang b/htdocs/langs/ca_ES/install.lang index c3ac01b7081..1a6b3862337 100644 --- a/htdocs/langs/ca_ES/install.lang +++ b/htdocs/langs/ca_ES/install.lang @@ -1,4 +1,4 @@ -# Dolibarr language file - ca_ES - install +# Dolibarr language file - ca_ES - install CHARSET=UTF-8 InstallEasy=Hem procurat que la instal·lació sigui el més simple possible, vostè només ha de seguir els passos un a un. MiscellanousChecks=Comprovació dels Prerequisits @@ -51,6 +51,7 @@ ServerAddressDescription=Nom o adreça IP del servidor de base de dades, general ServerPortDescription=Port del servidor de la base de dades. Deixar en blanc si ho desconeix. DatabaseServer=Servidor de la base de dades DatabaseName=Nom de la base de dades +DatabasePrefix=Prefixe per a les taules Login=Usuari AdminLogin=Usuari de l'administrador de la base de dades Dolibarr. Deixi buit si es connecta com a anonymous Password=Contrasenya @@ -152,8 +153,9 @@ MigrationShippingDelivery=Actualització de les dades de expedicions MigrationShippingDelivery2=Actualització de les dades expedicions 2 MigrationFinished=Acabada l'actualització LastStepDesc=Últim pas: Indiqueu aquí el compte i la contrasenya del primer usuari que fareu servir per connectar-se a l'aplicació. No perdi aquests identificadors, és el compte que permet administrar la resta. -######### -# upgrade +ActivateModule=Activació del mòdul %s +#########=undefined +# upgrade=undefined MigrationFixData=Correcció de dades desnormalitzades MigrationOrder=Migració de dades de les comandes clients MigrationSupplierOrder=Migració de dades de les comandes a proveïdors @@ -163,56 +165,56 @@ MigrationContract=Migració de dades dels contractes MigrationSuccessfullUpdate=Actualització finalitzada MigrationUpdateFailed=L'actualització ha fallat MigrationRelationshipTables=Migració de les taules de relació (%s) -# Payments Update +# Payments Update MigrationPaymentsUpdate=Actualització dels pagaments (vincle nn pagaments-factures) MigrationPaymentsNumberToUpdate=%s pagament(s) a actualitzar MigrationProcessPaymentUpdate=Actualització pagament(s) %s MigrationPaymentsNothingToUpdate=No hi ha més pagaments orfes que hagin de corregir. MigrationPaymentsNothingUpdatable=Cap pagament orfe de correcció. -# Contracts Update +# Contracts Update MigrationContractsUpdate=Actualització dels contractes sense detalls (gestió del contracte + detall de contracte) MigrationContractsNumberToUpdate=%s contracte(s) a actualitzar MigrationContractsLineCreation=Creació linia contracte per contracte Ref. %s MigrationContractsNothingToUpdate=No hi ha més contractes (vinculats a un producte) sense línies de detalls que hagin de corregir. MigrationContractsFieldDontExist=Els camps fk_facture no existeixen ja. No hi ha operació pendent. -# Contracts Empty Dates Update +# Contracts Empty Dates Update MigrationContractsEmptyDatesUpdate=Actualització de les dades de contractes no indicades MigrationContractsEmptyDatesUpdateSuccess=Ok per data de contracte MigrationContractsEmptyDatesNothingToUpdate=No hi ha més properes dates de contractes. MigrationContractsEmptyCreationDatesUpdateSuccess=Ok per la data de creació MigrationContractsEmptyCreationDatesNothingToUpdate=No hi ha més properes dates de creació. -# Contracts Invalid Dates Update +# Contracts Invalid Dates Update MigrationContractsInvalidDatesUpdate=Actualització dades contracte incorrectes (per contractes amb detall en servei) MigrationContractsInvalidDateFix=Corregir contracte %s (data contracte=%s, Data posada en servei min=%s) MigrationContractsInvalidDatesNumber=%s contractes modificats MigrationContractsInvalidDatesNothingToUpdate=No hi ha més de contractes que hagin de corregir-se. -# Contracts Incoherent Dates Update +# Contracts Incoherent Dates Update MigrationContractsIncoherentCreationDateUpdate=Actualització de les dades de creació de contracte que tenen un valor incoherent MigrationContractsIncoherentCreationDateUpdateSuccess=Ok MigrationContractsIncoherentCreationDateNothingToUpdate=No hi ha més dades de contractes. -# Reopening Contracts +# Reopening Contracts MigrationReopeningContracts=Reobertura dels contractes que tenen almenys un servei actiu no tancat MigrationReopenThisContract=Reobertura contracte %s MigrationReopenedContractsNumber=%s contractes modificats MigrationReopeningContractsNothingToUpdate=No hi ha més contractes que hagin de reobrirse. -# Migration transfert +# Migration transfert MigrationBankTransfertsUpdate=Actualització dels vincles entre registres bancaris i una transferència entre compte MigrationBankTransfertsNothingToUpdate=Cap vincle desfasat -# Migration delivery +# Migration delivery MigrationShipmentOrderMatching=Actualitzar notes d'expedició MigrationDeliveryOrderMatching=Actualitzar recepcions MigrationDeliveryDetail=Actualitzar recepcions -# Migration stock +# Migration stock MigrationStockDetail=Actualitzar valor en stock dels productes -# Migration menus +# Migration menus MigrationMenusDetail=Actualització de la taula de menús dinàmics -# Migration delivery address +# Migration delivery address MigrationDeliveryAddress=Actualització de les adreces d'enviament en les notes de lliurament -# Migration project task actors +# Migration project task actors MigrationProjectTaskActors=Migració de la taula llx_projet_task_actors -# Migration project user resp +# Migration project user resp MigrationProjectUserResp=Migració del camp fk_user_resp de llx_projet a llx_element_contact -# Migration project task time +# Migration project task time MigrationProjectTaskTime=Actualització de temps dedicat en segons -# Migration Acctioncom +# Migration Acctioncom=undefined MigrationActioncommElement=Actualització de les dades de accions sobre elements \ No newline at end of file diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index 9501abc248f..e51b916dc7b 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -231,6 +231,7 @@ ReductionsShort=Dto. Discount=Descuento Discounts=Descuentos ShowDiscount=Ver el abono +ShowReduc=Visualizar la deducción RelativeDiscount=Descuento relativo GlobalDiscount=Descuento fijo CreditNote=Abono @@ -342,6 +343,7 @@ LawApplicationPart2=las mercancías permanecen en propiedad de LawApplicationPart3=vendedor hasta el completo cobro de LawApplicationPart4=sus precios LimitedLiabilityCompanyCapital=SRL con capital de +UseLine=Aplicar UseDiscount=Aplicar descuento UseCredit=Usar crédito UseCreditNoteInInvoicePayment=Reducir el pago con este crédito @@ -384,4 +386,4 @@ PDFCrabeDescription=Modelo de factura completo (modelo recomendado por defecto) # oursin PDF Model PDFOursinDescription=Modelo de factura completo (modelo alternativo) # NumRef Modules -TerreNumRefModelDesc1=Devuelve el número bajo el formato %syymm-nnnn para las facturas y %syymm-nnnn para los abonos donde yy es el año, mm. el mes y nnnn un contador secuencial sin ruptura y sin permanencia a 0 +TerreNumRefModelDesc1=Devuelve el número bajo el formato %syymm-nnnn para las facturas y %syymm-nnnn para los abonos donde yy es el año, mm. el mes y nnnn un contador secuencial sin ruptura y sin permanencia a 0 \ No newline at end of file diff --git a/htdocs/langs/es_ES/boxes.lang b/htdocs/langs/es_ES/boxes.lang index 7ff3a8d01ad..734c8e0c8cd 100644 --- a/htdocs/langs/es_ES/boxes.lang +++ b/htdocs/langs/es_ES/boxes.lang @@ -1,4 +1,4 @@ -# Dolibarr language file - es_ES - boxes +# Dolibarr language file - es_ES - boxes CHARSET=UTF-8 BoxLastRssInfos=Hilos de información RSS BoxLastProducts=Los %s últimos productos/servicios @@ -46,16 +46,18 @@ BoxTitleTotalUnpaidSuppliersBills=Pendiente a proveedores BoxTitleLastModifiedContacts=Los %s últimos contactos/direcciones modificadas BoxTitleLastModifiedMembers=Los %s últimos miembros modificados BoxMyLastBookmarks=Mis %s últimos marcadores +BoxOldestExpiredServices=Servicios antiguos expirados +BoxLastExpiredServices=Los %s contratos más antiguos con servicios activos expirados +BoxTitleLastActionsToDo=Los %s últimos eventos a realizar +BoxTitleLastContracts=Los %s últimos contratos +BoxTitleLastModifiedDonations=Las %s últimas subvenciones modificadas +BoxTitleLastModifiedExpenses=Los %s últimos honorarios modificados FailedToRefreshDataInfoNotUpToDate=Error en el refresco del flujo RSS. Fecha del último refresco: %s LastRefreshDate=Fecha última actualización NoRecordedBookmarks=No hay marcadores personales. ClickToAdd=Haga clic aquí para añadir. NoRecordedCustomers=Ningún cliente registrado NoRecordedContacts=Ningún contacto registrado -BoxTitleLastActionsToDo=Los %s últimos eventos a realizar -BoxTitleLastContracts=Los %s últimos contratos -BoxTitleLastModifiedDonations=Las %s últimas subvenciones modificadas -BoxTitleLastModifiedExpenses=Los %s últimos honorarios modificados NoActionsToDo=Sin eventos a realizar NoRecordedOrders=Sin pedidos de clientes registrados NoRecordedProposals=Sin presupuestos registrados diff --git a/htdocs/langs/es_ES/contracts.lang b/htdocs/langs/es_ES/contracts.lang index 114ba38906b..12298ce4ca6 100644 --- a/htdocs/langs/es_ES/contracts.lang +++ b/htdocs/langs/es_ES/contracts.lang @@ -1,4 +1,4 @@ -# Dolibarr language file - es_ES - contracts +# Dolibarr language file - es_ES - contracts CHARSET=UTF-8 ContractsArea=Área contratos ListOfContracts=Listado de contratos @@ -84,10 +84,11 @@ ConfirmMoveToAnotherContractQuestion=Elija cualquier otro contrato del mismo ter PaymentRenewContractId=Renovación servicio (número %s) ExpiredSince=Expirado desde el RelatedContracts=Contratos asociados +NoExpiredServices=Sin servicios activos expirados ##### Types de contacts ##### TypeContact_contrat_internal_SALESREPSIGN=Comercial firmante del contrato TypeContact_contrat_internal_SALESREPFOLL=Comercial seguimiento del contrato TypeContact_contrat_external_BILLING=Contacto cliente de facturación del contrato TypeContact_contrat_external_CUSTOMER=Contacto cliente seguimiento del contrato TypeContact_contrat_external_SALESREPSIGN=Contacto cliente firmante del contrato -Error_CONTRACT_ADDON_NotDefined=Constante CONTRACT_ADDON no definida \ No newline at end of file +Error_CONTRACT_ADDON_NotDefined=Constante CONTRACT_ADDON no definida \ No newline at end of file diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang index 78a6d28c59e..170e20451b0 100644 --- a/htdocs/langs/es_ES/errors.lang +++ b/htdocs/langs/es_ES/errors.lang @@ -1,8 +1,7 @@ -# Dolibarr language file - es_ES - errors +# Dolibarr language file - es_ES - errors CHARSET=UTF-8 MenuManager=Gestor de menú - -# Errors +# Errors=undefined Error=Error Errors=Errores ErrorBadEMail=e-mail %s no correcto @@ -71,7 +70,7 @@ ErrorFileIsInfectedWithAVirus=¡El antivirus no ha podido validar este archivo ( ErrorSpecialCharNotAllowedForField=Los caracteres especiales no son admitidos por el campo "%s" ErrorDatabaseParameterWrong=El parámetro de configuración de la base de datos '%s' tiene un valor no compatible para una instalación de Dolibarr (debe tener el valor '%s'). ErrorNumRefModel=Hay una referencia en la base de datos (%s) y es incompatible con esta numeración. Elimine la línea o renombre la referencia para activar este módulo. -ErrorQtyTooLowForThisSupplier= Cantidad insuficiente para este proveedor +ErrorQtyTooLowForThisSupplier=Cantidad insuficiente para este proveedor ErrorModuleSetupNotComplete=La configuración del módulo parece incompleta. Vaya al área Configuración - Módulos para corregir ErrorBadMask=Error en la máscara ErrorBadMaskFailedToLocatePosOfSequence=Error, sin número de secuencia en la máscara @@ -98,7 +97,7 @@ ErrorFailedToChangePassword=Error en la modificación de la contraseña ErrorLoginDoesNotExists=La cuenta de usuario de %s no se ha encontrado. ErrorLoginHasNoEmail=Este usuario no tiene e-mail. Imposible continuar. ErrorBadValueForCode=Valor incorrecto para el código. Vuelva a intentar con un nuevo valor... - +ErrorBothFieldCantBeNegative=Los campos %s y %s no pueden ser negativos # Warnings WarningSafeModeOnCheckExecDir=Atención, está activada la opción PHP safe_mode, el comando deberá estar dentro de un directorio declarado dentro del parámetro php safe_mode_exec_dir. WarningAllowUrlFopenMustBeOn=El parámetro allow_url_fopen debe ser especificado a on en el archivo php.ini para disponer de este módulo completamente activo. Debe modificar este archivo manualmente diff --git a/htdocs/langs/es_ES/install.lang b/htdocs/langs/es_ES/install.lang index dcd1d5eeb40..1009d1a1e9f 100644 --- a/htdocs/langs/es_ES/install.lang +++ b/htdocs/langs/es_ES/install.lang @@ -51,6 +51,7 @@ ServerAddressDescription=Nombre o dirección IP del servidor de base de datos, g ServerPortDescription=Puerto del servidor de la base de datos. Dejar en blanco si lo desconoce. DatabaseServer=Servidor de la base de datos DatabaseName=Nombre de la base de datos +DatabasePrefix=Prefijo para las tablas Login=Usuario AdminLogin=Usuario del administrador de la base de datos Dolibarr. Deje vacío si se conecta en anonymous Password=Contraseña @@ -152,6 +153,7 @@ MigrationShippingDelivery=Actualización de los datos de expediciones MigrationShippingDelivery2=Actualización de los datos de expediciones 2 MigrationFinished=Actualización terminada LastStepDesc=Último paso: Indique aquí la cuenta y la contraseña del primer usuario que usted utilizará para conectarse a la aplicación. No pierda estos identificadores, es la cuenta que permite administrar el resto. +ActivateModule=Activación del módulo %s ######### # upgrade MigrationFixData=Corrección de datos desnormalizados @@ -163,56 +165,56 @@ MigrationContract=Migración de datos de los contratos MigrationSuccessfullUpdate=Actualización finalizada MigrationUpdateFailed=La actualización ha fallado MigrationRelationshipTables=Migración de las tablas de relación (%s) -# Payments Update +# Payments Update= MigrationPaymentsUpdate=Actualización de los pagos (vínculo n-n pagos-facturas) MigrationPaymentsNumberToUpdate=%s pago(s) a actualizar MigrationProcessPaymentUpdate=Actualización pago(s) %s MigrationPaymentsNothingToUpdate=No hay más pagos huérfanos que deban corregirse. MigrationPaymentsNothingUpdatable=Ningún pago huérfano corregible. -# Contracts Update +# Contracts Update= MigrationContractsUpdate=Actualización de los contratos sin detalles (gestión del contrato + detalle de contrato) MigrationContractsNumberToUpdate=%s contrato(s) a actualizar MigrationContractsLineCreation=Creación linea contrato para contrato Ref. %s MigrationContractsNothingToUpdate=No hay más contratos (vinculados a un producto) sin líneas de detalles que deban corregirse. MigrationContractsFieldDontExist=Los campos fk_facture no existen ya. No hay operación pendiente. -# Contracts Empty Dates Update +# Contracts Empty Dates Update= MigrationContractsEmptyDatesUpdate=Actualización de las fechas de contratos no indicadas MigrationContractsEmptyDatesUpdateSuccess=Ok para fecha de contrato MigrationContractsEmptyDatesNothingToUpdate=No hay más próximas fechas de contratos. MigrationContractsEmptyCreationDatesUpdateSuccess=Ok para la fecha de creación MigrationContractsEmptyCreationDatesNothingToUpdate=No hay más próximas fechas de creación. -# Contracts Invalid Dates Update +# Contracts Invalid Dates Update= MigrationContractsInvalidDatesUpdate=Actualización fechas contrato incorrectas (para contratos con detalle en servicio) MigrationContractsInvalidDateFix=Corregir contrato %s (fecha contrato=%s, Fecha puesta en servicio min=%s) MigrationContractsInvalidDatesNumber=%s contratos modificados MigrationContractsInvalidDatesNothingToUpdate=No hay más de contratos que deban corregirse. -# Contracts Incoherent Dates Update +# Contracts Incoherent Dates Update= MigrationContractsIncoherentCreationDateUpdate=Actualización de las fechas de creación de contrato que tienen un valor incoherente MigrationContractsIncoherentCreationDateUpdateSuccess=Ok MigrationContractsIncoherentCreationDateNothingToUpdate=No hay más fechas de contratos. -# Reopening Contracts +# Reopening Contracts= MigrationReopeningContracts=Reapertura de los contratos que tienen al menos un servicio activo no cerrado MigrationReopenThisContract=Reapertura contrato %s MigrationReopenedContractsNumber=%s contratos modificados MigrationReopeningContractsNothingToUpdate=No hay más contratos que deban reabrirse. -# Migration transfert +# Migration transfert= MigrationBankTransfertsUpdate=Actualización de los vínculos entre registros bancarios y una transferencia entre cuenta MigrationBankTransfertsNothingToUpdate=Ningún vínculo desfasado -# Migration delivery +# Migration delivery= MigrationShipmentOrderMatching=Actualizar notas de expedición MigrationDeliveryOrderMatching=Actualizar recepciones MigrationDeliveryDetail=Actualizar recepciones -# Migration stock +# Migration stock= MigrationStockDetail=Actualizar valor en stock de los productos -# Migration menus +# Migration menus= MigrationMenusDetail=Actualización de la tabla de menús dinámicos -# Migration delivery address +# Migration delivery address= MigrationDeliveryAddress=Actualización de las direcciones de envío en las notas de entrega -# Migration project task actors +# Migration project task actors= MigrationProjectTaskActors=Migración de la tabla llx_projet_task_actors -# Migration project user resp +# Migration project user resp= MigrationProjectUserResp=Migración del campo fk_user_resp de llx_projet a llx_element_contact -# Migration project task time +# Migration project task time= MigrationProjectTaskTime=Actualización de tiempo dedicado en segundos # Migration Acctioncom -MigrationActioncommElement=Actualización de los datos de acciones sobre elementos \ No newline at end of file +MigrationActioncommElement=Actualización de los datos de acciones sobre elementos
From c64f16da1c06eda54d0d410531f4f1093d8c0fa3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 24 Nov 2011 07:48:33 +0100 Subject: [PATCH 17/21] Change default prefix if needed --- htdocs/install/etape2.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/htdocs/install/etape2.php b/htdocs/install/etape2.php index 865989f9e61..8f81e55614c 100644 --- a/htdocs/install/etape2.php +++ b/htdocs/install/etape2.php @@ -188,6 +188,12 @@ if ($action == "set") { $buffer=preg_replace('/type=innodb/i','ENGINE=innodb',$buffer); } + + // Replace the prefix tables + if ($dolibarr_main_db_prefix != 'llx_') + { + $buffer=preg_replace('/llx_/i',$dolibarr_main_db_prefix,$buffer); + } //print "
Creation de la table $name/td>"; $requestnb++; @@ -330,6 +336,12 @@ if ($action == "set") $buffer=trim($req); if ($buffer) { + // Replace the prefix tables + if ($dolibarr_main_db_prefix != 'llx_') + { + $buffer=preg_replace('/llx_/i',$dolibarr_main_db_prefix,$buffer); + } + //print "
Creation des cles et index de la table $name: '$buffer'
Creation de la table $name/td>"; $requestnb++; @@ -330,6 +336,12 @@ if ($action == "set") $buffer=trim($req); if ($buffer) { + // Replace the prefix tables + if ($dolibarr_main_db_prefix != 'llx_') + { + $buffer=preg_replace('/llx_/i',$dolibarr_main_db_prefix,$buffer); + } + //print "
Creation des cles et index de la table $name: '$buffer'