From 6252857440d7f4ddf1f0549e8b89179473809977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 6 Apr 2013 17:56:10 +0200 Subject: [PATCH 01/64] Fixed translations and BILL_SUPPLIER_BUILDDOC trigger --- htdocs/adherents/admin/adherent_extrafields.php | 4 +--- htdocs/admin/agenda_extrafields.php | 3 +-- .../supplier_invoice/modules_facturefournisseur.php | 2 +- .../modules/supplier_invoice/pdf/pdf_canelle.modules.php | 8 ++++---- htdocs/langs/en_US/margins.lang | 1 + htdocs/langs/es_ES/admin.lang | 2 +- htdocs/langs/es_ES/margins.lang | 3 ++- htdocs/langs/fr_FR/margins.lang | 1 + 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php index ef104cab883..91377a5e843 100755 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/adherent_extrafields.php @@ -58,8 +58,6 @@ require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; * View */ -$textobject=$langs->transnoentitiesnoconv("Members"); - $help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; llxHeader('',$langs->trans("MembersSetup"),$help_url); @@ -73,7 +71,7 @@ $head = member_admin_prepare_head(); dol_fiche_head($head, 'attributes', $langs->trans("Member"), 0, 'user'); -print $langs->trans("DefineHereComplementaryAttributes",$textobject).'
'."\n"; +print $langs->trans("DefineHereComplementaryAttributes", $langs->transnoentitiesnoconv("Members")).'
'."\n"; print '
'; dol_htmloutput_errors($mesg); diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index 1bd0c84ef77..8efb31dad27 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -76,8 +76,7 @@ $head=agenda_prepare_head(); dol_fiche_head($head, 'attributes', $langs->trans("Agenda")); - -print $langs->trans("DefineHereComplementaryAttributes",$textobject).'
'."\n"; +print $langs->trans("DefineHereComplementaryAttributes", $langs->transnoentitiesnoconv("Agenda")).'
'."\n"; print '
'; dol_htmloutput_errors($mesg); diff --git a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php index d29abaa08a0..1f8f6cb858f 100755 --- a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php +++ b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php @@ -148,7 +148,7 @@ function supplier_invoice_pdf_create($db, $object, $modele, $outputlangs, $hided // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); - $result=$interface->run_triggers('BILL_INVOICE_BUILDDOC',$object,$user,$langs,$conf); + $result=$interface->run_triggers('BILL_SUPPLIER_BUILDDOC',$object,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers 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 5e857abf6b0..1477b202878 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -564,8 +564,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalLT1",$mysoc->country_code).' '; - $totalvat.=vatrate(abs($tvakey),1).$tvacompl; + $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; + $totalvat.= vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -592,8 +592,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalLT2",$mysoc->country_code).' '; - $totalvat.=vatrate(abs($tvakey),1).$tvacompl; + $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; + $totalvat.= vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); diff --git a/htdocs/langs/en_US/margins.lang b/htdocs/langs/en_US/margins.lang index 10a8112f87e..f4975b719c7 100644 --- a/htdocs/langs/en_US/margins.lang +++ b/htdocs/langs/en_US/margins.lang @@ -45,6 +45,7 @@ MargeBrute=Raw margin MargeNette=Net margin MARGIN_TYPE_DETAILS=Raw margin : Selling price - Buying price
Net margin : Selling price - Cost price +CostPrice=Cost price BuyingCost=Cost price UnitCharges=Unit charges Charges=Charges diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index cd40781f4a1..1cc8dbe0028 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -1344,7 +1344,7 @@ AccountancyCodeBuy=Código contable compras AgendaSetup=Módulo configuración de acciones y agenda PasswordTogetVCalExport=Clave de autorización vcal export link PastDelayVCalExport=No exportar los eventos de más de -AGENDA_USE_EVENT_TYPE=Use los tipos de eventos (administrables desde Configuración->Diccionarios->llx_c_actioncomm) +AGENDA_USE_EVENT_TYPE=Usar los tipos de eventos (administrables desde Configuración->Diccionarios->llx_c_actioncomm) ##### ClickToDial ##### ClickToDialDesc=Este módulo permite agregar un icono después del número de teléfono de contactos Dolibarr. Un clic en este icono, Llama a un servidor con una URL que se indica a continuación. Esto puede ser usado para llamar al sistema call center de Dolibarr que puede llamar al número de teléfono en un sistema SIP, por ejemplo. ##### Point Of Sales (CashDesk) ##### diff --git a/htdocs/langs/es_ES/margins.lang b/htdocs/langs/es_ES/margins.lang index 0dc08481c46..9dd68991ae7 100644 --- a/htdocs/langs/es_ES/margins.lang +++ b/htdocs/langs/es_ES/margins.lang @@ -43,8 +43,9 @@ MARGIN_METHODE_FOR_DISCOUNT_DETAILS=Indica si un descuento global se toma en cue MARGIN_TYPE=Tipo de margen gestionado MargeBrute=Margen bruto MargeNette=Margen neto -MARGIN_TYPE_DETAILS=Margen bruto : Precio de venta sin IVA - Precio de compra sin IVA
Margen neto : Precio de venta sin IVA - Costos +MARGIN_TYPE_DETAILS=Margen bruto: Precio de venta sin IVA - Precio de compra sin IVA
Margen neto: Precio de venta sin IVA - Costos +CostPrice=Precio de compra BuyingCost=Costos UnitCharges=Carga unitaria Charges=Cargas diff --git a/htdocs/langs/fr_FR/margins.lang b/htdocs/langs/fr_FR/margins.lang index 3c81a9a1e4d..b30e79a3e7b 100644 --- a/htdocs/langs/fr_FR/margins.lang +++ b/htdocs/langs/fr_FR/margins.lang @@ -45,6 +45,7 @@ MargeBrute=Marge brute MargeNette=Marge nette MARGIN_TYPE_DETAILS=Marge brute : Prix de vente HT - Prix d'achat HT
Marge nette : Prix de vente HT - Coût de revient +CostPrice=Prix ​​d'achat BuyingCost=Coût de revient UnitCharges=Charge unitaire Charges=Charges From 4ceeea4a1c24c8690e9e319877be557e2880c79b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Apr 2013 14:36:22 +0200 Subject: [PATCH 02/64] Fix: Can't reset payment due date --- htdocs/fourn/facture/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 468a5c91e79..6f80f5b0303 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -191,7 +191,7 @@ elseif ($action == 'setdate_lim_reglement' && $user->rights->fournisseur->factur { $object->fetch($id); $object->date_echeance=dol_mktime(12,0,0,$_POST['date_lim_reglementmonth'],$_POST['date_lim_reglementday'],$_POST['date_lim_reglementyear']); - if ($object->date_echeance < $object->date) + if (! empty($object->date_echeance) && $object->date_echeance < $object->date) { $object->date_echeance=$object->date; setEventMessage($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"),'warnings'); From 64a96894733826d0ceafbf902d77e0a0ccc48f7e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Apr 2013 14:40:13 +0200 Subject: [PATCH 03/64] Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment --- htdocs/core/boxes/box_factures_fourn.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 7de7d3d1ea1..1e9996dc4ad 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -96,7 +96,7 @@ class box_factures_fourn extends ModeleBoxes $now=dol_now(); $i = 0; - $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; + $l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)'; while ($i < $num) { @@ -105,7 +105,7 @@ class box_factures_fourn extends ModeleBoxes $datec=$db->jdate($objp->datec); $late = ''; - if ($objp->paye == 0 && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day'))); + if ($objp->paye == 0 && $datelimite && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day'))); $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, From 515c5e58ca1fb4d9a6e5499509f24777cd0e1ca9 Mon Sep 17 00:00:00 2001 From: simnandez Date: Sun, 7 Apr 2013 15:04:55 +0200 Subject: [PATCH 04/64] Update Changelog --- ChangeLog | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a95ef991d5b..fe34f954f38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,9 +6,12 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.3.2 compared to 3.3.1 ***** --Fix: Ducth (nl_NL) translation --Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated --Generalize fix: file with a specific mask not found, again +- Fix: Ducth (nl_NL) translation +- Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated +- Generalize fix: file with a specific mask not found, again +- Fix: translations and BILL_SUPPLIER_BUILDDOC trigger +- Fix: Can't reset payment due date +- Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment From 35279f652092162c2b6195872305b88166f2ad53 Mon Sep 17 00:00:00 2001 From: simnandez Date: Sun, 7 Apr 2013 15:17:31 +0200 Subject: [PATCH 05/64] Update ChangeLog --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index fe34f954f38..70762076068 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,8 @@ English Dolibarr ChangeLog - Fix: translations and BILL_SUPPLIER_BUILDDOC trigger - Fix: Can't reset payment due date - Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment +- Fix: [ bug #794 ] Lost filter on zipwode in prospect list +- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed From 8f67606685b67bb091e1209f4cd8164094b9f871 Mon Sep 17 00:00:00 2001 From: simnandez Date: Sun, 7 Apr 2013 16:04:57 +0200 Subject: [PATCH 06/64] Spelling fix --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 70762076068..3a3907ab729 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,7 +12,7 @@ English Dolibarr ChangeLog - Fix: translations and BILL_SUPPLIER_BUILDDOC trigger - Fix: Can't reset payment due date - Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment -- Fix: [ bug #794 ] Lost filter on zipwode in prospect list +- Fix: [ bug #794 ] Lost filter on zipcode in prospect list - Fix: [ bug #774 ] Bug on creating event with box "all day" crossed From b678183ff2d8f3046250cb5428ec5dcef8a861ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Apr 2013 21:09:57 +0200 Subject: [PATCH 07/64] Log --- htdocs/core/class/hookmanager.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 753086339fb..efd7ad6932d 100755 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -138,6 +138,8 @@ class HookManager { foreach($modules as $module => $actionclassinstance) { + //var_dump(get_class($actionclassinstance).'->'.$method); + // jump to next class if method does not exists if (! method_exists($actionclassinstance,$method)) continue; // test to avoid to run twice a hook, when a module implements several active contexts @@ -162,7 +164,7 @@ class HookManager } // Generic hooks that return a string (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...) else - { + { // TODO. this should be done into the method by returning nothing if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue; From 6013916d459e4b448ecf0a150755c49fc1edcb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 7 Apr 2013 21:58:24 +0200 Subject: [PATCH 08/64] Removed duplicated code and fixed a problem with orders2invoice --- htdocs/commande/orderstoinvoice.php | 35 +++++++++++++---------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index c709b2b4bbd..a6b2fe44a1f 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -51,37 +51,32 @@ $sref = GETPOST('sref'); $sref_client = GETPOST('sref_client'); $sall = GETPOST('sall'); $socid = GETPOST('socid','int'); +$selected = GETPOST('orders_to_invoice'); +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$viewstatut = GETPOST('viewstatut'); - -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); if (! $sortfield) $sortfield='c.rowid'; if (! $sortorder) $sortorder='DESC'; -$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]); // Date for local PHP server -$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]); -$date_starty=dol_mktime(0,0,0,$_REQUEST["date_start_delymonth"],$_REQUEST["date_start_delyday"],$_REQUEST["date_start_delyyear"]); // Date for local PHP server -$date_endy=dol_mktime(23,59,59,$_REQUEST["date_end_delymonth"],$_REQUEST["date_end_delyday"],$_REQUEST["date_end_delyyear"]); -$selected=GETPOST('orders_to_invoice'); -$action=GETPOST('action','alpha'); +$now = dol_now(); +$date_start = dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]); // Date for local PHP server +$date_end = dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]); +$date_starty = dol_mktime(0,0,0,$_REQUEST["date_start_delymonth"],$_REQUEST["date_start_delyday"],$_REQUEST["date_start_delyyear"]); // Date for local PHP server +$date_endy = dol_mktime(23,59,59,$_REQUEST["date_end_delymonth"],$_REQUEST["date_end_delyday"],$_REQUEST["date_end_delyyear"]); + if ($action == 'create') { - if (! is_array($selected)) + if (is_array($selected) == false) { - $mesgs[]='
'.$langs->trans('Error_OrderNotChecked').'
'; + $mesgs = array('
'.$langs->trans('Error_OrderNotChecked').'
'); } else { - $socid=GETPOST('socid'); - $action=GETPOST('action'); - $origin=GETPOST('origin'); - $originid=GETPOST('originid'); + $origin = GETPOST('origin'); + $originid = GETPOST('originid'); } } -$now=dol_now(); - -$viewstatut=GETPOST('viewstatut'); - /* * Actions @@ -358,7 +353,7 @@ $formfile = new FormFile($db); $companystatic = new Societe($db); // Mode creation -if ($action == 'create') +if ($action == 'create' && empty($mesgs)) { $facturestatic=new Facture($db); From 303cf3bc41062c945fa6e3a1132d00e11053cc3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 7 Apr 2013 22:00:51 +0200 Subject: [PATCH 09/64] Updated changelog --- ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3a3907ab729..5300f3f219b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,7 +13,8 @@ English Dolibarr ChangeLog - Fix: Can't reset payment due date - Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment - Fix: [ bug #794 ] Lost filter on zipcode in prospect list -- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed +- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed +- Fix: Orderstoinvoice didn't act as expected when no order was checked From f3bbfe375cc242ccca073f5f3f905c491b710b09 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 8 Apr 2013 12:38:51 +0200 Subject: [PATCH 10/64] Fix: for multicompany compatibility --- htdocs/paypal/lib/paypal.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 372122940f4..b3949b3d068 100755 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -309,6 +309,10 @@ function getPaypalPaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f } } } + + // For multicompany + $out.="&entity=".$conf->entity; + return $out; } @@ -790,4 +794,4 @@ function getApiError() return $errors; } -?> \ No newline at end of file +?> From 98aaec18a72e96ee98cb6bda909c7f84e8ca1202 Mon Sep 17 00:00:00 2001 From: fhenry Date: Mon, 8 Apr 2013 18:08:38 +0200 Subject: [PATCH 11/64] Fix [ bug #810 ] Cannot update ODT template path --- htdocs/admin/commande.php | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 7dda6ded0e4..fc982db0bb7 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -66,7 +66,7 @@ if ($action == 'updateMask') } } -if ($action == 'specimen') +else if ($action == 'specimen') { $modele=GETPOST('module','alpha'); @@ -111,7 +111,8 @@ if ($action == 'specimen') } } -if ($action == 'set') +// Activate a model +else if ($action == 'set') { $label = GETPOST('label','alpha'); $scandir = GETPOST('scandir','alpha'); @@ -128,7 +129,7 @@ if ($action == 'set') } } -if ($action == 'del') +else if ($action == 'del') { $type='order'; $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; @@ -142,7 +143,8 @@ if ($action == 'del') } } -if ($action == 'setdoc') +// Set default model +else if ($action == 'setdoc') { $label = GETPOST('label','alpha'); $scandir = GETPOST('scandir','alpha'); @@ -182,7 +184,7 @@ if ($action == 'setdoc') } } -if ($action == 'setmod') +else if ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated @@ -190,7 +192,7 @@ if ($action == 'setmod') dolibarr_set_const($db, "COMMANDE_ADDON",$value,'chaine',0,'',$conf->entity); } -if ($action == 'set_COMMANDE_DRAFT_WATERMARK') +else if ($action == 'set_COMMANDE_DRAFT_WATERMARK') { $draft = GETPOST("COMMANDE_DRAFT_WATERMARK"); $res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); @@ -207,7 +209,7 @@ if ($action == 'set_COMMANDE_DRAFT_WATERMARK') } } -if ($action == 'set_COMMANDE_FREE_TEXT') +else if ($action == 'set_COMMANDE_FREE_TEXT') { $freetext = GETPOST("COMMANDE_FREE_TEXT"); // No alpha here, we want exact string @@ -224,6 +226,14 @@ if ($action == 'set_COMMANDE_FREE_TEXT') $mesg = "".$langs->trans("Error").""; } } +else if ($action='setModuleOptions') { + if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF_ODT_PATH",GETPOST('value1'),'chaine',0,'',$conf->entity)) + { + // La constante qui a ete lue en avant du nouveau set + // on passe donc par une variable pour avoir un affichage coherent + $conf->global->COMMANDE_ADDON_PDF_ODT_PATH = GETPOST('value1'); + } +} /* From 8118332dfb0419b68e07f93bd3330d3f9649a143 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 10 Apr 2013 13:00:05 +0200 Subject: [PATCH 12/64] Fix: security Conflicts: htdocs/core/modules/mailings/contacts2.modules.php --- htdocs/core/modules/mailings/contacts2.modules.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/mailings/contacts2.modules.php b/htdocs/core/modules/mailings/contacts2.modules.php index 1d722cb938d..3270c2cf36d 100755 --- a/htdocs/core/modules/mailings/contacts2.modules.php +++ b/htdocs/core/modules/mailings/contacts2.modules.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2011 François Cerbelle + * Copyright (C) 2013 Regis Houssin * * 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 @@ -87,7 +88,7 @@ class mailing_contacts2 extends MailingTargets $sql.= " AND sp.no_email = 0"; //$sql.= " AND sp.poste != ''"; $sql.= " AND sp.entity IN (".getEntity('societe', 1).")"; - if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$filtersarray[0]."'"; + if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$this->db->escape($filtersarray[0])."'"; $sql.= " ORDER BY sp.name, sp.firstname"; $resql = $this->db->query($sql); if ($resql) @@ -219,4 +220,4 @@ class mailing_contacts2 extends MailingTargets } -?> \ No newline at end of file +?> From 38e30836a5972bea3621cb080801ef94c76f4dc3 Mon Sep 17 00:00:00 2001 From: fhenry Date: Wed, 10 Apr 2013 15:08:03 +0200 Subject: [PATCH 13/64] Fix bug with multicompany (SYSLOG_FILE on wrong entity) --- htdocs/admin/syslog.php | 4 ++-- htdocs/install/mysql/migration/3.2.0-3.3.0.sql | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 5bb0e85de84..075f975adb2 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -98,14 +98,14 @@ if ($action == 'set') if ($_POST[$option['constant']]) { dolibarr_del_const($db, $option['constant'], 0); - dolibarr_set_const($db, $option['constant'], $_POST[$option['constant']], 'chaine'); + dolibarr_set_const($db, $option['constant'], $_POST[$option['constant']], 'chaine',0, '', 0); } } } } } - dolibarr_set_const($db, 'SYSLOG_HANDLERS', json_encode($activeModules), 'chaine'); + dolibarr_set_const($db, 'SYSLOG_HANDLERS', json_encode($activeModules), 'chaine',0,'',0); if (! $error) { diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index b756659d987..76f48ed7d61 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -927,3 +927,6 @@ UPDATE llx_c_departements SET ncc='ALAVA', nom='Álava' WHERE code_departement=' ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseur; UPDATE llx_const set name='PRODUIT_MULTI_PRICES' where name='PRODUIT_MUTLI_PRICES'; + +DELETE FROM llx_const WHERE entity<>0 AND name IN ('SYSLOG_HANDLERS','SYSLOG_LEVEL'); +UPDATE llx_const SET entity=0 WHERE name = 'SYSLOG_FILE'; From 057365b69e837b6f1a8410acb55530ae47ac46d1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 10 Apr 2013 15:33:03 +0200 Subject: [PATCH 14/64] Fix: change for experimental encryption --- htdocs/install/mysql/migration/3.2.0-3.3.0.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index b756659d987..18620fe09f7 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -89,7 +89,7 @@ ALTER TABLE llx_commande CHANGE COLUMN fk_demand_reason fk_input_reason integer ALTER TABLE llx_propal CHANGE COLUMN fk_demand_reason fk_input_reason integer NULL DEFAULT NULL; ALTER TABLE llx_commande_fournisseur CHANGE COLUMN fk_methode_commande fk_input_method integer NULL DEFAULT 0; -INSERT INTO llx_const (name, value, type, note, visible) values ('PRODUCT_CODEPRODUCT_ADDON','mod_codeproduct_leopard','yesno','Module to control product codes',0); +INSERT INTO llx_const (name, value, type, note, visible) values (__ENCRYPT('PRODUCT_CODEPRODUCT_ADDON')__, __ENCRYPT('mod_codeproduct_leopard')__, 'yesno', 'Module to control product codes', 0); ALTER TABLE llx_c_barcode_type ADD UNIQUE INDEX uk_c_barcode_type(code, entity); @@ -926,4 +926,4 @@ UPDATE llx_c_departements SET ncc='ALAVA', nom='Álava' WHERE code_departement=' ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseur; -UPDATE llx_const set name='PRODUIT_MULTI_PRICES' where name='PRODUIT_MUTLI_PRICES'; +UPDATE llx_const SET name = __ENCRYPT('PRODUIT_MULTI_PRICES')__ WHERE __DECRYPT('name')__ = 'PRODUIT_MUTLI_PRICES'; From 19e902ef8f104b5c5599168ed46220b902c5da38 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 10 Apr 2013 15:59:54 +0200 Subject: [PATCH 15/64] Fix: filter on all contacts, not just those related to a company --- .../modules/mailings/contacts2.modules.php | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/mailings/contacts2.modules.php b/htdocs/core/modules/mailings/contacts2.modules.php index 3270c2cf36d..0096b855fe0 100755 --- a/htdocs/core/modules/mailings/contacts2.modules.php +++ b/htdocs/core/modules/mailings/contacts2.modules.php @@ -81,13 +81,12 @@ class mailing_contacts2 extends MailingTargets $sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,"; $sql.= " sp.name as name, sp.firstname as firstname, sp.civilite,"; $sql.= " s.nom as companyname"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; - $sql.= " ".MAIN_DB_PREFIX."societe as s"; - $sql.= " WHERE s.rowid = sp.fk_soc"; + $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; + $sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")"; $sql.= " AND sp.email != ''"; // Note that null != '' is false $sql.= " AND sp.no_email = 0"; //$sql.= " AND sp.poste != ''"; - $sql.= " AND sp.entity IN (".getEntity('societe', 1).")"; if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$this->db->escape($filtersarray[0])."'"; $sql.= " ORDER BY sp.name, sp.firstname"; $resql = $this->db->query($sql); @@ -163,10 +162,9 @@ class mailing_contacts2 extends MailingTargets // Number with a filter are show in the combo list for each filter. // If we want a filter "a position is defined", we must add it into formFilter $sql = "SELECT count(distinct(sp.email)) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; - $sql.= " ".MAIN_DB_PREFIX."societe as s"; - $sql.= " WHERE s.rowid = sp.fk_soc"; - $sql.= " AND sp.entity IN (".getEntity('societe', 1).")"; + $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; + $sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")"; $sql.= " AND sp.email != ''"; // Note that null != '' is false $sql.= " AND sp.no_email = 0"; //$sql.= " AND sp.poste != ''"; @@ -188,10 +186,9 @@ class mailing_contacts2 extends MailingTargets $langs->load("companies"); $sql = "SELECT sp.poste, count(distinct(sp.email)) AS nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; - $sql.= " ".MAIN_DB_PREFIX."societe as s"; - $sql.= " WHERE s.rowid = sp.fk_soc"; - $sql.= " AND sp.entity IN (".getEntity('societe', 1).")"; + $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; + $sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")"; $sql.= " AND sp.email != ''"; // Note that null != '' is false $sql.= " AND sp.no_email = 0"; $sql.= " AND (sp.poste IS NOT NULL AND sp.poste != '')"; From 5d94b0c5768607928d567b5e55591d1d0f3d291c Mon Sep 17 00:00:00 2001 From: fhenry Date: Wed, 10 Apr 2013 16:34:06 +0200 Subject: [PATCH 16/64] Fix bug : change path of ODT template for commande and propal module --- htdocs/admin/commande.php | 2 +- htdocs/admin/propal.php | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index fc982db0bb7..bb82c0d9ee1 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -226,7 +226,7 @@ else if ($action == 'set_COMMANDE_FREE_TEXT') $mesg = "".$langs->trans("Error").""; } } -else if ($action='setModuleOptions') { +else if ($action=='setModuleOptions') { if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF_ODT_PATH",GETPOST('value1'),'chaine',0,'',$conf->entity)) { // La constante qui a ete lue en avant du nouveau set diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 04f429f50bb..46da115c360 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -162,6 +162,36 @@ if ($action == 'setdefaultduration') } } +// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...) +if ($action == 'setModuleOptions') +{ + $post_size=count($_POST); + + $db->begin(); + + for($i=0;$i < $post_size;$i++) + { + if (array_key_exists('param'.$i,$_POST)) + { + $param=GETPOST("param".$i,'alpha'); + $value=GETPOST("value".$i,'alpha'); + if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + } + } + if (! $error) + { + $db->commit(); + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $db->rollback(); + $mesg = "".$langs->trans("Error").""; + } +} + + /*if ($action == 'setusecustomercontactasrecipient') { dolibarr_set_const($db, "PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT",$_POST["value"],'chaine',0,'',$conf->entity); From 72f0ca194cdf087c884088dbfdd958cade1932da Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Apr 2013 19:28:54 +0200 Subject: [PATCH 17/64] Fix: Solve conflict of translation --- htdocs/langs/ar_SA/admin.lang | 4 ---- htdocs/langs/bg_BG/admin.lang | 4 ---- htdocs/langs/ca_ES/admin.lang | 4 ---- htdocs/langs/da_DK/admin.lang | 4 ---- htdocs/langs/de_AT/admin.lang | 4 ---- htdocs/langs/de_DE/admin.lang | 4 ---- htdocs/langs/el_GR/admin.lang | 1 - htdocs/langs/en_US/admin.lang | 4 ---- htdocs/langs/es_ES/admin.lang | 4 ---- htdocs/langs/et_EE/admin.lang | 4 ---- htdocs/langs/fa_IR/admin.lang | 4 ---- htdocs/langs/fi_FI/admin.lang | 4 ---- htdocs/langs/fr_FR/admin.lang | 4 ---- htdocs/langs/he_IL/admin.lang | 4 ---- htdocs/langs/hu_HU/admin.lang | 4 ---- htdocs/langs/is_IS/admin.lang | 4 ---- htdocs/langs/it_IT/admin.lang | 4 ---- htdocs/langs/ja_JP/admin.lang | 4 ---- htdocs/langs/nb_NO/admin.lang | 4 ---- htdocs/langs/nl_BE/admin.lang | 4 ---- htdocs/langs/nl_NL/admin.lang | 4 ---- htdocs/langs/pl_PL/admin.lang | 4 ---- htdocs/langs/pt_BR/admin.lang | 4 ---- htdocs/langs/pt_PT/admin.lang | 4 ---- htdocs/langs/ro_RO/admin.lang | 4 ---- htdocs/langs/ru_RU/admin.lang | 4 ---- htdocs/langs/sl_SI/admin.lang | 4 ---- htdocs/langs/sv_SE/admin.lang | 4 ---- htdocs/langs/tr_TR/admin.lang | 4 ---- htdocs/langs/zh_CN/admin.lang | 4 ---- htdocs/langs/zh_TW/admin.lang | 4 ---- 31 files changed, 121 deletions(-) diff --git a/htdocs/langs/ar_SA/admin.lang b/htdocs/langs/ar_SA/admin.lang index 1869540d58b..722231818d2 100644 --- a/htdocs/langs/ar_SA/admin.lang +++ b/htdocs/langs/ar_SA/admin.lang @@ -333,10 +333,6 @@ Module1400Name=المحاسبة Module1400Desc=المحاسبة الإدارية (ضعف الأحزاب) Module1780Name=الفئات Module1780Desc=الفئات إدارة المنتجات والموردين والزبائن) -Module2200Name=الإقراض الإنسان -Module2200Desc=الإقراض لإدارة الحقوق -Module2300Name=القوائم -Module2300Desc=القوائم إدارة Module2400Name=جدول الأعمال Module2400Desc=الأعمال / الإدارة المهام وجدول الأعمال Module2500Name=إدارة المحتوى الإلكتروني diff --git a/htdocs/langs/bg_BG/admin.lang b/htdocs/langs/bg_BG/admin.lang index 34dfd27832a..812767e5ab4 100644 --- a/htdocs/langs/bg_BG/admin.lang +++ b/htdocs/langs/bg_BG/admin.lang @@ -438,10 +438,6 @@ Module1780Name=Категории Module1780Desc=Категория управление (продукти, доставчици и клиенти) Module2000Name=WYSIWYG редактор Module2000Desc=Оставя се да редактирате някакъв текст, чрез използване на усъвършенствана редактор -Module2200Name=Кредити права -Module2200Desc=Заеми за управление на права -Module2300Name=Менюта -Module2300Desc=Меню управление Module2400Name=Дневен ред Module2400Desc=Събития / задачи и управление на дневен ред Module2500Name=Управление на електронно съдържание diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 1b5bdfcbfad..230450ce3fa 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -446,10 +446,6 @@ Module1780Name=Categories Module1780Desc=Gestió de categories (productes, proveïdors i clients) Module2000Name=Editor WYSIWYG Module2000Desc=Permet l'edició de certes zones de text mitjançant un editor avançat -Module2200Name=Dret de préstecs -Module2200Desc=Gestió dels drets de préstecs -Module2300Name=Menús -Module2300Desc=Administració dels menús per base de dades Module2400Name=Agenda Module2400Desc=Gestió de l'agenda i de les accions Module2500Name=Gestió Electrònica de Documents diff --git a/htdocs/langs/da_DK/admin.lang b/htdocs/langs/da_DK/admin.lang index a710c6cfda8..5dc84bdef04 100644 --- a/htdocs/langs/da_DK/admin.lang +++ b/htdocs/langs/da_DK/admin.lang @@ -305,10 +305,6 @@ Module1400Name=Regnskabsmæssig ekspert Module1400Desc=Regnskabsmæssig forvaltning for eksperter (dobbelt parterne) Module1780Name=Kategorier Module1780Desc=Kategorier 'forvaltning (produkter, leverandører og kunder) -Module2200Name=Udlånsrettighederne -Module2200Desc=Udlånsrettighederne forvaltning -Module2300Name=Menuer -Module2300Desc=Menuer 'ledelse Module2400Name=Agenda Module2400Desc=Handlinger / opgaver og dagsorden forvaltning Module2500Name=Elektronisk Content Management diff --git a/htdocs/langs/de_AT/admin.lang b/htdocs/langs/de_AT/admin.lang index fb5b1ee498f..50b20c94796 100644 --- a/htdocs/langs/de_AT/admin.lang +++ b/htdocs/langs/de_AT/admin.lang @@ -300,10 +300,6 @@ Module1400Name=Buchhaltung Module1400Desc=Buchhaltung für Experten (doppelte Buchhaltung) Module1780Name=Kategorien Module1780Desc=Kategorienverwaltung (Produkte, Lieferanten und Kunden) -Module2200Name=Verleihrechte -Module2200Desc=Verleihrechteverwaltung -Module2300Name=Menüs -Module2300Desc=Menüverwaltung Module2400Name=Agenda Module2400Desc=Maßnahmen/Aufgaben und Agendaverwaltung Module2500Name=Inhaltsverwaltung(ECM) diff --git a/htdocs/langs/de_DE/admin.lang b/htdocs/langs/de_DE/admin.lang index 6f27f1b4c5f..7c56963166b 100644 --- a/htdocs/langs/de_DE/admin.lang +++ b/htdocs/langs/de_DE/admin.lang @@ -421,10 +421,6 @@ Module1780Name=Kategorien Module1780Desc=Kategorienverwaltung (Produkte, Lieferanten und Kunden) Module2000Name=FCKeditor Module2000Desc=WYSIWYG-Editor -Module2200Name=Verleihrechte -Module2200Desc=Verleihrechteverwaltung -Module2300Name=Menüs -Module2300Desc=Menüverwaltung Module2400Name=Agenda Module2400Desc=Maßnahmen/Aufgaben und Agendaverwaltung Module2500Name=Inhaltsverwaltung(ECM) diff --git a/htdocs/langs/el_GR/admin.lang b/htdocs/langs/el_GR/admin.lang index 1250cfadf24..9628acf2211 100644 --- a/htdocs/langs/el_GR/admin.lang +++ b/htdocs/langs/el_GR/admin.lang @@ -181,7 +181,6 @@ Module330Name=Σελιδοδείκτες Module400Name=Έργα Module700Name=Δωρεές Module1780Name=Κατηγορίες -Module2300Name=Μενού Module2400Name=Ατζέντα Module50100Name=Σημείο Πωλήσεων Permission19=Διαγραφή τιμολογίων diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1554fcede0f..8d613053e3a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -448,10 +448,6 @@ Module1780Name=Categories Module1780Desc=Category management (products, suppliers and customers) Module2000Name=WYSIWYG editor Module2000Desc=Allow to edit some text area using an advanced editor -Module2200Name=Lending rights -Module2200Desc=Lending rights management -Module2300Name=Menus -Module2300Desc=Menu management Module2400Name=Agenda Module2400Desc=Events/tasks and agenda management Module2500Name=Electronic Content Management diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 1cc8dbe0028..ad4a06a6f79 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -449,10 +449,6 @@ Module1780Name=Categorías Module1780Desc=Gestión de categorías (productos, proveedores y clientes) Module2000Name=Editor WYSIWYG Module2000Desc=Permite la edición de ciertas zonas de texto mediante un editor avanzado -Module2200Name=Derecho de préstamos -Module2200Desc=Gestión de los derechos de préstamos -Module2300Name=Menús -Module2300Desc=Administración de los menús por base de datos Module2400Name=Agenda Module2400Desc=Gestión de la agenda y de las acciones Module2500Name=Gestión Electrónica de Documentos diff --git a/htdocs/langs/et_EE/admin.lang b/htdocs/langs/et_EE/admin.lang index 763bc5b6eac..b42ccb0a190 100644 --- a/htdocs/langs/et_EE/admin.lang +++ b/htdocs/langs/et_EE/admin.lang @@ -418,10 +418,6 @@ Module1780Name=Kategooriad Module1780Desc=Kategoorias juhtkond (toodete, tarnijate ja tarbijate) Module2000Name=WYSIWYG editor Module2000Desc=Võimaldavad muuta natuke teksti ala, kasutades täiustatud toimetaja -Module2200Name=Laenutusõigust -Module2200Desc=Laenutusõigust juhtimine -Module2300Name=Menüüd -Module2300Desc=Menüü juhtkond Module2400Name=Päevakord Module2400Desc=Events / ülesanded ja kava haldamise Module2500Name=Electronic Content Management diff --git a/htdocs/langs/fa_IR/admin.lang b/htdocs/langs/fa_IR/admin.lang index f3a038532d4..2f703f61e92 100644 --- a/htdocs/langs/fa_IR/admin.lang +++ b/htdocs/langs/fa_IR/admin.lang @@ -341,10 +341,6 @@ Module1400Name=المحاسبة Module1400Desc=المحاسبة الإدارية (ضعف الأحزاب) Module1780Name=الفئات Module1780Desc=الفئات إدارة المنتجات والموردين والزبائن) -Module2200Name=الإقراض الإنسان -Module2200Desc=الإقراض لإدارة الحقوق -Module2300Name=القوائم -Module2300Desc=القوائم إدارة Module2400Name=جدول الأعمال Module2400Desc=الأعمال / الإدارة المهام وجدول الأعمال Module2500Name=إدارة المحتوى الإلكتروني diff --git a/htdocs/langs/fi_FI/admin.lang b/htdocs/langs/fi_FI/admin.lang index 06cd7ef8817..a79d9c9adbf 100644 --- a/htdocs/langs/fi_FI/admin.lang +++ b/htdocs/langs/fi_FI/admin.lang @@ -303,10 +303,6 @@ Module1400Name=Kirjanpidon asiantuntija Module1400Desc=Kirjanpidon hallinta asiantuntijoille (double osapuolet) Module1780Name=Kategoriat Module1780Desc=Kategoriat hallintaa (tuotteet, tavarantoimittajat ja asiakkaat) -Module2200Name=Lainausoikeuksia -Module2200Desc=Luotonanto oikeuksien hallinta -Module2300Name=Menut -Module2300Desc=Valikot hallinto Module2400Name=Agenda Module2400Desc=Toimet / tehtävät ja esityslistan hallinta Module2500Name=Sähköinen Content Management diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index ffd0ac60658..616cfc6d550 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -443,10 +443,6 @@ Module1780Name= Catégories Module1780Desc= Gestion des catégories (produits, fournisseurs et clients) Module2000Name= Editeur WYSIWYG Module2000Desc= Permet la saisie de certaines zones de textes grace à un éditeur avancé -Module2200Name= Droit de prêts -Module2200Desc= Gestion du droit de prêts -Module2300Name= Menus -Module2300Desc= Administration des menus par base de données Module2400Name= Agenda Module2400Desc= Gestion des actions (événements et tâches) et de l'agenda Module2500Name= Gestion Electronique de Documents diff --git a/htdocs/langs/he_IL/admin.lang b/htdocs/langs/he_IL/admin.lang index c84af3ec434..4c9f6a55ec0 100644 --- a/htdocs/langs/he_IL/admin.lang +++ b/htdocs/langs/he_IL/admin.lang @@ -418,10 +418,6 @@ Module1780Name=קטגוריות Module1780Desc=Categorie ההנהלה (מוצרים, ספקים ולקוחות) Module2000Name=עורך WYSIWYG Module2000Desc=אפשר לערוך כמה אזור הטקסט באמצעות עורך מתקדם -Module2200Name=ההלוואות זכויות -Module2200Desc=זכויות ההלוואות וניהול -Module2300Name=תפריטים -Module2300Desc=תפריט של ההנהלה Module2400Name=סדר היום Module2400Desc=אירועים / משימות וניהול סדר היום Module2500Name=תוכן אלקטרוני ניהול diff --git a/htdocs/langs/hu_HU/admin.lang b/htdocs/langs/hu_HU/admin.lang index 0445f9fb8e9..fd1a1715e7a 100644 --- a/htdocs/langs/hu_HU/admin.lang +++ b/htdocs/langs/hu_HU/admin.lang @@ -418,10 +418,6 @@ Module1780Name=Kategóriák Module1780Desc=Kategóriában vezetősége (termékek, szállítók és vevők) Module2000Name=WYSIWYG szerkesztő Module2000Desc=Hagyjuk szerkeszteni egy szöveget terület egy fejlett szerkesztő -Module2200Name=Haszonkölcsönzési jogait -Module2200Desc=Hitelezési jogkezelés -Module2300Name=Menük -Module2300Desc=Menü vezetése Module2400Name=Napirend Module2400Desc=Események / feladatok és napirend menedzsment Module2500Name=Elektronikus Content Management diff --git a/htdocs/langs/is_IS/admin.lang b/htdocs/langs/is_IS/admin.lang index 3b4af098b57..6ed5df3e4fb 100644 --- a/htdocs/langs/is_IS/admin.lang +++ b/htdocs/langs/is_IS/admin.lang @@ -369,10 +369,6 @@ Module1780Name=Flokkar Module1780Desc=Stjórn Flokkur's (vörur, birgja og viðskiptavina) Module2000Name=Fckeditor Module2000Desc=WYSIWYG Editor -Module2200Name=Útlán réttindi -Module2200Desc=Útlán réttindi -Module2300Name=Matseðlar -Module2300Desc=Valmynd's stjórnun Module2400Name=Dagskrá Module2400Desc=Aðgerðir / verkefni og dagskrá stjórnun Module2500Name=Rafræn Innihald Stjórnun diff --git a/htdocs/langs/it_IT/admin.lang b/htdocs/langs/it_IT/admin.lang index a8a55093f8d..605bb6a625d 100644 --- a/htdocs/langs/it_IT/admin.lang +++ b/htdocs/langs/it_IT/admin.lang @@ -637,12 +637,8 @@ Module20Desc =Gestione proposte commerciali Module20Name =Proposte Module210Desc =Integrazione Postnuke Module210Name =Postnuke -Module2200Desc =Gestione dei diritti di prestito -Module2200Name =Diritti di prestito Module22Desc =Gestione posta massiva Module22Name =Posta massiva -Module2300Desc =Gestione dei Menu -Module2300Name =Menu Module23Desc =Monitoraggio del consumo energetico Module23Name =Energia Module2400Desc =Gestione eventi/compiti e ordine del giorno diff --git a/htdocs/langs/ja_JP/admin.lang b/htdocs/langs/ja_JP/admin.lang index 6422a0c9634..f1a474fed1a 100644 --- a/htdocs/langs/ja_JP/admin.lang +++ b/htdocs/langs/ja_JP/admin.lang @@ -418,10 +418,6 @@ Module1780Name=カテゴリー Module1780Desc=Categorieの管理(製品、サプライヤー、顧客) Module2000Name=WYSIWYGエディタ Module2000Desc=高度なエディタを使用して、いくつかのテキストエリアを編集することができます -Module2200Name=融資の権限 -Module2200Desc=貸出権限の管理 -Module2300Name=メニュー -Module2300Desc=メニューの管理 Module2400Name=議題 Module2400Desc=イベント/タスクと議題の管理 Module2500Name=電子コンテンツ管理 diff --git a/htdocs/langs/nb_NO/admin.lang b/htdocs/langs/nb_NO/admin.lang index 7a9ec630980..f37656c62ab 100644 --- a/htdocs/langs/nb_NO/admin.lang +++ b/htdocs/langs/nb_NO/admin.lang @@ -299,10 +299,6 @@ Module1400Name=Regnskapsekspert Module1400Desc=Behandling av regnskapssopplysninger for eksperter (double parties) Module1780Name=Kategorier Module1780Desc=Behandling av kategorier (varer, leverandører og kunder) -Module2200Name=Utlånsrettigheter -Module2200Desc=Behandling av utlånsrettigheter -Module2300Name=Menyer -Module2300Desc=Menybehandling Module2400Name=Agenda Module2400Desc=Handlinger/oppgaver og agendabehandling Module2500Name=Electronic Content Management diff --git a/htdocs/langs/nl_BE/admin.lang b/htdocs/langs/nl_BE/admin.lang index 9da2674c14c..711478a2a6a 100644 --- a/htdocs/langs/nl_BE/admin.lang +++ b/htdocs/langs/nl_BE/admin.lang @@ -413,10 +413,6 @@ Module1780Name = Categorieën Module1780Desc = Categorie' beheer (producten, leveranciers en klanten) Module2000Name = Module2000Desc = -Module2200Name = Uitleenrechten -Module2200Desc = Uitleenrechten beheer -Module2300Name = Menu's -Module2300Desc = Menu's beheer Module2400Name = Agenda Module2400Desc = Acties / taken en agenda beheer Module2500Name = Electronic Content Management diff --git a/htdocs/langs/nl_NL/admin.lang b/htdocs/langs/nl_NL/admin.lang index b3d80668ba2..97efffdbe5e 100644 --- a/htdocs/langs/nl_NL/admin.lang +++ b/htdocs/langs/nl_NL/admin.lang @@ -383,10 +383,6 @@ Module1780Name = Categorieën Module1780Desc = Categoriebeheer (producten, leveranciers en afnemers) Module2000Name = Fckeditor Module2000Desc = Een WYSIWYG editor -Module2200Name = Uitleenrechten -Module2200Desc = Uitleenrechtenbeheer -Module2300Name = Menu's -Module2300Desc = Menubeheer Module2400Name = Agenda Module2400Desc = Acties-, taken- en agendabeheer Module2500Name = Electronic Content Management diff --git a/htdocs/langs/pl_PL/admin.lang b/htdocs/langs/pl_PL/admin.lang index 3e98c2e19c8..1817660d665 100644 --- a/htdocs/langs/pl_PL/admin.lang +++ b/htdocs/langs/pl_PL/admin.lang @@ -306,10 +306,6 @@ Module1400Name=Księgowość ekspertów Module1400Desc=Księgowość zarządzania dla ekspertów (double stron) Module1780Name=Kategorie Module1780Desc=Kategorie zarządzania (produktów, dostawców i klientów) -Module2200Name=Użyczanie -Module2200Desc=Kredyty zarządzania prawami -Module2300Name=Menu -Module2300Desc=Menu zarządzania Module2400Name=Porządek obrad Module2400Desc=Działania / zadania i porządku zarządzania Module2500Name=Electronic Content Management diff --git a/htdocs/langs/pt_BR/admin.lang b/htdocs/langs/pt_BR/admin.lang index 78a92d28d73..d001e6fb84c 100644 --- a/htdocs/langs/pt_BR/admin.lang +++ b/htdocs/langs/pt_BR/admin.lang @@ -320,10 +320,6 @@ Module1200Name=Mantis Module1200Desc=Interface com o sistema de seguimento de incidências Mantis Module1780Name=Categorias Module1780Desc=Administração de categorias (produtos, Fornecedores e clientes) -Module2200Name=Direito de emprétimos -Module2200Desc=Administração dos direitos de emprétimos -Module2300Name=Menus -Module2300Desc=Administração dos menus por base de dados Module2400Name=Agenda Module2400Desc=Administração da agenda e das ações Module2500Name=Administração Eletrônica de Documentos diff --git a/htdocs/langs/pt_PT/admin.lang b/htdocs/langs/pt_PT/admin.lang index c9a0c81d20e..7f6f02be470 100644 --- a/htdocs/langs/pt_PT/admin.lang +++ b/htdocs/langs/pt_PT/admin.lang @@ -558,12 +558,8 @@ Module20Desc = Gestão de Orçamentos/Propostas comerciais Module20Name = Orçamentos Module210Desc = Integração com PostNuke Module210Name = PostNuke -Module2200Desc = Gestão dos direitos de empréstimos -Module2200Name = Direito de empréstimos Module22Desc = Administração e envío de E-Mails massivos Module22Name = E-Mailings -Module2300Desc = Administração dos menus por base de dados -Module2300Name = Menus Module23Desc = Acompanhamento do consumo de energia Module23Name = Energia Module2400Desc = Gestão da agenda e das acções diff --git a/htdocs/langs/ro_RO/admin.lang b/htdocs/langs/ro_RO/admin.lang index 907e7c10e7b..e049b78fbbd 100644 --- a/htdocs/langs/ro_RO/admin.lang +++ b/htdocs/langs/ro_RO/admin.lang @@ -304,10 +304,6 @@ Module1400Name=Expert contabil Module1400Desc=Contabilitate de gestiune pentru experţi (dublu părţi) Module1780Name=Categorii Module1780Desc=Categorii de "management (produse, furnizori şi clienţi) -Module2200Name=Credite drepturile -Module2200Desc=Credite de gestionare a drepturilor -Module2300Name=Meniuri -Module2300Desc=Meniuri de gestionare Module2400Name=Ordinea de zi Module2400Desc=Acţiuni / activităţi de ordine de zi şi de gestionare a Module2500Name=Electronic Content Management diff --git a/htdocs/langs/ru_RU/admin.lang b/htdocs/langs/ru_RU/admin.lang index 76591925e57..9f051c0f3ba 100644 --- a/htdocs/langs/ru_RU/admin.lang +++ b/htdocs/langs/ru_RU/admin.lang @@ -303,10 +303,6 @@ Module1400Name=Бухгалтерия эксперт Module1400Desc=Бухгалтерия управления для экспертов (двойная сторон) Module1780Name=Категории Module1780Desc=Категории управления (продукции, поставщиков и заказчиков) -Module2200Name=Кредитование человека -Module2200Desc=Кредитование права управления -Module2300Name=Меню -Module2300Desc=Меню управления Module2400Name=Повестка дня Module2400Desc=Деятельность / задачи и программы управления Module2500Name=Электронное управление diff --git a/htdocs/langs/sl_SI/admin.lang b/htdocs/langs/sl_SI/admin.lang index 47b8ab80347..6c83d1d141e 100644 --- a/htdocs/langs/sl_SI/admin.lang +++ b/htdocs/langs/sl_SI/admin.lang @@ -399,10 +399,6 @@ Module1780Name = Kategorije Module1780Desc = Upravljanje kategorij (proizvodi, dobavitelji in kupci) Module2000Name = Fck urejevalnik Module2000Desc = WYSIWYG urejevalnik -Module2200Name = Kreditne pravice -Module2200Desc = Upravljanje kreditnih pravic -Module2300Name = Meniji -Module2300Desc = Upravljanje menijev Module2400Name = Dnevni red Module2400Desc = Upravljanje aktivnosti/nalog in dnevnih redov Module2500Name = Upravljanje elektronskih vsebin diff --git a/htdocs/langs/sv_SE/admin.lang b/htdocs/langs/sv_SE/admin.lang index 82e94b5acd9..e7036e47db4 100644 --- a/htdocs/langs/sv_SE/admin.lang +++ b/htdocs/langs/sv_SE/admin.lang @@ -372,10 +372,6 @@ Module1780Name=Kategorier Module1780Desc=Categorie ledning (produkter, leverantörer och kunder) Module2000Name=FCKeditor Module2000Desc=WYSIWYG Editor -Module2200Name=Utlåning rättigheter -Module2200Desc=Utlåning förvaltning av rättigheter -Module2300Name=Menyer -Module2300Desc=Meny ledning Module2400Name=Agenda Module2400Desc=Åtgärder / uppgifter och dagordning förvaltning Module2500Name=Electronic Content Management diff --git a/htdocs/langs/tr_TR/admin.lang b/htdocs/langs/tr_TR/admin.lang index ef75bda0eee..212a938edde 100755 --- a/htdocs/langs/tr_TR/admin.lang +++ b/htdocs/langs/tr_TR/admin.lang @@ -370,10 +370,6 @@ Module1780Name=Kategoriler Module1780Desc=Kategorilerin yönetimi (ürünler, tedarikçiler ve müşteriler) Module2000Name=FCKdüzenleyici (FCKeditor) Module2000Desc=Gelişmiş editör kullanarak bazı metin alanlarının düzenlenmesini sağlar -Module2200Name=Kiralama hakları -Module2200Desc=Kiralama hakları yönetimi -Module2300Name=Menüler -Module2300Desc=Menülerin yönetimi Module2400Name=Gündem Module2400Desc=Eylemler/görevler ve gündem yönetimi Module2500Name=Elektronik İçerik Yönetimi diff --git a/htdocs/langs/zh_CN/admin.lang b/htdocs/langs/zh_CN/admin.lang index 39121d9ce0b..937e3dae058 100644 --- a/htdocs/langs/zh_CN/admin.lang +++ b/htdocs/langs/zh_CN/admin.lang @@ -366,10 +366,6 @@ Module1780Name=分类 Module1780Desc=的类别:管理层(产品,供应商和客户) Module2000Name=fckeditor的 Module2000Desc=所见即所得的编辑器 -Module2200Name=贷款的权利 -Module2200Desc=贷款权限管理 -Module2300Name=菜单 -Module2300Desc=菜单的管理 Module2400Name=议程 Module2400Desc=行动/任务和议程管理 Module2500Name=电子内容管理 diff --git a/htdocs/langs/zh_TW/admin.lang b/htdocs/langs/zh_TW/admin.lang index c1f69179187..edf18ba2584 100644 --- a/htdocs/langs/zh_TW/admin.lang +++ b/htdocs/langs/zh_TW/admin.lang @@ -371,10 +371,6 @@ Module1780Name=分類 Module1780Desc=分類的管理(產品,供應商和客戶) Module2000Name=fckeditor的 Module2000Desc=所見即所得的編輯器 -Module2200Name=貸款的權利 -Module2200Desc=貸款權限管理 -Module2300Name=選單 -Module2300Desc=選單的管理 Module2400Name=議程 Module2400Desc=行動/任務和議程管理 Module2500Name=電子內容管理 From 3bcd506e73dd753d8afdaea2e2fa1fedec4ffbf3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Apr 2013 23:06:38 +0200 Subject: [PATCH 18/64] Fix: demo modules list --- htdocs/public/demo/index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index fcd0976876b..b9be5a24070 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -70,16 +70,18 @@ $object=new stdClass(); $reshook=$hookmanager->executeHooks('addDemoProfile', $parameters, $object, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; +// Visible $alwayscheckedmodules=array('barcode','bookmark','externalrss','fckeditor','geoipmaxmind','gravatar','memcached','syslog','user','webservices'); // Technical module we always want $alwaysuncheckedmodules=array('paybox','paypal','google','scanner','workflow'); // Module we never want +// Not visible $alwayshiddencheckedmodules=array('accounting','barcode','bookmark','clicktodial','comptabilite','document','domain','externalrss','externalsite','fckeditor','geoipmaxmind','gravatar','label','ldap', 'mailmanspip','notification','syslog','user','webservices', // Extended modules 'memcached','numberwords','zipautofillfr'); $alwayshiddenuncheckedmodules=array('boutique','ftp', // Extended modules - 'awstats','bittorrent','cabinetmed','cmcic','concatpdf','dolicloud','filemanager','lightbox','mantis','monitoring','moretemplates','nltechno','numberingpack','openstreetmap', - 'ovh','phenix','phpsysinfo','pibarcode','postnuke','skincoloreditor','submiteverywhere','survey','thomsonphonebook','topten','tvacerfa','voyage','webcalendar','webmail'); + 'awstats','bittorrent','bootstrap','cabinetmed','cmcic','concatpdf','dolicloud','filemanager','lightbox','mantis','monitoring','moretemplates','nltechno','numberingpack','openstreetmap', + 'ovh','phenix','phpsysinfo','pibarcode','postnuke','selectbank','skincoloreditor','submiteverywhere','survey','thomsonphonebook','topten','tvacerfa','voyage','webcalendar','webmail'); // Search modules $dirlist=$conf->file->dol_document_root; From d570aa02d4b097c5dc3249fca86831d04c3a3ccc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Apr 2013 23:11:21 +0200 Subject: [PATCH 19/64] Fix: bad url --- htdocs/public/demo/index.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index b9be5a24070..da447c7fd00 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -218,8 +218,7 @@ if (GETPOST("action") == 'gotodemo') // Do redirect to login page if ($disablestring) { - $url=DOL_URL_ROOT.'/index.php?disablemodules='.$disablestring; - if (GETPOST('urlfrom','alpha')) $url.='&urlfrom='.GETPOST('urlfrom','alpha'); + $url=DOL_URL_ROOT.'/index.php?'.(GETPOST('urlfrom','alpha')?'urlfrom='.urlencode(GETPOST('urlfrom','alpha')).'&':'').'disablemodules='.$disablestring; header("Location: ".$url); exit; } From 76c180aaafd5e72846f9b7d1378a9dc8e2d9eaf5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Apr 2013 23:13:55 +0200 Subject: [PATCH 20/64] Fix: encoding at wrong place --- htdocs/public/demo/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index da447c7fd00..93eed01d86c 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -297,7 +297,7 @@ foreach ($demoprofiles as $profilearray) print '
'."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; From 662d9cfa6efa5d5a212c7d132d33ab012b8a5b32 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 11 Apr 2013 17:10:11 +0200 Subject: [PATCH 21/64] Fix: for avoid problem with multicompany thirdparty sharing --- htdocs/core/class/conf.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index e456effe66e..449ba902c26 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -341,7 +341,8 @@ class Conf // societe if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) $this->global->SOCIETE_CODECLIENT_ADDON="mod_codeclient_leopard"; - if (empty($this->global->SOCIETE_CODEFOURNISSEUR_ADDON)) $this->global->SOCIETE_CODEFOURNISSEUR_ADDON=$this->global->SOCIETE_CODECLIENT_ADDON; + // Unused constant and for avoid problem with multicompany sharing + //if (empty($this->global->SOCIETE_CODEFOURNISSEUR_ADDON)) $this->global->SOCIETE_CODEFOURNISSEUR_ADDON=$this->global->SOCIETE_CODECLIENT_ADDON; if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) $this->global->SOCIETE_CODECOMPTA_ADDON="mod_codecompta_panicum"; // Security From 9ec74194a0cff38ec994244937dcb2dd5f6ea34b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Thu, 11 Apr 2013 23:10:27 +0200 Subject: [PATCH 22/64] Translated linked object propal module name --- htdocs/compta/facture.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index a990149aa87..66d78e66b9a 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2082,7 +2082,9 @@ if ($action == 'create') print ''; $newclassname=$classname; - if ($newclassname=='Propal') $newclassname='CommercialProposal'; + if ($newclassname == 'Propal') $newclassname = 'CommercialProposal'; + elseif ($newclassname == 'Commande') $newclassname = 'Order'; + print ''; print ''; print '"; From 3892a52852409b78e68a94c177321dd66f359549 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 12 Apr 2013 10:00:20 +0200 Subject: [PATCH 23/64] Fix: missing return with hook --- htdocs/core/lib/files.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 726b3486e30..5c3aaf62e9d 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -686,6 +686,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable return -3; // Unknown error } } + else + return $reshook; } /** From 85e09a953f87481cd3a74d5049760f48ec72b9be Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 12 Apr 2013 10:00:20 +0200 Subject: [PATCH 24/64] Fix: missing return with hook --- htdocs/core/lib/files.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index d5874b1d4d7..81a3c2705de 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -700,6 +700,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable return -3; // Unknown error } } + else + return $reshook; } /** From 0b2b888584e2d6fb4b34b0b837101c9bea0352c5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 12 Apr 2013 10:26:52 +0200 Subject: [PATCH 25/64] Fix: use new method --- htdocs/core/lib/files.lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 5c3aaf62e9d..d847bd2df71 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1,7 +1,7 @@ - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2012 Juanjo Menent +/* Copyright (C) 2008-2012 Laurent Destailleur + * Copyright (C) 2012-2013 Regis Houssin + * Copyright (C) 2012 Juanjo Menent * * 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 @@ -650,10 +650,10 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable $hookmanager->initHooks(array('fileslib')); $parameters=array('dest_file' => $dest_file, 'src_file' => $src_file, 'file_name' => $file_name, 'varfiles' => $varfiles, 'allowoverwrite' => $allowoverwrite); - $reshook=$hookmanager->executeHooks('moveUploadedFile', $parameters, $object); + $hookmanager->executeHooks('moveUploadedFile', $parameters, $object); } - if (empty($reshook)) + if (empty($hookmanager->resPrint)) { // The file functions must be in OS filesystem encoding. $src_file_osencoded=dol_osencode($src_file); @@ -687,7 +687,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable } } else - return $reshook; + return $hookmanager->resPrint; } /** From 9596134e47b810a00bf574e96c1560026aa91296 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 12 Apr 2013 10:26:52 +0200 Subject: [PATCH 26/64] Fix: use new method --- htdocs/core/lib/files.lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 81a3c2705de..5211841fc02 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1,7 +1,7 @@ - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2012 Juanjo Menent +/* Copyright (C) 2008-2012 Laurent Destailleur + * Copyright (C) 2012-2013 Regis Houssin + * Copyright (C) 2012 Juanjo Menent * * 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 @@ -664,10 +664,10 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable $hookmanager->initHooks(array('fileslib')); $parameters=array('dest_file' => $dest_file, 'src_file' => $src_file, 'file_name' => $file_name, 'varfiles' => $varfiles, 'allowoverwrite' => $allowoverwrite); - $reshook=$hookmanager->executeHooks('moveUploadedFile', $parameters, $object); + $hookmanager->executeHooks('moveUploadedFile', $parameters, $object); } - if (empty($reshook)) + if (empty($hookmanager->resPrint)) { // The file functions must be in OS filesystem encoding. $src_file_osencoded=dol_osencode($src_file); @@ -701,7 +701,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable } } else - return $reshook; + return $hookmanager->resPrint; } /** From 2e9a8369a7aaf3ac6e35c8843fee730db96e3b96 Mon Sep 17 00:00:00 2001 From: simnandez Date: Fri, 12 Apr 2013 10:46:33 +0200 Subject: [PATCH 27/64] Trad: Update ca_ES and es_ES translations --- htdocs/langs/ca_ES/admin.lang | 23 ++++++++++++++++------- htdocs/langs/ca_ES/errors.lang | 2 ++ htdocs/langs/ca_ES/mails.lang | 2 +- htdocs/langs/ca_ES/members.lang | 2 ++ htdocs/langs/ca_ES/suppliers.lang | 1 + htdocs/langs/es_ES/admin.lang | 31 ++++++++++++++++++++----------- htdocs/langs/es_ES/errors.lang | 2 ++ htdocs/langs/es_ES/mails.lang | 2 +- htdocs/langs/es_ES/members.lang | 2 ++ htdocs/langs/es_ES/suppliers.lang | 1 + 10 files changed, 48 insertions(+), 20 deletions(-) diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 86a446c255f..917e18df8bb 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -349,20 +349,27 @@ Int=numèric enter Float=Decimal DateAndTime=Data i hora Unique=Unic -Boolean=Boleano (Checkbox) +Boolean=Boleano (Casella de verificació) ExtrafieldPhone=Telèfon ExtrafieldPrice=Preu ExtrafieldMail=Correu ExtrafieldSelect=Llista de selecció -ExtrafieldSeparator=Separator -ExtrafieldCheckBox=Casilla -ExtrafieldRadio=Opción -ExtrafieldParamHelp=Optiones Lista esta llave,valor

para exemplo :
1,texto1
2,texto2
3,texto3
... +ExtrafieldSeparator=Separador +ExtrafieldCheckBox=Casella de verificació +ExtrafieldRadio=Botó de selecció excloent +ExtrafieldParamHelp=La llista ha de ser en forma clau, valor

per exemple :
1,text1
2,text2
3,text3
... LibraryToBuildPDF=Llibreria usada per a la creació d'arxius PDF WarningUsingFPDF=Atenció: El seu arxiu conf.php conté la directiva dolibarr_pdf_force_fpdf=1. Això fa que s'usi la llibreria FPDF per generar els seus arxius PDF. Aquesta llibreria és antiga i no cobreix algunes funcionalitats (Unicode, transparència d'imatges, idiomes ciríl · lics, àrabs o asiàtics, etc.), Pel que pot tenir problemes en la generació dels PDF.
Per resoldre-ho, i disposar d'un suport complet de PDF, pot descarregar la llibreria TCPDF , i a continuació comentar o eliminar la línia $dolibarr_pdf_force_fpdf=1, i afegir al seu lloc $dolibarr_lib_TCPDF_PATH='ruta_a_TCPDF' LocalTaxDesc=Alguns països apliquen 2 o 3 taxes a cada línia de factura. Si és el cas, escolliu el tipus de la segona i tercera taxa i el seu valor. Els possibles tipus són:
1: taxa local aplicable a productes i serveis sense IVA (IVA no s'aplica a la taxa local)
2: taxa local s'aplica a productes i serveis abans de l'IVA (IVA es calcula sobre import + taxa local)
3: taxa local s'aplica a productes sense IVA (IVA no s'aplica a la taxa local)
4: taxa local s'aplica a productes abans de l'IVA (IVA es calcula sobre l'import + taxa local)
5: taxa local s'aplica a serveis sense IVA (IVA no s'aplica a la taxa local)
6: taxa local s'aplica a serveis abans de l'IVA (IVA es calcula sobre import + taxa local) SuhosinSessionEncrypt=Emmagatzematge de sessions xifrades per Suhosin -# Modules +SMS=SMS +LinkToTestClickToDial=Introduïu un número de telèfon que voleu marcar per provar l'enllaç de crida ClickToDial per a l'usuari %s +RefreshPhoneLink=Refrescar enllaç +LinkToTest=Enllaç seleccionable per l'usuari %s (feu clic al número per provar) +KeepEmptyToUseDefault=Deixeu aquest camp buit per usar el valor per defecte +DefaultLink=Enllaç per defecte +ValueOverwrittenByUserSetup=Atenció: Aquest valor pot ser sobreescrit per un valor específic de la configuració de l'usuari (cada usuari pot tenir la seva pròpia url clicktodial) +# Modules= undefined== Module0Name=Usuaris y grups Module0Desc=Gestió d'usuaris i grups Module1Name=Tercers @@ -945,6 +952,8 @@ ExtraFieldsContacts=Atributs adicionals (contactes/adreçes) ExtraFieldsMember=Atributs complementaris (membres) ExtraFieldsMemberType=Atributs complementaris (tipus de membres) ExtraFieldsCustomerInvoices=Atributs complementaris (factures a clients) +ExtraFieldsSupplierOrders=Atributs complementaris (comandes) +ExtraFieldsSupplierInvoices=AAtributs complementaris (factures) ExtraFieldHasWrongValue=L'atribut %s te un valor incorrecte. AlphaNumOnlyCharsAndNoSpace=només carateres alfanumèrics sense espais SendingMailSetup=Configuració de l'enviament per mail @@ -957,7 +966,7 @@ TranslationDesc=L'elecció de l'idioma mostrat en pantalla es modifica:
* A n ClassNotFoundIntoPathWarning=No s'ha trobat la classe %s en el seu path PHP YesInSummer=Sí a l'estiu OnlyFollowingModulesAreOpenedToExternalUsers=Recordeu que només els mòduls següents estan oberts a usuaris externs (siguin quins siguin els permisos dels usuaris): -##### Module password generation +##### Module password generation= undefined== PasswordGenerationStandard=Retorna una contrasenya generada per l'algoritme intern Dolibarr: 8 caràcters, números i caràcters en minúscules barrejades. PasswordGenerationNone=No ofereix contrasenyes. La contrasenya s'introdueix manualment. ##### Users setup ##### diff --git a/htdocs/langs/ca_ES/errors.lang b/htdocs/langs/ca_ES/errors.lang index d6dce2cd433..5a68c272c3a 100644 --- a/htdocs/langs/ca_ES/errors.lang +++ b/htdocs/langs/ca_ES/errors.lang @@ -116,6 +116,7 @@ ErrorFileMustBeADolibarrPackage=El fitxer %s ha de ser un paquet Dolibarr en for ErrorFileRequired=Es requereix un fitxer de paquet Dolibarr en format zip ErrorPhpCurlNotInstalled=L'extensió PHP CURL no es troba instal·lada, és indispensable per dialogar amb Paypal. ErrorFailedToAddToMailmanList=S'ha produït un error en intentar afegir un registre a la llista Mailman o base de dades SPIP +ErrorFailedToRemoveToMailmanList=Error en l'eliminació de %s de la llista Mailmain %s o base SPIP ErrorNewValueCantMatchOldValue=El Nou valor no pot ser igual al antic ErrorFailedToValidatePasswordReset=No s'ha pogut restablir la contrasenya. És possible que aquest enllaç ja s'hagi utilitzat (aquest enllaç només es pot utilitzar una vegada). Si no és el cas prova de reiniciar el procés de restabliment de contrasenya des del principi. @@ -133,3 +134,4 @@ WarningLockFileDoesNotExists=Atenció: Un cop acabada l'instal·lació, han de d WarningUntilDirRemoved=Aquesta alerta seguirà activa mentre la carpeta existeixi (alerta visible per als usuaris admin solament). WarningCloseAlways=Avís, el tancament és realitzat encara que la quantitat total difereixi entre els elements d'origen i destí. Activi aquesta funcionalitat amb precaució. WarningUsingThisBoxSlowDown=Atenció, l'ús d'aquest panell provoca serioses alentiments en les pàgines que mostren aquest panell. +WarningClickToDialUserSetupNotComplete=La configuració de ClickToDial per al compte d'usuari no està completa (vegeu la pestanya ClickToDial en la seva fitxa d'usuari) diff --git a/htdocs/langs/ca_ES/mails.lang b/htdocs/langs/ca_ES/mails.lang index f5721bd7557..5a767a07608 100644 --- a/htdocs/langs/ca_ES/mails.lang +++ b/htdocs/langs/ca_ES/mails.lang @@ -95,7 +95,7 @@ MailSelectedRecipients=Destinataris seleccionats MailingArea=Àrea E-Mailings LastMailings=Els %s darrers E-Mailings TargetsStatistics=Estadístiques destinataris -NbOfCompaniesContacts=Contactes únics d'empreses +NbOfCompaniesContacts=Contactes/adreces únics MailNoChangePossible=Destinataris d'un E-Mailing validat no modificables SearchAMailing=Cercar un E-Mailing SendMailing=Enviar E-Mailing diff --git a/htdocs/langs/ca_ES/members.lang b/htdocs/langs/ca_ES/members.lang index b996329e516..489fd0a9c40 100644 --- a/htdocs/langs/ca_ES/members.lang +++ b/htdocs/langs/ca_ES/members.lang @@ -206,3 +206,5 @@ MembersStatisticsByProperties=Estadístiques dels membres per característiques MembersByNature=Membres per naturalesa VATToUseForSubscriptions=Taxa d'IVA per les afiliacions NoVatOnSubscription=Sense IVA per a les afiliacions + +MEMBER_PAYONLINE_SENDEMAIL=E-Mail per advertir en cas de recepció de confirmació d'un pagament validat d'una afiliació diff --git a/htdocs/langs/ca_ES/suppliers.lang b/htdocs/langs/ca_ES/suppliers.lang index 065d0404862..be740e4eab1 100644 --- a/htdocs/langs/ca_ES/suppliers.lang +++ b/htdocs/langs/ca_ES/suppliers.lang @@ -5,6 +5,7 @@ Supplier=Proveïdor AddSupplier=Afegir proveïdor SupplierRemoved=Proveïdor eliminat SuppliersInvoice=Factura proveïdor +SuppliersInvoices=Factures proveïdors NewSupplier=Nou proveïdor History=Històric ListOfSuppliers=Llistat de proveïdors diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index c3107679ba3..1135fa62c44 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -349,20 +349,27 @@ Int=Numérico entero Float=Decimal DateAndTime=Fecha y hora Unique=Único -Boolean=Boleano (Casilla unico) +Boolean=Boleano (Casilla de verificación) ExtrafieldPhone=Teléfono ExtrafieldPrice=Precio ExtrafieldMail=Correo ExtrafieldSelect=Lista de selección -ExtrafieldSeparator=Separator -ExtrafieldCheckBox=Casilla -ExtrafieldRadio=Opción -ExtrafieldParamHelp=Optiones Lista esta llave,valor

para exemplo :
1,texto1
2,texto2
3,texto3
... +ExtrafieldSeparator=Separador +ExtrafieldCheckBox=Casilla de verificación +ExtrafieldRadio=Botón de selección excluyente +ExtrafieldParamHelp=La lista debe ser en forma llave,valor

por ejemplo :
1,texto1
2,texto2
3,texto3
... LibraryToBuildPDF=Librería usada para la creación de archivos PDF WarningUsingFPDF=Atención: Su archivo conf.php contiene la directiva dolibarr_pdf_force_fpdf=1. Esto hace que se use la librería FPDF para generar sus archivos PDF. Esta librería es antigua y no cubre algunas funcionalidades (Unicode, transparencia de imágenes, idiomas cirílicos, árabes o asiáticos, etc.), por lo que puede tener problemas en la generación de los PDF.
Para resolverlo, y disponer de un soporte completo de PDF, puede descargar la librería TCPDF , y a continuación comentar o eliminar la línea $dolibarr_pdf_force_fpdf=1, y añadir en su lugar $dolibarr_lib_TCPDF_PATH='ruta_a_TCPDF' LocalTaxDesc=Algunos países aplican 2 o 3 tasas a cada línea de factura. Si es el caso, escoja el tipo de la segunda y tercera tasa y su valor. Los posibles tipos son:
1 : tasa local aplicable a productos y servicios sin IVA (IVA no se aplica en la tasa local)
2 : tasa local se aplica a productos y servicios antes del IVA (IVA se calcula sobre importe+tasa local)
3 : tasa local se aplica a productos sin IVA (IVA no se aplica en la tasa local)
4 : tasa local se aplica a productos antes del IVA (IVA se calcula sobre el importe+tasa local)
5 : tasa local se aplica a servicios sin IVA (IVA no se aplica a la tasa local)
6 : tasa local se aplica a servicios antes del IVA (IVA se calcula sobre importe + tasa local) SuhosinSessionEncrypt=Almacenamiento de sesiones cifradas por Suhosin -# Modules +SMS=SMS +LinkToTestClickToDial=Introduzca un número de teléfono al que llamar para probar el enlace de llamada ClickToDial para el usuario %s +RefreshPhoneLink=Refrescar enlace +LinkToTest=Enlace seleccionable para el usuario %s (haga clic en el número para probar) +KeepEmptyToUseDefault=Deje este campo vacío para usar el valor por defecto +DefaultLink=Enlace por defecto +ValueOverwrittenByUserSetup=Atención: Este valor puede ser sobreescrito por un valor específico de la configuración del usuario (cada usuario puede tener su propia url clicktodial) +# Modules= undefined= Module0Name=Usuarios y grupos Module0Desc=Gestión de usuarios y grupos Module1Name=Terceros @@ -680,10 +687,10 @@ Permission1411=Leer los movimientos contables Permission1412=Crear/modificar/anular movimientos contables Permission1415=Leer Balances, informes, diarios, libros maestros Permission1421=Exportar pedidos de clientes y atributos -Permission23001 = Ver tareas programadas -Permission23002 = Crear/actualizar tareas programadas -Permission23003 = Borrar tareas programadas -Permission23004 = Ejecutar tareas programadas +Permission23001=Ver tareas programadas +Permission23002=Crear/actualizar tareas programadas +Permission23003=Borrar tareas programadas +Permission23004=Ejecutar tareas programadas Permission2401=Leer acciones (eventos o tareas) vinculadas a su cuenta Permission2402=Crear/eliminar acciones (eventos o tareas) vinculadas a su cuenta Permission2403=Modificar acciones (eventos o tareas) vinculadas a su cuenta @@ -945,6 +952,8 @@ ExtraFieldsContacts=Atributos adicionales (contactos/direcciones) ExtraFieldsMember=Atributos complementarios (miembros) ExtraFieldsMemberType=Atributos complementarios (tipos de miembros) ExtraFieldsCustomerInvoices=Atributos complementarios (facturas a clientes) +ExtraFieldsSupplierOrders=Atributos complementarios (pedidos) +ExtraFieldsSupplierInvoices=Atributos complementarios (facturas) ExtraFieldHasWrongValue=El atributo %s tiene un valor incorrecto. AlphaNumOnlyCharsAndNoSpace=solamente caracteres alfanuméricos sin espacios SendingMailSetup=Configuración del envío por mail @@ -957,7 +966,7 @@ TranslationDesc=La elección del idioma mostrado en pantalla se modifica:
* A ClassNotFoundIntoPathWarning=No se ha encontrado la clase %s en su path PHP YesInSummer=Sí en verano OnlyFollowingModulesAreOpenedToExternalUsers=Tenga en cuenta que sólo los módulos siguientes están abiertos a usuarios externos (sean cuales sean los permisos de los usuarios): -##### Module password generation +##### Module password generation= undefined= PasswordGenerationStandard=Devuelve una contraseña generada por el algoritmo interno Dolibarr: 8 caracteres, números y caracteres en minúsculas mezcladas. PasswordGenerationNone=No ofrece contraseñas. La contraseña se introduce manualmente. ##### Users setup ##### diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang index a3fa3a004e4..b9ba1a5083a 100644 --- a/htdocs/langs/es_ES/errors.lang +++ b/htdocs/langs/es_ES/errors.lang @@ -119,6 +119,7 @@ ErrorFileMustBeADolibarrPackage=El archivo %s debe ser un paquete Dolibarr en fo ErrorFileRequired=Se requiere un archivo de paquete Dolibarr en formato zip ErrorPhpCurlNotInstalled=La extensión PHP CURL no se encuentra instalada, es indispensable para dialogar con Paypal. ErrorFailedToAddToMailmanList=Ha ocurrido un error al intentar añadir un registro a la lista Mailman o base de datos SPIP +ErrorFailedToRemoveToMailmanList=Error en la eliminación de %s de la lista Mailmain %s o base SPIP ErrorNewValueCantMatchOldValue=El nuevo valor no puede ser igual al antiguo ErrorFailedToValidatePasswordReset=No se ha podido restablecer la contraseña. Es posible que este enlace ya se haya utilizado (este enlace sólo puede usarse una vez). Si no es el caso, trate de reiniciar el proceso de restablecimiento de contraseña desde el principio. @@ -136,3 +137,4 @@ WarningLockFileDoesNotExists=Atención: Una vez terminada la instalación, deben WarningUntilDirRemoved=Las alertas de seguridad sólo son visibles a los administradores y permanecen activas hasta que el problema sea resuelto (o si la constante MAIN_REMOVE_INSTALL_WARNING es definida en Configuración->Varios) WarningCloseAlways=Aviso, el cierre es realizado aunque la cantidad total difiera entre los elementos de origen y destino. Active esta funcionalidad con precaución. WarningUsingThisBoxSlowDown=Atención, el uso de este panel provoca serias ralentizaciones en las páginas que muestran este panel. +WarningClickToDialUserSetupNotComplete=La configuración de ClickToDial para su cuenta de usuario no está completa (vea la pestaña ClickToDial en su ficha de usuario) diff --git a/htdocs/langs/es_ES/mails.lang b/htdocs/langs/es_ES/mails.lang index 1885d285946..d9a1761148c 100644 --- a/htdocs/langs/es_ES/mails.lang +++ b/htdocs/langs/es_ES/mails.lang @@ -97,7 +97,7 @@ MailSelectedRecipients=Destinatarios seleccionados MailingArea=Área E-Mailings LastMailings=Los %s últimos E-Mailings TargetsStatistics=Estadísticas destinatarios -NbOfCompaniesContacts=Contactos únicos de empresas +NbOfCompaniesContacts=Contactos/direcciones únicos MailNoChangePossible=Destinatarios de un E-Mailing validado no modificables SearchAMailing=Buscar un E-Mailing SendMailing=Enviar E-Mailing diff --git a/htdocs/langs/es_ES/members.lang b/htdocs/langs/es_ES/members.lang index fd9230fac88..afe0688aa5b 100644 --- a/htdocs/langs/es_ES/members.lang +++ b/htdocs/langs/es_ES/members.lang @@ -206,3 +206,5 @@ MembersStatisticsByProperties=Estadísticas de los miembros por características MembersByNature=Miembros por naturaleza VATToUseForSubscriptions=Tasa de IVA para las afiliaciones NoVatOnSubscription=Sin IVA para en las afiliaciones + +MEMBER_PAYONLINE_SENDEMAIL=E-Mail para advertir en caso de recepción de confirmación de un pago validado de una afiliación diff --git a/htdocs/langs/es_ES/suppliers.lang b/htdocs/langs/es_ES/suppliers.lang index 69846ff3daa..d30005f9528 100644 --- a/htdocs/langs/es_ES/suppliers.lang +++ b/htdocs/langs/es_ES/suppliers.lang @@ -5,6 +5,7 @@ Supplier=Proveedor AddSupplier=Añadir proveedor SupplierRemoved=Proveedor eliminado SuppliersInvoice=Factura proveedor +SuppliersInvoices=Facturas proveedores NewSupplier=Nuevo proveedor History=Histórico ListOfSuppliers=Listado de proveedores From c9b3193c44b0662c7b3aada430ff28a3dc09e779 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Apr 2013 13:18:24 +0200 Subject: [PATCH 28/64] Fix: Hooks with version 3.4 must match specification defined here: http://wiki.dolibarr.org/index.php/Hooks_system So i try a better fix that implement correctly this. To have the moveFileUpload trigger keeping dolibarr code, it must return 0. --- htdocs/core/class/hookmanager.class.php | 9 ++++++--- htdocs/core/lib/files.lib.php | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 72b49af418e..64d35cf004b 100755 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -128,10 +128,10 @@ class HookManager $parameters['context']=join(':',$this->contextarray); dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']); - // Define type of hook ('output', 'returnvalue' or 'addreplace') + // Define type of hook ('output', 'returnvalue' or 'addreplace'). 'addreplace' should be type for all hooks. 'output' and 'returnvalue' are deprecated. $hooktype='output'; if (preg_match('/^pdf_/',$method)) $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are returnvalue hooks. When there is 2 hooks of this type, only last one win. - if (in_array($method,array('doActions','formObjectOptions','pdf_writelinedesc','paymentsupplierinvoices'))) $hooktype='addreplace'; + if (in_array($method,array('doActions','formObjectOptions','moveUploadedFile','pdf_writelinedesc','paymentsupplierinvoices'))) $hooktype='addreplace'; // Loop on each hook to qualify modules that declared context $modulealreadyexecuted=array(); @@ -166,8 +166,11 @@ class HookManager if ($action=='update') $action='edit'; } } + + if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); + if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; } - // Generic hooks that return a string (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...) + // Generic hooks that return a string or array (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...) else { // TODO. this should be done into the method of hook by returning nothing diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index d847bd2df71..53726f39460 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -647,13 +647,13 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable return -2; } - $hookmanager->initHooks(array('fileslib')); + $reshook=$hookmanager->initHooks(array('fileslib')); $parameters=array('dest_file' => $dest_file, 'src_file' => $src_file, 'file_name' => $file_name, 'varfiles' => $varfiles, 'allowoverwrite' => $allowoverwrite); - $hookmanager->executeHooks('moveUploadedFile', $parameters, $object); + $reshook=$hookmanager->executeHooks('moveUploadedFile', $parameters, $object); } - if (empty($hookmanager->resPrint)) + if (empty($reshook)) { // The file functions must be in OS filesystem encoding. $src_file_osencoded=dol_osencode($src_file); @@ -687,7 +687,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable } } else - return $hookmanager->resPrint; + return $reshook; } /** From 8f7f0b142d9c5a222bef31a446b1d3bf5eb6e25e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Apr 2013 14:27:41 +0200 Subject: [PATCH 29/64] Fix: Change of permission are immediatly effective --- htdocs/user/perms.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 1513776e35d..e6836a9b1d4 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -83,6 +83,7 @@ if ($action == 'addrights' && $caneditperms) { $user->clearrights(); $user->getrights(); + $menumanager->loadMenu(); } } @@ -98,6 +99,7 @@ if ($action == 'delrights' && $caneditperms) { $user->clearrights(); $user->getrights(); + $menumanager->loadMenu(); } } @@ -185,6 +187,7 @@ if (! empty($conf->multicompany->enabled)) { } $sql.= " AND ur.fk_user = ".$fuser->id; +dol_syslog("get user perms sql=".$sql); $result=$db->query($sql); if ($result) { @@ -220,6 +223,7 @@ if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transv $sql.= " AND gr.fk_usergroup = gu.fk_usergroup"; $sql.= " AND gu.fk_user = ".$fuser->id; +dol_syslog("get user perms sql=".$sql); $result=$db->query($sql); if ($result) { From 3238a22afdcc3edffc79e30c3932a2e4a3ee8e94 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Apr 2013 14:46:48 +0200 Subject: [PATCH 30/64] Fix: Do not show not defined entries --- htdocs/core/lib/functions2.lib.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index e3afbbb1ecd..fb51b62809e 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -188,11 +188,11 @@ function dol_print_object_info($object) //print "x".$deltadateforserver." - ".$deltadateforclient." - ".$deltadateforuser; // Import key - if (isset($object->import_key)) + if (! empty($object->import_key)) print $langs->trans("ImportedWithSet").': '.$object->import_key.'
'; // User creation - if (isset($object->user_creation)) + if (! empty($object->user_creation)) { print $langs->trans("CreatedBy").': '; if (is_object($object->user_creation)) @@ -209,7 +209,7 @@ function dol_print_object_info($object) } // Date creation - if (isset($object->date_creation)) + if (! empty($object->date_creation)) { print $langs->trans("DateCreation").': '.dol_print_date($object->date_creation, 'dayhour'); if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_creation+($deltadateforuser*3600),"dayhour").'  '.$langs->trans("ClientHour"); @@ -217,7 +217,7 @@ function dol_print_object_info($object) } // User change - if (isset($object->user_modification)) + if (! empty($object->user_modification)) { print $langs->trans("ModifiedBy").': '; if (is_object($object->user_modification)) @@ -234,7 +234,7 @@ function dol_print_object_info($object) } // Date change - if (isset($object->date_modification)) + if (! empty($object->date_modification)) { print $langs->trans("DateLastModification").': '.dol_print_date($object->date_modification, 'dayhour'); if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_modification+($deltadateforuser*3600),"dayhour").'  '.$langs->trans("ClientHour"); @@ -242,7 +242,7 @@ function dol_print_object_info($object) } // User validation - if (isset($object->user_validation)) + if (! empty($object->user_validation)) { print $langs->trans("ValidatedBy").': '; if (is_object($object->user_validation)) @@ -259,7 +259,7 @@ function dol_print_object_info($object) } // Date validation - if (isset($object->date_validation)) + if (! empty($object->date_validation)) { print $langs->trans("DateValidation").': '.dol_print_date($object->date_validation, 'dayhour'); if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_validation+($deltadateforuser*3600),"dayhour").'  '.$langs->trans("ClientHour"); @@ -267,7 +267,7 @@ function dol_print_object_info($object) } // User approve - if (isset($object->user_approve)) + if (! empty($object->user_approve)) { print $langs->trans("ApprovedBy").': '; if (is_object($object->user_approve)) @@ -284,7 +284,7 @@ function dol_print_object_info($object) } // Date approve - if (isset($object->date_approve)) + if (! empty($object->date_approve)) { print $langs->trans("DateApprove").': '.dol_print_date($object->date_approve, 'dayhour'); if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_approve+($deltadateforuser*3600),"dayhour").'  '.$langs->trans("ClientHour"); @@ -292,7 +292,7 @@ function dol_print_object_info($object) } // User close - if (isset($object->user_cloture)) + if (! empty($object->user_cloture)) { print $langs->trans("ClosedBy").': '; if (is_object($object->user_cloture)) @@ -309,7 +309,7 @@ function dol_print_object_info($object) } // Date close - if (isset($object->date_cloture)) + if (! empty($object->date_cloture)) { print $langs->trans("DateClosing").': '.dol_print_date($object->date_cloture, 'dayhour'); if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_cloture+($deltadateforuser*3600),"dayhour").'  '.$langs->trans("ClientHour"); @@ -317,7 +317,7 @@ function dol_print_object_info($object) } // User conciliate - if (isset($object->user_rappro)) + if (! empty($object->user_rappro)) { print $langs->trans("ConciliatedBy").': '; if (is_object($object->user_rappro)) @@ -334,7 +334,7 @@ function dol_print_object_info($object) } // Date conciliate - if (isset($object->date_rappro)) + if (! empty($object->date_rappro)) { print $langs->trans("DateConciliating").': '.dol_print_date($object->date_rappro, 'dayhour'); if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_rappro+($deltadateforuser*3600),"dayhour").'  '.$langs->trans("ClientHour"); @@ -342,7 +342,7 @@ function dol_print_object_info($object) } // Date send - if (isset($object->date_envoi)) + if (! empty($object->date_envoi)) { print $langs->trans("DateLastSend").': '.dol_print_date($object->date_envoi, 'dayhour'); if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_envoi+($deltadateforuser*3600),"dayhour").'  '.$langs->trans("ClientHour"); From 3b939206da9f81deaf5045753b41168cec907342 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Apr 2013 14:55:40 +0200 Subject: [PATCH 31/64] Look: Minor optimization --- htdocs/adherents/card_subscriptions.php | 2 +- htdocs/adherents/fiche.php | 5 +++-- htdocs/adherents/info.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 6bef7622a2b..17a39148eba 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -505,7 +505,7 @@ if ($rowid) print $form->showrefnav($object, 'rowid', $linkback); print ''; - $showphoto='
'; + $showphoto=''; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 65c79d66068..76b2b2d23f5 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -1015,7 +1015,7 @@ else print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy); print ""; // Photo - print ''; - $showphoto=''; @@ -1364,6 +1364,7 @@ else if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''; + // Photo print $showphoto; $showphoto=''; print ''; } diff --git a/htdocs/adherents/info.php b/htdocs/adherents/info.php index e43ba2fe058..08ae0e2da9a 100644 --- a/htdocs/adherents/info.php +++ b/htdocs/adherents/info.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify From faebda20d58081fd601813a1db3e6a36fc95ac53 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 12 Apr 2013 16:09:52 +0200 Subject: [PATCH 32/64] Fix: wrong amounts --- htdocs/commande/fiche.php | 64 +++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index ce25c5cab31..150a55923dd 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1,34 +1,34 @@ - * Copyright (C) 2004-2013 Laurent Destailleur -* Copyright (C) 2005 Marc Barilley / Ocebo -* Copyright (C) 2005-2012 Regis Houssin -* Copyright (C) 2006 Andre Cianfarani -* Copyright (C) 2010-2013 Juanjo Menent -* Copyright (C) 2011 Philippe Grand -* Copyright (C) 2012 Christophe Battarel -* Copyright (C) 2012 Marcos García -* Copyright (C) 2013 Florian Henry -* -* 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 3 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 . -*/ +/* Copyright (C) 2003-2006 Rodolphe Quiedeville + * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012 Marcos García + * Copyright (C) 2013 Florian Henry + * + * 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 3 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/commande/fiche.php -* \ingroup commande -* \brief Page to show customer order -*/ + * \ingroup commande + * \brief Page to show customer order + */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; @@ -2201,7 +2201,7 @@ else // Total HT print ''; - print ''; + print ''; // Margin Infos if (! empty($conf->margin->enabled)) @@ -2215,22 +2215,22 @@ else print ''; // Total TVA - print ''; + print ''; // Amount Local Taxes if ($mysoc->localtax1_assuj=="1") //Localtax1 RE { print ''; - print ''; + print ''; } if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF { print ''; - print ''; + print ''; } // Total TTC - print ''; + print ''; // Statut print ''; From ae01285fe986f022f9c17652fb37acc744cca473 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Apr 2013 16:16:39 +0200 Subject: [PATCH 33/64] Look: Replace table with div. Look: Optimize for smartphone --- htdocs/bookmarks/fiche.php | 12 ++++++------ htdocs/categories/photos.php | 8 ++++---- htdocs/compta/facture.php | 2 +- htdocs/compta/index.php | 8 ++++---- htdocs/core/tpl/freeproductline_create.tpl.php | 2 +- .../core/tpl/predefinedproductline_create.tpl.php | 2 +- htdocs/fourn/commande/fiche.php | 6 +++--- htdocs/fourn/facture/fiche.php | 6 +++--- htdocs/projet/activity/index.php | 12 ++++++++---- htdocs/projet/index.php | 14 ++++++++++---- 10 files changed, 41 insertions(+), 31 deletions(-) diff --git a/htdocs/bookmarks/fiche.php b/htdocs/bookmarks/fiche.php index 296bf4c12a4..d5caac4612e 100644 --- a/htdocs/bookmarks/fiche.php +++ b/htdocs/bookmarks/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2012 Laurent Destailleur + * Copyright (C) 2005-2013 Laurent Destailleur * * 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 @@ -147,23 +147,23 @@ if ($action == 'create') print '
'.$langs->trans($newclassname).''.$objectsrc->getNomUrl(1).'
'.$langs->trans('TotalHT').''.price($objectsrc->total_ht).'
'.$langs->trans('TotalVAT').''.price($objectsrc->total_tva)."
'.$form->showphoto('memberphoto',$object).''.$form->showphoto('memberphoto',$object).''; + print ''; print $form->showphoto('memberphoto',$object)."\n"; if ($caneditfieldmember) { @@ -1356,7 +1356,7 @@ else print $form->showrefnav($object, 'rowid', $linkback); print '
'; + $showphoto=''; $showphoto.=$form->showphoto('memberphoto',$object); $showphoto.='
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans('AmountHT').''.price($object->total_ht,'',$langs,'','',0,$conf->currency).''.price($object->total_ht,1,'',1,-1,-1,$conf->currency).'
'.$langs->trans('AmountVAT').''.price($object->total_tva,'',$langs,'','',0,$conf->currency).'
'.$langs->trans('AmountVAT').''.price($object->total_tva,1,'',1,-1,-1,$conf->currency).'
'.$langs->transcountry("AmountLT1",$mysoc->country_code).''.price($object->total_localtax1,'',$langs,'','',0,$conf->currency).'
'.price($object->total_localtax1,1,'',1,-1,-1,$conf->currency).'
'.$langs->transcountry("AmountLT2",$mysoc->country_code).''.price($object->total_localtax2,'',$langs,'','',0,$conf->currency).'
'.price($object->total_localtax2,1,'',1,-1,-1,$conf->currency).'
'.$langs->trans('AmountTTC').''.price($object->total_ttc,'',$langs,'','',0,$conf->currency).'
'.$langs->trans('AmountTTC').''.price($object->total_ttc,1,'',1,-1,-1,$conf->currency).'
'.$langs->trans('Status').''.$object->getLibStatut(4).'
'; - print ''; + print ''; - print ''; + print ''; print ''; + print ''; print ''; + print ''; // Position print ''; + print ''; print '
'.$langs->trans("BookmarkTitle").''.$langs->trans("SetHereATitleForLink").'
'.$langs->trans("BookmarkTitle").''.$langs->trans("SetHereATitleForLink").'
'.$langs->trans("UrlOrLink").''.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'
'.$langs->trans("UrlOrLink").''.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'
'.$langs->trans("BehaviourOnClick").''; $liste=array(0=>$langs->trans("ReplaceWindow"),1=>$langs->trans("OpenANewWindow")); print $form->selectarray('target',$liste,1); - print ''.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'
'.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'
'.$langs->trans("Owner").''; $form->select_users(isset($_POST['userid'])?$_POST['userid']:$user->id,'userid',1); - print ' 
 
'.$langs->trans("Position").''; print 'position).'">'; - print ' 
 

'; diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 5bd159e2742..8a98ff44c01 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -184,23 +184,23 @@ if ($object->id) /* */ /* ************************************************************************** */ - print "\n
\n"; + print '
'."\n"; if ($action != 'ajout_photo' && $user->rights->categorie->creer) { if (! empty($conf->global->MAIN_UPLOAD_DOC)) { - print ''; + print ''; print $langs->trans("AddPhoto").''; } else { - print ''; + print ''; print $langs->trans("AddPhoto").''; } } - print "\n
\n"; + print '
'."\n"; /* * Ajouter une photo diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4c85064e427..7f003b4503b 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -8,7 +8,7 @@ * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2013 Jean-Francois FERRY - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Florian Henry * * 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 diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index f3e496b4c02..ad4d032d5a9 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -104,10 +104,10 @@ llxHeader("",$langs->trans("AccountancyTreasuryArea")); print_fiche_titre($langs->trans("AccountancyTreasuryArea")); -//print ''; -//print '
'; + print '
'; + $max=3; @@ -323,7 +323,6 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- } -//print '
'; print '
'; @@ -1032,9 +1031,10 @@ if ($resql) print "

"; } -//print ''; + print ''; + llxFooter(); $db->close(); diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php index 6ab525117a2..7c6268d30cd 100644 --- a/htdocs/core/tpl/freeproductline_create.tpl.php +++ b/htdocs/core/tpl/freeproductline_create.tpl.php @@ -100,7 +100,7 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob "> "> - % + % - % + % id)) print ''; print ''; print ''; - print '%'; + print '%'; print ''; print '
'; print '' . "\n"; @@ -1596,7 +1596,7 @@ elseif (! empty($object->id)) print ''; print ''; print ''; - print '%'; + print '%'; print ''; print ''; @@ -1653,7 +1653,7 @@ elseif (! empty($object->id)) print ''; print ''; - print '%'; + print '%'; print ''; print ''; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 24577bbf3f1..75c5aa67a29 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1746,7 +1746,7 @@ else print ''; - print '%'; + print '%'; print ' '; @@ -1891,7 +1891,7 @@ else print ''; print ''; print ''; - print '%'; + print '%'; print ' '; print ' '; print ''; @@ -1958,7 +1958,7 @@ else print ''; print ''; - print '%'; + print '%'; print ' '; print ' '; print ''; diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 41cd8ce051e..f7b5fa76650 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -65,8 +65,9 @@ else else print $langs->trans("TasksPublicDesc").'

'; } -print ''; -print '
'; + +print '
'; + print_projecttasks_array($db,$socid,$projectsListId,$mine); @@ -180,7 +181,8 @@ print "
"; } -print ''; +print '
'; + // TODO Do not use week function to be compatible with all database if ($db->type != 'pgsql') @@ -326,7 +328,9 @@ else } print ""; -print ''; + +print '
'; + llxFooter(); diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 40183c5a8de..d7eb62f927a 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -68,12 +68,16 @@ else else print $langs->trans("ProjectsPublicDesc").'

'; } -print ''; -print '
'; + + +print '
'; + print_projecttasks_array($db,$socid,$projectsListId); -print '
'; + +print '
'; + print ''; print ''; @@ -128,7 +132,9 @@ else } print "
"; -print '
'; + +print ''; + llxFooter(); From 97b0076c5adbf81d0bf36be6962f78c4d7a2969f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Apr 2013 16:31:16 +0200 Subject: [PATCH 34/64] Doxygen --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 38a65fc54ac..e764de4e3b7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2588,7 +2588,7 @@ function vatrate($rate,$addpercent=false,$info_bits=0,$usestarfornpr=0) * @param Translate $outlangs Object langs for output * @param int $trunc 1=Truncate if there is too much decimals (default), 0=Does not truncate * @param int $rounding Minimum number of decimal to show. If not defined we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL) - * @param int $forcerounding Force the number of decimal + * @param int $forcerounding Force the number of decimal fo forcerounding decimal (-1=do not force) * @param string $currency_code To add currency symbol (''=add nothing, 'XXX'=add currency symbols for XXX currency) * @return string Chaine avec montant formate * From 26653a42e43a9588ba246fbf3dce02de0466d374 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Apr 2013 16:53:06 +0200 Subject: [PATCH 35/64] Optimize for terminal with no_mouse_hover --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index e430ae4612c..81a04269604 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -433,7 +433,7 @@ class FormFile $out.= ' type="submit" value="'.$buttonlabel.'"'; if (! $allowgenifempty && ! is_array($modellist) && empty($modellist)) $out.= ' disabled="disabled"'; $out.= '>'; - if ($allowgenifempty && ! is_array($modellist) && empty($modellist) && $modulepart != 'unpaid') + if ($allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') { $langs->load("errors"); $out.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated")); From 62893c2ae466c40b1b111ce43ef9f769edcd5661 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Apr 2013 17:08:54 +0200 Subject: [PATCH 36/64] Qual: uniformize code to use function de set with and height for graphs --- htdocs/compta/bank/graph.php | 29 ++++++++++++++-------------- htdocs/core/class/dolgraph.class.php | 7 ++++--- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 3e13d2a2f36..fb4e2a09a86 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -30,6 +30,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $langs->load("banks"); +$WIDTH=DolGraph::getDefaultGraphSizeForStats('width',768); +$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height',200); + // Security check if (isset($_GET["account"]) || isset($_GET["ref"])) { @@ -82,11 +85,7 @@ if ($result < 0) } else { - // Definition de $width et $height - $width = 768; - $height = 200; - - // Calcul de $min et $max + // Calcul $min and $max $sql = "SELECT MIN(b.datev) as min, MAX(b.datev) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; @@ -239,8 +238,8 @@ else $px1->SetMaxValue($px1->GetCeilMaxValue()<0?0:$px1->GetCeilMaxValue()); $px1->SetMinValue($px1->GetFloorMinValue()>0?0:$px1->GetFloorMinValue()); $px1->SetTitle($title); - $px1->SetWidth($width); - $px1->SetHeight($height); + $px1->SetWidth($WIDTH); + $px1->SetHeight($HEIGHT); $px1->SetType(array('lines','lines')); $px1->setBgColor('onglet'); $px1->setBgColorGrid(array(255,255,255)); @@ -369,8 +368,8 @@ else $px2->SetMaxValue($px2->GetCeilMaxValue()<0?0:$px2->GetCeilMaxValue()); $px2->SetMinValue($px2->GetFloorMinValue()>0?0:$px2->GetFloorMinValue()); $px2->SetTitle($title); - $px2->SetWidth($width); - $px2->SetHeight($height); + $px2->SetWidth($WIDTH); + $px2->SetHeight($HEIGHT); $px2->SetType(array('lines','lines')); $px2->setBgColor('onglet'); $px2->setBgColorGrid(array(255,255,255)); @@ -478,8 +477,8 @@ else $px3->SetMaxValue($px3->GetCeilMaxValue()<0?0:$px3->GetCeilMaxValue()); $px3->SetMinValue($px3->GetFloorMinValue()>0?0:$px3->GetFloorMinValue()); $px3->SetTitle($title); - $px3->SetWidth($width); - $px3->SetHeight($height); + $px3->SetWidth($WIDTH); + $px3->SetHeight($HEIGHT); $px3->SetType(array('lines','lines')); $px3->setBgColor('onglet'); $px3->setBgColorGrid(array(255,255,255)); @@ -605,8 +604,8 @@ else $px4->SetMaxValue($px4->GetCeilMaxValue()<0?0:$px4->GetCeilMaxValue()); $px4->SetMinValue($px4->GetFloorMinValue()>0?0:$px4->GetFloorMinValue()); $px4->SetTitle($title); - $px4->SetWidth($width); - $px4->SetHeight($height); + $px4->SetWidth($WIDTH); + $px4->SetHeight($HEIGHT); $px4->SetType(array('bars','bars')); $px4->SetShading(3); $px4->setBgColor('onglet'); @@ -714,8 +713,8 @@ else $px5->SetMaxValue($px5->GetCeilMaxValue()<0?0:$px5->GetCeilMaxValue()); $px5->SetMinValue($px5->GetFloorMinValue()>0?0:$px5->GetFloorMinValue()); $px5->SetTitle($title); - $px5->SetWidth($width); - $px5->SetHeight($height); + $px5->SetWidth($WIDTH); + $px5->SetHeight($HEIGHT); $px5->SetType(array('bars','bars')); $px5->SetShading(3); $px5->setBgColor('onglet'); diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index dd512b25f02..0306a48eb99 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -898,14 +898,15 @@ class DolGraph * getDefaultGraphSizeForStats * * @param string $direction 'width' or 'height' + * @param string $defaultsize Value we want as default size * @return int Value of width or height to use by default */ - static function getDefaultGraphSizeForStats($direction) + static function getDefaultGraphSizeForStats($direction,$defaultsize='') { global $conf; - if ($direction == 'width') return ($conf->dol_optimize_smallscreen?'400':'500'); - if ($direction == 'height') return ($conf->dol_optimize_smallscreen?'160':'200'); + if ($direction == 'width') return ($conf->dol_optimize_smallscreen?'400':($defaultsize?$defaultsize:'500')); + if ($direction == 'height') return ($conf->dol_optimize_smallscreen?'160':($defaultsize?$defaultsize:'200')); return 0; } } From 43fd068d1d53460320122b8a8496d48636772de2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Apr 2013 18:45:19 +0200 Subject: [PATCH 37/64] Qual: Uniformize way to get graph sizes. --- htdocs/adherents/stats/geo.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 2595136a33e..dbb964cfd47 100755 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -23,8 +23,9 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; -$graphwidth = 700; +$graphwidth=DolGraph::getDefaultGraphSizeForStats('width',700); $mapratio = 0.5; $graphheight = round($graphwidth * $mapratio); From 90cfa429151134b79f6c8e2e09b115d1c9e6b73e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Apr 2013 19:45:09 +0200 Subject: [PATCH 38/64] Fix: removed useless   --- htdocs/core/search_page.php | 4 ++-- htdocs/main.inc.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index cf8be7ddb12..3cab48155ae 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -55,8 +55,8 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); -print ''."\n"; -print '
'; +print ''."\n"; +print '

'; // Define $searchform if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index f772df7420b..30677ea5b9c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1719,7 +1719,7 @@ function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinput $ret.='global->MAIN_HTML5_PLACEHOLDER)) $ret.=' placeholder="'.$langs->trans("SearchOf").''.strip_tags($title).'"'; else $ret.=' title="'.$langs->trans("SearchOf").''.strip_tags($title).'"'; - $ret.=' name="'.$htmlinputname.'" size="10" /> '; + $ret.=' name="'.$htmlinputname.'" size="10" />'; $ret.=''; $ret.="\n"; return $ret; From b6f765ef3c7cb3af194c76b96286f31eae65fe5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Fri, 12 Apr 2013 23:51:52 +0200 Subject: [PATCH 39/64] Improved es_ES translations --- htdocs/langs/es_ES/errors.lang | 2 +- htdocs/langs/es_ES/install.lang | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang index 41e39e4aea2..afb31dd4269 100644 --- a/htdocs/langs/es_ES/errors.lang +++ b/htdocs/langs/es_ES/errors.lang @@ -18,7 +18,7 @@ ErrorFailToCreateDir=Error al crear el directorio '%s' ErrorFailToDeleteDir=Error al eliminar el directorio '%s'. ErrorFailedToDeleteJoinedFiles=Imposible eliminar la entidad ya que tiene archivos adjuntos. Elimine antes los archivos adjuntos ErrorThisContactIsAlreadyDefinedAsThisType=Este contacto ya está definido como contacto para este tipo. -ErrorCashAccountAcceptsOnlyCashMoney=Esta cuenta bancaria es de tipo caja y solo acepta el método de pago de tipo especie. +ErrorCashAccountAcceptsOnlyCashMoney=Esta cuenta bancaria es de tipo caja y sólo acepta pagos en efectivo. ErrorFromToAccountsMustDiffers=La cuenta origen y destino deben ser diferentes. ErrorBadThirdPartyName=Nombre de tercero incorrecto ErrorProdIdIsMandatory=El %s es obligatorio diff --git a/htdocs/langs/es_ES/install.lang b/htdocs/langs/es_ES/install.lang index d53dcc28407..6ebfe3e0e10 100644 --- a/htdocs/langs/es_ES/install.lang +++ b/htdocs/langs/es_ES/install.lang @@ -225,4 +225,6 @@ MigrationProjectTaskTime=Actualización de tiempo dedicado en segundos # Migration Acctioncom MigrationActioncommElement=Actualización de los datos de acciones sobre elementos # Migration payment mode -MigrationPaymentMode=Actualización de los modos de pago \ No newline at end of file +MigrationPaymentMode=Actualización de los modos de pago +# Migration categories +MigrationCategorieAssociation=Actualización de las categorías \ No newline at end of file From ac0cd975cd5b688a410aafcc98581226a41b8a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 13 Apr 2013 13:03:13 +0200 Subject: [PATCH 40/64] Added missing table head strings into supplier invoices --- htdocs/fourn/facture/fiche.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 6f80f5b0303..68ed4bc001e 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1609,7 +1609,7 @@ else print ''.$langs->trans('PriceUHT').''; print ''.$langs->trans('PriceUTTC').''; print ''.$langs->trans('Qty').''; - print ''.$langs->trans('Discount').''; + print ''.$langs->trans('ReductionShort').''; print ''.$langs->trans('TotalHTShort').''; print ''.$langs->trans('TotalTTCShort').''; print ' '; @@ -1783,7 +1783,7 @@ else print ''.$langs->trans('PriceUHT').''; print ''.$langs->trans('PriceUTTC').''; print ''.$langs->trans('Qty').''; - print ' '; + print ''.$langs->trans('ReductionShort').''; print ' '; print ' '; print ' '; @@ -1853,7 +1853,7 @@ else } print ''; print ''.$langs->trans('Qty').''; - print ' '; + print ''.$langs->trans('ReductionShort').''; print ' '; print ' '; print ''; From 4bb815937ae91c838da6eaa4c08f67ddd625fabb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Apr 2013 13:56:13 +0200 Subject: [PATCH 41/64] Module opensurvey become a standard feature. --- htdocs/{opensurvey => }/langs/en_US/opensurvey.lang | 0 htdocs/{opensurvey => }/langs/fr_FR/opensurvey.lang | 0 htdocs/opensurvey/admin/index.php | 2 +- htdocs/opensurvey/index.php | 2 +- htdocs/opensurvey/list.php | 2 +- htdocs/opensurvey/public/create_survey.php | 2 +- 6 files changed, 4 insertions(+), 4 deletions(-) rename htdocs/{opensurvey => }/langs/en_US/opensurvey.lang (100%) rename htdocs/{opensurvey => }/langs/fr_FR/opensurvey.lang (100%) diff --git a/htdocs/opensurvey/langs/en_US/opensurvey.lang b/htdocs/langs/en_US/opensurvey.lang similarity index 100% rename from htdocs/opensurvey/langs/en_US/opensurvey.lang rename to htdocs/langs/en_US/opensurvey.lang diff --git a/htdocs/opensurvey/langs/fr_FR/opensurvey.lang b/htdocs/langs/fr_FR/opensurvey.lang similarity index 100% rename from htdocs/opensurvey/langs/fr_FR/opensurvey.lang rename to htdocs/langs/fr_FR/opensurvey.lang diff --git a/htdocs/opensurvey/admin/index.php b/htdocs/opensurvey/admin/index.php index 02c6a5ea125..8d1b95183ba 100755 --- a/htdocs/opensurvey/admin/index.php +++ b/htdocs/opensurvey/admin/index.php @@ -36,7 +36,7 @@ if (!$user->admin) accessforbidden(); * View */ -$langs->load("opensurvey@opensurvey"); +$langs->load("opensurvey"); llxHeader(); print_fiche_titre($langs->trans("OpenSurveyArea")); diff --git a/htdocs/opensurvey/index.php b/htdocs/opensurvey/index.php index 21babf4f2e8..ddfa578a5ff 100755 --- a/htdocs/opensurvey/index.php +++ b/htdocs/opensurvey/index.php @@ -31,7 +31,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); * View */ -$langs->load("opensurvey@opensurvey"); +$langs->load("opensurvey"); llxHeader(); $nbsondages=0; diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index 20a3ed50d94..868354dd184 100755 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -66,7 +66,7 @@ if ($action == 'delete_confirm') $form=new Form($db); -$langs->load("opensurvey@opensurvey"); +$langs->load("opensurvey"); llxHeader(); print '
'."\n"; diff --git a/htdocs/opensurvey/public/create_survey.php b/htdocs/opensurvey/public/create_survey.php index 729255a6ca1..168f601b9f5 100755 --- a/htdocs/opensurvey/public/create_survey.php +++ b/htdocs/opensurvey/public/create_survey.php @@ -28,7 +28,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); -$langs->load("opensurvey@opensurvey"); +$langs->load("opensurvey"); $origin=GETPOST('origin','alpha'); From 2b941884142f955795e06ae2b249d1940e8d1603 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Apr 2013 14:09:50 +0200 Subject: [PATCH 42/64] Fix: Languages files permissions and loading --- htdocs/langs/en_US/holiday.lang | 0 htdocs/langs/en_US/opensurvey.lang | 0 htdocs/langs/fr_FR/opensurvey.lang | 0 htdocs/langs/pt_BR/banks.lang | 0 htdocs/langs/pt_BR/bills.lang | 0 htdocs/langs/pt_BR/commercial.lang | 0 htdocs/langs/pt_BR/contracts.lang | 0 htdocs/langs/pt_BR/main.lang | 0 htdocs/langs/pt_BR/orders.lang | 0 htdocs/langs/pt_BR/other.lang | 0 htdocs/langs/pt_BR/products.lang | 0 htdocs/langs/pt_BR/projects.lang | 0 htdocs/langs/pt_BR/propal.lang | 0 htdocs/langs/pt_BR/sendings.lang | 0 htdocs/langs/tr_TR/admin.lang | 0 htdocs/langs/tr_TR/agenda.lang | 0 htdocs/langs/tr_TR/banks.lang | 0 htdocs/langs/tr_TR/bills.lang | 0 htdocs/langs/tr_TR/bookmarks.lang | 0 htdocs/langs/tr_TR/boxes.lang | 0 htdocs/langs/tr_TR/install.lang | 0 htdocs/langs/tr_TR/main.lang | 0 htdocs/langs/tr_TR/other.lang | 0 htdocs/langs/tr_TR/products.lang | 0 htdocs/langs/tr_TR/stocks.lang | 0 htdocs/langs/tr_TR/users.lang | 0 htdocs/opensurvey/admin/index.php | 1 + htdocs/opensurvey/index.php | 1 + htdocs/opensurvey/public/index.php | 2 ++ 29 files changed, 4 insertions(+) mode change 100755 => 100644 htdocs/langs/en_US/holiday.lang mode change 100755 => 100644 htdocs/langs/en_US/opensurvey.lang mode change 100755 => 100644 htdocs/langs/fr_FR/opensurvey.lang mode change 100755 => 100644 htdocs/langs/pt_BR/banks.lang mode change 100755 => 100644 htdocs/langs/pt_BR/bills.lang mode change 100755 => 100644 htdocs/langs/pt_BR/commercial.lang mode change 100755 => 100644 htdocs/langs/pt_BR/contracts.lang mode change 100755 => 100644 htdocs/langs/pt_BR/main.lang mode change 100755 => 100644 htdocs/langs/pt_BR/orders.lang mode change 100755 => 100644 htdocs/langs/pt_BR/other.lang mode change 100755 => 100644 htdocs/langs/pt_BR/products.lang mode change 100755 => 100644 htdocs/langs/pt_BR/projects.lang mode change 100755 => 100644 htdocs/langs/pt_BR/propal.lang mode change 100755 => 100644 htdocs/langs/pt_BR/sendings.lang mode change 100755 => 100644 htdocs/langs/tr_TR/admin.lang mode change 100755 => 100644 htdocs/langs/tr_TR/agenda.lang mode change 100755 => 100644 htdocs/langs/tr_TR/banks.lang mode change 100755 => 100644 htdocs/langs/tr_TR/bills.lang mode change 100755 => 100644 htdocs/langs/tr_TR/bookmarks.lang mode change 100755 => 100644 htdocs/langs/tr_TR/boxes.lang mode change 100755 => 100644 htdocs/langs/tr_TR/install.lang mode change 100755 => 100644 htdocs/langs/tr_TR/main.lang mode change 100755 => 100644 htdocs/langs/tr_TR/other.lang mode change 100755 => 100644 htdocs/langs/tr_TR/products.lang mode change 100755 => 100644 htdocs/langs/tr_TR/stocks.lang mode change 100755 => 100644 htdocs/langs/tr_TR/users.lang diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/en_US/opensurvey.lang b/htdocs/langs/en_US/opensurvey.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/fr_FR/opensurvey.lang b/htdocs/langs/fr_FR/opensurvey.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/pt_BR/banks.lang b/htdocs/langs/pt_BR/banks.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/pt_BR/bills.lang b/htdocs/langs/pt_BR/bills.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/pt_BR/commercial.lang b/htdocs/langs/pt_BR/commercial.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/pt_BR/contracts.lang b/htdocs/langs/pt_BR/contracts.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/pt_BR/main.lang b/htdocs/langs/pt_BR/main.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/pt_BR/orders.lang b/htdocs/langs/pt_BR/orders.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/pt_BR/other.lang b/htdocs/langs/pt_BR/other.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/pt_BR/products.lang b/htdocs/langs/pt_BR/products.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/pt_BR/projects.lang b/htdocs/langs/pt_BR/projects.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/pt_BR/propal.lang b/htdocs/langs/pt_BR/propal.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/pt_BR/sendings.lang b/htdocs/langs/pt_BR/sendings.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/tr_TR/admin.lang b/htdocs/langs/tr_TR/admin.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/tr_TR/agenda.lang b/htdocs/langs/tr_TR/agenda.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/tr_TR/banks.lang b/htdocs/langs/tr_TR/banks.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/tr_TR/bills.lang b/htdocs/langs/tr_TR/bills.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/tr_TR/bookmarks.lang b/htdocs/langs/tr_TR/bookmarks.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/tr_TR/boxes.lang b/htdocs/langs/tr_TR/boxes.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/tr_TR/install.lang b/htdocs/langs/tr_TR/install.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/tr_TR/main.lang b/htdocs/langs/tr_TR/main.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/tr_TR/other.lang b/htdocs/langs/tr_TR/other.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/tr_TR/products.lang b/htdocs/langs/tr_TR/products.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/tr_TR/stocks.lang b/htdocs/langs/tr_TR/stocks.lang old mode 100755 new mode 100644 diff --git a/htdocs/langs/tr_TR/users.lang b/htdocs/langs/tr_TR/users.lang old mode 100755 new mode 100644 diff --git a/htdocs/opensurvey/admin/index.php b/htdocs/opensurvey/admin/index.php index 8d1b95183ba..9617a9c7ee6 100755 --- a/htdocs/opensurvey/admin/index.php +++ b/htdocs/opensurvey/admin/index.php @@ -37,6 +37,7 @@ if (!$user->admin) accessforbidden(); */ $langs->load("opensurvey"); + llxHeader(); print_fiche_titre($langs->trans("OpenSurveyArea")); diff --git a/htdocs/opensurvey/index.php b/htdocs/opensurvey/index.php index ddfa578a5ff..37f975d1f40 100755 --- a/htdocs/opensurvey/index.php +++ b/htdocs/opensurvey/index.php @@ -32,6 +32,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); */ $langs->load("opensurvey"); + llxHeader(); $nbsondages=0; diff --git a/htdocs/opensurvey/public/index.php b/htdocs/opensurvey/public/index.php index 1d31bf260b3..557142d691d 100755 --- a/htdocs/opensurvey/public/index.php +++ b/htdocs/opensurvey/public/index.php @@ -33,6 +33,8 @@ require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); $origin=GETPOST('origin','alpha'); +$langs->load("opensurvey"); + /* * View From 6e495bfbe1abb419d78858fac18788d3d52b4f3d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Apr 2013 14:38:26 +0200 Subject: [PATCH 43/64] Fix: lang loading --- htdocs/core/modules/modOpenSurvey.class.php | 8 ++++---- htdocs/opensurvey/list.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php index e9385442a85..0930f7dfa94 100755 --- a/htdocs/core/modules/modOpenSurvey.class.php +++ b/htdocs/core/modules/modOpenSurvey.class.php @@ -123,7 +123,7 @@ class modOpenSurvey extends DolibarrModules 'titre'=>'Surveys', 'mainmenu'=>'opensurvey', 'url'=>'/opensurvey/index.php', - 'langs'=>'opensurvey@opensurvey', + 'langs'=>'opensurvey', 'position'=>200, 'enabled'=>'$conf->opensurvey->enabled', // Define condition to show or hide menu entry. Use '$conf->NewsSubmitter->enabled' if entry must be visible if module is enabled. 'perms'=>'$user->rights->opensurvey->survey->read', @@ -137,7 +137,7 @@ class modOpenSurvey extends DolibarrModules 'mainmenu'=>'opensurvey', 'leftmenu'=>'opensurvey', 'url'=>'/opensurvey/index.php?mainmenu=opensurvey&leftmenu=opensurvey', - 'langs'=>'opensurvey@opensurvey', + 'langs'=>'opensurvey', 'position'=>200, 'enabled'=>'$conf->opensurvey->enabled', // Define condition to show or hide menu entry. Use '$conf->NewsSubmitter->enabled' if entry must be visible if module is enabled. 'perms'=>'', @@ -151,7 +151,7 @@ class modOpenSurvey extends DolibarrModules 'mainmenu'=>'opensurvey', 'leftmenu'=>'opensurvey_new', 'url'=>'/opensurvey/public/index.php?origin=dolibarr', - 'langs'=>'opensurvey@opensurvey', + 'langs'=>'opensurvey', 'position'=>210, 'enabled'=>'$conf->opensurvey->enabled', // Define condition to show or hide menu entry. Use '$conf->NewsSubmitter->enabled' if entry must be visible if module is enabled. 'perms'=>'', @@ -165,7 +165,7 @@ class modOpenSurvey extends DolibarrModules 'mainmenu'=>'opensurvey', 'leftmenu'=>'opensurvey_list', 'url'=>'/opensurvey/list.php', - 'langs'=>'opensurvey@opensurvey', + 'langs'=>'opensurvey', 'position'=>220, 'enabled'=>'$conf->opensurvey->enabled', // Define condition to show or hide menu entry. Use '$conf->NewsSubmitter->enabled' if entry must be visible if module is enabled. 'perms'=>'', diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index 868354dd184..506ffecc99e 100755 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -118,7 +118,7 @@ while ($i < min($num,$limit)) $var=!$var; print ''; print ''; - print ''.img_picto('','object_opensurvey@opensurvey').' '.$obj->id_sondage.''; + print ''.img_picto('','object_opensurvey').' '.$obj->id_sondage.''; print ''; $type=($obj->format=='A' || $obj->format=='A+')?'classic':'date'; print img_picto('',dol_buildpath('/opensurvey/img/'.($type == 'classic'?'chart-32.png':'calendar-32.png'),1),'width="16"',1); From d6b42ac87924a38ed3307e93c38c6dedf4563ef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 13 Apr 2013 14:44:56 +0200 Subject: [PATCH 44/64] [ bug #816 ] Sales journal does not reflect localtaxes --- htdocs/compta/journal/sellsjournal.php | 52 ++++++++++++++++++++++---- htdocs/langs/es_ES/compta.lang | 4 +- 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index 4ffed9fa53c..495db3b4c65 100755 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -4,6 +4,7 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2012 Regis Houssin * Copyright (C) 2011-2012 Alexandre Spangaro + * Copyright (C) 2013 Marcos García * * 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 @@ -24,6 +25,8 @@ * \ingroup societe, facture * \brief Page with sells journal */ +global $mysoc; + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -42,10 +45,10 @@ $date_endmonth=GETPOST('date_endmonth'); $date_endday=GETPOST('date_endday'); $date_endyear=GETPOST('date_endyear'); -// Security check -if ($user->societe_id > 0) $socid = $user->societe_id; -if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat'); -if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport'); +// Security check +if ($user->societe_id > 0) $socid = $user->societe_id; +if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat'); +if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport'); /* * Actions @@ -96,15 +99,17 @@ $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_PAYS); $idpays = $p[0]; $sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client,"; -$sql.= " fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc,"; +$sql.= " fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc, fd.localtax1_tx, fd.localtax2_tx, fd.total_localtax1, fd.total_localtax2,"; $sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.client,"; $sql.= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell,"; -$sql.= " ct.accountancy_code_sell as account_tva"; +$sql.= " ct.accountancy_code_sell as account_tva, ctl1.accountancy_code_sell as account_localtax1, ctl2.accountancy_code_sell as account_localtax2"; $sql.= " FROM ".MAIN_DB_PREFIX."facturedet fd"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = fd.fk_product"; $sql.= " JOIN ".MAIN_DB_PREFIX."facture f ON f.rowid = fd.fk_facture"; $sql.= " JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid = f.fk_soc"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '".$idpays."'"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ctl1 ON fd.localtax1_tx = ctl1.localtax1 AND ctl1.fk_pays = '".$idpays."'"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ctl2 ON fd.localtax2_tx = ctl2.localtax2 AND ctl2.fk_pays = '".$idpays."'"; $sql.= " WHERE f.entity = ".$conf->entity; $sql.= " AND f.fk_statut > 0"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; @@ -119,6 +124,8 @@ if ($result) $tabfac = array(); $tabht = array(); $tabtva = array(); + $tablocaltax1 = array(); + $tablocaltax2 = array(); $tabttc = array(); $tabcompany = array(); @@ -139,6 +146,8 @@ if ($result) } $cpttva = (! empty($conf->global->COMPTA_VAT_ACCOUNT)?$conf->global->COMPTA_VAT_ACCOUNT:$langs->trans("CodeNotDef")); $compta_tva = (! empty($obj->account_tva)?$obj->account_tva:$cpttva); + $compta_localtax1 = (! empty($obj->account_localtax1)?$obj->account_localtax1:$langs->trans("CodeNotDef")); + $compta_localtax2 = (! empty($obj->account_localtax2)?$obj->account_localtax2:$langs->trans("CodeNotDef")); //la ligne facture $tabfac[$obj->rowid]["date"] = $obj->datef; @@ -147,9 +156,13 @@ if ($result) if (! isset($tabttc[$obj->rowid][$compta_soc])) $tabttc[$obj->rowid][$compta_soc]=0; if (! isset($tabht[$obj->rowid][$compta_prod])) $tabht[$obj->rowid][$compta_prod]=0; if (! isset($tabtva[$obj->rowid][$compta_tva])) $tabtva[$obj->rowid][$compta_tva]=0; + if (! isset($tablocaltax1[$obj->rowid][$compta_localtax1])) $tablocaltax1[$obj->rowid][$compta_localtax1]=0; + if (! isset($tablocaltax2[$obj->rowid][$compta_localtax2])) $tablocaltax2[$obj->rowid][$compta_localtax2]=0; $tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc; $tabht[$obj->rowid][$compta_prod] += $obj->total_ht; $tabtva[$obj->rowid][$compta_tva] += $obj->total_tva; + $tablocaltax1[$obj->rowid][$compta_localtax1] += $obj->total_localtax1; + $tablocaltax2[$obj->rowid][$compta_localtax2] += $obj->total_localtax2; $tabcompany[$obj->rowid]=array('id'=>$obj->socid, 'name'=>$obj->name, 'client'=>$obj->client); $i++; } @@ -215,7 +228,6 @@ foreach ($tabfac as $key => $val) } } // vat - //var_dump($tabtva); foreach ($tabtva[$key] as $k => $mt) { if ($mt) @@ -228,6 +240,32 @@ foreach ($tabfac as $key => $val) print "".$langs->trans("VAT")."".($mt<0?price(-$mt):'')."".($mt>=0?price($mt):'').""; } } + // localtax1 + foreach ($tablocaltax1[$key] as $k => $mt) + { + if ($mt) + { + print ""; + //print "".$conf->global->COMPTA_JOURNAL_SELL.""; + print "".$val["date"].""; + print "".$invoicestatic->getNomUrl(1).""; + print "".$k; + print "".$langs->transcountrynoentities("LT1",$mysoc->country_code)."".($mt<0?price(-$mt):'')."".($mt>=0?price($mt):'').""; + } + } + // localtax2 + foreach ($tablocaltax2[$key] as $k => $mt) + { + if ($mt) + { + print ""; + //print "".$conf->global->COMPTA_JOURNAL_SELL.""; + print "".$val["date"].""; + print "".$invoicestatic->getNomUrl(1).""; + print "".$k; + print "".$langs->transcountrynoentities("LT2",$mysoc->country_code)."".($mt<0?price(-$mt):'')."".($mt>=0?price($mt):'').""; + } + } $var = !$var; } diff --git a/htdocs/langs/es_ES/compta.lang b/htdocs/langs/es_ES/compta.lang index 2f72861a920..248a41a843d 100644 --- a/htdocs/langs/es_ES/compta.lang +++ b/htdocs/langs/es_ES/compta.lang @@ -29,8 +29,8 @@ PaymentsNotLinkedToInvoice=Pagos vinculados a ninguna factura, por lo que ningu PaymentsNotLinkedToUser=Pagos no vinculados a un usuario Profit=Beneficio Balance=Saldo -Debit=Débito -Credit=Crédito +Debit=Debe +Credit=Haber Withdrawl=Domiciliación Withdrawls=Domiciliaciones AmountHTVATRealReceived=Total repercutido From 3ed4d7bfbf5c9a86058a3614fa77770a599f2b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 13 Apr 2013 14:46:43 +0200 Subject: [PATCH 45/64] Updated changelog --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 5300f3f219b..619e0058e93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,7 @@ English Dolibarr ChangeLog - Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment - Fix: [ bug #794 ] Lost filter on zipcode in prospect list - Fix: [ bug #774 ] Bug on creating event with box "all day" crossed +- Fix: [ bug #816 ] Sales journal does not reflect localtaxes - Fix: Orderstoinvoice didn't act as expected when no order was checked From 473fbf2c33e251e7c7392e96e1e26ec8bfc62f52 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Apr 2013 15:09:57 +0200 Subject: [PATCH 46/64] Fix: syntax error --- htdocs/opensurvey/adminstuds_preview.php | 6 +++--- htdocs/theme/amarok/img/object_opensurvey.png | Bin 0 -> 828 bytes htdocs/theme/auguria/img/object_opensurvey.png | Bin 0 -> 828 bytes .../theme/bureau2crea/img/object_opensurvey.png | Bin 0 -> 828 bytes htdocs/theme/cameleo/img/object_opensurvey.png | Bin 0 -> 828 bytes htdocs/theme/eldy/img/object_opensurvey.png | Bin 0 -> 828 bytes 6 files changed, 3 insertions(+), 3 deletions(-) create mode 100755 htdocs/theme/amarok/img/object_opensurvey.png create mode 100755 htdocs/theme/auguria/img/object_opensurvey.png create mode 100755 htdocs/theme/bureau2crea/img/object_opensurvey.png create mode 100755 htdocs/theme/cameleo/img/object_opensurvey.png create mode 100755 htdocs/theme/eldy/img/object_opensurvey.png diff --git a/htdocs/opensurvey/adminstuds_preview.php b/htdocs/opensurvey/adminstuds_preview.php index 4d07cc67ba3..d85dc37297b 100755 --- a/htdocs/opensurvey/adminstuds_preview.php +++ b/htdocs/opensurvey/adminstuds_preview.php @@ -76,8 +76,8 @@ if (isset($_POST["boutonp"]) || isset($_POST["boutonp_x"])) // Check if vote already exists $sql = 'SELECT id_users, nom'; - $sql.= ' FROM '.MAIN_DB_PREFIX."opensurvey_user_studs'; - $sql.= ' WHERE id_sondage='".$db->escape($numsondage)."' AND nom = '".$db->escape($nom)."'"; + $sql.= ' FROM '.MAIN_DB_PREFIX.'opensurvey_user_studs'; + $sql.= " WHERE id_sondage='".$db->escape($numsondage)."' AND nom = '".$db->escape($nom)."'"; $sql.= ' ORDER BY id_users'; $resql = $db->query($sql); $num_rows = $db->num_rows($resql); @@ -211,7 +211,7 @@ if (isset($_POST["ajoutercolonne"]) && ($object->format == "D" || $object->forma $cleinsertion = count($datesbase); } else { $nbdatesbase=count($datesbase); - for ($i = 0; $i < $nbdatesbase; $i++) + for ($i = 0; $i < $nbdatesbase; $i++) { $j = $i + 1; if ($nouvelledate > $datesbase[$i] && $nouvelledate < $datesbase[$j]) { diff --git a/htdocs/theme/amarok/img/object_opensurvey.png b/htdocs/theme/amarok/img/object_opensurvey.png new file mode 100755 index 0000000000000000000000000000000000000000..042d82172576c5653ed257e778eb73fa1ddfefda GIT binary patch literal 828 zcmV-C1H=4@P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*e% z7Be9VAL4od00O*8L_t(2&pp!5Ynufa!13?%zIpp5d6OKIqzRBaw z&)@Ko=5dpV6G2reS9TID-_2Q8UtZA+fcARp?RI;?Hmt&gHBpnZLiJG<0Z>&QR<^U1 zPVMHc?H|*H`#-Stcpm}A`cqt+nkPFvTS}U-8`J5jMG-+%mGa(B_UHOvh0pGO6D=QC zbubdcG7SOnyFEQ}U6P@Me2}?%^lWr8H$6VJD3#qx;$i3Dmk-yzOdop<9daBA8a)Dr zfyWYM&6%WZ+sK>YyU@UAi>R4RA zaE(_+UgXl?1*y5ax_r2nZmX9wLY9@^tl#FPRFqWE=5#QO6ELyFY4Ghg#y3P51vva~`eTCx2$5fC1 z2B28Fh3DR;s~}=hcN;wa#A|dsZ@~y)6`oGamxlW1L^PnAwPlJMAMxwnDl1!GFyw^j zDYX5z4n^nW$y0MBOYDNEDz!#ETWxO??o_^tZq=7n@UZ(P#PxPCQT0_Bi_goY)cZ#R z#&~Y1eP;3ha*akkd!mOoA2feT-#aLB*t!oGBtny1Jbi_c@Jz|>#cm|+)S|=$>1r2K zOjMOxt(H*nbEawLdvr4>psf3TcY&T+NEVYdc~5A$E&c-*bT{uF>o-aO0000Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*e% z7Be9VAL4od00O*8L_t(2&pp!5Ynufa!13?%zIpp5d6OKIqzRBaw z&)@Ko=5dpV6G2reS9TID-_2Q8UtZA+fcARp?RI;?Hmt&gHBpnZLiJG<0Z>&QR<^U1 zPVMHc?H|*H`#-Stcpm}A`cqt+nkPFvTS}U-8`J5jMG-+%mGa(B_UHOvh0pGO6D=QC zbubdcG7SOnyFEQ}U6P@Me2}?%^lWr8H$6VJD3#qx;$i3Dmk-yzOdop<9daBA8a)Dr zfyWYM&6%WZ+sK>YyU@UAi>R4RA zaE(_+UgXl?1*y5ax_r2nZmX9wLY9@^tl#FPRFqWE=5#QO6ELyFY4Ghg#y3P51vva~`eTCx2$5fC1 z2B28Fh3DR;s~}=hcN;wa#A|dsZ@~y)6`oGamxlW1L^PnAwPlJMAMxwnDl1!GFyw^j zDYX5z4n^nW$y0MBOYDNEDz!#ETWxO??o_^tZq=7n@UZ(P#PxPCQT0_Bi_goY)cZ#R z#&~Y1eP;3ha*akkd!mOoA2feT-#aLB*t!oGBtny1Jbi_c@Jz|>#cm|+)S|=$>1r2K zOjMOxt(H*nbEawLdvr4>psf3TcY&T+NEVYdc~5A$E&c-*bT{uF>o-aO0000Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*e% z7Be9VAL4od00O*8L_t(2&pp!5Ynufa!13?%zIpp5d6OKIqzRBaw z&)@Ko=5dpV6G2reS9TID-_2Q8UtZA+fcARp?RI;?Hmt&gHBpnZLiJG<0Z>&QR<^U1 zPVMHc?H|*H`#-Stcpm}A`cqt+nkPFvTS}U-8`J5jMG-+%mGa(B_UHOvh0pGO6D=QC zbubdcG7SOnyFEQ}U6P@Me2}?%^lWr8H$6VJD3#qx;$i3Dmk-yzOdop<9daBA8a)Dr zfyWYM&6%WZ+sK>YyU@UAi>R4RA zaE(_+UgXl?1*y5ax_r2nZmX9wLY9@^tl#FPRFqWE=5#QO6ELyFY4Ghg#y3P51vva~`eTCx2$5fC1 z2B28Fh3DR;s~}=hcN;wa#A|dsZ@~y)6`oGamxlW1L^PnAwPlJMAMxwnDl1!GFyw^j zDYX5z4n^nW$y0MBOYDNEDz!#ETWxO??o_^tZq=7n@UZ(P#PxPCQT0_Bi_goY)cZ#R z#&~Y1eP;3ha*akkd!mOoA2feT-#aLB*t!oGBtny1Jbi_c@Jz|>#cm|+)S|=$>1r2K zOjMOxt(H*nbEawLdvr4>psf3TcY&T+NEVYdc~5A$E&c-*bT{uF>o-aO0000Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*e% z7Be9VAL4od00O*8L_t(2&pp!5Ynufa!13?%zIpp5d6OKIqzRBaw z&)@Ko=5dpV6G2reS9TID-_2Q8UtZA+fcARp?RI;?Hmt&gHBpnZLiJG<0Z>&QR<^U1 zPVMHc?H|*H`#-Stcpm}A`cqt+nkPFvTS}U-8`J5jMG-+%mGa(B_UHOvh0pGO6D=QC zbubdcG7SOnyFEQ}U6P@Me2}?%^lWr8H$6VJD3#qx;$i3Dmk-yzOdop<9daBA8a)Dr zfyWYM&6%WZ+sK>YyU@UAi>R4RA zaE(_+UgXl?1*y5ax_r2nZmX9wLY9@^tl#FPRFqWE=5#QO6ELyFY4Ghg#y3P51vva~`eTCx2$5fC1 z2B28Fh3DR;s~}=hcN;wa#A|dsZ@~y)6`oGamxlW1L^PnAwPlJMAMxwnDl1!GFyw^j zDYX5z4n^nW$y0MBOYDNEDz!#ETWxO??o_^tZq=7n@UZ(P#PxPCQT0_Bi_goY)cZ#R z#&~Y1eP;3ha*akkd!mOoA2feT-#aLB*t!oGBtny1Jbi_c@Jz|>#cm|+)S|=$>1r2K zOjMOxt(H*nbEawLdvr4>psf3TcY&T+NEVYdc~5A$E&c-*bT{uF>o-aO0000Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*e% z7Be9VAL4od00O*8L_t(2&pp!5Ynufa!13?%zIpp5d6OKIqzRBaw z&)@Ko=5dpV6G2reS9TID-_2Q8UtZA+fcARp?RI;?Hmt&gHBpnZLiJG<0Z>&QR<^U1 zPVMHc?H|*H`#-Stcpm}A`cqt+nkPFvTS}U-8`J5jMG-+%mGa(B_UHOvh0pGO6D=QC zbubdcG7SOnyFEQ}U6P@Me2}?%^lWr8H$6VJD3#qx;$i3Dmk-yzOdop<9daBA8a)Dr zfyWYM&6%WZ+sK>YyU@UAi>R4RA zaE(_+UgXl?1*y5ax_r2nZmX9wLY9@^tl#FPRFqWE=5#QO6ELyFY4Ghg#y3P51vva~`eTCx2$5fC1 z2B28Fh3DR;s~}=hcN;wa#A|dsZ@~y)6`oGamxlW1L^PnAwPlJMAMxwnDl1!GFyw^j zDYX5z4n^nW$y0MBOYDNEDz!#ETWxO??o_^tZq=7n@UZ(P#PxPCQT0_Bi_goY)cZ#R z#&~Y1eP;3ha*akkd!mOoA2feT-#aLB*t!oGBtny1Jbi_c@Jz|>#cm|+)S|=$>1r2K zOjMOxt(H*nbEawLdvr4>psf3TcY&T+NEVYdc~5A$E&c-*bT{uF>o-aO0000 Date: Sat, 13 Apr 2013 15:22:59 +0200 Subject: [PATCH 47/64] [ bug #817 ] Purchases journal does not reflect localtaxes --- ChangeLog | 1 + htdocs/compta/journal/purchasesjournal.php | 49 +++++++++++++++++++--- 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5300f3f219b..15db292de73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,7 @@ English Dolibarr ChangeLog - Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment - Fix: [ bug #794 ] Lost filter on zipcode in prospect list - Fix: [ bug #774 ] Bug on creating event with box "all day" crossed +- Fix: [ bug #817 ] Purchases journal does not reflect localtaxes - Fix: Orderstoinvoice didn't act as expected when no order was checked diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index 1521802a580..66f7f5a6aa2 100755 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -24,6 +24,8 @@ * \ingroup societe, fournisseur, facture * \brief Page with purchases journal */ +global $mysoc; + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -58,7 +60,7 @@ if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accountin * View */ -llxHeader('','',''); +llxHeader('',$langs->trans("PurchasesJournal"),''); $form=new Form($db); @@ -94,12 +96,14 @@ $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_PAYS); $idpays = $p[0]; $sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.libelle,"; -$sql.= " fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_type,"; +$sql.= " fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_type, fd.localtax1_tx, fd.localtax2_tx, fd.total_localtax1, fd.total_localtax2,"; $sql.= " s.rowid as socid, s.nom as name, s.code_compta_fournisseur,"; $sql.= " p.rowid as pid, p.ref as ref, p.accountancy_code_buy,"; -$sql.= " ct.accountancy_code_buy as account_tva"; +$sql.= " ct.accountancy_code_buy as account_tva, ctl1.accountancy_code_buy as account_localtax1, ctl2.accountancy_code_buy as account_localtax2"; $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn_det fd"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '".$idpays."'"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ctl1 ON fd.localtax1_tx = ctl1.localtax1 AND ctl1.fk_pays = '".$idpays."'"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ctl2 ON fd.localtax2_tx = ctl2.localtax2 AND ctl2.fk_pays = '".$idpays."'"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = fd.fk_product"; $sql.= " JOIN ".MAIN_DB_PREFIX."facture_fourn f ON f.rowid = fd.fk_facture_fourn"; $sql.= " JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid = f.fk_soc" ; @@ -120,6 +124,8 @@ if ($result) $tabht = array(); $tabtva = array(); $tabttc = array(); + $tablocaltax1 = array(); + $tablocaltax2 = array(); $tabcompany = array(); $i=0; @@ -135,6 +141,8 @@ if ($result) else $compta_prod = (! empty($conf->global->COMPTA_SERVICE_BUY_ACCOUNT)?$conf->global->COMPTA_SERVICE_BUY_ACCOUNT:$langs->trans("CodeNotDef")); } $compta_tva = (! empty($obj->account_tva)?$obj->account_tva:$cpttva); + $compta_localtax1 = (! empty($obj->account_localtax1)?$obj->account_localtax1:$langs->trans("CodeNotDef")); + $compta_localtax2 = (! empty($obj->account_localtax2)?$obj->account_localtax2:$langs->trans("CodeNotDef")); $tabfac[$obj->rowid]["date"] = $obj->datef; $tabfac[$obj->rowid]["ref"] = $obj->facnumber; @@ -143,6 +151,8 @@ if ($result) $tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc; $tabht[$obj->rowid][$compta_prod] += $obj->total_ht; $tabtva[$obj->rowid][$compta_tva] += $obj->total_tva; + $tablocaltax1[$obj->rowid][$compta_localtax1] += $obj->total_localtax1; + $tablocaltax2[$obj->rowid][$compta_localtax2] += $obj->total_localtax2; $tabcompany[$obj->rowid]=array('id'=>$obj->socid,'name'=>$obj->name); $i++; @@ -193,7 +203,6 @@ foreach ($tabfac as $key => $val) } } // vat - //var_dump($tabtva); foreach ($tabtva[$key] as $k => $mt) { if ($mt) @@ -202,12 +211,42 @@ foreach ($tabfac as $key => $val) //print "".$conf->global->COMPTA_JOURNAL_BUY.""; print "".$val["date"].""; print "".$invoicestatic->getNomUrl(1).""; - print "".$k."".$langs->trans("VAT")." ".$key.""; + print "".$k."".$langs->trans("VAT").""; print ''.($mt>=0?price($mt):'').""; print ''.($mt<0?price(-$mt):'').""; print ""; } } + // localtax1 + foreach ($tablocaltax1[$key] as $k => $mt) + { + if ($mt) + { + print ""; + //print "".$conf->global->COMPTA_JOURNAL_BUY.""; + print "".$val["date"].""; + print "".$invoicestatic->getNomUrl(1).""; + print "".$k."".$langs->transcountrynoentities("LT1",$mysoc->country_code).""; + print "".($mt>=0?price($mt):'').""; + print "".($mt<0?price(-$mt):'').""; + print ""; + } + } + // localtax2 + foreach ($tablocaltax2[$key] as $k => $mt) + { + if ($mt) + { + print ""; + //print "".$conf->global->COMPTA_JOURNAL_BUY.""; + print "".$val["date"].""; + print "".$invoicestatic->getNomUrl(1).""; + print "".$k."".$langs->transcountrynoentities("LT2",$mysoc->country_code).""; + print "".($mt>=0?price($mt):'').""; + print "".($mt<0?price(-$mt):'').""; + print ""; + } + } print ""; // third party //print "".$conf->global->COMPTA_JOURNAL_BUY.""; From e24fb9f48ab8f5824285474ec5414f7049ebc8f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Apr 2013 15:43:31 +0200 Subject: [PATCH 48/64] Removed all old code. All orignal code has been rewritten now. --- htdocs/opensurvey/adminstuds_preview.php | 29 ++- htdocs/opensurvey/public/studs.php | 274 +++++++++++++---------- 2 files changed, 175 insertions(+), 128 deletions(-) diff --git a/htdocs/opensurvey/adminstuds_preview.php b/htdocs/opensurvey/adminstuds_preview.php index d85dc37297b..c93221a2af2 100755 --- a/htdocs/opensurvey/adminstuds_preview.php +++ b/htdocs/opensurvey/adminstuds_preview.php @@ -39,7 +39,9 @@ $numsondageadmin=GETPOST("sondage"); $numsondage=substr($numsondageadmin, 0, 16); $object=new Opensurveysondage($db); -$object->fetch(0,$numsondageadmin); +$result=$object->fetch(0,$numsondage); +if ($result <= 0) dol_print_error('','Failed to get survey id '.$numsondage); + $nblignes=count($object->fetch_lines()); @@ -587,7 +589,7 @@ print ''; print '
'."\n"; print '
'."\n"; -//debut de l'affichage de résultats +// Start to show survey result print ''."\n"; //reformatage des données des sujets du sondage @@ -863,14 +865,14 @@ while ($compteur < $num) } } - //a la fin de chaque ligne se trouve les boutons modifier + // Button edit at end of line if ($compteur != $ligneamodifier) { print ''."\n"; } //demande de confirmation pour modification de ligne - for ($i = 0; $i < $nblignes; $i++) + for ($i=0; $i<$nblignes; $i++) { if (isset($_POST["modifierligne".$i])) { @@ -935,10 +937,12 @@ for ($i=0; $i < $nbcolonnes + 1; $i++) $nbofcheckbox++; if (isset($sumfor[$i])) { - if ($i == 0) { + if ($i == 0) + { $meilleurecolonne = $sumfor[$i]; } - if (isset($sumfor[$i]) && $sumfor[$i] > $meilleurecolonne){ + if (isset($sumfor[$i]) && $sumfor[$i] > $meilleurecolonne) + { $meilleurecolonne = $sumfor[$i]; } } @@ -1015,7 +1019,7 @@ $toutsujet = explode(",", $object->sujet); $compteursujet = 0; $meilleursujet = ''; for ($i = 0; $i < $nbcolonnes; $i++) { - if (isset($sumfor[$i]) === true && isset($meilleurecolonne) === true && $sumfor[$i] == $meilleurecolonne){ + if (isset($sumfor[$i]) === true && isset($meilleurecolonne) === true && $sumfor[$i] == $meilleurecolonne) { $meilleursujet.=", "; if ($object->format == "D" || $object->format == "D+") { @@ -1038,7 +1042,6 @@ for ($i = 0; $i < $nbcolonnes; $i++) { } } -//adaptation pour affichage des valeurs $meilleursujet = substr("$meilleursujet", 1); $meilleursujet = str_replace("°", "'", $meilleursujet); @@ -1046,18 +1049,20 @@ $meilleursujet = str_replace("°", "'", $meilleursujet); if ($nbofcheckbox >= 2) { $vote_str = $langs->trans('votes'); - print '

'."\n"; + print '

'."\n"; if (isset($meilleurecolonne) && $compteursujet == "1") { - print " " . $langs->trans('TheBestChoice') . " : $meilleursujet " . $langs->trans("with") . " $meilleurecolonne " . $vote_str . ".
\n"; + print " " . $langs->trans('TheBestChoice') . " : $meilleursujet " . $langs->trans("with") . " $meilleurecolonne " . $vote_str . ".\n"; } elseif (isset($meilleurecolonne)) { - print " " . $langs->trans('TheBestChoices') . " : $meilleursujet " . $langs->trans("with") . " $meilleurecolonne " . $vote_str . ".
\n"; + print " " . $langs->trans('TheBestChoices') . " : $meilleursujet " . $langs->trans("with") . " $meilleurecolonne " . $vote_str . ".\n"; } - print '


'."\n"; + print '


'."\n"; } print ''."\n"; +print ''."\n"; + llxFooterSurvey(); $db->close(); diff --git a/htdocs/opensurvey/public/studs.php b/htdocs/opensurvey/public/studs.php index 9a20b14031b..d1df65c8eea 100755 --- a/htdocs/opensurvey/public/studs.php +++ b/htdocs/opensurvey/public/studs.php @@ -51,15 +51,15 @@ $object=new Opensurveysondage($db); $result=$object->fetch(0,$numsondage); if ($result <= 0) dol_print_error('','Failed to get survey id '.$numsondage); - -$nbcolonnes = substr_count($object->sujet, ',') + 1; - +$nblignes=count($object->fetch_lines()); /* * Actions */ +$nbcolonnes = substr_count($object->sujet, ',') + 1; + $listofvoters=explode(',',$_SESSION["savevoter"]); // Add comment @@ -162,22 +162,22 @@ if (isset($_POST["boutonp"]) || isset($_POST["boutonp_x"])) // Update vote -$sql = 'SELECT * FROM '.MAIN_DB_PREFIX.'opensurvey_user_studs WHERE id_sondage='.$connect->Param('numsondage').' ORDER BY id_users'; -$sql = $connect->Prepare($sql); -$user_studs = $connect->Execute($sql, array($numsondage)); -$nblignes = $user_studs->RecordCount(); $testmodifier = false; +$testligneamodifier = false; $ligneamodifier = -1; for ($i=0; $i<$nblignes; $i++) { - if (isset($_POST['modifierligne'.$i])) { - $ligneamodifier = $i; + if (isset($_POST['modifierligne'.$i])) + { + $ligneamodifier=$i; + $testligneamodifier=true; } //test pour voir si une ligne est a modifier - if (isset($_POST['validermodifier'.$i])) { - $modifier = $i; - $testmodifier = true; + if (isset($_POST['validermodifier'.$i])) + { + $modifier=$i; + $testmodifier=true; } } @@ -200,33 +200,16 @@ if ($testmodifier) $nouveauchoix.="0"; } } + + $idtomodify=$_POST["idtomodify".$modifier]; + $sql = 'UPDATE '.MAIN_DB_PREFIX."opensurvey_user_studs"; + $sql.= " SET reponses = '".$db->escape($nouveauchoix)."'"; + $sql.= " WHERE id_users = '".$db->escape($idtomodify)."'"; - $compteur=0; - while ($data = $user_studs->FetchNextObject(false) ) - { - if ($compteur == $modifier) - { - $sql = 'UPDATE '.MAIN_DB_PREFIX."opensurvey_user_studs"; - $sql.= " SET reponses = '".$db->escape($nouveauchoix)."'"; - $sql.= " WHERE nom = '".$db->escape($data->nom)."' AND id_users = '".$db->escape($data->id_users)."'"; - $resql = $db->query($sql); - if ($resql <= 0) - { - dol_print_error($db); - exit; - } - - if ($object->mailsonde=="yes") - { - // TODO Use CMailFile - //$headers="From: ".NOMAPPLICATION." <".ADRESSEMAILADMIN.">\r\nContent-Type: text/plain; charset=\"UTF-8\"\nContent-Transfer-Encoding: 8bit"; - //mail ("$object->mail_admin", "[".NOMAPPLICATION."] " . _("Poll's participation") . " : $object->titre", "\"$data->nom\""."" . _("has filled a line.\nYou can find your poll at the link") . " :\n\n".getUrlSondage($numsondage)." \n\n" . _("Thanks for your confidence.") . "\n".NOMAPPLICATION,$headers); - } - } - - $compteur++; - } -} + dol_syslog("sql=".$sql); + $resql = $db->query($sql); + if (! $resql) dol_print_error($db); +} // Delete comment $idcomment=GETPOST('deletecomment','int'); @@ -245,30 +228,30 @@ if ($idcomment) $form=new Form($db); $object=new OpenSurveySondage($db); +$result=$object->fetch(0,$numsondage); +if ($result <= 0) +{ + print $langs->trans("ErrorRecordNotFound"); + llxFooterSurvey(); + exit; +} + $arrayofjs=array(); $arrayofcss=array('/opensurvey/css/style.css'); llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss); - -$res=$object->fetch(0,$numsondage); - -if ($res <= 0) -{ - print $langs->trans("ErrorPollDoesNotExists",$numsondage); - llxFooterSurvey(); - exit; -} + // Define format of choices $toutsujet=explode(",",$object->sujet); +$listofanswers=array(); +foreach ($toutsujet as $value) +{ + $tmp=explode('@',$value); + $listofanswers[]=array('label'=>$tmp[0],'format'=>($tmp[1]?$tmp[1]:'checkbox')); +} +$toutsujet=str_replace("@","
",$toutsujet); $toutsujet=str_replace("°","'",$toutsujet); -$listofanswers=array(); -foreach ($toutsujet as $value) -{ - $tmp=explode('@',$value); - $listofanswers[]=array('label'=>$tmp[0],'format'=>($tmp[1]?$tmp[1]:'checkbox')); -} - print '
'.$langs->trans("YouAreInivitedToVote").'
'; print $langs->trans("OpenSurveyHowTo").'

'; @@ -283,7 +266,8 @@ print ''.$titre.'
'."\n"; print $langs->trans("InitiatorOfPoll") .' : '.$object->nom_admin.'
'."\n"; //affichage des commentaires du sondage -if ($object->commentaires) { +if ($object->commentaires) +{ print '
'.$langs->trans("Description") .' :
'."\n"; $commentaires=dol_nl2br($object->commentaires); print $commentaires; @@ -294,19 +278,14 @@ print ''."\n"; print ''."\n"; print ''; -// Todo : add CSRF protection + print '
'."\n"; print '

'."\n"; -// Debut de l'affichage des resultats du sondage +// Start to show survey result print '
'."\n"; -//recuperation des utilisateurs du sondage -$sql = 'SELECT * FROM '.MAIN_DB_PREFIX.'opensurvey_user_studs WHERE id_sondage='.$connect->Param('numsondage').' ORDER BY id_users'; -$sql = $connect->Prepare($sql); -$user_studs = $connect->Execute($sql, array($numsondage)); - -//si le sondage est un sondage de date +// Show choice titles if ($object->format=="D"||$object->format=="D+") { //affichage des sujets du sondage @@ -410,15 +389,22 @@ else $sumfor = array(); $sumagainst = array(); $compteur = 0; - -$sql = 'SELECT * FROM '.MAIN_DB_PREFIX.'opensurvey_user_studs WHERE id_sondage='.$connect->Param('numsondage').' ORDER BY id_users'; -$sql = $connect->Prepare($sql); -$user_studs = $connect->Execute($sql, array($numsondage)); - -while ($data = $user_studs->FetchNextObject(false)) +$sql ="SELECT id_users, nom, id_sondage, reponses"; +$sql.=" FROM ".MAIN_DB_PREFIX."opensurvey_user_studs"; +$sql.=" WHERE id_sondage = '".$db->escape($numsondage)."'"; +dol_syslog('sql='.$sql); +$resql=$db->query($sql); +if (! $resql) { - $ensemblereponses = $data->reponses; - $nombase=str_replace("°","'",$data->nom); + dol_print_error($db); + exit; +} +$num=$db->num_rows($resql); +while ($compteur < $num) +{ + $obj=$db->fetch_object($resql); + + $ensemblereponses = $obj->reponses; print ''."\n"; @@ -426,41 +412,23 @@ while ($data = $user_studs->FetchNextObject(false)) $mod_ok = ($object->canedit || (! empty($nombase) && in_array($nombase, $listofvoters))); // Name + $nombase=str_replace("°","'",$obj->nom); print ''."\n"; - // pour chaque colonne - for ($i=0; $i < $nbcolonnes; $i++) + // si la ligne n'est pas a changer, on affiche les données + if (! $testligneamodifier) { - $car = substr($ensemblereponses, $i, 1); - if ($compteur == $ligneamodifier) - { - print ''."\n"; - } - else + for ($i = 0; $i < $nbcolonnes; $i++) { + $car = substr($ensemblereponses, $i, 1); + //print 'xx'.$i."-".$car.'-'.$listofanswers[$i]['format'].'zz'; + if (empty($listofanswers[$i]['format']) || ! in_array($listofanswers[$i]['format'],array('yesno','foragainst'))) { if (((string) $car) == "1") print ''."\n"; else print ''."\n"; // Total - if (isset($sumfor[$i]) === false) $sumfor[$i] = 0; + if (! isset($sumfor[$i])) $sumfor[$i] = 0; if (((string) $car) == "1") $sumfor[$i]++; } if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'yesno') @@ -476,9 +444,9 @@ while ($data = $user_studs->FetchNextObject(false)) } if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'foragainst') { - if (((string) $car) == "1") print ''."\n"; + if (((string) $car) == "1") print ''."\n"; else if (((string) $car) == "0") print ''."\n"; - else print ''."\n"; + else print ''."\n"; // Total if (! isset($sumfor[$i])) $sumfor[$i] = 0; if (! isset($sumagainst[$i])) $sumagainst[$i] = 0; @@ -487,18 +455,90 @@ while ($data = $user_studs->FetchNextObject(false)) } } } + else + { + //sinon on remplace les choix de l'utilisateur par une ligne de checkbox pour recuperer de nouvelles valeurs + if ($compteur == $ligneamodifier) + { + for ($i = 0; $i < $nbcolonnes; $i++) + { + $car = substr($ensemblereponses, $i, 1); + print ''."\n"; + } + } + else + { + for ($i = 0; $i < $nbcolonnes; $i++) + { + $car = substr($ensemblereponses, $i, 1); + if (empty($listofanswers[$i]['format']) || ! in_array($listofanswers[$i]['format'],array('yesno','foragainst'))) + { + if (((string) $car) == "1") print ''."\n"; + else print ''."\n"; + // Total + if (! isset($sumfor[$i])) $sumfor[$i] = 0; + if (((string) $car) == "1") $sumfor[$i]++; + } + if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'yesno') + { + if (((string) $car) == "1") print ''."\n"; + else if (((string) $car) == "0") print ''."\n"; + else print ''."\n"; + // Total + if (! isset($sumfor[$i])) $sumfor[$i] = 0; + if (! isset($sumagainst[$i])) $sumagainst[$i] = 0; + if (((string) $car) == "1") $sumfor[$i]++; + if (((string) $car) == "0") $sumagainst[$i]++; + } + if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'foragainst') + { + if (((string) $car) == "1") print ''."\n"; + else if (((string) $car) == "0") print ''."\n"; + else print ''."\n"; + // Total + if (! isset($sumfor[$i])) $sumfor[$i] = 0; + if (! isset($sumagainst[$i])) $sumagainst[$i] = 0; + if (((string) $car) == "1") $sumfor[$i]++; + if (((string) $car) == "0") $sumagainst[$i]++; + } + } + } + } - // Button edit at end of line + // Button edit at end of line if ($compteur != $ligneamodifier && $mod_ok) { print ''."\n"; } //demande de confirmation pour modification de ligne - for ($i=0;$i<$nblignes;$i++) { - if (isset($_POST["modifierligne$i"])) { - if ($compteur == $i) { - print ''."\n"; + for ($i=0; $i<$nblignes; $i++) + { + if (isset($_POST["modifierligne".$i])) + { + if ($compteur == $i) + { + print ''."\n"; } } } @@ -547,7 +587,7 @@ if ($ligneamodifier < 0 && (! isset($_SESSION['nom']))) } // Affichage du bouton de formulaire pour inscrire un nouvel utilisateur dans la base - print ''."\n"; + print ''."\n"; print ''."\n"; } @@ -555,7 +595,7 @@ if ($ligneamodifier < 0 && (! isset($_SESSION['nom']))) $nbofcheckbox=0; for ($i=0; $i < $nbcolonnes; $i++) { - if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] != 'checkbox') continue; + if (empty($listofanswers[$i]['format']) || ! in_array($listofanswers[$i]['format'],array('yesno','foragainst'))) $nbofcheckbox++; if (isset($sumfor[$i])) { @@ -571,7 +611,7 @@ for ($i=0; $i < $nbcolonnes; $i++) } // Show line total -print ''."\n"; +print ''."\n"; print ''."\n"; for ($i = 0; $i < $nbcolonnes; $i++) { @@ -587,7 +627,7 @@ for ($i = 0; $i < $nbcolonnes; $i++) print ''."\n"; } print ''; -// Show picto winnner +// Show picto winner if ($nbofcheckbox >= 2) { print ''."\n"; @@ -595,7 +635,7 @@ if ($nbofcheckbox >= 2) for ($i=0; $i < $nbcolonnes; $i++) { //print 'xx'.(! empty($listofanswers[$i]['format'])).'-'.$sumfor[$i].'-'.$meilleurecolonne; - if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'checkbox' && isset($sumfor[$i]) && isset($meilleurecolonne) && $sumfor[$i] == $meilleurecolonne) + if (empty($listofanswers[$i]['format']) || ! in_array($listofanswers[$i]['format'],array('yesno','foragainst')) && isset($sumfor[$i]) && isset($meilleurecolonne) && $sumfor[$i] == $meilleurecolonne) { print ''."\n"; } else { @@ -625,7 +665,9 @@ for ($i = 0; $i < $nbcolonnes; $i++) { } else { $meilleursujet .= dol_print_date($toutsujet[$i],'daytext'). ' ('.dol_print_date($toutsujet[$i],'%A').')'; } - } else { + } + else + { $tmps=explode('@',$toutsujet[$i]); $meilleursujet .= $tmps[0]; } @@ -644,13 +686,13 @@ if ($nbofcheckbox >= 2) $vote_str = $langs->trans('votes'); print '

'."\n"; - if ($compteursujet == "1" && isset($meilleurecolonne)) { - print 'Meilleur choix ' . $langs->trans('TheBestChoice') . ": $meilleursujet " . $langs->trans('with') . " $meilleurecolonne " . $vote_str . ".\n"; + if (isset($meilleurecolonne) && $compteursujet == "1") { + print ' ' . $langs->trans('TheBestChoice') . ": $meilleursujet " . $langs->trans('with') . " $meilleurecolonne " . $vote_str . ".\n"; } elseif (isset($meilleurecolonne)) { - print 'Meilleur choix ' . $langs->trans('TheBestChoices') . ": $meilleursujet " . $langs->trans('with') . " $meilleurecolonne " . $vote_str . ".\n"; + print ' ' . $langs->trans('TheBestChoices') . ": $meilleursujet " . $langs->trans('with') . " $meilleurecolonne " . $vote_str . ".\n"; } - print '


'; + print '


'."\n"; } print '
'; @@ -685,8 +727,8 @@ print $langs->trans("Name") .' : '; print '   '."\n"; print '
'."\n"; print ''."\n"; -// Focus javascript sur la case de texte du formulaire -print ''."\n"; + +print ''."\n"; // div add comment print '

'; From 404ad184253b0f7a14be31ac2f6fb26dd67766bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 13 Apr 2013 16:04:51 +0200 Subject: [PATCH 49/64] Added missing translation --- htdocs/langs/en_US/bills.lang | 1 + htdocs/langs/es_ES/bills.lang | 1 + htdocs/langs/fr_FR/bills.lang | 1 + 3 files changed, 3 insertions(+) diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 78179acd8c9..c6c4aabf708 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -189,6 +189,7 @@ Abandoned=Abandoned RemainderToPay=Remainder to pay RemainderToTake=Remainder to take RemainderToPayBack=Remainder to pay back +Rest=Pending AmountExpected=Amount claimed ExcessReceived=Excess received EscompteOffered=Discount offered (payment before term) diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index e72c4637fd4..21b61974c6a 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -184,6 +184,7 @@ Abandoned=Abandonada RemainderToPay=Queda por pagar RemainderToTake=Queda por cobrar RemainderToPayBack=Queda por reembolsar +Rest=Pendiente AmountExpected=Importe reclamado ExcessReceived=Recibido en exceso EscompteOffered=Descuento (Pronto pago) diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 237dcedda8b..02789aa3402 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -184,6 +184,7 @@ Abandoned=Abandonné RemainderToPay=Reste à payer RemainderToTake=Reste à encaisser RemainderToPayBack=Reste à rembourser +Rest=Créance AmountExpected=Montant réclamé ExcessReceived=Trop perçu EscompteOffered=Escompte (règlement avant échéance) From 20c93706900dcd0a9735881623ffc4b05fa68c79 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Apr 2013 16:23:05 +0200 Subject: [PATCH 50/64] New: Support the mode readonly of ckeditor --- htdocs/comm/mailing/fiche.php | 4 ++-- htdocs/core/class/doleditor.class.php | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 954dad26cee..1129d33605c 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -1004,7 +1004,7 @@ else { // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('body',$object->body,'',320,'dolibarr_readonly','',false,true,empty($conf->global->FCKEDITOR_ENABLE_MAILING)?0:1,20,70); + $doleditor=new DolEditor('body',$object->body,'',320,'dolibarr_readonly','',false,true,empty($conf->global->FCKEDITOR_ENABLE_MAILING)?0:1,20,120,1); $doleditor->Create(); } else print dol_htmlentitiesbr($object->body); @@ -1130,7 +1130,7 @@ else print ''; diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index f608d293ee2..40bfa0ef585 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -42,6 +42,7 @@ class DolEditor var $cols; var $height; var $width; + var $readonly; /** @@ -60,8 +61,9 @@ class DolEditor * @param int $okforextendededitor True=Allow usage of extended editor tool (like fckeditor) * @param int $rows Size of rows for textarea tool * @param int $cols Size of cols for textarea tool + * @param int $readOnly 0=Read/Edit, 1=Read only */ - function __construct($htmlname,$content,$width='',$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextendededitor=true,$rows=0,$cols=0) + function __construct($htmlname,$content,$width='',$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextendededitor=true,$rows=0,$cols=0,$readonly=0) { global $conf,$langs; @@ -75,6 +77,7 @@ class DolEditor $defaulteditor='ckeditor'; $this->tool=empty($conf->global->FCKEDITOR_EDITORNAME)?$defaulteditor:$conf->global->FCKEDITOR_EDITORNAME; $this->uselocalbrowser=$uselocalbrowser; + $this->readonly=$readonly; // Check if extended editor is ok. If not we force textarea if (empty($conf->fckeditor->enabled) || ! $okforextendededitor) $this->tool = 'textarea'; @@ -156,6 +159,7 @@ class DolEditor if (in_array($this->tool,array('textarea','ckeditor'))) { $found=1; + //$out.= ''; @@ -177,7 +181,9 @@ class DolEditor /* should be editor=CKEDITOR.replace but what if serveral editors ? */ CKEDITOR.replace(\''.$this->htmlname.'\', { + /* property:xxx is same than CKEDITOR.config.property = xxx */ customConfig : ckeditorConfig, + readOnly : '.($this->readonly?'true':'false').', htmlEncodeOutput :'.$htmlencode_force.', toolbar: \''.$this->toolbarname.'\', toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').', From 8a88b130b4379b6aeb68cd2584263551722ef7e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Apr 2013 16:31:25 +0200 Subject: [PATCH 51/64] Fix: Bad label shown --- htdocs/opensurvey/public/studs.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/opensurvey/public/studs.php b/htdocs/opensurvey/public/studs.php index d1df65c8eea..e2fc682553e 100755 --- a/htdocs/opensurvey/public/studs.php +++ b/htdocs/opensurvey/public/studs.php @@ -249,7 +249,6 @@ foreach ($toutsujet as $value) $tmp=explode('@',$value); $listofanswers[]=array('label'=>$tmp[0],'format'=>($tmp[1]?$tmp[1]:'checkbox')); } -$toutsujet=str_replace("@","
",$toutsujet); $toutsujet=str_replace("°","'",$toutsujet); @@ -369,8 +368,6 @@ if ($object->format=="D"||$object->format=="D+") } else { - $toutsujet=str_replace("°","'",$toutsujet); - //affichage des sujets du sondage print '
'."\n"; print ''."\n"; From 85866ff9a645a7125b947bd4bda312f72b3c03b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 13 Apr 2013 17:10:07 +0200 Subject: [PATCH 52/64] Revert "Added missing translation" This reverts commit 404ad184253b0f7a14be31ac2f6fb26dd67766bc. --- htdocs/langs/en_US/bills.lang | 1 - htdocs/langs/es_ES/bills.lang | 1 - htdocs/langs/fr_FR/bills.lang | 1 - 3 files changed, 3 deletions(-) diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index c6c4aabf708..78179acd8c9 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -189,7 +189,6 @@ Abandoned=Abandoned RemainderToPay=Remainder to pay RemainderToTake=Remainder to take RemainderToPayBack=Remainder to pay back -Rest=Pending AmountExpected=Amount claimed ExcessReceived=Excess received EscompteOffered=Discount offered (payment before term) diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index 21b61974c6a..e72c4637fd4 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -184,7 +184,6 @@ Abandoned=Abandonada RemainderToPay=Queda por pagar RemainderToTake=Queda por cobrar RemainderToPayBack=Queda por reembolsar -Rest=Pendiente AmountExpected=Importe reclamado ExcessReceived=Recibido en exceso EscompteOffered=Descuento (Pronto pago) diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 02789aa3402..237dcedda8b 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -184,7 +184,6 @@ Abandoned=Abandonné RemainderToPay=Reste à payer RemainderToTake=Reste à encaisser RemainderToPayBack=Reste à rembourser -Rest=Créance AmountExpected=Montant réclamé ExcessReceived=Trop perçu EscompteOffered=Escompte (règlement avant échéance) From 580881c205080fec5447039d91726a209597fa43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 13 Apr 2013 17:12:16 +0200 Subject: [PATCH 53/64] Replaced `Rest` not translated string with `AlreadyPaid` --- htdocs/compta/facture/impayees.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 5737c9bb99a..0b5fe8f410e 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -130,18 +130,18 @@ if ($action == "builddoc" && $user->rights->facture->lire) } // Remove file -if ($action == 'remove_file') -{ - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - $langs->load("other"); - $upload_dir = $diroutputpdf; +if ($action == 'remove_file') +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $langs->load("other"); + $upload_dir = $diroutputpdf; $file = $upload_dir . '/' . GETPOST('file'); - $ret=dol_delete_file($file,0,0,0,''); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); - $action=''; -} + $ret=dol_delete_file($file,0,0,0,''); + if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); + else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); + $action=''; +} @@ -283,7 +283,7 @@ if ($resql) print_liste_field_titre($langs->trans("AmountVAT"),$_SERVER["PHP_SELF"],"f.tva","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Received"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Rest"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("AlreadyPaid"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye,am","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Merge"),$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder); print "\n"; From a6ed2551fbb44b1a23f8da989a08d988730c0385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 13 Apr 2013 17:13:59 +0200 Subject: [PATCH 54/64] Revert "Replaced `Rest` not translated string with `AlreadyPaid`" This reverts commit 580881c205080fec5447039d91726a209597fa43. --- htdocs/compta/facture/impayees.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 0b5fe8f410e..5737c9bb99a 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -130,18 +130,18 @@ if ($action == "builddoc" && $user->rights->facture->lire) } // Remove file -if ($action == 'remove_file') -{ - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - $langs->load("other"); - $upload_dir = $diroutputpdf; +if ($action == 'remove_file') +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $langs->load("other"); + $upload_dir = $diroutputpdf; $file = $upload_dir . '/' . GETPOST('file'); - $ret=dol_delete_file($file,0,0,0,''); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); - $action=''; -} + $ret=dol_delete_file($file,0,0,0,''); + if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); + else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); + $action=''; +} @@ -283,7 +283,7 @@ if ($resql) print_liste_field_titre($langs->trans("AmountVAT"),$_SERVER["PHP_SELF"],"f.tva","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Received"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AlreadyPaid"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Rest"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye,am","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Merge"),$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder); print "\n"; From 418921f360e88299285bae6bb6ac11db80ec5ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 13 Apr 2013 17:14:06 +0200 Subject: [PATCH 55/64] Revert "Revert "Added missing translation"" This reverts commit 85866ff9a645a7125b947bd4bda312f72b3c03b3. --- htdocs/langs/en_US/bills.lang | 1 + htdocs/langs/es_ES/bills.lang | 1 + htdocs/langs/fr_FR/bills.lang | 1 + 3 files changed, 3 insertions(+) diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 78179acd8c9..c6c4aabf708 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -189,6 +189,7 @@ Abandoned=Abandoned RemainderToPay=Remainder to pay RemainderToTake=Remainder to take RemainderToPayBack=Remainder to pay back +Rest=Pending AmountExpected=Amount claimed ExcessReceived=Excess received EscompteOffered=Discount offered (payment before term) diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index e72c4637fd4..21b61974c6a 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -184,6 +184,7 @@ Abandoned=Abandonada RemainderToPay=Queda por pagar RemainderToTake=Queda por cobrar RemainderToPayBack=Queda por reembolsar +Rest=Pendiente AmountExpected=Importe reclamado ExcessReceived=Recibido en exceso EscompteOffered=Descuento (Pronto pago) diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 237dcedda8b..02789aa3402 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -184,6 +184,7 @@ Abandoned=Abandonné RemainderToPay=Reste à payer RemainderToTake=Reste à encaisser RemainderToPayBack=Reste à rembourser +Rest=Créance AmountExpected=Montant réclamé ExcessReceived=Trop perçu EscompteOffered=Escompte (règlement avant échéance) From 7c4b901b0a7098e74e487fa3837f3d2310723fcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 13 Apr 2013 17:45:41 +0200 Subject: [PATCH 56/64] Improved es_ES translations and replaced missing translation --- htdocs/compta/facture.php | 2 +- htdocs/langs/es_ES/bills.lang | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 66d78e66b9a..32505622a85 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2789,7 +2789,7 @@ else if ($id > 0 || ! empty($ref)) if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'discount_vat') { print ''; $resteapayeraffiche=0; } diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index 21b61974c6a..2ac03e256db 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -103,17 +103,17 @@ BillStatusValidated=Validada (a pagar) BillStatusStarted=Pagada parcialmente BillStatusNotPaid=Pendiente de pago BillStatusClosedUnpaid=Cerrada (pendiente de pago) -BillStatusClosedPaidPartially=Pagada (parcialmente) +BillStatusClosedPaidPartially=Cerrada (pagada parcialmente) BillShortStatusDraft=Borrador BillShortStatusPaid=Pagada BillShortStatusPaidBackOrConverted=Procesada BillShortStatusConverted=Tratada BillShortStatusCanceled=Abandonada BillShortStatusValidated=Validada -BillShortStatusStarted=Empezada -BillShortStatusNotPaid=Pendiente de cobro -BillShortStatusClosedUnpaid=Cerrada -BillShortStatusClosedPaidPartially=Pagada +BillShortStatusStarted=Pago parcial +BillShortStatusNotPaid=Pte. pago +BillShortStatusClosedUnpaid=Cerrada (pte. pago) +BillShortStatusClosedPaidPartially=Cerrada (pago parcial) PaymentStatusToValidShort=A validar ErrorVATIntraNotConfigured=Número de IVA intracomunitario aún no configurado ErrorNoPaiementModeConfigured=No hay definido modo de pago por defecto. Corregir desde el módulo factura From 1a1e09a5ed2a93daccb2da9f80e0a32995941d7b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Apr 2013 18:33:23 +0200 Subject: [PATCH 57/64] Qual: Clean and mutualize code. --- htdocs/core/tpl/login.tpl.php | 82 +++------------------ htdocs/core/tpl/passwordforgotten.tpl.php | 86 +++-------------------- 2 files changed, 18 insertions(+), 150 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 51d4f737899..8717225cd3f 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -14,90 +14,24 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ header('Cache-Control: Public, must-revalidate'); header("Content-type: text/html; charset=".$conf->file->character_set_client); +if (GETPOST('dol_hide_topmenu')) $conf->dol_use_jmobile=1; +if (GETPOST('dol_hide_leftmenu')) $conf->dol_hide_leftmenu=1; +if (GETPOST('dol_optimize_smallscreen')) $conf->dol_optimize_smallscreen=1; +if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover=1; +if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile=1; + +$arrayofjs=array('/core/js/dst.js'); // Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second +print top_htmlhead('',$langs->trans('Login').' '.$title,0,0,$arrayofjs); ?> - - - - - - - -'.$langs->trans('Login').' '.$title.''."\n"; -print ''."\n"; -$jquerytheme = 'smoothness'; -if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME; -if (constant('JS_JQUERY_UI')) print ''."\n"; // JQuery -else print ''."\n"; // JQuery -print ''."\n"; // Tooltip -print ''."\n"; // JNotify -// jQuery jMobile -if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || GETPOST('dol_use_jmobile')) -{ - print ''."\n"; -} -print ''."\n"; -// Includes CSS for Dolibarr theme -$themepath=dol_buildpath((empty($conf->global->MAIN_FORCETHEMEDIR)?'':$conf->global->MAIN_FORCETHEMEDIR).$conf->css,1); -$themesubdir=''; -if (! empty($conf->modules_parts['theme'])) // This slow down -{ - foreach($conf->modules_parts['theme'] as $reldir) - { - if (file_exists(dol_buildpath($reldir.$conf->css, 0))) - { - $themepath=dol_buildpath($reldir.$conf->css, 1); - $themesubdir=$reldir; - break; - } - } -} -// CSS forced by modules (relative url starting with /) -if (isset($conf->modules_parts['css'])) -{ - $arraycss=(array) $conf->modules_parts['css']; - foreach($arraycss as $modcss => $filescss) - { - $filescss=(array) $filescss; // To be sure filecss is an array - foreach($filescss as $cssfile) - { - // cssfile is a relative path - print ''."\n"; - } - } -} -if (! empty($conf_css)) print ''."\n"; - -// JQuery. Must be before other js includes -$ext='.js'; -print ''."\n"; -if (constant('JS_JQUERY')) print ''."\n"; -else print ''."\n"; -print ''."\n"; -// jQuery jMobile -if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || GETPOST('dol_use_jmobile')) -{ - print ''."\n"; -} -if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER; -print ' -'; - -?> - '."\n"; -else print ''."\n"; -print ''."\n"; -// jQuery jMobile -if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || GETPOST('dol_use_jmobile')) -{ - print ''."\n"; -} -if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER; -print ' -'; - -?> @@ -146,7 +80,7 @@ if (! empty($hookmanager->resArray['options'])) { - + '; print ''; + + // Approved by print ''; print ''; - // Liste des utiliseurs du groupes choisi dans la config - $idGroupValid = $cp->getConfCP('userGroup'); - - $validator = new UserGroup($db, $idGroupValid); - $valideurarray = $validator->listUsersForGroup(); - + // Liste des utiliseurs du groupe choisi dans la config + $validator = new UserGroup($db); + $excludefilter=$user->admin?'':'u.rowid <> '.$user->id; + $valideurobjects = $validator->listUsersForGroup($excludefilter); + $valideurarray = array(); + foreach($valideurobjects as $val) $valideurarray[$val->id]=$val->id; print ''; print ''; + + // Description print ''; print ''; print ''; print ''; + print ''; print '
'.$nombase.''; - if (empty($listofanswers[$i]['format']) || ! in_array($listofanswers[$i]['format'],array('yesno','foragainst'))) - { - print ''; - } - if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'yesno') - { - $arraychoice=array('2'=>' ','0'=>$langs->trans("No"),'1'=>$langs->trans("Yes")); - print $form->selectarray("choix".$i, $arraychoice, $car); - } - if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'foragainst') - { - $arraychoice=array('2'=>' ','0'=>$langs->trans("Against"),'1'=>$langs->trans("For")); - print $form->selectarray("choix".$i, $arraychoice, $car); - } - print 'OKKO'.$langs->trans("For").''.$langs->trans("For").''.$langs->trans("Against").'  '; + if (empty($listofanswers[$i]['format']) || ! in_array($listofanswers[$i]['format'],array('yesno','foragainst'))) + { + print ''; + } + if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'yesno') + { + $arraychoice=array('2'=>' ','0'=>$langs->trans("No"),'1'=>$langs->trans("Yes")); + print $form->selectarray("choix".$i, $arraychoice, $car); + } + if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'foragainst') + { + $arraychoice=array('2'=>' ','0'=>$langs->trans("Against"),'1'=>$langs->trans("For")); + print $form->selectarray("choix".$i, $arraychoice, $car); + } + print 'OKKO'.$langs->trans("For").''.$langs->trans("Against").' '.$langs->trans("For").''.$langs->trans("Against").' '; + print ''; + print ''; + print '
'. $langs->trans("Total") .'
'; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('body',$object->body,'',320,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,70); + $doleditor=new DolEditor('body',$object->body,'',320,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,120); $doleditor->Create(); print '
'; - print $form->textwithpicto($langs->trans("Escompte").':',$langs->trans("HelpEscompte"),-1); + print $form->textwithpicto($langs->trans("Discount").':',$langs->trans("HelpEscompte"),-1); print ''.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).' 
trans('SecurityCode'); ?>
@@ -182,8 +116,8 @@ if (! empty($hookmanager->resArray['options'])) { if (! empty($conf->dol_hide_leftmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu; if (! empty($conf->dol_no_mouse_hover)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover; if (! empty($conf->dol_use_jmobile)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$conf->dol_use_jmobile; - - print '('.$langs->trans('BackToLoginPage').')'; + + print '('.$langs->trans('BackToLoginPage').')'; ?> From 355168527d5602ff0c19c70576327731fed5c8ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Apr 2013 18:41:43 +0200 Subject: [PATCH 58/64] Look: Optimize for smartphone --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 81a04269604..71541ab4a5d 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -396,7 +396,7 @@ class FormFile if (! empty($modellist)) { $out.= ''; $var=true; -$var=!$var; +/*$var=!$var; print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; +*/ $var=!$var; print ''."\n"; @@ -312,18 +313,6 @@ print ''." print ''."\n"; print ''."\n"; -$var=!$var; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; - -$var=!$var; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; - print ''."\n"; print ''."\n"; @@ -332,7 +321,17 @@ print ''."\n\n"; dol_fiche_end(); -print '
'; + +/*$var=!$var; +print $langs->trans('nbUserCP').': '."\n"; +print $cp->getConfCP('nbUser')."
\n"; +*/ + +$var=!$var; +print $langs->trans('LastUpdateCP').': '."\n"; +print dol_print_date($db->jdate($cp->getConfCP('lastUpdate')),'dayhour','tzuser')."
\n"; + +print '
'; print_fiche_titre($langs->trans('TitleOptionEventCP'),'',''); diff --git a/htdocs/holiday/common.inc.php b/htdocs/holiday/common.inc.php index 133177df614..072b4818be6 100644 --- a/htdocs/holiday/common.inc.php +++ b/htdocs/holiday/common.inc.php @@ -23,7 +23,7 @@ * \brief Common load of data */ -require_once realpath(dirname(__FILE__)) . '/../main.inc.php'; +require_once realpath(dirname(__FILE__)).'/../main.inc.php'; if (! class_exists('Holiday')) { require DOL_DOCUMENT_ROOT. '/holiday/class/holiday.class.php'; } @@ -43,7 +43,7 @@ if (empty($conf->holiday->enabled)) } -$sql = "SELECT value"; +/*$sql = "SELECT value"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday_config"; $sql.= " WHERE name = 'userGroup'"; @@ -63,5 +63,6 @@ if ($obj->value == null || $obj->value < 0) llxFooter(); exit(); } +*/ ?> diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index 518a83908c4..fc45819a018 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -702,24 +702,29 @@ if (empty($id) || $action == 'add' || $action == 'request') print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday')?GETPOST('endhalfday'):'afternoon')); print '
'.$langs->trans("ValidateByCP").''; - print $form->select_dolusers($validator->id, "valideur", 1, "", 0, $valideurarray); + print $form->select_dolusers($user->fk_user, "valideur", 1, "", 0, $valideurarray); // By default, hierarchical parent print '
'.$langs->trans("DescCP").''; print ''; print '
'; print '
'; diff --git a/htdocs/index.php b/htdocs/index.php index 8c2f009cb4a..29c9ccfb4de 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -166,8 +166,8 @@ if ($user->societe_id == 0) 'bill', 'order'); // Translation keyword - $titres=array("Customers", - "Prospects", + $titres=array("ThirdPartyCustomersStats", + "ThirdPartyProspectsStats", "Suppliers", "Members", "Products", diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 0ae15edba41..56238311a27 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -37,7 +37,9 @@ ThirdParty=Third party ThirdParties=Third parties ThirdPartyAll=Third parties (all) ThirdPartyProspects=Prospects +ThirdPartyProspectsStats=Prospects ThirdPartyCustomers=Customers +ThirdPartyCustomersStats=Customers ThirdPartyCustomersWithIdProf12=Customers with %s or %s ThirdPartySuppliers=Suppliers ThirdPartyType=Third party type diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index abf2b1dc514..9c4c2dc0187 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -99,6 +99,7 @@ ErrorUpdateConfCP=An error occurred during the update, please try again. AddCPforUsers=Please add the balance of holidays of users by clicking here. DelayForSubmitCP=Deadline to apply for holidays AlertapprobatortorDelayCP=Prevent the approbator if the holiday request does not match the deadline +AlertValidatorDelayCP=Préevent the approbator if the holiday request exceed delay AlertValidorSoldeCP=Prevent the approbator if the holiday request exceed the balance nbUserCP=Number of users supported in the module holidays nbHolidayDeductedCP=Number of holidays to be deducted per day of holiday taken diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index 99612d8ec2d..78db7f02ad4 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -39,7 +39,9 @@ ThirdParty=Tiers ThirdParties=Tiers ThirdPartyAll=Tiers (tous) ThirdPartyProspects=Prospects +ThirdPartyProspectsStats=Prospects ThirdPartyCustomers=Clients +ThirdPartyCustomersStats=Clients ThirdPartyCustomersWithIdProf12=Clients avec %s ou %s ThirdPartySuppliers=Fournisseurs ThirdPartyType=Type du tiers diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index ae6867be12d..eb22a97a41b 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -757,8 +757,8 @@ else print ''.$langs->trans('ProspectCustomer').''; @@ -1156,8 +1156,8 @@ else // Prospect/Customer print ''.$langs->trans('ProspectCustomer').''; print ''.$langs->trans('CustomerCode').''; diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index ef554f85d2c..69d7855b8d3 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -176,19 +176,22 @@ class UserGroup extends CommonObject /** * Return array of users id for group * - * @return array of users + * @param string $excludefilter Filter to exclude + * @return array Array of users */ - function listUsersForGroup() + function listUsersForGroup($excludefilter='') { global $conf, $user; $ret=array(); - $sql = "SELECT u.rowid, ug.entity as usergroup_entity"; - $sql.= " FROM ".MAIN_DB_PREFIX."user as u,"; - $sql.= " ".MAIN_DB_PREFIX."usergroup_user as ug"; - $sql.= " WHERE ug.fk_user = u.rowid"; - $sql.= " AND ug.fk_usergroup = ".$this->id; + $sql = "SELECT u.rowid"; + if (! empty($this->id)) $sql.= ", ug.entity as usergroup_entity"; + $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; + if (! empty($this->id)) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; + $sql.= " WHERE 1 = 1"; + if (! empty($this->id)) $sql.= " AND ug.fk_user = u.rowid"; + if (! empty($this->id)) $sql.= " AND ug.fk_usergroup = ".$this->id; if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity) { $sql.= " AND u.entity IS NOT NULL"; @@ -197,12 +200,13 @@ class UserGroup extends CommonObject { $sql.= " AND u.entity IN (0,".$conf->entity.")"; } + if (! empty($excludefilter)) $sql.=' AND ('.$excludefilter.')'; dol_syslog(get_class($this)."::listUsersForGroup sql=".$sql,LOG_DEBUG); - $result = $this->db->query($sql); - if ($result) + $resql = $this->db->query($sql); + if ($resql) { - while ($obj = $this->db->fetch_object($result)) + while ($obj = $this->db->fetch_object($resql)) { if (! array_key_exists($obj->rowid, $ret)) { @@ -214,7 +218,7 @@ class UserGroup extends CommonObject $ret[$obj->rowid]->usergroup_entity[]=$obj->usergroup_entity; } - $this->db->free($result); + $this->db->free($resql); return $ret; } From 2f5709e3cbb9f3651e6f07051983b487f29d08c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Apr 2013 01:21:54 +0200 Subject: [PATCH 61/64] Fix: Some fix into holiday module --- htdocs/holiday/fiche.php | 55 +++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 32 deletions(-) diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index fc45819a018..2280fe8b970 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -236,13 +236,15 @@ if ($action == 'confirm_delete' && $_GET['confirm'] == 'yes') if($user->rights->holiday->delete) { $cp = new Holiday($db); - $cp->fetch($_GET['id']); + $cp->fetch($id); // Si c'est bien un brouillon - if($cp->statut == 1) { + if ($cp->statut == 1) + { // Si l'utilisateur à le droit de lire cette demande, il peut la supprimer - if($user->id == $cp->fk_user || $user->rights->holiday->lire_tous) { - $cp->delete($_GET['id']); + if ($user->id == $cp->fk_user || $user->rights->holiday->lire_tous) + { + $cp->delete($id); header('Location: index.php'); exit; } @@ -257,12 +259,10 @@ if ($action == 'confirm_delete' && $_GET['confirm'] == 'yes') if ($action == 'confirm_send') { $cp = new Holiday($db); - $cp->fetch($_GET['id']); - - $userID = $user->id; + $cp->fetch($id); // Si brouillon et créateur - if($cp->statut == 1 && $userID == $cp->fk_user) + if($cp->statut == 1 && $user->id == $cp->fk_user) { $cp->statut = 2; @@ -351,12 +351,10 @@ if ($action == 'confirm_send') if($action == 'confirm_valid') { $cp = new Holiday($db); - $cp->fetch($_GET['id']); - - $userID = $user->id; + $cp->fetch($id); // Si statut en attente de validation et valideur = utilisateur - if($cp->statut == 2 && $userID == $cp->fk_validator) + if($cp->statut == 2 && $user->id == $cp->fk_validator) { $cp->date_valid = dol_now(); @@ -375,7 +373,7 @@ if($action == 'confirm_valid') $newSolde = $soldeActuel - ($nbJour*$cp->getConfCP('nbHolidayDeducted')); // On ajoute la modification dans le LOG - $cp->addLogCP($userID,$cp->fk_user,'Event : '.$langs->transnoentitiesnoconv("Holiday"),$newSolde); + $cp->addLogCP($user->id, $cp->fk_user, 'Event : '.$langs->transnoentitiesnoconv("Holiday"), $newSolde); // Mise à jour du solde $cp->updateSoldeCP($cp->fk_user,$newSolde); @@ -433,11 +431,9 @@ if ($action == 'confirm_refuse') $cp = new Holiday($db); $cp->fetch($_GET['id']); - $userID = $user->id; - // Si statut en attente de validation et valideur = utilisateur - if($cp->statut == 2 && $userID == $cp->fk_validator) { - + if($cp->statut == 2 && $user->id == $cp->fk_validator) + { $cp->date_refuse = date('Y-m-d H:i:s', time()); $cp->fk_user_refuse = $user->id; $cp->statut = 5; @@ -500,15 +496,13 @@ if ($action == 'confirm_refuse') } // Si Validation de la demande -if ($action == 'confirm_cancel' && $_GET['confirm'] == 'yes') +if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes') { $cp = new Holiday($db); $cp->fetch($_GET['id']); - $userID = $user->id; - // Si statut en attente de validation et valideur = utilisateur - if ($cp->statut == 2 && $userID == $cp->fk_validator) + if ($cp->statut == 2 && ($user->id == $cp->fk_validator || $user->id == $cp->fk_user)) { $cp->date_cancel = dol_now(); $cp->fk_user_cancel = $user->id; @@ -761,9 +755,6 @@ else $userRequest = new User($db); $userRequest->fetch($cp->fk_user); - // Utilisateur connecté - $userID = $user->id; - //print_fiche_titre($langs->trans('TitreRequestCP')); // Si il y a une erreur @@ -816,21 +807,21 @@ else } // Si envoi en validation - if ($action == 'sendToValidate' && $cp->statut == 1 && $userID == $cp->fk_user) + if ($action == 'sendToValidate' && $cp->statut == 1 && $user->id == $cp->fk_user) { $ret=$form->form_confirm("fiche.php?id=".$id,$langs->trans("TitleToValidCP"),$langs->trans("ConfirmToValidCP"),"confirm_send", '', 1, 1); if ($ret == 'html') print '
'; } // Si validation de la demande - if ($action == 'valid' && $cp->statut == 2 && $userID == $cp->fk_validator) + if ($action == 'valid' && $cp->statut == 2 && $user->id == $cp->fk_validator) { $ret=$form->form_confirm("fiche.php?id=".$id,$langs->trans("TitleValidCP"),$langs->trans("ConfirmValidCP"),"confirm_valid", '', 1, 1); if ($ret == 'html') print '
'; } // Si refus de la demande - if ($action == 'refuse' && $cp->statut == 2 && $userID == $cp->fk_validator) + if ($action == 'refuse' && $cp->statut == 2 && $user->id == $cp->fk_validator) { $array_input = array(array('type'=>"text",'label'=>"Entrez ci-dessous un motif de refus :",'name'=>"detail_refuse",'size'=>"50",'value'=>"")); $ret=$form->form_confirm("fiche.php?id=".$id."&action=confirm_refuse", $langs->trans("TitleRefuseCP"), "", "confirm_refuse", $array_input, 1, 0); @@ -838,7 +829,7 @@ else } // Si annulation de la demande - if ($action == 'cancel' && $cp->statut == 2 && $userID == $cp->fk_validator) + if ($action == 'cancel' && $cp->statut == 2 && ($user->id == $cp->fk_validator || $user->id == $cp->fk_user)) { $ret=$form->form_confirm("fiche.php?id=".$id,$langs->trans("TitleCancelCP"),$langs->trans("ConfirmCancelCP"),"confirm_cancel", '', 1, 1); if ($ret == 'html') print '
'; @@ -1036,16 +1027,16 @@ else print ''.$langs->trans("DeleteCP").''; } - // Si le statut est en attente de validation et que le valideur est connecté - if ($userID == $cp->fk_validator && $cp->statut == 2) + if ($user->id == $cp->fk_validator && $cp->statut == 2) { print ''.$langs->trans("Approve").''; print ''.$langs->trans("ActionRefuseCP").''; } - if (($userID == $cp->fk_validator && $cp->statut == 2) || ($cp->date_debut > dol_now()) || $user->admin) + if (($user->id == $cp->fk_validator || $user->id == $cp->fk_user) && $cp->statut == 2) { - print ''.$langs->trans("ActionCancelCP").''; + if (($cp->date_debut > dol_now()) || $user->admin) print ''.$langs->trans("ActionCancelCP").''; + else print ''.$langs->trans("ActionCancelCP").''; } print '
'; From 38cb9a530fff3572eca97790bca20ee4fe28f6f1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Apr 2013 01:28:43 +0200 Subject: [PATCH 62/64] Doxygen --- htdocs/core/class/commoninvoice.class.php | 50 +++++++++++------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 8a793bb73a0..20d56ae6ef6 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -155,7 +155,7 @@ abstract class CommonInvoice extends CommonObject * Return label of object status * * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto - * @param int $alreadypaid 0=No payment already done, 1=Some payments already done + * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label */ function getLibStatut($mode=0,$alreadypaid=-1) @@ -166,27 +166,27 @@ abstract class CommonInvoice extends CommonObject /** * Renvoi le libelle d'un statut donne * - * @param int $paye Etat paye - * @param int $statut Id statut - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto - * @param double $alreadypaid Montant deja paye + * @param int $paye Status field paye + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto + * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @param int $type Type facture * @return string Libelle du statut */ - function LibStatut($paye,$statut,$mode=0,$alreadypaid=-1,$type=0) + function LibStatut($paye,$status,$mode=0,$alreadypaid=-1,$type=0) { global $langs; $langs->load('bills'); - //print "$paye,$statut,$mode,$alreadypaid,$type"; + //print "$paye,$status,$mode,$alreadypaid,$type"; if ($mode == 0) { $prefix=''; if (! $paye) { - if ($statut == 0) return $langs->trans('Bill'.$prefix.'StatusDraft'); - if (($statut == 3 || $statut == 2) && $alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusClosedUnpaid'); - if (($statut == 3 || $statut == 2) && $alreadypaid > 0) return $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially'); + if ($status == 0) return $langs->trans('Bill'.$prefix.'StatusDraft'); + if (($status == 3 || $status == 2) && $alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusClosedUnpaid'); + if (($status == 3 || $status == 2) && $alreadypaid > 0) return $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially'); if ($alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusNotPaid'); return $langs->trans('Bill'.$prefix.'StatusStarted'); } @@ -202,9 +202,9 @@ abstract class CommonInvoice extends CommonObject $prefix='Short'; if (! $paye) { - if ($statut == 0) return $langs->trans('Bill'.$prefix.'StatusDraft'); - if (($statut == 3 || $statut == 2) && $alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusCanceled'); - if (($statut == 3 || $statut == 2) && $alreadypaid > 0) return $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially'); + if ($status == 0) return $langs->trans('Bill'.$prefix.'StatusDraft'); + if (($status == 3 || $status == 2) && $alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusCanceled'); + if (($status == 3 || $status == 2) && $alreadypaid > 0) return $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially'); if ($alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusNotPaid'); return $langs->trans('Bill'.$prefix.'StatusStarted'); } @@ -220,9 +220,9 @@ abstract class CommonInvoice extends CommonObject $prefix='Short'; if (! $paye) { - if ($statut == 0) return img_picto($langs->trans('BillStatusDraft'),'statut0').' '.$langs->trans('Bill'.$prefix.'StatusDraft'); - if (($statut == 3 || $statut == 2) && $alreadypaid <= 0) return img_picto($langs->trans('StatusCanceled'),'statut5').' '.$langs->trans('Bill'.$prefix.'StatusCanceled'); - if (($statut == 3 || $statut == 2) && $alreadypaid > 0) return img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7').' '.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially'); + if ($status == 0) return img_picto($langs->trans('BillStatusDraft'),'statut0').' '.$langs->trans('Bill'.$prefix.'StatusDraft'); + if (($status == 3 || $status == 2) && $alreadypaid <= 0) return img_picto($langs->trans('StatusCanceled'),'statut5').' '.$langs->trans('Bill'.$prefix.'StatusCanceled'); + if (($status == 3 || $status == 2) && $alreadypaid > 0) return img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7').' '.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially'); if ($alreadypaid <= 0) return img_picto($langs->trans('BillStatusNotPaid'),'statut1').' '.$langs->trans('Bill'.$prefix.'StatusNotPaid'); return img_picto($langs->trans('BillStatusStarted'),'statut3').' '.$langs->trans('Bill'.$prefix.'StatusStarted'); } @@ -238,9 +238,9 @@ abstract class CommonInvoice extends CommonObject $prefix='Short'; if (! $paye) { - if ($statut == 0) return img_picto($langs->trans('BillStatusDraft'),'statut0'); - if (($statut == 3 || $statut == 2) && $alreadypaid <= 0) return img_picto($langs->trans('BillStatusCanceled'),'statut5'); - if (($statut == 3 || $statut == 2) && $alreadypaid > 0) return img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7'); + if ($status == 0) return img_picto($langs->trans('BillStatusDraft'),'statut0'); + if (($status == 3 || $status == 2) && $alreadypaid <= 0) return img_picto($langs->trans('BillStatusCanceled'),'statut5'); + if (($status == 3 || $status == 2) && $alreadypaid > 0) return img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7'); if ($alreadypaid <= 0) return img_picto($langs->trans('BillStatusNotPaid'),'statut1'); return img_picto($langs->trans('BillStatusStarted'),'statut3'); } @@ -255,9 +255,9 @@ abstract class CommonInvoice extends CommonObject { if (! $paye) { - if ($statut == 0) return img_picto($langs->trans('BillStatusDraft'),'statut0').' '.$langs->trans('BillStatusDraft'); - if (($statut == 3 || $statut == 2) && $alreadypaid <= 0) return img_picto($langs->trans('BillStatusCanceled'),'statut5').' '.$langs->trans('Bill'.$prefix.'StatusCanceled'); - if (($statut == 3 || $statut == 2) && $alreadypaid > 0) return img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7').' '.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially'); + if ($status == 0) return img_picto($langs->trans('BillStatusDraft'),'statut0').' '.$langs->trans('BillStatusDraft'); + if (($status == 3 || $status == 2) && $alreadypaid <= 0) return img_picto($langs->trans('BillStatusCanceled'),'statut5').' '.$langs->trans('Bill'.$prefix.'StatusCanceled'); + if (($status == 3 || $status == 2) && $alreadypaid > 0) return img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7').' '.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially'); if ($alreadypaid <= 0) return img_picto($langs->trans('BillStatusNotPaid'),'statut1').' '.$langs->trans('BillStatusNotPaid'); return img_picto($langs->trans('BillStatusStarted'),'statut3').' '.$langs->trans('BillStatusStarted'); } @@ -273,9 +273,9 @@ abstract class CommonInvoice extends CommonObject $prefix='Short'; if (! $paye) { - if ($statut == 0) return $langs->trans('Bill'.$prefix.'StatusDraft').' '.img_picto($langs->trans('BillStatusDraft'),'statut0'); - if (($statut == 3 || $statut == 2) && $alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusCanceled').' '.img_picto($langs->trans('BillStatusCanceled'),'statut5'); - if (($statut == 3 || $statut == 2) && $alreadypaid > 0) return $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' '.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7'); + if ($status == 0) return $langs->trans('Bill'.$prefix.'StatusDraft').' '.img_picto($langs->trans('BillStatusDraft'),'statut0'); + if (($status == 3 || $status == 2) && $alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusCanceled').' '.img_picto($langs->trans('BillStatusCanceled'),'statut5'); + if (($status == 3 || $status == 2) && $alreadypaid > 0) return $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' '.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7'); if ($alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusNotPaid').' '.img_picto($langs->trans('BillStatusNotPaid'),'statut1'); return $langs->trans('Bill'.$prefix.'StatusStarted').' '.img_picto($langs->trans('BillStatusStarted'),'statut3'); } From 51f444fb8c5d9db60826abc2969e819093fcf040 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Apr 2013 02:09:41 +0200 Subject: [PATCH 63/64] Look: Optimize title lines --- htdocs/core/lib/functions.lib.php | 52 +++++++++++++++++-------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e764de4e3b7..dc9d0ec5773 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -673,7 +673,7 @@ function dol_get_fiche_end($notab=0) /** * Return string to add class property on html element with pair/impair. - * + * * @param string $var 0 or 1 * @param string $moreclass More class to add * @return string String to add class onto HTML element @@ -2286,7 +2286,7 @@ function print_liste_field_titre($name, $file="", $field="", $begin="", $morepar * Get title line of an array * * @param string $name Label of field - * @param int $thead For thead format + * @param int $thead For thead format (0 by default) * @param string $file Url used when we click on sort picto * @param string $field Field to use for new sorting. Empty if this field is not sortable. * @param string $begin ("" by defaut) @@ -2301,20 +2301,33 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m global $conf; //print "$name, $file, $field, $begin, $options, $moreattrib, $sortfield, $sortorder
\n"; + $sortorder=strtoupper($sortorder); $out=''; + // If field is used as sort criteria we use a specific class // Example if (sortfield,field)=("nom","xxx.nom") or (sortfield,field)=("nom","nom") - if ($field && ($sortfield == $field || $sortfield == preg_replace("/^[^\.]+\./","",$field))) + if ($field && ($sortfield == $field || $sortfield == preg_replace("/^[^\.]+\./","",$field))) $out.= ''; + else $out.= ''; + + if (! empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field { - $out.= ''; - } - else - { - $out.= ''; + $options=preg_replace('/sortfield=([a-zA-Z0-9,\s\.]+)/i','',$moreparam); + $options=preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i','',$options); + $options=preg_replace('/&+/i','&',$options); + if (! preg_match('/^&/',$options)) $options='&'.$options; + + if ($sortorder == 'DESC' ) $out.= ''; + if ($sortorder == 'ASC' ) $out.= ''; } + $out.=$name; - if (empty($thead) && $field) // If this is a sort field + if (! empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field + { + $out.=''; + } + + if (empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field { $options=preg_replace('/sortfield=([a-zA-Z0-9,\s\.]+)/i','',$moreparam); $options=preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i','',$options); @@ -2323,28 +2336,21 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m //print " "; $out.= ''; - if (! $sortorder) + + if (! $sortorder || $field != $sortfield) { $out.= ''.img_down("A-Z",0).''; $out.= ''.img_up("Z-A",0).''; } else { - if ($field != $sortfield) - { + if ($sortorder == 'DESC' ) { $out.= ''.img_down("A-Z",0).''; - $out.= ''.img_up("Z-A",0).''; + $out.= ''.img_up("Z-A",1).''; } - else { - $sortorder=strtoupper($sortorder); - if ($sortorder == 'DESC' ) { - $out.= ''.img_down("A-Z",0).''; - $out.= ''.img_up("Z-A",1).''; - } - if ($sortorder == 'ASC' ) { - $out.= ''.img_down("A-Z",1).''; - $out.= ''.img_up("Z-A",0).''; - } + if ($sortorder == 'ASC' ) { + $out.= ''.img_down("A-Z",1).''; + $out.= ''.img_up("Z-A",0).''; } } } From 263e9098faf74baa89d64869d0f18533cbf5ee87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Apr 2013 02:54:54 +0200 Subject: [PATCH 64/64] Fix: group name not visible --- htdocs/user/fiche.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 3e695b63e2a..892d5fc4ac3 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -1432,7 +1432,7 @@ else } /* - * Groupes affectes + * Groups assigned to user */ print ''; print ''; @@ -1455,11 +1455,11 @@ else print ''; if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
'; if ($caneditgroup) { - print ''.img_object($langs->trans("ShowGroup"),"group").' '.$group->nom.''; + print ''.img_object($langs->trans("ShowGroup"),"group").' '.$group->name.''; } else { - print img_object($langs->trans("ShowGroup"),"group").' '.$group->nom; + print img_object($langs->trans("ShowGroup"),"group").' '.$group->name; } print '