From 7c01e984f87a03f1cc1130494a56020c509b6557 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 22 Apr 2013 10:05:32 +0200 Subject: [PATCH 001/167] Fix : column missing in migration for price by qty --- htdocs/install/mysql/migration/3.2.0-3.3.0.sql | 1 + 1 file changed, 1 insertion(+) 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 eaf395a6204..0ba2270dd88 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 @@ -848,6 +848,7 @@ ALTER TABLE llx_product_price_by_qty ADD CONSTRAINT fk_product_price_by_qty_fk_p ALTER TABLE llx_product_price_by_qty ADD remise_percent DOUBLE NOT NULL DEFAULT '0' AFTER price_ttc; ALTER TABLE llx_product_price_by_qty ADD remise DOUBLE NOT NULL DEFAULT '0' AFTER remise_percent; +ALTER TABLE llx_product_price_by_qty ADD unitprice DOUBLE (24,8) NOT NULL DEFAULT '0' AFTER qty_min; -- Change index name to be compliant with SQL standard, index name must be unique in database schema ALTER TABLE llx_c_actioncomm DROP INDEX code; From ab4a3dcaa7793e0a51c6acbf80bd0bc95c90e4eb Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 10:18:03 +0200 Subject: [PATCH 002/167] Fix: missing rename field --- htdocs/core/modules/modFacture.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 666bcb9a22a..4d18c3d8757 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -198,10 +198,10 @@ class modFacture extends DolibarrModules $this->export_label[$r]='CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_icon[$r]='bill'; $this->export_permission[$r]=array(array("facture","facture","export")); - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"NotePrivate",'f.note_public'=>"NotePublic",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber'); - //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); - $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); - $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment'); + $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber'); + //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); + $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); + $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment'); $this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_sql_start[$r]='SELECT DISTINCT '; From ee843924dd56d1d5b47346a99125bb3f2e8f91c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 10:33:06 +0200 Subject: [PATCH 003/167] Fix: Some translation change to have things more clear. --- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/langs/en_US/products.lang | 12 +++++++----- htdocs/langs/fr_FR/products.lang | 16 +++++++++------- htdocs/product/class/product.class.php | 7 ++++--- htdocs/product/composition/fiche.php | 15 ++++++++++----- 5 files changed, 32 insertions(+), 22 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 944f364ee4b..97658572831 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -344,7 +344,7 @@ class Form * Show a text and picto with tooltip on text or picto * * @param string $text Text to show - * @param string $htmltext Content html of tooltip. Must be HTML/UTF8 encoded. + * @param string $htmltext HTML content of tooltip. Must be HTML/UTF8 encoded. * @param int $tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2 * @param int $direction -1=Le picto est avant, 0=pas de picto, 1=le picto est apres * @param string $img Code img du picto (use img_xxx() function to get it) @@ -383,7 +383,7 @@ class Form //if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').''; $paramfortooltiptd.= (($direction < 0)?' style="padding-left: 3px !important;"':''); $paramfortooltiptd.= (($direction > 0)?' style="padding-right: 3px !important;"':''); - if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.''; + if ((string) $text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.''; if ($direction > 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; if (empty($notabs)) $s.=''; diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index b58dec53dcb..6ba653600e4 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -111,10 +111,12 @@ ServiceLimitedDuration=If product is a service with limited duration: MultiPricesAbility=Activate the multi-prices MultiPricesNumPrices=Number of price MultiPriceLevelsName=Price categories -AssociatedProductsAbility=Activate the sub-products -AssociatedProducts=Sub-products -AssociatedProductsNumber=Number of products composing this product -ParentProductsNumber=Number of parent product +AssociatedProductsAbility=Activate the virtual products feature +AssociatedProducts=Virtual product +AssociatedProductsNumber=Number of products composing this virtual product +ParentProductsNumber=Number of parent virtual product +IfZeroItIsNotAVirtualProduct=If 0, this product is not a virtual product +IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any virtual product EditAssociate=Associate Translation=Translation KeywordFilter=Keyword filter @@ -124,7 +126,7 @@ AddDel=Add/Delete Quantity=Quantity NoMatchFound=No match found ProductAssociationList=List of related products/services: name of product/service (quantity affected) -ProductParentList=List of products/services with this product as a component +ProductParentList=List of virtual products/services with this product as a component ErrorAssociationIsFatherOfThis=One of selected product is parent with current product DeleteProduct=Delete a product/service ConfirmDeleteProduct=Are you sure you want to delete this product/service? diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 3d27fdd9d6d..f5ce6482353 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -111,11 +111,13 @@ ServiceLimitedDuration=Si produit de type service à durée limitée : MultiPricesAbility=Prise en charge de prix multiples MultiPricesNumPrices=Nombre de prix MultiPriceLevelsName=Catégorie de prix -AssociatedProductsAbility=Prise en charge des produits composés -AssociatedProducts=Composition -AssociatedProductsNumber=Nbre de sous-produits composant ce produit -ParentProductsNumber=Nbre de produits parent -EditAssociate=Composer +AssociatedProductsAbility=Prise en charge des produits virtuels +AssociatedProducts=Produit virtuel +AssociatedProductsNumber=Nbre de sous-produits constituant ce produit virtuel +ParentProductsNumber=Nbre de produits virtuels parent +IfZeroItIsNotAVirtualProduct=Si 0, ce produit n'est pas un produit virtuel +IfZeroItIsNotUsedByVirtualProduct=Si 0, ce produit n'est pas utilisé par un produit virtuel +EditAssociate=Composer comme produit virtuel Translation=Traduction KeywordFilter=Filtre par mot-clé CategoryFilter=Filtre par catégorie @@ -123,8 +125,8 @@ ProductToAddSearch=Recherche des produits à ajouter AddDel=Ajouter/Retirer Quantity=Quantité NoMatchFound=Aucun résultat n'a été trouvé -ProductAssociationList=Liste des produits/services composant ce produit: Le nombre entre parenthèse est la quantité affectée dans cette composition. -ProductParentList=Liste des produits/services avec ce produit comme composante +ProductAssociationList=Liste des produits/services composant ce produit virtuel: Le nombre entre parenthèse est la quantité affectée dans cette composition. +ProductParentList=Liste des produits/services virtuels avec ce produit comme composante ErrorAssociationIsFatherOfThis=L'un des produits sélectionnés est parent du produit en cours DeleteProduct=Supprimer un produit/service ConfirmDeleteProduct=Êtes-vous sûr de vouloir supprimer ce produit/service ? diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index a8803d6e5e8..f6219d5acd4 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2137,6 +2137,7 @@ class Product extends CommonObject $id=(! empty($desc_pere[0]) ? $desc_pere[0] :''); $nb=(! empty($desc_pere[1]) ? $desc_pere[1] :''); $type=(! empty($desc_pere[2]) ? $desc_pere[2] :''); + $label=(! empty($desc_pere[3]) ? $desc_pere[3] :''); if ($multiply) { @@ -2157,10 +2158,10 @@ class Product extends CommonObject */ 'id'=>$id, // Id product 'nb'=>$nb, // Nb of units that compose parent product 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product - 'stock'=>$this->stock_warehouse[1]->real, // Stock + 'stock'=>$this->stock_warehouse[1]->real, // Stock 'stock_alert'=>$this->seuil_stock_alerte, // Stock alert - 'fullpath' => $compl_path.$nom_pere, // Label - 'type'=>$type // Nb of units that compose parent product + 'fullpath' => $compl_path.$label, // Label + 'type'=>$type // Nb of units that compose parent product ); } else diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php index 804759afe3a..471631cc464 100644 --- a/htdocs/product/composition/fiche.php +++ b/htdocs/product/composition/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani @@ -200,12 +200,15 @@ if ($id || $ref) // Number of subproducts $prodsfather = $product->getFather(); //Parent Products $product->get_sousproduits_arbo(); - print ''.$langs->trans("AssociatedProductsNumber").''.count($product->get_arbo_each_prod()).''; + $nbofsubproducts=count($product->get_arbo_each_prod()); + print ''.$langs->trans("AssociatedProductsNumber").''; + print $form->textwithpicto($nbofsubproducts, $langs->trans('IfZeroItIsNotAVirtualProduct')); + print ''; dol_fiche_end(); - // List of subproducts + // List of products into this virtual product $prods_arbo = $product->get_arbo_each_prod(); if (count($prods_arbo) > 0) { @@ -231,8 +234,10 @@ if ($id || $ref) print ''; } - // Number of parent products - print ''.$langs->trans("ParentProductsNumber").''.count($prodsfather).''; + // Number of parent virtual products + print ''.$langs->trans("ParentProductsNumber").''; + print $form->textwithpicto(count($prodsfather), $langs->trans('IfZeroItIsNotUsedByVirtualProduct')); + print ''; if (count($prodsfather) > 0) { From 882da5d7d7f1e9a8d9f1a1a7dd1328842d61937e Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 22 Apr 2013 11:54:30 +0200 Subject: [PATCH 004/167] Fix : price by quantity, bad column name --- htdocs/install/mysql/migration/3.2.0-3.3.0.sql | 1 + 1 file changed, 1 insertion(+) 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 0ba2270dd88..f7054bc4184 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 @@ -849,6 +849,7 @@ ALTER TABLE llx_product_price_by_qty ADD CONSTRAINT fk_product_price_by_qty_fk_p ALTER TABLE llx_product_price_by_qty ADD remise_percent DOUBLE NOT NULL DEFAULT '0' AFTER price_ttc; ALTER TABLE llx_product_price_by_qty ADD remise DOUBLE NOT NULL DEFAULT '0' AFTER remise_percent; ALTER TABLE llx_product_price_by_qty ADD unitprice DOUBLE (24,8) NOT NULL DEFAULT '0' AFTER qty_min; +ALTER TABLE llx_product_price_by_qty CHANGE qty_min quantity DOUBLE NULL DEFAULT NULL; -- Change index name to be compliant with SQL standard, index name must be unique in database schema ALTER TABLE llx_c_actioncomm DROP INDEX code; From e6f9c567d98ca05ff3ebeba1f05d4a47e83ba7e3 Mon Sep 17 00:00:00 2001 From: fhenry Date: Mon, 22 Apr 2013 12:08:35 +0200 Subject: [PATCH 005/167] Fix odt as PDF generation --- htdocs/includes/odtphp/odf.php | 9 ++++---- htdocs/includes/odtphp/odt2pdf.sh | 34 +++++++++++++++---------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 4f91157438b..03136a20b63 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -459,7 +459,8 @@ IMG; $name=str_replace('.odt', '', $name); $command = DOL_DOCUMENT_ROOT.'/includes/odtphp/odt2pdf.sh '.$name; - //dol_syslog('$execmethod='.$execmethod.' Run command='.$command); + + dol_syslog(get_class($this).'::exportAsAttachedPDF $execmethod='.$execmethod.' Run command='.$command,LOG_DEBUG); if ($execmethod == 1) { exec($command, $output_arr, $retval); @@ -486,16 +487,16 @@ IMG; if($retval == 0) { - //dol_syslog(get_class($this).'::exportAsAttachedPDF $ret_val='.$retval, LOG_DEBUG); + dol_syslog(get_class($this).'::exportAsAttachedPDF $ret_val='.$retval, LOG_DEBUG); if (headers_sent($filename, $linenum)) { throw new OdfException("headers already sent ($filename at $linenum)"); } - if (!empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { + /*if (!empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { header('Content-type: application/pdf'); header('Content-Disposition: attachment; filename="'.$name.'.pdf"'); readfile("$name.pdf"); - } + }*/ unlink("$name.odt"); } else { //dol_syslog(get_class($this).'::exportAsAttachedPDF $ret_val='.$retval, LOG_DEBUG); diff --git a/htdocs/includes/odtphp/odt2pdf.sh b/htdocs/includes/odtphp/odt2pdf.sh index b9710682465..28f9ef32b22 100755 --- a/htdocs/includes/odtphp/odt2pdf.sh +++ b/htdocs/includes/odtphp/odt2pdf.sh @@ -2,21 +2,21 @@ # @copyright GPL License 2010 - Vikas Mahajan - http://vikasmahajan.wordpress.com if [ -f "$1.odt" ] -then -pgrep -U `id -u` soffice -if [ $? -ne 0 ] -then -soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard -sleep 2 -fi -jodconverter "$1.odt" "$1.pdf" -if [ $? -ne 0 ] -then -echo "Error while converting odt to pdf" -exit 1 -fi -sleep 1 -else -echo "Error: Odt file does not exist" -exit 1 + then + pgrep -U `id -u` soffice + if [ $? -ne 0 ] + then + soffice --invisible --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --headless & + sleep 2 + fi + jodconverter "$1.odt" "$1.pdf" + if [ $? -ne 0 ] + then + echo "Error while converting odt to pdf" + exit 1 + fi + sleep 1 + else + echo "Error: Odt file does not exist" + exit 1 fi From 5b4b0583998752ac9993d1e1745d58475ba5c2ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 12:30:52 +0200 Subject: [PATCH 006/167] Perf: Minor perf enhancement --- htdocs/product/composition/fiche.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php index 206dd87ceae..d02253b4d24 100644 --- a/htdocs/product/composition/fiche.php +++ b/htdocs/product/composition/fiche.php @@ -198,9 +198,10 @@ if ($id || $ref) print ''; // Number of subproducts - $prodsfather = $product->getFather(); //Parent Products + $prodsfather = $product->getFather(); // Parent Products $product->get_sousproduits_arbo(); - $nbofsubproducts=count($product->get_arbo_each_prod()); + $prods_arbo=$product->get_arbo_each_prod(); + $nbofsubproducts=count($prods_arbo); print ''.$langs->trans("AssociatedProductsNumber").''; print $form->textwithpicto($nbofsubproducts, $langs->trans('IfZeroItIsNotAVirtualProduct')); print ''; @@ -209,7 +210,6 @@ if ($id || $ref) // List of products into this virtual product - $prods_arbo = $product->get_arbo_each_prod(); if (count($prods_arbo) > 0) { print ''; @@ -226,7 +226,8 @@ if ($id || $ref) //print $productstatic->getNomUrl(1).'
'; //print $value[0]; // This contains a tr line. print ''; - print ''.$productstatic->getNomUrl(1,'composition').' ('.$value['nb'].')    '; + //print ''.$productstatic->getNomUrl(1,'composition').' ('.$value['nb'].($value['nb_total'] > $value['nb']?'->'.$value['nb_total']:'').')    '; + print ''.$productstatic->getNomUrl(1,'composition').' ('.$value['nb_total'].')    '; if (! empty($conf->stock->enabled)) print ''.$langs->trans("Stock").' : '.$productstatic->stock_reel.''; print ''; } From 54040bed1d4b5280cd76eb4c751335f439c29941 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 12:48:56 +0200 Subject: [PATCH 007/167] Fix: No slash alone --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index d01c0456250..695b6deb2c1 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -47,7 +47,7 @@ function societe_prepare_head($object) { $head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$object->id; if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && ($object->client==2 || $object->client==3)) $head[$h][1] = $langs->trans("Prospect"); - if ($object->client==3) $head[$h][1] .= '/'; + if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && $object->client==3) $head[$h][1] .= '/'; if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && ($object->client==1 || $object->client==3)) $head[$h][1] .= $langs->trans("Customer"); $head[$h][2] = 'customer'; $h++; From c87c7703cd4a50b78fd4f3ad4882b5cde4d83d4d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 13:01:22 +0200 Subject: [PATCH 008/167] Qual: Make code simpler. --- htdocs/product/class/product.class.php | 95 +++++++++----------------- htdocs/product/composition/fiche.php | 16 +++-- 2 files changed, 43 insertions(+), 68 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 9422eed8250..8cac5ebe573 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1803,7 +1803,7 @@ class Product extends CommonObject $result=$this->del_sousproduit($id_pere, $id_fils); if ($result < 0) return $result; - + // Check not already father of id_pere (to avoid father -> child -> father links) $sql = 'SELECT fk_product_pere from '.MAIN_DB_PREFIX.'product_association'; $sql .= ' WHERE fk_product_pere = '.$id_fils.' AND fk_product_fils = '.$id_pere; @@ -1852,11 +1852,11 @@ class Product extends CommonObject { if (! is_numeric($fk_parent)) $fk_parent=0; if (! is_numeric($fk_child)) $fk_child=0; - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association"; $sql.= " WHERE fk_product_pere = ".$fk_parent; $sql.= " AND fk_product_fils = ".$fk_child; - + dol_syslog(get_class($this).'::del_sousproduit sql='.$sql); if (! $this->db->query($sql)) { @@ -2122,7 +2122,7 @@ class Product extends CommonObject * Define value of this->res * * @param array $prod Products array - * @param string $compl_path Directory path + * @param string $compl_path Directory path of parents to add before * @param int $multiply Because each sublevel must be multiplicated by parent nb * @param int $level Init level * @return void @@ -2132,7 +2132,8 @@ class Product extends CommonObject global $conf,$langs; $product = new Product($this->db); - foreach($prod as $nom_pere => $desc_pere) + //var_dump($prod); + foreach($prod as $id_product => $desc_pere) // nom_pere is 0 or id of sub_product { if (is_array($desc_pere)) // If this parent desc is an array, this is an array of childs { @@ -2140,58 +2141,27 @@ class Product extends CommonObject $nb=(! empty($desc_pere[1]) ? $desc_pere[1] :''); $type=(! empty($desc_pere[2]) ? $desc_pere[2] :''); $label=(! empty($desc_pere[3]) ? $desc_pere[3] :''); + if ($multiply < 1) $multiply=1; - if ($multiply) - { - //print "XXX ".$desc_pere[1]." multiply=".$multiply; - $img=""; - $this->fetch($id); - $this->load_stock(); - if ($this->stock_warehouse[1]->real < $this->seuil_stock_alerte) - { - $img=img_warning($langs->trans("StockTooLow")); - } - $this->res[]= array( -/* "      -> - ".$compl_path.stripslashes($nom_pere)." - (".$desc_pere[1].") ".($desc_pere[1]*$multiply)."   - ".$this->stock_entrepot[1]." ".$img."", - $desc_pere[0], // Id product -*/ 'id'=>$id, // Id product - 'nb'=>$nb, // Nb of units that compose parent product - 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product - 'stock'=>$this->stock_warehouse[1]->real, // Stock - 'stock_alert'=>$this->seuil_stock_alerte, // Stock alert - 'fullpath' => $compl_path.$label, // Label - 'type'=>$type // Nb of units that compose parent product - ); - } - else - { - $this->fetch($desc_pere[0]); - $this->load_stock(); - $this->res[]= array( -/* $compl_path.$nom_pere." (".$desc_pere[1].")", - $desc_pere[0], // Id product -*/ 'id'=>$id, // Id product + //print "XXX We add id=".$id." - label=".$label." - nb=".$nb." - multiply=".$multiply." fullpath=".$compl_path.$label."\n"; + $this->fetch($id); + $this->load_stock(); + $this->res[]= array( + 'id'=>$id, // Id product 'nb'=>$nb, // Nb of units that compose parent product - 'nb_total'=>$nb, // Nb of units for all nb of product - 'stock'=>$this->stock_warehouse[1]->real, // Stock + 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product + 'stock'=>$this->stock_warehouse[1]->real, // Stock 'stock_alert'=>$this->seuil_stock_alerte, // Stock alert - 'fullpath' => $compl_path.$nom_pere, // Label - 'type'=>$type // Nb of units that compose parent product - ); - } - } - else if($nom_pere != "0" && $nom_pere != "1") - { - $this->res[]= array($compl_path.$nom_pere,$desc_pere); + 'fullpath' => $compl_path.$label, // Label + 'type'=>$type // Nb of units that compose parent product + ); } // Recursive call if child is an array - if (is_array($desc_pere[0])) + if (is_array($desc_pere['childs'])) { - $this ->fetch_prod_arbo($desc_pere[0], $nom_pere." -> ", $desc_pere[1]*$multiply, $level+1); + //print 'YYY We go down for '.$desc_pere[3]." -> \n"; + $this ->fetch_prod_arbo($desc_pere['childs'], $compl_path.$desc_pere[3]." -> ", $desc_pere[1]*$multiply, $level+1); } } } @@ -2228,11 +2198,12 @@ class Product extends CommonObject $this->res = array(); if (isset($this->sousprods) && is_array($this->sousprods)) { - foreach($this->sousprods as $nom_pere => $desc_pere) + foreach($this->sousprods as $prod_name => $desc_product) { - if (is_array($desc_pere)) $this->fetch_prod_arbo($desc_pere,"",$multiply); + if (is_array($desc_product)) $this->fetch_prod_arbo($desc_product,"",$multiply); } } + //var_dump($this->res); return $this->res; } @@ -2293,7 +2264,7 @@ class Product extends CommonObject /** - * Return all parent products fo current product + * Return all direct parent products fo current product * * @return array prod */ @@ -2324,19 +2295,19 @@ class Product extends CommonObject } /** - * Return childs of product with if fk_parent + * Return childs of product $id * - * @param int $fk_parent Id of product to search childs of + * @param int $id Id of product to search childs of * @return array Prod */ - function getChildsArbo($fk_parent) + function getChildsArbo($id) { $sql = "SELECT p.rowid, p.label as label, pa.qty as qty, pa.fk_product_fils as id, p.fk_product_type"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= ", ".MAIN_DB_PREFIX."product_association as pa"; $sql.= " WHERE p.rowid = pa.fk_product_fils"; - $sql.= " AND pa.fk_product_pere = ".$fk_parent; - $sql.= " AND pa.fk_product_fils != ".$fk_parent; // This should not happens, it is to avoid invinite loop if it happens + $sql.= " AND pa.fk_product_pere = ".$id; + $sql.= " AND pa.fk_product_fils != ".$id; // This should not happens, it is to avoid infinite loop if it happens dol_syslog(get_class($this).'::getChildsArbo sql='.$sql); $res = $this->db->query($sql); @@ -2351,7 +2322,7 @@ class Product extends CommonObject $listofchilds=$this->getChildsArbo($rec['id']); foreach($listofchilds as $keyChild => $valueChild) { - $prods[$rec['rowid']][$keyChild] = $valueChild; + $prods[$rec['rowid']]['childs'][$keyChild] = $valueChild; } } @@ -2373,14 +2344,14 @@ class Product extends CommonObject function get_sousproduits_arbo() { $parent = $this->getParent(); - foreach($parent as $key => $value) + foreach($parent as $key => $value) // key=label, value[0]=id { foreach($this->getChildsArbo($value[0]) as $keyChild => $valueChild) { $parent[$key][$keyChild] = $valueChild; } } - foreach($parent as $key => $value) + foreach($parent as $key => $value) // key=label, value is array of childs { $this->sousprods[$key] = $value; } @@ -2418,7 +2389,7 @@ class Product extends CommonObject else if ($option == 'category') { $lien = ''; - } + } else { $lien = ''; diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php index d02253b4d24..71ce35c76e1 100644 --- a/htdocs/product/composition/fiche.php +++ b/htdocs/product/composition/fiche.php @@ -227,7 +227,7 @@ if ($id || $ref) //print $value[0]; // This contains a tr line. print ''; //print ''.$productstatic->getNomUrl(1,'composition').' ('.$value['nb'].($value['nb_total'] > $value['nb']?'->'.$value['nb_total']:'').')    '; - print ''.$productstatic->getNomUrl(1,'composition').' ('.$value['nb_total'].')    '; + print ''.$productstatic->getNomUrl(1,'composition').' ('.$value['nb'].')    '; if (! empty($conf->stock->enabled)) print ''.$langs->trans("Stock").' : '.$productstatic->stock_reel.''; print ''; } @@ -292,12 +292,14 @@ if ($id || $ref) // Number of subproducts $prodsfather = $product->getFather(); //Parent Products $product->get_sousproduits_arbo(); - print ''.$langs->trans("AssociatedProductsNumber").''.count($product->get_arbo_each_prod()).''; + $prods_arbo=$product->get_arbo_each_prod(); + $nbofsubproducts=count($prods_arbo); + print ''.$langs->trans("AssociatedProductsNumber").''; + print $form->textwithpicto($nbofsubproducts, $langs->trans('IfZeroItIsNotAVirtualProduct')); + print ''; print ''; // List of subproducts - $prods_arbo = $product->get_arbo_each_prod(); - //var_dump($prods_arbo); if(count($prods_arbo) > 0) { print ''; @@ -322,8 +324,10 @@ if ($id || $ref) print ''; } - // Number of parent products - print ''.$langs->trans("ParentProductsNumber").''.count($prodsfather).''; + // Number of parent virtual products + print ''.$langs->trans("ParentProductsNumber").''; + print $form->textwithpicto(count($prodsfather), $langs->trans('IfZeroItIsNotUsedByVirtualProduct')); + print ''; if (count($prodsfather) > 0) { From 335c8cd5112df9a55c0e456d85729547213743fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 13:01:38 +0200 Subject: [PATCH 009/167] Look: Minor change --- htdocs/theme/eldy/style.css.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 43af5fc2482..bcfb9a051bd 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1326,7 +1326,7 @@ a.tabTitle { text-shadow:1px 1px 1px #ffffff; font-family: ; font-weight: normal; - padding: 5px 6px 2px 6px; + padding: 4px 6px 2px 6px; margin: 0px 6px; text-decoration: none; white-space: nowrap; @@ -1334,7 +1334,7 @@ a.tabTitle { a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { font-family: ; - padding: 5px 6px 2px 6px; + padding: 4px 6px 2px 6px; margin: 0em 0.2em; text-decoration: none; white-space: nowrap; From 6adaf2fa8fde1788ff9392605e795b5732234364 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 13:02:10 +0200 Subject: [PATCH 010/167] Fix: Pb when using virtual products inside virtual products --- htdocs/product/class/product.class.php | 153 +++++++++++-------------- 1 file changed, 65 insertions(+), 88 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 49f1d495cde..22c6aa0e6c1 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1799,8 +1799,16 @@ class Product extends CommonObject */ function add_sousproduit($id_pere, $id_fils,$qty) { - $sql = 'DELETE from '.MAIN_DB_PREFIX.'product_association'; - $sql .= ' WHERE fk_product_pere = "'.$id_pere.'" AND fk_product_fils = "'.$id_fils.'"'; + // Clean parameters + if (! is_numeric($id_pere)) $id_pere=0; + if (! is_numeric($id_fils)) $id_fils=0; + + $result=$this->del_sousproduit($id_pere, $id_fils); + if ($result < 0) return $result; + + // Check not already father of id_pere (to avoid father -> child -> father links) + $sql = 'SELECT fk_product_pere from '.MAIN_DB_PREFIX.'product_association'; + $sql .= ' WHERE fk_product_pere = '.$id_fils.' AND fk_product_fils = '.$id_pere; if (! $this->db->query($sql)) { dol_print_error($this->db); @@ -1808,37 +1816,27 @@ class Product extends CommonObject } else { - $sql = 'SELECT fk_product_pere from '.MAIN_DB_PREFIX.'product_association'; - $sql .= ' WHERE fk_product_pere = "'.$id_fils.'" AND fk_product_fils = "'.$id_pere.'"'; - if (! $this->db->query($sql)) + $result = $this->db->query($sql); + if ($result) { - dol_print_error($this->db); - return -1; - } - else - { - $result = $this->db->query($sql); - if ($result) + $num = $this->db->num_rows($result); + if($num > 0) { - $num = $this->db->num_rows($result); - if($num > 0) + $this->error="isFatherOfThis"; + return -1; + } + else + { + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association(fk_product_pere,fk_product_fils,qty)'; + $sql .= ' VALUES ('.$id_pere.', '.$id_fils.', '.$qty.')'; + if (! $this->db->query($sql)) { - $this->error="isFatherOfThis"; + dol_print_error($this->db); return -1; } else { - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association(fk_product_pere,fk_product_fils,qty)'; - $sql .= ' VALUES ("'.$id_pere.'","'.$id_fils.'","'.$qty.'")'; - if (! $this->db->query($sql)) - { - dol_print_error($this->db); - return -1; - } - else - { - return 1; - } + return 1; } } } @@ -1850,14 +1848,18 @@ class Product extends CommonObject * * @param int $fk_parent Id du produit auquel ne sera plus lie le produit lie * @param int $fk_child Id du produit a ne plus lie - * @return int < 0 si erreur, > 0 si ok + * @return int < 0 if KO, > 0 if OK */ function del_sousproduit($fk_parent, $fk_child) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association"; - $sql.= " WHERE fk_product_pere = '".$fk_parent."'"; - $sql.= " AND fk_product_fils = '".$fk_child."'"; + if (! is_numeric($fk_parent)) $fk_parent=0; + if (! is_numeric($fk_child)) $fk_child=0; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association"; + $sql.= " WHERE fk_product_pere = ".$fk_parent; + $sql.= " AND fk_product_fils = ".$fk_child; + + dol_syslog(get_class($this).'::del_sousproduit sql='.$sql); if (! $this->db->query($sql)) { dol_print_error($this->db); @@ -2122,7 +2124,7 @@ class Product extends CommonObject * Define value of this->res * * @param array $prod Products array - * @param string $compl_path Directory path + * @param string $compl_path Directory path of parents to add before * @param int $multiply Because each sublevel must be multiplicated by parent nb * @param int $level Init level * @return void @@ -2132,65 +2134,36 @@ class Product extends CommonObject global $conf,$langs; $product = new Product($this->db); - foreach($prod as $nom_pere => $desc_pere) + //var_dump($prod); + foreach($prod as $id_product => $desc_pere) // nom_pere is 0 or id of sub_product { if (is_array($desc_pere)) // If this parent desc is an array, this is an array of childs { $id=(! empty($desc_pere[0]) ? $desc_pere[0] :''); $nb=(! empty($desc_pere[1]) ? $desc_pere[1] :''); $type=(! empty($desc_pere[2]) ? $desc_pere[2] :''); + $label=(! empty($desc_pere[3]) ? $desc_pere[3] :''); + if ($multiply < 1) $multiply=1; - if ($multiply) - { - //print "XXX ".$desc_pere[1]." multiply=".$multiply; - $img=""; - $this->fetch($id); - $this->load_stock(); - if ($this->stock_warehouse[1]->real < $this->seuil_stock_alerte) - { - $img=img_warning($langs->trans("StockTooLow")); - } - $this->res[]= array( -/* "      -> - ".$compl_path.stripslashes($nom_pere)." - (".$desc_pere[1].") ".($desc_pere[1]*$multiply)."   - ".$this->stock_entrepot[1]." ".$img."", - $desc_pere[0], // Id product -*/ 'id'=>$id, // Id product - 'nb'=>$nb, // Nb of units that compose parent product - 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product - 'stock'=>$this->stock_warehouse[1]->real, // Stock - 'stock_alert'=>$this->seuil_stock_alerte, // Stock alert - 'fullpath' => $compl_path.$nom_pere, // Label - 'type'=>$type // Nb of units that compose parent product - ); - } - else - { - $this->fetch($desc_pere[0]); - $this->load_stock(); - $this->res[]= array( -/* $compl_path.$nom_pere." (".$desc_pere[1].")", - $desc_pere[0], // Id product -*/ 'id'=>$id, // Id product + //print "XXX We add id=".$id." - label=".$label." - nb=".$nb." - multiply=".$multiply." fullpath=".$compl_path.$label."\n"; + $this->fetch($id); + $this->load_stock(); + $this->res[]= array( + 'id'=>$id, // Id product 'nb'=>$nb, // Nb of units that compose parent product - 'nb_total'=>$nb, // Nb of units for all nb of product - 'stock'=>$this->stock_warehouse[1]->real, // Stock + 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product + 'stock'=>$this->stock_warehouse[1]->real, // Stock 'stock_alert'=>$this->seuil_stock_alerte, // Stock alert - 'fullpath' => $compl_path.$nom_pere, // Label - 'type'=>$type // Nb of units that compose parent product - ); - } - } - else if($nom_pere != "0" && $nom_pere != "1") - { - $this->res[]= array($compl_path.$nom_pere,$desc_pere); + 'fullpath' => $compl_path.$label, // Label + 'type'=>$type // Nb of units that compose parent product + ); } // Recursive call if child is an array - if (is_array($desc_pere[0])) + if (is_array($desc_pere['childs'])) { - $this ->fetch_prod_arbo($desc_pere[0], $nom_pere." -> ", $desc_pere[1]*$multiply, $level+1); + //print 'YYY We go down for '.$desc_pere[3]." -> \n"; + $this ->fetch_prod_arbo($desc_pere['childs'], $compl_path.$desc_pere[3]." -> ", $desc_pere[1]*$multiply, $level+1); } } } @@ -2227,11 +2200,12 @@ class Product extends CommonObject $this->res = array(); if (isset($this->sousprods) && is_array($this->sousprods)) { - foreach($this->sousprods as $nom_pere => $desc_pere) + foreach($this->sousprods as $prod_name => $desc_product) { - if (is_array($desc_pere)) $this->fetch_prod_arbo($desc_pere,"",$multiply); + if (is_array($desc_product)) $this->fetch_prod_arbo($desc_product,"",$multiply); } } + //var_dump($this->res); return $this->res; } @@ -2292,7 +2266,7 @@ class Product extends CommonObject /** - * Return all parent products fo current product + * Return all direct parent products fo current product * * @return array prod */ @@ -2323,31 +2297,34 @@ class Product extends CommonObject } /** - * Return childs of prodcut with if fk_parent + * Return childs of product $id * - * @param int $fk_parent Id of product to search childs of + * @param int $id Id of product to search childs of * @return array Prod */ - function getChildsArbo($fk_parent) + function getChildsArbo($id) { $sql = "SELECT p.rowid, p.label as label, pa.qty as qty, pa.fk_product_fils as id, p.fk_product_type"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= ", ".MAIN_DB_PREFIX."product_association as pa"; $sql.= " WHERE p.rowid = pa.fk_product_fils"; - $sql.= " AND pa.fk_product_pere = ".$fk_parent; + $sql.= " AND pa.fk_product_pere = ".$id; + $sql.= " AND pa.fk_product_fils != ".$id; // This should not happens, it is to avoid infinite loop if it happens + dol_syslog(get_class($this).'::getChildsArbo sql='.$sql); $res = $this->db->query($sql); if ($res) { $prods = array(); while ($rec = $this->db->fetch_array($res)) { + $prods[$rec['rowid']]= array(0=>$rec['id'],1=>$rec['qty'],2=>$rec['fk_product_type'],3=>$this->db->escape($rec['label'])); //$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty'],2=>$rec['fk_product_type']); - $prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty']); + //$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty']); $listofchilds=$this->getChildsArbo($rec['id']); foreach($listofchilds as $keyChild => $valueChild) { - $prods[$this->db->escape($rec['label'])][$keyChild] = $valueChild; + $prods[$rec['rowid']]['childs'][$keyChild] = $valueChild; } } @@ -2369,14 +2346,14 @@ class Product extends CommonObject function get_sousproduits_arbo() { $parent = $this->getParent(); - foreach($parent as $key => $value) + foreach($parent as $key => $value) // key=label, value[0]=id { foreach($this->getChildsArbo($value[0]) as $keyChild => $valueChild) { $parent[$key][$keyChild] = $valueChild; } } - foreach($parent as $key => $value) + foreach($parent as $key => $value) // key=label, value is array of childs { $this->sousprods[$key] = $value; } From ed4c18b9d36fdb83c4d0fee00bd339879c61c0e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 13:15:33 +0200 Subject: [PATCH 011/167] Update changelog. Fix: Fix template ODS. --- ChangeLog | 69 +++++++++--------- .../thirdparties/template_thirdparty.ods | Bin 14558 -> 13595 bytes 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4b8ccf1e55..a70c0f58da2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.4 compared to 3.3.2 ***** For users: +- New: Can use ODS templates as document templates. - New: Add link to autofill/reset with quantity to ship when creating a delivery receipt. - New: Event into calendar use different colors for different users. @@ -11,46 +12,48 @@ For users: - New: Add a tab "consumption" on thirdparties to list products bought/sells. - New: Some performance enhancements. - New: Can attach files onto trip and expenses modules. -- New: Add option MAIN_PDF_TITLE_BACKGROUND_COLOR. +- New: Add hidden option MAIN_PDF_TITLE_BACKGROUND_COLOR. - New: Merge tab customer and prospect. - New: Add ES formated address country rule. -- New: Can define a hierarchical responsible on user. -- New: Add a hierarchical view for users. +- New: Can define a hierarchical responsible on user and add a tree view to + see hierarchy of users. - New: Can expand/collapse menus, categories and users list. -- New: extra parameters are supported into ODT templates. -- New: total per vat rate are available as tags for ODT templates. -- New: Add more types for extra parameters (lists, phone, emails, checkbox, prices). +- New: extra parameters are supported into ODT/ODS templates. +- New: total per vat rate are available as tags for ODT/ODS templates. - New: Some part of interface use more CSS3 (ie: agenda) -- New: [ task #707 ] Create option ProfIdx are mandatory to validate a invoice. +- New: [ task #707 ] Create option "ProfIdx is mandatory to validate a invoice". - New: Can define if we want to use VAT or not for subscriptions (foundation module). -- New: Can define a default choice for choice "More action when recording - a subscription" (foundation module). -- New: Add link to check professional id for india. +- New: Can define a default choice for "More action when recording a + subscription" (foundation module). +- New: Add link to check professional id for India. - New: [ task #731 ] Uniformize ref generation - New: [ task #748 ] Add a link "Dolibarr" into left menu -- New: Script email_unpaid_invoices_to_representative accepts now a parameter test - and a delay. -- New: Can define a different clicktodial setup per user. -- New: Add option INVOICE_CAN_NEVER_BE_REMOVED. -- New: Enhance agenda module to reach RFC2445 (add busy information). +- New: Script email_unpaid_invoices_to_representative accepts now a parameter "test" + and a "late delay". +- New: Can define different clicktodial setups for each user. +- New: Add hidden option INVOICE_CAN_NEVER_BE_REMOVED. +- New: Enhance agenda module to reach RFC2445 ("type" not enabled by default and add + "busy" information). - New: Add module Opensurvey. -- New: Default aprrover for holidays i sby default hierchical parent. +- New: Default approver for holidays is set by default to hierchical parent. - First change to prepare feature "click to print" (IPP) for PDF. -- New: [ task #350 ] Merge tab customer and prospect -- New: [ task #710 ] Add substitution into mailing send (and HTML is now valid) -- New: [ task #711 ] Add combobox for contact as done for product/thirdparty -- New: [ task #714 ] In Emailing module admin autogenerate security key of READRECIEPT -- New: [ task #743 ] GED : Add aministration option to disabled autotree to display -- New: [ task #767 ] Customer Address fallback when a contact doesn't have an address -- New: [ task #768 ] WYSIWYG for all mail -- New: [ task #773 ] Add Project document in GED(ECM) modules -- New: [ task #783 ] Add checkbox and radio into extrafield feature -- New: [ task #798 ] Add range limit date on product/services as it is done on order and invoice -- New: [ task #814 ] Add extrafield feature into Project/project tasks module -- New: [ task #770 ] Add ODT document generation for Projects module -- New: [ task #741 ] Add intervention box -- New: [ task #826 ] Optionnal increase stock when deleting an invoice already validated -- New: [ task #823 ] Shipping_validate email notification +- New: [ task #350 ] Merge tab customer and prospect. +- New: [ task #710 ] Add substitution into mailing send (and HTML is now valid). +- New: [ task #711 ] Add combobox for contact, as done for product/thirdparty. +- New: [ task #714 ] In Emailing module admin autogenerate security key of READRECEIPT. +- New: [ task #743 ] GED : Add aministration option to disable autotree display. +- New: [ task #767 ] Customer Address fallback when a contact doesn't have an address. +- New: [ task #768 ] WYSIWYG for all mails. +- New: [ task #773 ] Add Project document in GED(ECM) modules. +- New: [ task #783 ] Add more types for extra parameters (lists, phone, emails, checkbox, + prices, radio). +- New: [ task #798 ] Add range limit date on product/services as it is done on order + and invoice. +- New: [ task #814 ] Add extrafield feature for projects ands tasks. +- New: [ task #770 ] Add ODT document generation for Projects module. +- New: [ task #741 ] Add intervention box. +- New: [ task #826 ] Optionnal increase stock when deleting an invoice already validated. +- New: [ task #823 ] Shipping_validate email notification. For translators: - Update language files. @@ -60,8 +63,8 @@ For developers: - An external module can force its theme. - Add function dol_set_focus('#xxx'). - A mymodule can bring its own core/modules/mymodule/modules_mymodule.php file. -- Removed not used libraries. -- More web services. +- Removed some not used libraries. +- More web services. - Renamed some database fields, code variables and parameters from french to english. - First change to manage margins on contracts. - Add hook getFormMail. diff --git a/htdocs/install/doctemplates/thirdparties/template_thirdparty.ods b/htdocs/install/doctemplates/thirdparties/template_thirdparty.ods index ad50961b562d95810ea98e692c74827e9ece247d..c715d7fb80f94399f3a39710b5d67c73a91db913 100644 GIT binary patch literal 13595 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 literal 14558 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 From 60382f4b2cfc47eaf043cc1ebb0856c4de0e29e0 Mon Sep 17 00:00:00 2001 From: jfefe Date: Mon, 22 Apr 2013 13:18:40 +0200 Subject: [PATCH 012/167] New webservice to retrieve a document (work on invoice, propal, order and generic) --- htdocs/webservices/server_other.php | 212 +++++++++++++++++++++++++++- 1 file changed, 211 insertions(+), 1 deletion(-) diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php index 64bc426d144..3578796838b 100644 --- a/htdocs/webservices/server_other.php +++ b/htdocs/webservices/server_other.php @@ -27,7 +27,7 @@ require_once '../master.inc.php'; require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; - +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -82,6 +82,21 @@ $server->wsdl->addComplexType( ) ); +// Define WSDL Return object for document +$server->wsdl->addComplexType( + 'document', + 'complexType', + 'struct', + 'all', + '', + array( + 'filename' => array('name'=>'filename','type'=>'xsd:string'), + 'mimetype' => array('name'=>'mimetype','type'=>'xsd:string'), + 'content' => array('name'=>'content','type'=>'xsd:string'), + 'length' => array('name'=>'length','type'=>'xsd:string') + ) +); + // Define other specific objects // None @@ -107,6 +122,20 @@ $server->register( 'WS to get Versions' ); +// Register WSDL +$server->register( + 'getDocument', + // Entry values + array('authentication'=>'tns:authentication', 'modulepart'=>'xsd:string', 'file'=>'xsd:string' ), + // Exit values + array('result'=>'tns:result','document'=>'tns:document'), + $ns, + $ns.'#getDocument', + $styledoc, + $styleuse, + 'WS to get document' +); + // Full methods code @@ -144,6 +173,187 @@ function getVersions($authentication) } +/* + * Method to get a document by webservice +* \param authentication array +* \param modulepart array Properties of document +* +*/ +function getDocument($authentication, $modulepart, $file) +{ + global $db,$conf,$langs,$mysoc; + + dol_syslog("Function: getDocument login=".$authentication['login'].' - modulepart='.$modulepart.' - file='.$file); + + if ($authentication['entity']) $conf->entity=$authentication['entity']; + + $objectresp=array(); + $errorcode='';$errorlabel=''; + $error=0; + + // Properties of doc + $original_file = $file; + $type=dol_mimetype($original_file); + $relativefilepath = $ref . "/"; + $relativepath = $relativefilepath . $ref.'.pdf'; + + $accessallowed=0; + + $fuser=check_authentication($authentication,$error,$errorcode,$errorlabel); + + if ($fuser->societe_id) $socid=$fuser->societe_id; + + // Check parameters + if (! $error && ( ! $file || ! $modulepart ) ) + { + $error++; + $errorcode='BAD_PARAMETERS'; $errorlabel="Parameter file and modulepart must be both provided."; + } + + if (! $error) + { + $fuser->getrights(); + + // Suppression de la chaine de caractere ../ dans $original_file + $original_file = str_replace("../","/", $original_file); + + // find the subdirectory name as the reference + $refname=basename(dirname($original_file)."/"); + + // Wrapping for invoices + if ($modulepart == 'facture') + { + if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file = $conf->facture->dir_output.'/'.$original_file; + $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture WHERE ref='".$refname."' AND entity=".$conf->entity; + } + // Wrapping pour les propales + else if ($modulepart == 'propal') + { + if ($fuser->rights->propal->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file = $conf->propal->dir_output.'/'.$original_file; + $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."propal WHERE ref='".$refname."' AND entity=".$conf->entity; + } + + // Wrapping pour les commandes + else if ($modulepart == 'commande') + { + if ($fuser->rights->commande->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->commande->dir_output.'/'.$original_file; + $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande WHERE ref='".$refname."' AND entity=".$conf->entity; + } + // Wrapping pour generic module + else + { + if ($fuser->rights->$modulepart->read || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->$modulepart->dir_output.'/'.$original_file; + // TODO + //$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."registration WHERE ref='".$refname."' AND entity=".$conf->entity; + } + + // Basic protection (against external users only) + if ($fuser->societe_id > 0) + { + if ($sqlprotectagainstexternals) + { + $resql = $db->query($sqlprotectagainstexternals); + if ($resql) + { + $num=$db->num_rows($resql); + $i=0; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + if ($fuser->societe_id != $obj->fk_soc) + { + $accessallowed=0; + break; + } + $i++; + } + } + } + } + + // Security: + // Limite acces si droits non corrects + if (! $accessallowed) + { + $errorcode='NOT_PERMITTED'; + $errorlabel='Access not allowed'; + $error++; + } + + // Security: + // On interdit les remontees de repertoire ainsi que les pipe dans + // les noms de fichiers. + if (preg_match('/\.\./',$original_file) || preg_match('/[<>|]/',$original_file)) + { + dol_syslog("Refused to deliver file ".$original_file); + $errorcode='REFUSED'; + $errorlabel=''; + $error++; + } + + clearstatcache(); + + if(!$error) + { + if(file_exists($original_file)) + { + dol_syslog("Function: getDocument $original_file $filename content-type=$type"); + + $file=$fileparams['fullname']; + $filename = basename($file); + + $f = fopen($original_file,'r'); + $content_file = fread($f,filesize($original_file)); + + $objectret = array( + 'filename' => basename($original_file), + 'mimetype' => dol_mimetype($original_file), + 'content' => base64_encode($content_file), + 'length' => filesize($original_file) + ); + + // Create return object + $objectresp = array( + 'result'=>array('result_code'=>'OK', 'result_label'=>''), + 'document'=>$objectret + ); + } + else + { + dol_syslog("File doesn't exist ".$original_file); + $errorcode='NOT_FOUND'; + $errorlabel=''; + $error++; + } + } + } + + if ($error) + { + $objectresp = array( + 'result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel) + ); + } + + return $objectresp; +} + // Return the results. $server->service($HTTP_RAW_POST_DATA); From b9dab6d059d6f3abcd8557ef313171a92b0b964b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 13:57:24 +0200 Subject: [PATCH 013/167] Fix: Korting --- htdocs/langs/nl_NL/bills.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/nl_NL/bills.lang b/htdocs/langs/nl_NL/bills.lang index bc238882ecc..17880cd10af 100644 --- a/htdocs/langs/nl_NL/bills.lang +++ b/htdocs/langs/nl_NL/bills.lang @@ -223,9 +223,9 @@ ExportDataset_invoice_1 = Afnemersfacturen en factuurregels ExportDataset_invoice_2 = Afnemersfacturen en -betalingen ProformaBill = Proforma factuur: Reduction = Vermindering -ReductionShort = Minder +ReductionShort = Korting Reductions = Verminderingen -ReductionsShort = Minder +ReductionsShort = Korting Discount = Korting Discounts = Kortingen ShowDiscount = Toon korting From 88fe3e86f241a5694329f3395d54121a71135ebf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 14:01:47 +0200 Subject: [PATCH 014/167] Missing translation --- htdocs/langs/fr_FR/admin.lang | 4 ++-- htdocs/langs/fr_FR/externalsite.lang | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 51966eebcf2..2bff0050348 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -45,8 +45,8 @@ ErrorModuleRequireDolibarrVersion= Erreur, ce module requiert une version %s ou ErrorDecimalLargerThanAreForbidden= Erreur, les précisions supérieures à %s ne sont pas supportées. DictionnarySetup= Dictionnaires Dictionnary= Dictionnaires -ErrorReservedTypeSystemSystemAuto= -ErrorCodeCantContainZero= +ErrorReservedTypeSystemSystemAuto=Erreur, La valeur 'system' et 'systemauto' est réservée. +ErrorCodeCantContainZero=Erruer, le code ne peut contenir la valeur 0 DisableJavascript= Désactiver les fonctions Javascript et Ajax ConfirmAjax= Utiliser les popups de confirmation Ajax UseSearchToSelectCompany= Utiliser un champ avec autocomplétion pour choisir un tiers (plutôt qu'une liste déroulante).

Notez que si vous avez un nombre important de produits ou services (> 100 000), vous pouvez améliorer les performances en définissant la constante SOCIETE_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine. diff --git a/htdocs/langs/fr_FR/externalsite.lang b/htdocs/langs/fr_FR/externalsite.lang index 36c8686a3c3..e41bab65bbd 100644 --- a/htdocs/langs/fr_FR/externalsite.lang +++ b/htdocs/langs/fr_FR/externalsite.lang @@ -2,4 +2,4 @@ CHARSET=UTF-8 ExternalSiteSetup=Configuration du lien vers le site externe ExternalSiteURL=URL du site externe -ExternalSiteModuleNotComplete= \ No newline at end of file +ExternalSiteModuleNotComplete=La configuration du module "Lien externe" est incomplète. \ No newline at end of file From e65e6516c5bc7f781f1a6d881f2d500df07f83c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 14:33:47 +0200 Subject: [PATCH 015/167] Fix: Logon theme on amarok --- htdocs/core/tpl/login.tpl.php | 2 +- htdocs/theme/amarok/style.css.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 8717225cd3f..7f10efcc1ec 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -179,7 +179,7 @@ if ($forgetpasslink || $helpcenterlink) -
+

dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?> } div.ficheaddleft { - dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } + dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } else print "margin-top: 10px;\n"; ?> } From 63a5aee80e06d7fde214e8af7b8958192fd52779 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 12:35:31 +0200 Subject: [PATCH 016/167] Fix: broken features for fileupload --- htdocs/comm/action/document.php | 2 +- htdocs/core/class/fileupload.class.php | 28 +++++++++++++++++++++++++- htdocs/projet/class/task.class.php | 1 + htdocs/projet/tasks/document.php | 8 ++++++-- 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 9fcbca3e743..042f330b199 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -263,7 +263,7 @@ if ($objectid > 0) // Affiche formulaire upload $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act); // List of document diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index c5e83017940..a86073e6969 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -56,6 +56,8 @@ class FileUpload $filename = $regs[2]; } + $parentForeignKey = ''; + // For compatibility if ($element == 'propal') { $pathname = 'comm/propal'; @@ -69,6 +71,14 @@ class FileUpload $element = $pathname = 'projet'; $dir_output=$conf->$element->dir_output; } + elseif ($element == 'project_task') { + $pathname = 'projet'; $filename='task'; + $dir_output=$conf->projet->dir_output; + $parentForeignKey = 'fk_project'; + $parentClass = 'Project'; + $parentElement = 'projet'; + $parentObject = 'project'; + } elseif ($element == 'fichinter') { $element='ficheinter'; $dir_output=$conf->$element->dir_output; @@ -80,6 +90,10 @@ class FileUpload elseif ($element == 'invoice_supplier') { $pathname = 'fourn'; $filename='fournisseur.facture'; $dir_output=$conf->fournisseur->facture->dir_output; + } + elseif ($element == 'action') { + $pathname = 'comm/action'; $filename='actioncomm'; + $dir_output=$conf->agenda->dir_output; } else { $dir_output=$conf->$element->dir_output; } @@ -97,11 +111,23 @@ class FileUpload $object = new $classname($db); $object->fetch($fk_element); - $object->fetch_thirdparty(); + if (!empty($parentForeignKey)) { + dol_include_once('/'.$parentElement.'/class/'.$parentObject.'.class.php'); + $parent = new $parentClass($db); + $parent->fetch($object->$parentForeignKey); + if (!empty($parent->socid)) { + $parent->fetch_thirdparty(); + } + $object->$parentObject = dol_clone($parent); + } else { + $object->fetch_thirdparty(); + } $object_ref = dol_sanitizeFileName($object->ref); if ($element == 'invoice_supplier') { $object_ref = get_exdir($object->id, 2) . $object_ref; + } else if ($element == 'project_task') { + $object_ref = $object->project->ref . '/' . $object_ref; } $this->options = array( diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index f28e5d27e6d..12571aad64a 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -171,6 +171,7 @@ class Task extends CommonObject $sql.= " t.label,"; $sql.= " t.description,"; $sql.= " t.duration_effective,"; + $sql.= " t.datec,"; $sql.= " t.dateo,"; $sql.= " t.datee,"; $sql.= " t.fk_user_creat,"; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 5d42a44d54b..90adc2925c2 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -93,7 +93,11 @@ if ($id > 0 || ! empty($ref)) { $projectstatic->fetch($object->fk_project); - if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid); + if (! empty($projectstatic->socid)) { + $projectstatic->fetch_thirdparty(); + } + + $object->project = dol_clone($projectstatic); $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref); } @@ -114,7 +118,7 @@ if ($action=='delete') { $langs->load("other"); $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file); + $ret=dol_delete_file($file,0,0,0,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); From 1be6a2c1208c7e6b5337892712b1beb1c0d0d1aa Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 12:35:31 +0200 Subject: [PATCH 017/167] Fix: broken features for fileupload --- htdocs/comm/action/document.php | 2 +- htdocs/core/class/fileupload.class.php | 28 +++++++++++++++++++++++++- htdocs/projet/class/task.class.php | 1 + htdocs/projet/tasks/document.php | 8 ++++++-- 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 9fcbca3e743..042f330b199 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -263,7 +263,7 @@ if ($objectid > 0) // Affiche formulaire upload $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act); // List of document diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index c5e83017940..a86073e6969 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -56,6 +56,8 @@ class FileUpload $filename = $regs[2]; } + $parentForeignKey = ''; + // For compatibility if ($element == 'propal') { $pathname = 'comm/propal'; @@ -69,6 +71,14 @@ class FileUpload $element = $pathname = 'projet'; $dir_output=$conf->$element->dir_output; } + elseif ($element == 'project_task') { + $pathname = 'projet'; $filename='task'; + $dir_output=$conf->projet->dir_output; + $parentForeignKey = 'fk_project'; + $parentClass = 'Project'; + $parentElement = 'projet'; + $parentObject = 'project'; + } elseif ($element == 'fichinter') { $element='ficheinter'; $dir_output=$conf->$element->dir_output; @@ -80,6 +90,10 @@ class FileUpload elseif ($element == 'invoice_supplier') { $pathname = 'fourn'; $filename='fournisseur.facture'; $dir_output=$conf->fournisseur->facture->dir_output; + } + elseif ($element == 'action') { + $pathname = 'comm/action'; $filename='actioncomm'; + $dir_output=$conf->agenda->dir_output; } else { $dir_output=$conf->$element->dir_output; } @@ -97,11 +111,23 @@ class FileUpload $object = new $classname($db); $object->fetch($fk_element); - $object->fetch_thirdparty(); + if (!empty($parentForeignKey)) { + dol_include_once('/'.$parentElement.'/class/'.$parentObject.'.class.php'); + $parent = new $parentClass($db); + $parent->fetch($object->$parentForeignKey); + if (!empty($parent->socid)) { + $parent->fetch_thirdparty(); + } + $object->$parentObject = dol_clone($parent); + } else { + $object->fetch_thirdparty(); + } $object_ref = dol_sanitizeFileName($object->ref); if ($element == 'invoice_supplier') { $object_ref = get_exdir($object->id, 2) . $object_ref; + } else if ($element == 'project_task') { + $object_ref = $object->project->ref . '/' . $object_ref; } $this->options = array( diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index ac29870106b..a177ddf838b 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -183,6 +183,7 @@ class Task extends CommonObject $sql.= " t.label,"; $sql.= " t.description,"; $sql.= " t.duration_effective,"; + $sql.= " t.datec,"; $sql.= " t.dateo,"; $sql.= " t.datee,"; $sql.= " t.fk_user_creat,"; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 5d42a44d54b..90adc2925c2 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -93,7 +93,11 @@ if ($id > 0 || ! empty($ref)) { $projectstatic->fetch($object->fk_project); - if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid); + if (! empty($projectstatic->socid)) { + $projectstatic->fetch_thirdparty(); + } + + $object->project = dol_clone($projectstatic); $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref); } @@ -114,7 +118,7 @@ if ($action=='delete') { $langs->load("other"); $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file); + $ret=dol_delete_file($file,0,0,0,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); From 5ccb4108d4d8bdbd9645d47406a6496be73a8deb Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 14:47:37 +0200 Subject: [PATCH 018/167] Fix: merge problem --- htdocs/comm/action/document.php | 323 ++++++++++++++++---------------- 1 file changed, 162 insertions(+), 161 deletions(-) diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 042f330b199..6a576c580ca 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -51,6 +51,19 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } +$act = new ActionComm($db); + +if ($objectid > 0) +{ + $ret = $act->fetch($objectid); + if ($ret > 0) { + $company=new Societe($db); + $company->fetch($act->societe->id); + $act->societe=$company; // For backward compatibility + $act->thirdparty=$company; + } +} + // Get parameters $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -79,7 +92,7 @@ if ($action == 'delete') { $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); $file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file); + $ret=dol_delete_file($file,0,0,0,$act); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); $action=''; @@ -96,184 +109,172 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; llxHeader('',$langs->trans("Agenda"),$help_url); -if ($objectid > 0) +if ($act->id > 0) { - $act = new ActionComm($db); - if ($act->fetch($objectid)) + $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); + + $author=new User($db); + $author->fetch($act->author->id); + $act->author=$author; + + if ($act->contact->id) $act->fetch_contact($act->contact->id); + + $head=actions_prepare_head($act); + dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action'); + + // Affichage fiche action en mode visu + print ''; + + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + + // Type + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); + print ''; + } - $company=new Societe($db); - $company->fetch($act->societe->id); - $act->societe=$company; + // Title + print ''; - $author=new User($db); - $author->fetch($act->author->id); - $act->author=$author; + // Full day event + print ''; - if ($act->contact->id) $act->fetch_contact($act->contact->id); + // Date start + print ''; + print ''; + print ''; - $head=actions_prepare_head($act); - dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action'); + // Date end + print ''; - // Affichage fiche action en mode visu - print '
'.$langs->trans("Ref").''; + print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); + print '
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("EventOnFullDay").''.yn($act->fulldayevent).'
'.$langs->trans("DateActionStart").''; + if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour'); + else print dol_print_date($act->datep,'day'); + if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); + print ''."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendar').' '; + print '
'."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarweek').' '; + print '
'."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarday').' '; + print '
'."\n"; + print '
'.$langs->trans("DateActionEnd").''; + if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour'); + else print dol_print_date($act->datef,'day'); + if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); + print '
'; + // Status + print ''; - $linkback = ''.$langs->trans("BackToList").''; + // Location + print ''; - // Ref - print ''; - // Type - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) + print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print $act->getLibStatut(4); + print '
'.$langs->trans("Location").''.$act->location.'
'.$langs->trans("Ref").''; - print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); - print '


'; + + + // Third party - Contact + print ''; + print "
".dol_print_phone($act->societe->tel); } - - // Title - print ''; - - // Full day event - print ''; - - // Date start - print ''; - print ''; - print ''; - - // Date end - print ''; - - // Status - print ''; - - // Location - print ''; - - - print '
'.$langs->trans("ActionOnCompany").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); + if ($act->societe->id && $act->type_code == 'AC_TEL') + { + if ($act->societe->fetch($act->societe->id)) { - print '
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("EventOnFullDay").''.yn($act->fulldayevent).'
'.$langs->trans("DateActionStart").''; - if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour'); - else print dol_print_date($act->datep,'day'); - if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); - print ''."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendar').' '; - print '
'."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarweek').' '; - print '
'."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarday').' '; - print '
'."\n"; - print '
'.$langs->trans("DateActionEnd").''; - if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour'); - else print dol_print_date($act->datef,'day'); - if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); - print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - print $act->getLibStatut(4); - print '
'.$langs->trans("Location").''.$act->location.'


'; - - - // Third party - Contact - print ''; - print ''; - print ''; - - // Project - if (! empty($conf->projet->enabled)) - { - print ''; - } - - // Priority - print ''; - - - print '
'.$langs->trans("ActionOnCompany").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); - if ($act->societe->id && $act->type_code == 'AC_TEL') - { - if ($act->societe->fetch($act->societe->id)) - { - print "
".dol_print_phone($act->societe->tel); - } - } - print '
'.$langs->trans("Contact").''; - if ($act->contact->id > 0) - { - print $act->contact->getNomUrl(1); - if ($act->contact->id && $act->type_code == 'AC_TEL') - { - if ($act->contact->fetch($act->contact->id)) - { - print "
".dol_print_phone($act->contact->phone_pro); - } - } - } - else - { - print $langs->trans("None"); - } - - print '
'.$langs->trans("Project").''; - if ($act->fk_project) - { - $project=new Project($db); - $project->fetch($act->fk_project); - print $project->getNomUrl(1); - } - print '
'.$langs->trans("Priority").''; - print ($act->priority?$act->priority:''); - print '


'; - - // Construit liste des fichiers - $filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - $totalsize=0; - foreach($filearray as $key => $file) + } + print ''; + print ''; + print ''; - print ''; - print '
'.$langs->trans("Contact").''; + if ($act->contact->id > 0) + { + print $act->contact->getNomUrl(1); + if ($act->contact->id && $act->type_code == 'AC_TEL') { - $totalsize+=$file['size']; + if ($act->contact->fetch($act->contact->id)) + { + print "
".dol_print_phone($act->contact->phone_pro); + } } - - - print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; - - print '
'; - - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act); - - - // List of document - $param='&id='.$act->id; - $formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create); } else { - dol_print_error($db); + print $langs->trans("None"); } + + print ''; + + // Project + if (! empty($conf->projet->enabled)) + { + print ''.$langs->trans("Project").''; + if ($act->fk_project) + { + $project=new Project($db); + $project->fetch($act->fk_project); + print $project->getNomUrl(1); + } + print ''; + } + + // Priority + print ''.$langs->trans("Priority").''; + print ($act->priority?$act->priority:''); + print ''; + + + print '

'; + + // Construit liste des fichiers + $filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); + $totalsize=0; + foreach($filearray as $key => $file) + { + $totalsize+=$file['size']; + } + + + print ''; + print ''; + print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; + + print ''; + + + // Affiche formulaire upload + $formfile=new FormFile($db); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act); + + + // List of document + $param='&id='.$act->id; + $formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create); } else { From 733872e9c90bcbbd263260c228f4e6eeb6b09d11 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 14:47:37 +0200 Subject: [PATCH 019/167] Fix: merge problem --- htdocs/comm/action/document.php | 323 ++++++++++++++++---------------- 1 file changed, 162 insertions(+), 161 deletions(-) diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 042f330b199..6a576c580ca 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -51,6 +51,19 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } +$act = new ActionComm($db); + +if ($objectid > 0) +{ + $ret = $act->fetch($objectid); + if ($ret > 0) { + $company=new Societe($db); + $company->fetch($act->societe->id); + $act->societe=$company; // For backward compatibility + $act->thirdparty=$company; + } +} + // Get parameters $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -79,7 +92,7 @@ if ($action == 'delete') { $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); $file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file); + $ret=dol_delete_file($file,0,0,0,$act); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); $action=''; @@ -96,184 +109,172 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; llxHeader('',$langs->trans("Agenda"),$help_url); -if ($objectid > 0) +if ($act->id > 0) { - $act = new ActionComm($db); - if ($act->fetch($objectid)) + $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); + + $author=new User($db); + $author->fetch($act->author->id); + $act->author=$author; + + if ($act->contact->id) $act->fetch_contact($act->contact->id); + + $head=actions_prepare_head($act); + dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action'); + + // Affichage fiche action en mode visu + print ''; + + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + + // Type + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); + print ''; + } - $company=new Societe($db); - $company->fetch($act->societe->id); - $act->societe=$company; + // Title + print ''; - $author=new User($db); - $author->fetch($act->author->id); - $act->author=$author; + // Full day event + print ''; - if ($act->contact->id) $act->fetch_contact($act->contact->id); + // Date start + print ''; + print ''; + print ''; - $head=actions_prepare_head($act); - dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action'); + // Date end + print ''; - // Affichage fiche action en mode visu - print '
'.$langs->trans("Ref").''; + print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); + print '
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("EventOnFullDay").''.yn($act->fulldayevent).'
'.$langs->trans("DateActionStart").''; + if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour'); + else print dol_print_date($act->datep,'day'); + if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); + print ''."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendar').' '; + print '
'."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarweek').' '; + print '
'."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarday').' '; + print '
'."\n"; + print '
'.$langs->trans("DateActionEnd").''; + if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour'); + else print dol_print_date($act->datef,'day'); + if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); + print '
'; + // Status + print ''; - $linkback = ''.$langs->trans("BackToList").''; + // Location + print ''; - // Ref - print ''; - // Type - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) + print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print $act->getLibStatut(4); + print '
'.$langs->trans("Location").''.$act->location.'
'.$langs->trans("Ref").''; - print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); - print '


'; + + + // Third party - Contact + print ''; + print "
".dol_print_phone($act->societe->tel); } - - // Title - print ''; - - // Full day event - print ''; - - // Date start - print ''; - print ''; - print ''; - - // Date end - print ''; - - // Status - print ''; - - // Location - print ''; - - - print '
'.$langs->trans("ActionOnCompany").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); + if ($act->societe->id && $act->type_code == 'AC_TEL') + { + if ($act->societe->fetch($act->societe->id)) { - print '
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("EventOnFullDay").''.yn($act->fulldayevent).'
'.$langs->trans("DateActionStart").''; - if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour'); - else print dol_print_date($act->datep,'day'); - if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); - print ''."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendar').' '; - print '
'."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarweek').' '; - print '
'."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarday').' '; - print '
'."\n"; - print '
'.$langs->trans("DateActionEnd").''; - if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour'); - else print dol_print_date($act->datef,'day'); - if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); - print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - print $act->getLibStatut(4); - print '
'.$langs->trans("Location").''.$act->location.'


'; - - - // Third party - Contact - print ''; - print ''; - print ''; - - // Project - if (! empty($conf->projet->enabled)) - { - print ''; - } - - // Priority - print ''; - - - print '
'.$langs->trans("ActionOnCompany").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); - if ($act->societe->id && $act->type_code == 'AC_TEL') - { - if ($act->societe->fetch($act->societe->id)) - { - print "
".dol_print_phone($act->societe->tel); - } - } - print '
'.$langs->trans("Contact").''; - if ($act->contact->id > 0) - { - print $act->contact->getNomUrl(1); - if ($act->contact->id && $act->type_code == 'AC_TEL') - { - if ($act->contact->fetch($act->contact->id)) - { - print "
".dol_print_phone($act->contact->phone_pro); - } - } - } - else - { - print $langs->trans("None"); - } - - print '
'.$langs->trans("Project").''; - if ($act->fk_project) - { - $project=new Project($db); - $project->fetch($act->fk_project); - print $project->getNomUrl(1); - } - print '
'.$langs->trans("Priority").''; - print ($act->priority?$act->priority:''); - print '


'; - - // Construit liste des fichiers - $filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - $totalsize=0; - foreach($filearray as $key => $file) + } + print ''; + print ''; + print ''; - print ''; - print '
'.$langs->trans("Contact").''; + if ($act->contact->id > 0) + { + print $act->contact->getNomUrl(1); + if ($act->contact->id && $act->type_code == 'AC_TEL') { - $totalsize+=$file['size']; + if ($act->contact->fetch($act->contact->id)) + { + print "
".dol_print_phone($act->contact->phone_pro); + } } - - - print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; - - print ''; - - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act); - - - // List of document - $param='&id='.$act->id; - $formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create); } else { - dol_print_error($db); + print $langs->trans("None"); } + + print ''; + + // Project + if (! empty($conf->projet->enabled)) + { + print ''.$langs->trans("Project").''; + if ($act->fk_project) + { + $project=new Project($db); + $project->fetch($act->fk_project); + print $project->getNomUrl(1); + } + print ''; + } + + // Priority + print ''.$langs->trans("Priority").''; + print ($act->priority?$act->priority:''); + print ''; + + + print '

'; + + // Construit liste des fichiers + $filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); + $totalsize=0; + foreach($filearray as $key => $file) + { + $totalsize+=$file['size']; + } + + + print ''; + print ''; + print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; + + print ''; + + + // Affiche formulaire upload + $formfile=new FormFile($db); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act); + + + // List of document + $param='&id='.$act->id; + $formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create); } else { From b5e66cc4920958159a3491c37da4e144624f0ff6 Mon Sep 17 00:00:00 2001 From: jfefe Date: Mon, 22 Apr 2013 15:00:29 +0200 Subject: [PATCH 020/167] Mutualize code for security check when accessing a document by document.php and bywebservice --- htdocs/core/lib/files.lib.php | 358 ++++++++++++++++++++++++++++ htdocs/document.php | 341 +------------------------- htdocs/webservices/server_other.php | 47 +--- 3 files changed, 366 insertions(+), 380 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 02d3cc16a76..9aea97696ec 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1228,4 +1228,362 @@ function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('\.meta$ return $tmparray[0]; } +/** + * Security check when accessing to a document (used in document.php and webservices) + * @param string $modulepart module of document + * @param string $original_file relative path with filename + * @return mixed Array with access information : accessallowed & sqlprotectagainstexternals + */ +function dol_check_secure_access_document($modulepart,&$original_file) +{ + global $user, $conf; + + $accessallowed=0; + $sqlprotectagainstexternals=''; + $ret=array(); + + if ($modulepart) + { + // On fait une verification des droits et on definit le repertoire concerne + + // Wrapping for third parties + if ($modulepart == 'company' || $modulepart == 'societe') + { + if ($user->rights->societe->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->societe->multidir_output[$entity].'/'.$original_file; + $sqlprotectagainstexternals = "SELECT rowid as fk_soc FROM ".MAIN_DB_PREFIX."societe WHERE rowid='".$refname."' AND entity IN (".getEntity('societe', 1).")"; + } + + // Wrapping for invoices + else if ($modulepart == 'facture' || $modulepart == 'invoice') + { + if ($user->rights->facture->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->facture->dir_output.'/'.$original_file; + $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture WHERE ref='".$refname."' AND entity=".$conf->entity; + } + + else if ($modulepart == 'unpaid') + { + if ($user->rights->facture->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->facture->dir_output.'/unpaid/temp/'.$original_file; + } + + // Wrapping pour les fiches intervention + else if ($modulepart == 'ficheinter') + { + if ($user->rights->ficheinter->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->ficheinter->dir_output.'/'.$original_file; + $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$refname."' AND entity=".$conf->entity; + } + + // Wrapping pour les deplacements et notes de frais + else if ($modulepart == 'deplacement') + { + if ($user->rights->deplacement->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->deplacement->dir_output.'/'.$original_file; + //$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$refname."' AND entity=".$conf->entity; + } + + // Wrapping pour les prelevements + else if ($modulepart == 'prelevement') + { + if ($user->rights->prelevement->bons->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->prelevement->dir_output.'/'.$original_file; + } + + // Wrapping pour les propales + else if ($modulepart == 'propal') + { + if ($user->rights->propale->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + + $original_file=$conf->propal->dir_output.'/'.$original_file; + $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."propal WHERE ref='".$refname."' AND entity=".$conf->entity; + } + + // Wrapping pour les commandes + else if ($modulepart == 'commande' || $modulepart == 'order') + { + if ($user->rights->commande->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->commande->dir_output.'/'.$original_file; + $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande WHERE ref='".$refname."' AND entity=".$conf->entity; + } + + // Wrapping pour les projets + else if ($modulepart == 'project') + { + if ($user->rights->projet->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->projet->dir_output.'/'.$original_file; + $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$refname."' AND entity=".$conf->entity; + } + + // Wrapping pour les commandes fournisseurs + else if ($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') + { + if ($user->rights->fournisseur->commande->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->fournisseur->commande->dir_output.'/'.$original_file; + $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande_fournisseur WHERE ref='".$refname."' AND entity=".$conf->entity; + } + + // Wrapping pour les factures fournisseurs + else if ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') + { + if ($user->rights->fournisseur->facture->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->fournisseur->facture->dir_output.'/'.$original_file; + $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn WHERE facnumber='".$refname."' AND entity=".$conf->entity; + } + + // Wrapping pour les rapport de paiements + else if ($modulepart == 'facture_paiement') + { + if ($user->rights->facture->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + if ($user->societe_id > 0) $original_file=$conf->facture->dir_output.'/payments/private/'.$user->id.'/'.$original_file; + else $original_file=$conf->facture->dir_output.'/payments/'.$original_file; + } + + // Wrapping pour les exports de compta + else if ($modulepart == 'export_compta') + { + if ($user->rights->compta->ventilation->creer || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->compta->dir_output.'/'.$original_file; + } + + // Wrapping pour les expedition + else if ($modulepart == 'expedition') + { + if ($user->rights->expedition->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->expedition->dir_output."/sending/".$original_file; + } + + // Wrapping pour les bons de livraison + else if ($modulepart == 'livraison') + { + if ($user->rights->expedition->livraison->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->expedition->dir_output."/receipt/".$original_file; + } + + // Wrapping pour les actions + else if ($modulepart == 'actions') + { + if ($user->rights->agenda->myactions->read || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->agenda->dir_output.'/'.$original_file; + } + + // Wrapping pour les actions + else if ($modulepart == 'actionsreport') + { + if ($user->rights->agenda->allactions->read || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file = $conf->agenda->dir_temp."/".$original_file; + } + + // Wrapping pour les produits et services + else if ($modulepart == 'produit' || $modulepart == 'service') + { + if (($user->rights->produit->lire || $user->rights->service->lire) || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + if (! empty($conf->product->enabled)) $original_file=$conf->product->multidir_output[$entity].'/'.$original_file; + elseif (! empty($conf->service->enabled)) $original_file=$conf->service->multidir_output[$entity].'/'.$original_file; + } + + // Wrapping pour les contrats + else if ($modulepart == 'contract') + { + if ($user->rights->contrat->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->contrat->dir_output.'/'.$original_file; + } + + // Wrapping pour les dons + else if ($modulepart == 'donation') + { + if ($user->rights->don->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->don->dir_output.'/'.$original_file; + } + + // Wrapping pour les remises de cheques + else if ($modulepart == 'remisecheque') + { + if ($user->rights->banque->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + + $original_file=$conf->banque->dir_output.'/bordereau/'.get_exdir(basename($original_file,".pdf"),2,1).$original_file; + } + + // Wrapping for export module + else if ($modulepart == 'export') + { + // Aucun test necessaire car on force le rep de download sur + // le rep export qui est propre a l'utilisateur + $accessallowed=1; + $original_file=$conf->export->dir_temp.'/'.$user->id.'/'.$original_file; + } + + // Wrapping for import module + else if ($modulepart == 'import') + { + // Aucun test necessaire car on force le rep de download sur + // le rep export qui est propre a l'utilisateur + $accessallowed=1; + $original_file=$conf->import->dir_temp.'/'.$original_file; + } + + // Wrapping pour l'editeur wysiwyg + else if ($modulepart == 'editor') + { + // Aucun test necessaire car on force le rep de download sur + // le rep export qui est propre a l'utilisateur + $accessallowed=1; + $original_file=$conf->fckeditor->dir_output.'/'.$original_file; + } + + // Wrapping pour les backups + else if ($modulepart == 'systemtools') + { + if ($user->admin) + { + $accessallowed=1; + } + $original_file=$conf->admin->dir_output.'/'.$original_file; + } + + // Wrapping for upload file test + else if ($modulepart == 'admin_temp') + { + if ($user->admin) + $accessallowed=1; + $original_file=$conf->admin->dir_temp.'/'.$original_file; + } + + // Wrapping pour BitTorrent + else if ($modulepart == 'bittorrent') + { + $accessallowed=1; + $dir='files'; + if ($type == 'application/x-bittorrent') $dir='torrents'; + $original_file=$conf->bittorrent->dir_output.'/'.$dir.'/'.$original_file; + } + + // Wrapping pour Foundation module + else if ($modulepart == 'member') + { + if ($user->rights->adherent->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->adherent->dir_output.'/'.$original_file; + } + + // Wrapping for Scanner + else if ($modulepart == 'scanner_user_temp') + { + $accessallowed=1; + $original_file=$conf->scanner->dir_temp.'/'.$user->id.'/'.$original_file; + } + + // Generic wrapping + else + { + // For dir temp + $dir_temp=false; + if (preg_match('/\_temp$/i', $modulepart)) { + $modulepart = str_replace('_temp', '', $modulepart); + $dir_temp=true; + } + // Define $accessallowed + if (($user->rights->$modulepart->lire) || ($user->rights->$modulepart->read) || ($user->rights->$modulepart->download)) $accessallowed=1; // No subpermission, we have checked on main permission + elseif (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a specimen + elseif ($user->admin) $accessallowed=1; // If user is admin + + // For modules who wants to manage different levels of permissions for documents + $subPermCategoryConstName = strtoupper($modulepart).'_SUBPERMCATEGORY_FOR_DOCUMENTS'; + if (! empty($conf->global->$subPermCategoryConstName)) + { + $subPermCategory = $conf->global->$subPermCategoryConstName; + if (! empty($subPermCategory) && (($user->rights->$modulepart->$subPermCategory->lire) || ($user->rights->$modulepart->$subPermCategory->read) || ($user->rights->$modulepart->$subPermCategory->download))) + { + $accessallowed=1; + } + } + + // Define $original_file + $dir = $conf->$modulepart->dir_output; + if ($dir_temp) $dir = $conf->$modulepart->dir_temp; + $original_file = $dir.'/'.$original_file; + + // Define $sqlprotectagainstexternals for modules who want to protect access using a SQL query. + $sqlProtectConstName = strtoupper($modulepart).'_SQLPROTECTAGAINSTEXTERNALS_FOR_DOCUMENTS'; + if (! empty($conf->global->$sqlProtectConstName)) // If module want to define its own $sqlprotectagainstexternals + { + // Example: mymodule__SQLPROTECTAGAINSTEXTERNALS_FOR_DOCUMENTS = "SELECT fk_soc FROM ".MAIN_DB_PREFIX.$modulepart." WHERE ref='".$refname."' AND entity=".$conf->entity; + eval('$sqlprotectagainstexternals = "'.$conf->global->$sqlProtectConstName.'";'); + } + } + + $ret = array( + 'accessallowed' => $accessallowed, + 'sqlprotectagainstexternals'=>$sqlprotectagainstexternals + ); + + } + return $ret; +} ?> diff --git a/htdocs/document.php b/htdocs/document.php index 2a04ba28a74..7e7132db901 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -96,344 +96,9 @@ $refname=basename(dirname($original_file)."/"); // Security check $accessallowed=0; -$sqlprotectagainstexternals=''; -if ($modulepart) -{ - // On fait une verification des droits et on definit le repertoire concerne - - // Wrapping for third parties - if ($modulepart == 'company' || $modulepart == 'societe') - { - if ($user->rights->societe->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->societe->multidir_output[$entity].'/'.$original_file; - $sqlprotectagainstexternals = "SELECT rowid as fk_soc FROM ".MAIN_DB_PREFIX."societe WHERE rowid='".$refname."' AND entity IN (".getEntity('societe', 1).")"; - } - - // Wrapping for invoices - else if ($modulepart == 'facture' || $modulepart == 'invoice') - { - if ($user->rights->facture->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->facture->dir_output.'/'.$original_file; - $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture WHERE ref='".$refname."' AND entity=".$conf->entity; - } - - else if ($modulepart == 'unpaid') - { - if ($user->rights->facture->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->facture->dir_output.'/unpaid/temp/'.$original_file; - } - - // Wrapping pour les fiches intervention - else if ($modulepart == 'ficheinter') - { - if ($user->rights->ficheinter->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->ficheinter->dir_output.'/'.$original_file; - $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$refname."' AND entity=".$conf->entity; - } - - // Wrapping pour les deplacements et notes de frais - else if ($modulepart == 'deplacement') - { - if ($user->rights->deplacement->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->deplacement->dir_output.'/'.$original_file; - //$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$refname."' AND entity=".$conf->entity; - } - - // Wrapping pour les prelevements - else if ($modulepart == 'prelevement') - { - if ($user->rights->prelevement->bons->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->prelevement->dir_output.'/'.$original_file; - } - - // Wrapping pour les propales - else if ($modulepart == 'propal') - { - if ($user->rights->propale->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - - $original_file=$conf->propal->dir_output.'/'.$original_file; - $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."propal WHERE ref='".$refname."' AND entity=".$conf->entity; - } - - // Wrapping pour les commandes - else if ($modulepart == 'commande' || $modulepart == 'order') - { - if ($user->rights->commande->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->commande->dir_output.'/'.$original_file; - $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande WHERE ref='".$refname."' AND entity=".$conf->entity; - } - - // Wrapping pour les projets - else if ($modulepart == 'project') - { - if ($user->rights->projet->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->projet->dir_output.'/'.$original_file; - $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$refname."' AND entity=".$conf->entity; - } - - // Wrapping pour les commandes fournisseurs - else if ($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') - { - if ($user->rights->fournisseur->commande->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->fournisseur->commande->dir_output.'/'.$original_file; - $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande_fournisseur WHERE ref='".$refname."' AND entity=".$conf->entity; - } - - // Wrapping pour les factures fournisseurs - else if ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') - { - if ($user->rights->fournisseur->facture->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->fournisseur->facture->dir_output.'/'.$original_file; - $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn WHERE facnumber='".$refname."' AND entity=".$conf->entity; - } - - // Wrapping pour les rapport de paiements - else if ($modulepart == 'facture_paiement') - { - if ($user->rights->facture->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - if ($user->societe_id > 0) $original_file=$conf->facture->dir_output.'/payments/private/'.$user->id.'/'.$original_file; - else $original_file=$conf->facture->dir_output.'/payments/'.$original_file; - } - - // Wrapping pour les exports de compta - else if ($modulepart == 'export_compta') - { - if ($user->rights->compta->ventilation->creer || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->compta->dir_output.'/'.$original_file; - } - - // Wrapping pour les expedition - else if ($modulepart == 'expedition') - { - if ($user->rights->expedition->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->expedition->dir_output."/sending/".$original_file; - } - - // Wrapping pour les bons de livraison - else if ($modulepart == 'livraison') - { - if ($user->rights->expedition->livraison->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->expedition->dir_output."/receipt/".$original_file; - } - - // Wrapping pour les actions - else if ($modulepart == 'actions') - { - if ($user->rights->agenda->myactions->read || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->agenda->dir_output.'/'.$original_file; - } - - // Wrapping pour les actions - else if ($modulepart == 'actionsreport') - { - if ($user->rights->agenda->allactions->read || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file = $conf->agenda->dir_temp."/".$original_file; - } - - // Wrapping pour les produits et services - else if ($modulepart == 'produit' || $modulepart == 'service') - { - if (($user->rights->produit->lire || $user->rights->service->lire) || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - if (! empty($conf->product->enabled)) $original_file=$conf->product->multidir_output[$entity].'/'.$original_file; - elseif (! empty($conf->service->enabled)) $original_file=$conf->service->multidir_output[$entity].'/'.$original_file; - } - - // Wrapping pour les contrats - else if ($modulepart == 'contract') - { - if ($user->rights->contrat->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->contrat->dir_output.'/'.$original_file; - } - - // Wrapping pour les dons - else if ($modulepart == 'donation') - { - if ($user->rights->don->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->don->dir_output.'/'.$original_file; - } - - // Wrapping pour les remises de cheques - else if ($modulepart == 'remisecheque') - { - if ($user->rights->banque->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - - $original_file=$conf->banque->dir_output.'/bordereau/'.get_exdir(basename($original_file,".pdf"),2,1).$original_file; - } - - // Wrapping for export module - else if ($modulepart == 'export') - { - // Aucun test necessaire car on force le rep de download sur - // le rep export qui est propre a l'utilisateur - $accessallowed=1; - $original_file=$conf->export->dir_temp.'/'.$user->id.'/'.$original_file; - } - - // Wrapping for import module - else if ($modulepart == 'import') - { - // Aucun test necessaire car on force le rep de download sur - // le rep export qui est propre a l'utilisateur - $accessallowed=1; - $original_file=$conf->import->dir_temp.'/'.$original_file; - } - - // Wrapping pour l'editeur wysiwyg - else if ($modulepart == 'editor') - { - // Aucun test necessaire car on force le rep de download sur - // le rep export qui est propre a l'utilisateur - $accessallowed=1; - $original_file=$conf->fckeditor->dir_output.'/'.$original_file; - } - - // Wrapping pour les backups - else if ($modulepart == 'systemtools') - { - if ($user->admin) - { - $accessallowed=1; - } - $original_file=$conf->admin->dir_output.'/'.$original_file; - } - - // Wrapping for upload file test - else if ($modulepart == 'admin_temp') - { - if ($user->admin) - $accessallowed=1; - $original_file=$conf->admin->dir_temp.'/'.$original_file; - } - - // Wrapping pour BitTorrent - else if ($modulepart == 'bittorrent') - { - $accessallowed=1; - $dir='files'; - if ($type == 'application/x-bittorrent') $dir='torrents'; - $original_file=$conf->bittorrent->dir_output.'/'.$dir.'/'.$original_file; - } - - // Wrapping pour Foundation module - else if ($modulepart == 'member') - { - if ($user->rights->adherent->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->adherent->dir_output.'/'.$original_file; - } - - // Wrapping for Scanner - else if ($modulepart == 'scanner_user_temp') - { - $accessallowed=1; - $original_file=$conf->scanner->dir_temp.'/'.$user->id.'/'.$original_file; - } - - // Generic wrapping - else - { - // For dir temp - $dir_temp=false; - if (preg_match('/\_temp$/i', $modulepart)) { - $modulepart = str_replace('_temp', '', $modulepart); - $dir_temp=true; - } - // Define $accessallowed - if (($user->rights->$modulepart->lire) || ($user->rights->$modulepart->read) || ($user->rights->$modulepart->download)) $accessallowed=1; // No subpermission, we have checked on main permission - elseif (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a specimen - elseif ($user->admin) $accessallowed=1; // If user is admin - - // For modules who wants to manage different levels of permissions for documents - $subPermCategoryConstName = strtoupper($modulepart).'_SUBPERMCATEGORY_FOR_DOCUMENTS'; - if (! empty($conf->global->$subPermCategoryConstName)) - { - $subPermCategory = $conf->global->$subPermCategoryConstName; - if (! empty($subPermCategory) && (($user->rights->$modulepart->$subPermCategory->lire) || ($user->rights->$modulepart->$subPermCategory->read) || ($user->rights->$modulepart->$subPermCategory->download))) - { - $accessallowed=1; - } - } - - // Define $original_file - $dir = $conf->$modulepart->dir_output; - if ($dir_temp) $dir = $conf->$modulepart->dir_temp; - $original_file = $dir.'/'.$original_file; - - // Define $sqlprotectagainstexternals for modules who want to protect access using a SQL query. - $sqlProtectConstName = strtoupper($modulepart).'_SQLPROTECTAGAINSTEXTERNALS_FOR_DOCUMENTS'; - if (! empty($conf->global->$sqlProtectConstName)) // If module want to define its own $sqlprotectagainstexternals - { - // Example: mymodule__SQLPROTECTAGAINSTEXTERNALS_FOR_DOCUMENTS = "SELECT fk_soc FROM ".MAIN_DB_PREFIX.$modulepart." WHERE ref='".$refname."' AND entity=".$conf->entity; - eval('$sqlprotectagainstexternals = "'.$conf->global->$sqlProtectConstName.'";'); - } - } -} - +$check_access = dol_check_secure_access_document($modulepart,$original_file); +$accessallowed=$check_access['accessallowed']; +$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; // Basic protection (against external users only) if ($user->societe_id > 0) diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php index 3578796838b..23c22807002 100644 --- a/htdocs/webservices/server_other.php +++ b/htdocs/webservices/server_other.php @@ -220,48 +220,11 @@ function getDocument($authentication, $modulepart, $file) // find the subdirectory name as the reference $refname=basename(dirname($original_file)."/"); - // Wrapping for invoices - if ($modulepart == 'facture') - { - if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file = $conf->facture->dir_output.'/'.$original_file; - $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture WHERE ref='".$refname."' AND entity=".$conf->entity; - } - // Wrapping pour les propales - else if ($modulepart == 'propal') - { - if ($fuser->rights->propal->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file = $conf->propal->dir_output.'/'.$original_file; - $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."propal WHERE ref='".$refname."' AND entity=".$conf->entity; - } - - // Wrapping pour les commandes - else if ($modulepart == 'commande') - { - if ($fuser->rights->commande->lire || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->commande->dir_output.'/'.$original_file; - $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande WHERE ref='".$refname."' AND entity=".$conf->entity; - } - // Wrapping pour generic module - else - { - if ($fuser->rights->$modulepart->read || preg_match('/^specimen/i',$original_file)) - { - $accessallowed=1; - } - $original_file=$conf->$modulepart->dir_output.'/'.$original_file; - // TODO - //$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."registration WHERE ref='".$refname."' AND entity=".$conf->entity; - } + // Security check + $accessallowed=0; + $check_access = dol_check_secure_access_document($modulepart,$original_file); + $accessallowed=$check_access['accessallowed']; + $sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; // Basic protection (against external users only) if ($fuser->societe_id > 0) From 29a8c10504369d925bc17b0814a28ef152c6ca49 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 15:09:19 +0200 Subject: [PATCH 021/167] Fix: broken features --- htdocs/compta/sociales/class/chargesociales.class.php | 2 +- htdocs/compta/sociales/document.php | 4 ++-- htdocs/core/class/fileupload.class.php | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 6fbd0a23143..f62b2fcc594 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class ChargeSociales extends CommonObject { - public $element='rowid'; + public $element='chargesociales'; public $table='chargesociales'; public $table_element='chargesociales'; diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index dcb082b41d7..452de21285a 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -79,7 +79,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ($action == 'delete') { $file = $upload_dir . '/' . GETPOST("urlfile"); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file); + $ret=dol_delete_file($file,0,0,0,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); } @@ -172,7 +172,7 @@ if ($object->id) // Affiche formulaire upload $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer,50,$object); // List of document diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index a86073e6969..6bb5b9209d1 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -94,6 +94,10 @@ class FileUpload elseif ($element == 'action') { $pathname = 'comm/action'; $filename='actioncomm'; $dir_output=$conf->agenda->dir_output; + } + elseif ($element == 'chargesociales') { + $pathname = 'compta/sociales'; $filename='chargesociales'; + $dir_output=$conf->tax->dir_output; } else { $dir_output=$conf->$element->dir_output; } From ccf809b14aca83272451863534d767dc80291df1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 15:09:19 +0200 Subject: [PATCH 022/167] Fix: broken features --- htdocs/compta/sociales/class/chargesociales.class.php | 2 +- htdocs/compta/sociales/document.php | 4 ++-- htdocs/core/class/fileupload.class.php | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 6fbd0a23143..f62b2fcc594 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class ChargeSociales extends CommonObject { - public $element='rowid'; + public $element='chargesociales'; public $table='chargesociales'; public $table_element='chargesociales'; diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index dcb082b41d7..452de21285a 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -79,7 +79,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ($action == 'delete') { $file = $upload_dir . '/' . GETPOST("urlfile"); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file); + $ret=dol_delete_file($file,0,0,0,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); } @@ -172,7 +172,7 @@ if ($object->id) // Affiche formulaire upload $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer,50,$object); // List of document diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index a86073e6969..6bb5b9209d1 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -94,6 +94,10 @@ class FileUpload elseif ($element == 'action') { $pathname = 'comm/action'; $filename='actioncomm'; $dir_output=$conf->agenda->dir_output; + } + elseif ($element == 'chargesociales') { + $pathname = 'compta/sociales'; $filename='chargesociales'; + $dir_output=$conf->tax->dir_output; } else { $dir_output=$conf->$element->dir_output; } From 28757c8d8888db695fedc32b62dcf69ec8e3a205 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 15:26:14 +0200 Subject: [PATCH 023/167] Fix: missing commit --- htdocs/core/class/fileupload.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 6bb5b9209d1..910ad55e0a0 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -91,6 +91,9 @@ class FileUpload $pathname = 'fourn'; $filename='fournisseur.facture'; $dir_output=$conf->fournisseur->facture->dir_output; } + elseif ($element == 'product') { + $dir_output = $conf->product->multidir_output[$conf->entity]; + } elseif ($element == 'action') { $pathname = 'comm/action'; $filename='actioncomm'; $dir_output=$conf->agenda->dir_output; From 7217d91f132b76b14ccaf5541e07e23755fd13ee Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 15:26:14 +0200 Subject: [PATCH 024/167] Fix: missing commit --- htdocs/core/class/fileupload.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 6bb5b9209d1..910ad55e0a0 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -91,6 +91,9 @@ class FileUpload $pathname = 'fourn'; $filename='fournisseur.facture'; $dir_output=$conf->fournisseur->facture->dir_output; } + elseif ($element == 'product') { + $dir_output = $conf->product->multidir_output[$conf->entity]; + } elseif ($element == 'action') { $pathname = 'comm/action'; $filename='actioncomm'; $dir_output=$conf->agenda->dir_output; From ee4839c92ed0ba2983936690b0394c9cd885c159 Mon Sep 17 00:00:00 2001 From: fhenry Date: Mon, 22 Apr 2013 15:50:26 +0200 Subject: [PATCH 025/167] Better management for ODT to PDF --- .../doc/doc_generic_order_odt.modules.php | 12 ++++++- .../doc/doc_generic_invoice_odt.modules.php | 12 ++++++- .../pdf/doc_generic_project_odt.modules.php | 12 ++++++- .../doc/doc_generic_proposal_odt.modules.php | 12 ++++++- .../societe/doc/doc_generic_odt.modules.php | 12 ++++++- htdocs/includes/odtphp/odf.php | 31 ++++++++++------- htdocs/includes/odtphp/odt2pdf.sh | 33 ++++++++++++++++--- 7 files changed, 103 insertions(+), 21 deletions(-) diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 3330f491e70..623a6b9c8c6 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -520,10 +520,20 @@ class doc_generic_order_odt extends ModelePDFCommandes // Write new file if (!empty($conf->global->MAIN_ODT_AS_PDF)) { - $odfHandler->exportAsAttachedPDF($file); + try { + $odfHandler->exportAsAttachedPDF($file); + }catch (Exception $e){ + $this->error=$e->getMessage(); + return -1; + } } else { + try { $odfHandler->saveToDisk($file); + }catch (Exception $e){ + $this->error=$e->getMessage(); + return -1; + } } if (! empty($conf->global->MAIN_UMASK)) diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 8aa417c83c0..b65c6171430 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -498,10 +498,20 @@ class doc_generic_invoice_odt extends ModelePDFFactures // Write new file if (!empty($conf->global->MAIN_ODT_AS_PDF)) { - $odfHandler->exportAsAttachedPDF($file); + try { + $odfHandler->exportAsAttachedPDF($file); + }catch (Exception $e){ + $this->error=$e->getMessage(); + return -1; + } } else { + try { $odfHandler->saveToDisk($file); + }catch (Exception $e){ + $this->error=$e->getMessage(); + return -1; + } } if (! empty($conf->global->MAIN_UMASK)) diff --git a/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php index 4c81babaa55..a2f8c5fd07a 100644 --- a/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php @@ -974,10 +974,20 @@ class doc_generic_project_odt extends ModelePDFProjects // Write new file if (!empty($conf->global->MAIN_ODT_AS_PDF)) { - $odfHandler->exportAsAttachedPDF($file); + try { + $odfHandler->exportAsAttachedPDF($file); + }catch (Exception $e){ + $this->error=$e->getMessage(); + return -1; + } } else { + try { $odfHandler->saveToDisk($file); + }catch (Exception $e){ + $this->error=$e->getMessage(); + return -1; + } } if (! empty($conf->global->MAIN_UMASK)) diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index d4e485562a4..6a7384ba4d9 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -483,10 +483,20 @@ class doc_generic_proposal_odt extends ModelePDFPropales // Write new file if (!empty($conf->global->MAIN_ODT_AS_PDF)) { - $odfHandler->exportAsAttachedPDF($file); + try { + $odfHandler->exportAsAttachedPDF($file); + }catch (Exception $e){ + $this->error=$e->getMessage(); + return -1; + } } else { + try { $odfHandler->saveToDisk($file); + }catch (Exception $e){ + $this->error=$e->getMessage(); + return -1; + } } if (! empty($conf->global->MAIN_UMASK)) diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index ca93ab1880e..fc609a3de61 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -314,10 +314,20 @@ class doc_generic_odt extends ModeleThirdPartyDoc // Write new file if (!empty($conf->global->MAIN_ODT_AS_PDF)) { - $odfHandler->exportAsAttachedPDF($file); + try { + $odfHandler->exportAsAttachedPDF($file); + }catch (Exception $e){ + $this->error=$e->getMessage(); + return -1; + } } else { + try { $odfHandler->saveToDisk($file); + }catch (Exception $e){ + $this->error=$e->getMessage(); + return -1; + } } if (! empty($conf->global->MAIN_UMASK)) diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 03136a20b63..5326af0e116 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -452,14 +452,17 @@ IMG; if( $name == "" ) $name = md5(uniqid()); - //dol_syslog(get_class($this).'::exportAsAttachedPDF $name='.$name, LOG_DEBUG); + dol_syslog(get_class($this).'::exportAsAttachedPDF $name='.$name, LOG_DEBUG); $this->saveToDisk($name); $execmethod=(empty($conf->global->MAIN_EXEC_USE_POPEN)?1:2); // 1 or 2 - + $name=str_replace('.odt', '', $name); $command = DOL_DOCUMENT_ROOT.'/includes/odtphp/odt2pdf.sh '.$name; + //$dirname=dirname($name); + //$command = DOL_DOCUMENT_ROOT.'/includes/odtphp/odt2pdf.sh '.$name.' '.$dirname; + dol_syslog(get_class($this).'::exportAsAttachedPDF $execmethod='.$execmethod.' Run command='.$command,LOG_DEBUG); if ($execmethod == 1) { @@ -471,7 +474,7 @@ IMG; $handle = fopen($outputfile, 'w'); if ($handle) { - dol_syslog("Run command ".$command); + dol_syslog(get_class($this)."Run command ".$command,LOG_DEBUG); $handlein = popen($command, 'r'); while (!feof($handlein)) { @@ -492,19 +495,25 @@ IMG; throw new OdfException("headers already sent ($filename at $linenum)"); } - /*if (!empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { + if (!empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { header('Content-type: application/pdf'); header('Content-Disposition: attachment; filename="'.$name.'.pdf"'); readfile("$name.pdf"); - }*/ + } unlink("$name.odt"); } else { - //dol_syslog(get_class($this).'::exportAsAttachedPDF $ret_val='.$retval, LOG_DEBUG); - //dol_syslog(get_class($this).'::exportAsAttachedPDF $output_arr='.var_export($output_arr,true), LOG_DEBUG); - echo "Error occured:
"; - foreach($output_arr as $line) - echo $line."
"; - //dol_syslog(get_class($this).'::exportAsAttachedPDF ERROR $line='.$line, LOG_DEBUG); + dol_syslog(get_class($this).'::exportAsAttachedPDF $ret_val='.$retval, LOG_DEBUG); + dol_syslog(get_class($this).'::exportAsAttachedPDF $output_arr='.var_export($output_arr,true), LOG_DEBUG); + + if ($retval==126) { + throw new OdfException('Permission execute convert script : ' . $command); + } + else { + foreach($output_arr as $line) { + $errors.= $line."
"; + } + throw new OdfException('ODT to PDF convert fail : ' . $errors); + } } } diff --git a/htdocs/includes/odtphp/odt2pdf.sh b/htdocs/includes/odtphp/odt2pdf.sh index 28f9ef32b22..9268b4a680f 100755 --- a/htdocs/includes/odtphp/odt2pdf.sh +++ b/htdocs/includes/odtphp/odt2pdf.sh @@ -1,18 +1,41 @@ #!/bin/bash # @copyright GPL License 2010 - Vikas Mahajan - http://vikasmahajan.wordpress.com +# @copyright GPL License 2013 - Florian HEnry - florian.henry@open-concept.pro + +# +#if [ -f "$1.odt" ] +# then +# soffice --invisible --convert-to pdf:writer_pdf_Export --outdir $2 "$1.odt" +# retcode=$? +# if [ $retcode -ne 0 ] +# then +# echo "Error while converting odt to pdf: $retcode"; +# exit 1 +# fi +# else +# echo "Error: Odt file does not exist" +# exit 1 +#fi if [ -f "$1.odt" ] then - pgrep -U `id -u` soffice - if [ $? -ne 0 ] + nbprocess=$(pgrep -c soffice) + if [ $nbprocess -ne 1 ] then - soffice --invisible --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --headless & + soffice --invisible --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --headless + retcode=$? + if [ $retcode -ne 0 ] + then + echo "Error running soffice: $retcode" + exit 1 + fi sleep 2 fi jodconverter "$1.odt" "$1.pdf" - if [ $? -ne 0 ] + retcode=$? + if [ $retcode -ne 0 ] then - echo "Error while converting odt to pdf" + echo "Error while converting odt to pdf: $retcode" exit 1 fi sleep 1 From 7be75cde8dbf94933ee0e98525da9811fe112840 Mon Sep 17 00:00:00 2001 From: jfefe Date: Mon, 22 Apr 2013 16:13:48 +0200 Subject: [PATCH 026/167] Change name of hidden option to add timing in filename (MAIN_DOC_USE_TIMING) --- htdocs/core/modules/societe/doc/doc_generic_odt.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index e748e45a498..750c8004713 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -215,7 +215,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $newfiletmp=preg_replace('/modele_/i','',$newfiletmp); // Get extension (ods or odt) $newfileformat=substr($newfile, strrpos($newfile, '.')+1); - if ( ! empty($conf->global->MAIN_ODT_USE_TIMING)) + if ( ! empty($conf->global->MAIN_DOC_USE_TIMING)) { $filename=$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.'.$newfileformat; } From de5a57a3c8c56823be209b806586b2349cc9919f Mon Sep 17 00:00:00 2001 From: simnandez Date: Mon, 22 Apr 2013 16:23:59 +0200 Subject: [PATCH 027/167] Fix: Uniformize creation in orders --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index f4d7f3581db..ed73b895280 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -658,7 +658,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { $langs->load("orders"); $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); - $newmenu->add("/societe/societe.php?leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer); + $newmenu->add("/commande/fiche.php?action=create", $langs->trans("NewOrder"), 1, $user->rights->commande->creer); $newmenu->add("/commande/liste.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire); if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); From f8ddd69ccbb84db596f31b7a08b46fd2bd6f3d17 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 16:42:44 +0200 Subject: [PATCH 028/167] FIXME regresion if code with not in numeric base --- htdocs/admin/dict.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 5a4db149b87..779a7da96f5 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -448,11 +448,12 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok=0; $msg.= $langs->transnoentities('ErrorCodeCantContainZero').'
'; } - if (!is_numeric($_POST['code'])) + // FIXME regresion if code with not in numeric base + /*if (!is_numeric($_POST['code'])) { $ok = 0; $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'
'; - } + }*/ } if (isset($_POST["pays"]) && $_POST["pays"]=='0') { $ok=0; From 7f6a87ab3585a8aeb8af30a836e4cad11eb776b3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 16:42:44 +0200 Subject: [PATCH 029/167] FIXME regresion if code with not in numeric base --- htdocs/admin/dict.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 41178e36012..ef64ad34527 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -456,11 +456,12 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok=0; $msg.= $langs->transnoentities('ErrorCodeCantContainZero').'
'; } - if (!is_numeric($_POST['code'])) + // FIXME regresion if code with not in numeric base + /*if (!is_numeric($_POST['code'])) { $ok = 0; $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'
'; - } + }*/ } if (isset($_POST["country"]) && $_POST["country"]=='0') { $ok=0; From 5d74f228d8ce9baba3f93460c1462cf13307d8b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 19:59:41 +0200 Subject: [PATCH 030/167] Removed version into trigger page (version on trigger is useless since trigger depend on module. Only version of module is required). --- htdocs/admin/triggers.php | 22 ++++++++++++- htdocs/core/tpl/triggers.tpl.php | 53 -------------------------------- 2 files changed, 21 insertions(+), 54 deletions(-) delete mode 100644 htdocs/core/tpl/triggers.tpl.php diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index 7710b8e0490..3d9ebbd1d29 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -52,7 +52,27 @@ $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/'; $interfaces = new Interfaces($db); $triggers = $interfaces->getTriggersList(0,'priority'); -include $template_dir.'triggers.tpl.php'; +print ' + + + + + +'; + +$var=True; +foreach ($triggers as $trigger) +{ + $var=!$var; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; +} + +print '
'.$langs->trans("File").''.$langs->trans("Active").' 
'.$trigger['picto'].''.$trigger['file'].''.$trigger['status'].''.$form->textwithpicto('', $trigger['info']).'
'; llxFooter(); diff --git a/htdocs/core/tpl/triggers.tpl.php b/htdocs/core/tpl/triggers.tpl.php deleted file mode 100644 index ad933e43cd9..00000000000 --- a/htdocs/core/tpl/triggers.tpl.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * 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 . - * - */ -?> - - - - - - - - - - - - - -> - - - - - - - - - - - -
trans("File"); ?>trans("Version"); ?>trans("Active"); ?> 
textwithpicto('', $trigger['info']); ?>
- - \ No newline at end of file From 4e939f558a650bdf331a2b6f2306edb2f8aaf2f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 20:41:38 +0200 Subject: [PATCH 031/167] Restore font weight --- htdocs/theme/eldy/style.css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index bcfb9a051bd..de15a44705f 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1369,7 +1369,7 @@ a.tab#active { a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { color: #; - font-weight: normal !important; + /* font-weight: normal !important; */ } a.tabimage { From 494e9dbe184452c2792f9dba516868d423093bcb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 20:45:47 +0200 Subject: [PATCH 032/167] Removed warning --- htdocs/core/modules/modBanque.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index 832d96a194b..aeec5a30fef 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -159,7 +159,7 @@ class modBanque extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON bu.url_id = s.rowid'; $this->export_sql_end[$r] .=' WHERE ba.rowid = b.fk_account'; $this->export_sql_end[$r] .=' AND ba.entity = '.$conf->entity; - $this->export_sql_order[$r] .=' ORDER BY b.datev, b.num_releve'; + $this->export_sql_order[$r] =' ORDER BY b.datev, b.num_releve'; } From c8b2ce3d8ec9f4271e380257bd1728c4ddac4d93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 20:46:53 +0200 Subject: [PATCH 033/167] Removed warning --- htdocs/core/modules/modBanque.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index 1bae9f61129..4b9f5f060b3 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -159,7 +159,7 @@ class modBanque extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON bu.url_id = s.rowid'; $this->export_sql_end[$r] .=' WHERE ba.rowid = b.fk_account'; $this->export_sql_end[$r] .=' AND ba.entity = '.$conf->entity; - $this->export_sql_order[$r] .=' ORDER BY b.datev, b.num_releve'; + $this->export_sql_order[$r] =' ORDER BY b.datev, b.num_releve'; } From ff3b2933a817df4255b3448cbe8ed84ad46871cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 10:42:10 +0200 Subject: [PATCH 034/167] Fix: Removed bad test --- test/phpunit/DateLibTest.php | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index 15da662b92e..1b35809e0af 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -304,19 +304,5 @@ class DateLibTest extends PHPUnit_Framework_TestCase return $result; } - /** - * testDolGetFirstDay - * - * @return void - */ - public function testDolGetFirstDay() - { - global $conf,$user,$langs,$db; - $conf=$this->savconf; - $user=$this->savuser; - $langs=$this->savlangs; - $db=$this->savdb; - - } } ?> \ No newline at end of file From 0513cbe655885339065430188db0cce221f9de27 Mon Sep 17 00:00:00 2001 From: fhenry Date: Tue, 23 Apr 2013 11:12:07 +0200 Subject: [PATCH 035/167] Add debug log (dol_syslog) --- htdocs/comm/list.php | 2 ++ htdocs/product/liste.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index e7d6cd2811d..28696228e45 100755 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -137,6 +137,8 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($conf->liste_limit +1, $offset); +dol_syslog('comm:list.php: sql='.$sql,LOG_DEBUG); + $result = $db->query($sql); if ($result) { diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 9fb9aa8de51..29188400653 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -169,7 +169,7 @@ else $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); - dol_syslog("sql=".$sql); + dol_syslog("product:list.php: sql=".$sql); $resql = $db->query($sql); if ($resql) { From 78a0c7ace2ee1e83fafb0e50d5563458fcff8dea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 12:00:02 +0200 Subject: [PATCH 036/167] Fix: log must use the mask defined into setup --- htdocs/core/modules/syslog/mod_syslog_file.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php index f5315f064ae..e6bbefb7295 100644 --- a/htdocs/core/modules/syslog/mod_syslog_file.php +++ b/htdocs/core/modules/syslog/mod_syslog_file.php @@ -96,7 +96,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface /** * Return the parsed logfile path * - * @param string $suffixinfilename When output is a file, append this suffix into default log filename. + * @param string $suffixinfilename When output is a file, append this suffix into default log filename. * @return string */ private function getFilename($suffixinfilename='') @@ -109,11 +109,13 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface * Export the message * * @param array $content Array containing the info about the message - * @param string $suffixinfilename When output is a file, append this suffix into default log filename. + * @param string $suffixinfilename When output is a file, append this suffix into default log filename. * @return void */ public function export($content, $suffixinfilename='') { + global $conf; + $logfile = $this->getFilename($suffixinfilename); if (defined("SYSLOG_FILE_NO_ERROR")) $filefd = @fopen($logfile, 'a+'); @@ -145,6 +147,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface fwrite($filefd, $message."\n"); fclose($filefd); + @chmod($logfile, octdec($conf->global->MAIN_UMASK)); } } -} \ No newline at end of file +} From 39d3d1a34e7cc87b6b0532f83e1551471d4494b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 12:00:31 +0200 Subject: [PATCH 037/167] Enhance script to send email to sale representatives --- htdocs/langs/en_US/admin.lang | 2 +- htdocs/langs/fr_FR/admin.lang | 2 +- .../email_unpaid_invoices_to_representatives.php | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 290707219bb..13cd8e505f8 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -298,7 +298,7 @@ DoTestServerAvailability=Test server connectivity DoTestSend=Test sending DoTestSendHTML=Test sending HTML ErrorCantUseRazInStartedYearIfNoYearMonthInMask=Error, can't use option @ if sequence {yy}{mm} or {yyyy}{mm} is not in mask. -UMask=UMask parameter for new files on Unix/Linux/BSD file system. +UMask=UMask parameter for new files on Unix/Linux/BSD/Mac file system. UMaskExplanation=This parameter allow you to define permissions set by default on files created by Dolibarr on server (during upload for example).
It must be the octal value (for example, 0666 means read and write for everyone).
This parameter is useless on a Windows server. SeeWikiForAllTeam=Take a look at the wiki page for full list of all actors and their organisation UseACacheDelay= Delay for caching export response in seconds (0 or empty for no cache) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index cc2ee5b2a4e..5e9d958858e 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -293,7 +293,7 @@ DoTestServerAvailability= Tester disponibilité serveur DoTestSend= Tester envoi DoTestSendHTML= Tester envoi HTML ErrorCantUseRazInStartedYearIfNoYearMonthInMask= Erreur, ne peut utiliser l'option @ si la séquence {yy}{mm} ou {yyyy}{mm} n'est pas dans le masque. -UMask= Paramètre UMask des nouveaux fichiers sous Unix/Linux/BSD. +UMask= Paramètre UMask des nouveaux fichiers sous Unix/Linux/BSD/Mac. UMaskExplanation= Ce paramètre permet de définir les droits des fichiers créés sur le serveur par Dolibarr (lors d'upload par exemple).
Ce doit être la valeur octale (par exemple 0666 signifie lecture/écriture pour tous).
Ce paramètre n'a aucun effet sur un serveur Windows. SeeWikiForAllTeam= Voir le wiki pour le détail de tous les acteurs et leur organisation UseACacheDelay= Délai de mise en cache de l'export en secondes (0 ou vide pour aucun cache) diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index e62403366fb..abeb8296493 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -50,6 +50,7 @@ $mode=$argv[1]; require($path."../../htdocs/master.inc.php"); require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"); +$langs->load('main'); /* @@ -62,7 +63,7 @@ $duration_value=$argv[2]; $error = 0; print $script_file." launched with mode ".$mode.($duration_value?" delay=".$duration_value:"")."\n"; -$sql = "SELECT f.facnumber, f.total_ttc, s.nom as name, u.rowid as uid, u.lastname, u.firstname, u.email, u.lang"; +$sql = "SELECT f.facnumber, f.total_ttc, f.date_lim_reglement as due_date, s.nom as name, u.rowid as uid, u.lastname, u.firstname, u.email, u.lang"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " , ".MAIN_DB_PREFIX."societe as s"; $sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -110,7 +111,7 @@ if ($resql) if (dol_strlen($oldemail)) { $message .= $langs->trans("Invoice")." ".$obj->facnumber." : ".price($obj->total_ttc)." : ".$obj->name."\n"; - print "Invoice ".$obj->facnumber.", price ".price2num($obj->total_ttc).", linked to company ".$obj->name." with sale representative ".dolGetFirstLastname($obj->firstname, $obj->lastname)." qualified.\n"; + print "Unpaid invoice ".$obj->facnumber.", price ".price2num($obj->total_ttc).", due date ".dol_print_date($db->jdate($obj->due_date),'day')." (linked to company ".$obj->name.", sale representative ".dolGetFirstLastname($obj->firstname, $obj->lastname).", email ".$obj->email.") qualified.\n"; dol_syslog("email_unpaid_invoices_to_representatives.php: ".$obj->email); } @@ -129,7 +130,7 @@ if ($resql) } else { - print "No unpaid invoices to companies linked to a particular commercial dolibarr user\n"; + print "No unpaid invoices (for companies linked to a particular commercial dolibarr user) found\n"; } } else @@ -213,6 +214,8 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang) } else { + print "No email sent (test mode)\n"; + dol_syslog("No email sent (test mode)"); $mail->dump_mail(); $result=1; } From 3f1f065d4ecb212bc5b4825dc059ffdbac474aee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 12:02:56 +0200 Subject: [PATCH 038/167] Fix: log must use the mask defined into setup Conflicts: htdocs/core/modules/syslog/mod_syslog_file.php --- htdocs/core/modules/syslog/mod_syslog_file.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php index b0e1bd550b4..4d482f017cf 100644 --- a/htdocs/core/modules/syslog/mod_syslog_file.php +++ b/htdocs/core/modules/syslog/mod_syslog_file.php @@ -96,7 +96,12 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface /** * Return the parsed logfile path * +<<<<<<< OURS * @return string +======= + * @param string $suffixinfilename When output is a file, append this suffix into default log filename. + * @return string +>>>>>>> THEIRS */ private function getFilename() { @@ -111,6 +116,8 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface */ public function export($content) { + global $conf; + $logfile = $this->getFilename(); if (defined("SYSLOG_FILE_NO_ERROR")) $filefd = @fopen($logfile, 'a+'); @@ -142,6 +149,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface fwrite($filefd, $message."\n"); fclose($filefd); + @chmod($logfile, octdec($conf->global->MAIN_UMASK)); } } -} \ No newline at end of file +} From dbc2eddcbacbb4721ff61d0fba3160dac3da8c4d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 12:09:21 +0200 Subject: [PATCH 039/167] Prepare for 3.3.2 --- build/debian/changelog | 4 ++-- build/doxygen/dolibarr-doxygen.doxyfile | 2 +- build/exe/doliwamp/doliwamp.iss | 6 +++--- build/makepack-dolibarr.pl | 2 +- build/makepack-howto.txt | 2 +- build/perl/virtualmin/dolibarr.pl | 2 +- build/rpm/dolibarr_fedora.spec | 2 +- build/rpm/dolibarr_generic.spec | 2 +- build/rpm/dolibarr_mandriva.spec | 2 +- build/rpm/dolibarr_opensuse.spec | 2 +- htdocs/filefunc.inc.php | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/build/debian/changelog b/build/debian/changelog index 4382b1ae605..b9302cfc624 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -1,9 +1,9 @@ -dolibarr (3.3.1+nmu1) unstable; urgency=low +dolibarr (3.3.2+nmu1) unstable; urgency=low * Non-maintainer upload. * New upstream release. closes: bug#634783 - -- Dolibarr team Sat, 2 Mar 2013 12:00:00 +0100 + -- Dolibarr team Mon, 22 Apr 2013 12:00:00 +0100 # For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz \ No newline at end of file diff --git a/build/doxygen/dolibarr-doxygen.doxyfile b/build/doxygen/dolibarr-doxygen.doxyfile index 690b5daf1a2..294541450fb 100644 --- a/build/doxygen/dolibarr-doxygen.doxyfile +++ b/build/doxygen/dolibarr-doxygen.doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = dolibarr # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 3.3.0 +PROJECT_NUMBER = 3.3.2 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index dc202fdd371..4f9b0fabea6 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -17,9 +17,9 @@ ; ----- Change this ----- AppName=DoliWamp ; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -AppVerName=DoliWamp-3.3.1 +AppVerName=DoliWamp-3.3.2 ; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -OutputBaseFilename=DoliWamp-3.3.1 +OutputBaseFilename=DoliWamp-3.3.2 ; Define full path from wich all relative path are defined ; You must modify this to put here your dolibarr root directory ;SourceDir=C:\Documents and Settings\ldestailleur\git\dolibarr_old @@ -33,7 +33,7 @@ AppPublisherURL=http://www.nltechno.com AppSupportURL=http://www.dolibarr.org AppUpdatesURL=http://www.dolibarr.org AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares. -AppCopyright=Copyright (C) 2008-2012 Laurent Destailleur, NLTechno +AppCopyright=Copyright (C) 2008-2013 Laurent Destailleur, NLTechno DefaultDirName=c:\dolibarr DefaultGroupName=Dolibarr ;LicenseFile=COPYING diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index c2e8a0eda1a..f8fcdd762c4 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -10,7 +10,7 @@ use Cwd; $PROJECT="dolibarr"; $MAJOR="3"; $MINOR="3"; -$BUILD="1"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate +$BUILD="2"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate $RPMSUBVERSION="auto"; # auto use value found into BUILD @LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index fad028cfbf6..4847b0102ef 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -32,7 +32,7 @@ This files describe steps made by Dolibarr packaging team to make a complete release of Dolibarr, step by step. - Check all files are commited. -- Update version/info in /ChangeLog and /filefunc.inc.php +- Update version/info in ChangeLog - Update version number with x.x.x in htdocs/filefunc.inc.php - Update version number with x.x.x in build/makepack-dolibarr.pl - Update version number with x.x.x in build/debian/changelog diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index 1bc5f350954..0ede11d9968 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -30,7 +30,7 @@ return "Regis Houssin"; # script_dolibarr_versions() sub script_dolibarr_versions { -return ( "3.3.0", "3.2.1", "3.1.1" ); +return ( "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" ); } sub script_dolibarr_category diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index e2e1299a9df..41dff2735ff 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -333,5 +333,5 @@ fi %changelog -* Sun Feb 17 2013 Laurent Destailleur 3.3.1-0.3 +* Mon Apr 22 2013 Laurent Destailleur 3.3.2-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index dbd2a26686a..9fe677e6f42 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -522,5 +522,5 @@ fi %changelog -* Sun Feb 17 2013 Laurent Destailleur 3.3.1-0.3 +* Mon Apr 22 2013 Laurent Destailleur 3.3.2-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 4701ff2651e..f31988aed20 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -322,5 +322,5 @@ fi %changelog -* Sun Feb 17 2013 Laurent Destailleur 3.3.1-0.3 +* Mon Apr 22 2013 Laurent Destailleur 3.3.2-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index c5bde7c5427..3c59a8a075c 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -333,5 +333,5 @@ fi %changelog -* Sun Feb 17 2013 Laurent Destailleur 3.3.1-0.3 +* Mon Apr 22 2013 Laurent Destailleur 3.3.2-0.3 - Initial version (#723326) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index a8dba530b21..dd3b9981fce 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -29,7 +29,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.3.1'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.3.2'); if (! defined('EURO')) define('EURO',chr(128)); // Define syslog constants From 8f502b8cfc2dec020ce7d33c0e01398bc9512b66 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 12:39:55 +0200 Subject: [PATCH 040/167] Prepare 3.3.2 --- build/debian/README.howto | 2 +- build/debian/po/fr.po | 12 ++++++------ build/debian/po/templates.pot | 15 ++++++++------- build/debian/rules | 3 +++ build/makepack-dolibarr.pl | 2 ++ 5 files changed, 20 insertions(+), 14 deletions(-) mode change 100755 => 100644 build/debian/po/templates.pot diff --git a/build/debian/README.howto b/build/debian/README.howto index 9c3dbc9ad07..b281c20b13b 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -13,7 +13,7 @@ with format .DEB (for Debian, Ubuntu, ...). # This is standard command to work on Debian packaging: # -# gpg --gen-key Generate a GPG key +# gpg --gen-key Generate a GPG key (-> pubring.gpg + secring.gpg) # # debconf-updatepo To run into po dir to regenate templates.pot # podebconf-report-po --from email@email.com To send email to ask translations diff --git a/build/debian/po/fr.po b/build/debian/po/fr.po index a96cd360299..d23da598297 100755 --- a/build/debian/po/fr.po +++ b/build/debian/po/fr.po @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: 1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-08-01 18:17+0200\n" +"Report-Msgid-Bugs-To: dolibarr@packages.debian.org\n" +"POT-Creation-Date: 2013-04-23 12:16+0200\n" "PO-Revision-Date: 2011-07-29 22:45+0100\n" "Last-Translator: Laurent Destailleur \n" "Language-Team: Laurent Destailleur \n" @@ -27,13 +27,13 @@ msgstr "" #. Type: multiselect #. Description -#: ../templates:1001 +#: ../dolibarr.templates:1001 msgid "Web server to reconfigure automatically:" msgstr "Seveur web à reconfigurer automatiquement:" #. Type: multiselect #. Description -#: ../templates:1001 +#: ../dolibarr.templates:1001 msgid "" "Please choose the web server that should be automatically configured to run " "dolibarr." @@ -44,14 +44,14 @@ msgstr "" # #. Type: boolean #. Description -#: ../templates:2001 +#: ../dolibarr.templates:2001 msgid "Delete database and uploaded files ?" msgstr "Effacer la base de donnée et les fichiers uploadés ?" # #. Type: boolean #. Description -#: ../templates:2001 +#: ../dolibarr.templates:2001 msgid "" "Answer if you want to removed the Dolibarr MySQL database and all other " "datas (datas related to this question are the Dolibarr DBMS account, all " diff --git a/build/debian/po/templates.pot b/build/debian/po/templates.pot old mode 100755 new mode 100644 index 8813bd2d45b..90b57278e04 --- a/build/debian/po/templates.pot +++ b/build/debian/po/templates.pot @@ -3,11 +3,12 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # +#, fuzzy msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-08-01 18:17+0200\n" +"Project-Id-Version: dolibarr\n" +"Report-Msgid-Bugs-To: dolibarr@packages.debian.org\n" +"POT-Creation-Date: 2013-04-23 12:16+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,13 +19,13 @@ msgstr "" #. Type: multiselect #. Description -#: ../templates:1001 +#: ../dolibarr.templates:1001 msgid "Web server to reconfigure automatically:" msgstr "" #. Type: multiselect #. Description -#: ../templates:1001 +#: ../dolibarr.templates:1001 msgid "" "Please choose the web server that should be automatically configured to run " "dolibarr." @@ -32,13 +33,13 @@ msgstr "" #. Type: boolean #. Description -#: ../templates:2001 +#: ../dolibarr.templates:2001 msgid "Delete database and uploaded files ?" msgstr "" #. Type: boolean #. Description -#: ../templates:2001 +#: ../dolibarr.templates:2001 msgid "" "Answer if you want to removed the Dolibarr MySQL database and all other " "datas (datas related to this question are the Dolibarr DBMS account, all " diff --git a/build/debian/rules b/build/debian/rules index 6b75c68b85d..e36aa8f0545 100755 --- a/build/debian/rules +++ b/build/debian/rules @@ -112,6 +112,9 @@ clean: rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919 rm -fr htdocs/includes/tcpdf/fonts/utils + # clean from files to avoid warning of missing dependencies + rm -fr htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.py + # Licence files are included into copyright file. rm -fr htdocs/includes/phpexcel/license.txt rm -f htdocs/includes/tcpdf/LICENSE.TXT diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index f8fcdd762c4..ee44ac8a493 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -656,6 +656,8 @@ if ($nboftargetok) { $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_webservice_server.php`; $cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.php' -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.sh' -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; print "Rename directory $BUILDROOT/$PROJECT.tmp into $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n"; From 624a039eaf08f23b6292995b58497d36ecacbad1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 12:58:58 +0200 Subject: [PATCH 041/167] Update debian doc --- build/debian/README.howto | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/debian/README.howto b/build/debian/README.howto index b281c20b13b..797e653bc27 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -43,10 +43,11 @@ To submit a package to Debian: See page http://www.debian.org/devel/wnpp/#l1 for example of ITP requests contents. - Wait until you received bug number. -For first ITP submission of Dolibarr, bug id was 634783. + For first ITP submission of Dolibarr, bug id was 634783. -- Check bug is into database by searching with id on http://www.debian.org/Bugs/ - +- Check bug is into database by searching with id on + http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634783 + - Add a line for upstream into file changelog with bug number - Call for a mentor on ML debian-mentors to upload packages From 57ab4fb7983ea517d551bb899781cb1185fe42df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 13:38:00 +0200 Subject: [PATCH 042/167] Fix doc --- build/launchpad/README | 79 +++++++++++++++++++++++++++--------------- 1 file changed, 51 insertions(+), 28 deletions(-) diff --git a/build/launchpad/README b/build/launchpad/README index 2a1e7d138ca..37c1c51f96a 100644 --- a/build/launchpad/README +++ b/build/launchpad/README @@ -28,6 +28,8 @@ a package onto LaunchPad - Edit file ~/.bashrc to add DEBFULLNAME="" DEBEMAIL="" +- Create a Bazaar directory + mkdir bzr If you want to build/test package locally: - Create a file ~/.pbuilderrc with content @@ -36,24 +38,43 @@ If you want to build/test package locally: sudo pbuilder create [--distribution sid|squeeze] -# Push/declare sources to Launchpad +# Push/declare Dolibarr sources to Launchpad #---------------------------------- - -- Create a Bazaar directory - mkdir bzr -- Create a series - Call it 'dev' or 'stable' - For stable: Add file with *: http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_3.2.*.tar.gz - For dev: Configure Series branch - Link to series +- From Launchpad project (https://launchpad.net/dolibarr), register a series: + Call it 'trunk' or 'beta' or 'stable' + Use branch (dev): + ~eldy/dolibarr/develop + ~eldy/dolibarr/beta + ~eldy/dolibarr/stable + or + Use URL pattern (beta or stable): + http://www.dolibarr.org/files/lastbuild/package_debian-ubuntu/dolibarr_x.z.*.tar.gz + http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_x.y.*.tar.gz + +- For Dev, you can also add link serie to GIT HEAD. +- For beta and stable, you can init from command line + cd bzr/dolibarr-[beta|stable] bzr init bzr add bzr commit -m "Init" - bzr push lp:~yourlogin/dolibarr/stable + bzr push lp:~yourlogin/dolibarr/[beta|stable] -# Init repository of sources into launchpad (when repository for sources does not exist) +- List of series are visible here: https://launchpad.net/dolibarr/+series + +# To update Dolibarr into launchpad (when repository for sources already exists) #---------------------------------- + cd bzr + bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] + bzr status + -- Update files here -- + bzr commit -m "Description of change" + bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] -- Create debian directory and upload it onto bzr branch ~yourlogin/+junk/debian-[dev|stable] + + +# Init debian dir repository into launchpad (when repository for sources does not exist) +#---------------------------------- +- Create debian directory and upload it onto bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] cd bzr mkdir debian cd debian @@ -61,24 +82,28 @@ If you want to build/test package locally: bzr init bzr add bzr commit -m "Init control files" - bzr push lp:~yourlogin/+junk/debian-[dev|stable] (put here any branch name) - or download it from launchpad bazaar: + bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] (put here any branch name) +- or download it from launchpad bazaar: cd bzr - bzr branch lp:~yourlogin/+junk/debian-[dev|stable] -- To update this debian directory, edit files into the bzr dir and run - bzr status - bzr commit -m "Description of change" - bzr push lp:~yourlogin/+junk/debian-[dev|stable] + bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] -# Get repository of sources from launchpad (when repository for sources already exists) +# Get debian dir repository from launchpad (when repository for sources already exists) #---------------------------------- cd bzr - bzr branch lp:~yourlogin/+junk/debian-[dev|stable] + bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] + +# To update debian dir into launchpad (when repository for sources already exists) +#---------------------------------- + cd bzr + bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] + bzr status + -- Update files here -- + bzr commit -m "Description of change" + bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] # Define a recipe into launchpad (a rule to build packages into a PPA) #---------------------------------- - - Create a file dolibarr.recipe with content cd bzr vi dolibarr.recipe @@ -101,11 +126,11 @@ If you want to build/test package locally: # To get/download package from PPA: #---------------------------------- -Add signing key of the Launchpad repository: +- Add signing key of the Launchpad repository: > gpg --keyserver keyserver.ubuntu.com --recv-key A38BF8FD > sudo apt-key add ~/.gnupg/pubring.gpg -Add Dolibarr Launchpad repository to your system setup by adding the two lines to /etc/apt/sources.list +- Add Dolibarr Launchpad repository to your system setup by adding the two lines to /etc/apt/sources.list For the development snapshot version: deb http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main deb-src http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main @@ -113,12 +138,10 @@ For the stable version: deb http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main deb-src http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main -Update your package cache: +- Update your package cache: > apt-get update -Install Dolibarr: +- Install Dolibarr: > apt-get install dolibarr - - - + From 365a5e18e859148e532b57c21ab503628b7637de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 13:56:59 +0200 Subject: [PATCH 043/167] Prepare 3.3.2 --- build/launchpad/README | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/launchpad/README b/build/launchpad/README index 37c1c51f96a..dbf2dbdb4f1 100644 --- a/build/launchpad/README +++ b/build/launchpad/README @@ -64,12 +64,12 @@ If you want to build/test package locally: # To update Dolibarr into launchpad (when repository for sources already exists) #---------------------------------- cd bzr - bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] + bzr branch lp:~yourlogin/dolibarr/[dev|beta|stable] + cd dolibarr-[dev|beta|stable] bzr status -- Update files here -- bzr commit -m "Description of change" - bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] - + bzr push # Init debian dir repository into launchpad (when repository for sources does not exist) @@ -96,6 +96,7 @@ If you want to build/test package locally: #---------------------------------- cd bzr bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] + cd debian-[dev|beta|stable] bzr status -- Update files here -- bzr commit -m "Description of change" From ba0e9c0c1931694e0cc9c515087b4e39f9ecf9d5 Mon Sep 17 00:00:00 2001 From: fhenry Date: Tue, 23 Apr 2013 14:02:29 +0200 Subject: [PATCH 044/167] Fix [ bug #843 ] Erreur SQL box_stock fix [ bug #842 ] Erreur SQL Propal --- htdocs/comm/propal/class/propal.class.php | 11 +++++++---- htdocs/core/boxes/box_produits_alerte_stock.php | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 8e3e4748f05..75d66c2065f 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2631,10 +2631,13 @@ class PropaleLigne // Insert line into database $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'propaldet'; - $sql.= ' (fk_propal, fk_parent_line, label, description, fk_product, product_type, fk_remise_except, qty, tva_tx, localtax1_tx, localtax2_tx,'; + $sql.= ' (fk_propal, fk_parent_line, label, description, fk_product, product_type,'; + $sql.= ' fk_remise_except, qty, tva_tx, localtax1_tx, localtax2_tx,'; $sql.= ' subprice, remise_percent, '; $sql.= ' info_bits, '; - $sql.= ' total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, fk_product_fournisseur_price, buy_price_ht, special_code, rang)'; + $sql.= ' total_ht, total_tva, total_localtax1, total_localtax2,'; + $sql.= ' total_ttc, fk_product_fournisseur_price, buy_price_ht,'; + $sql.= ' special_code, rang)'; $sql.= " VALUES (".$this->fk_propal.","; $sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").","; $sql.= " ".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null").","; @@ -2648,13 +2651,13 @@ class PropaleLigne $sql.= " ".price2num($this->localtax2_tx).","; $sql.= " ".($this->subprice?price2num($this->subprice):'null').","; $sql.= " ".price2num($this->remise_percent).","; - $sql.= " '".$this->info_bits."',"; + $sql.= " ".(isset($this->info_bits)?"'".$this->info_bits."'":"null").","; $sql.= " ".price2num($this->total_ht).","; $sql.= " ".price2num($this->total_tva).","; $sql.= " ".price2num($this->total_localtax1).","; $sql.= " ".price2num($this->total_localtax2).","; $sql.= " ".price2num($this->total_ttc).","; - $sql.= " ".(isset($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null").","; + $sql.= " ".(!empty($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null").","; $sql.= " ".(isset($this->pa_ht)?"'".price2num($this->pa_ht)."'":"null").","; $sql.= ' '.$this->special_code.','; $sql.= ' '.$this->rang; diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index 26e7bd003b5..651361b1e45 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -82,6 +82,7 @@ class box_produits_alerte_stock extends ModeleBoxes $sql.= " AND p.tosell = 1"; if (empty($user->rights->produit->lire)) $sql.=' AND p.fk_product_type != 0'; if (empty($user->rights->service->lire)) $sql.=' AND p.fk_product_type != 1'; + $sql.= " GROUP BY p.rowid, p.seuil_stock_alerte, s.reel"; $sql.= " HAVING s.reel < p.seuil_stock_alerte"; $sql.= $db->order('s.reel', 'DESC'); $sql.= $db->plimit($max, 0); From 203d4e3ca8907f3471fc79bac63e25c7fb143f1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 14:17:04 +0200 Subject: [PATCH 045/167] Prepare database for parameters into boxes --- htdocs/install/mysql/migration/3.3.0-3.4.0.sql | 3 +++ htdocs/install/mysql/tables/llx_boxes.key.sql | 2 +- htdocs/install/mysql/tables/llx_boxes.sql | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 957dadf2845..acebc660662 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -347,3 +347,6 @@ ALTER TABLE llx_opensurvey_sondage ADD INDEX idx_date_fin (date_fin); ALTER TABLE llx_opensurvey_user_studs ADD INDEX idx_id_users (id_users); ALTER TABLE llx_opensurvey_user_studs ADD INDEX idx_nom (nom); ALTER TABLE llx_opensurvey_user_studs ADD INDEX idx_id_sondage (id_sondage); + +ALTER TABLE llx_boxes ADD COLUMN params varchar(255); + diff --git a/htdocs/install/mysql/tables/llx_boxes.key.sql b/htdocs/install/mysql/tables/llx_boxes.key.sql index d628257b5ce..52e06daf2af 100644 --- a/htdocs/install/mysql/tables/llx_boxes.key.sql +++ b/htdocs/install/mysql/tables/llx_boxes.key.sql @@ -21,7 +21,7 @@ ALTER TABLE llx_boxes ADD UNIQUE INDEX uk_boxes (entity, box_id, position, fk_user); -- Supprime orphelins pour permettre montee de la cle --- V4 DELETE llx_boxes FROM llx_boxes LEFT JOIN llx_boxes_def ON llx_boxes.box_id = llx_boxes_def.rowid WHERE llx_boxes_def.rowid IS NULL; +-- MYSQL V4 DELETE llx_boxes FROM llx_boxes LEFT JOIN llx_boxes_def ON llx_boxes.box_id = llx_boxes_def.rowid WHERE llx_boxes_def.rowid IS NULL; -- POSTGRESQL V8 DELETE FROM llx_boxes USING llx_boxes_def WHERE llx_boxes.box_id NOT IN (SELECT llx_boxes_def.rowid FROM llx_boxes_def); ALTER TABLE llx_boxes ADD INDEX idx_boxes_boxid (box_id); diff --git a/htdocs/install/mysql/tables/llx_boxes.sql b/htdocs/install/mysql/tables/llx_boxes.sql index a594e153afb..383e1bbcce4 100644 --- a/htdocs/install/mysql/tables/llx_boxes.sql +++ b/htdocs/install/mysql/tables/llx_boxes.sql @@ -19,7 +19,7 @@ -- =========================================================================== -- --- position : 0=index.php +-- position : 0=Home page index.php -- box_order : Box sort order -- @@ -31,6 +31,6 @@ create table llx_boxes position smallint NOT NULL, box_order varchar(3) NOT NULL, fk_user integer default 0 NOT NULL, - maxline integer NULL - + maxline integer NULL, + params varchar(255) )ENGINE=innodb; From 52a1e811475af78e9fbbeaa55aef74768ebbb076 Mon Sep 17 00:00:00 2001 From: fhenry Date: Tue, 23 Apr 2013 14:43:32 +0200 Subject: [PATCH 046/167] [ bug #842 ] Erreur SQL Propal --- htdocs/comm/propal/class/propal.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 75d66c2065f..237050928fc 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -310,7 +310,7 @@ class Propal extends CommonObject * * @see add_product */ - function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='') + function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='') { global $conf; @@ -466,7 +466,7 @@ class Propal extends CommonObject * @param int $type 0/1=Product/service * @return int 0 if OK, <0 if KO */ - function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $type=0) + function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0) { global $conf,$user,$langs; @@ -2615,6 +2615,7 @@ class PropaleLigne if (empty($this->info_bits)) $this->info_bits=0; if (empty($this->special_code)) $this->special_code=0; if (empty($this->fk_parent_line)) $this->fk_parent_line=0; + if (empty($this->fk_fournprice)) $this->fk_fournprice=0; if (empty($this->pa_ht)) $this->pa_ht=0; @@ -2755,6 +2756,7 @@ class PropaleLigne if (empty($this->info_bits)) $this->info_bits=0; if (empty($this->special_code)) $this->special_code=0; if (empty($this->fk_parent_line)) $this->fk_parent_line=0; + if (empty($this->fk_parent_line)) $this->fk_fournprice=0; if (empty($this->pa_ht)) $this->pa_ht=0; @@ -2787,13 +2789,13 @@ class PropaleLigne $sql.= " , total_localtax1=".price2num($this->total_localtax1).""; $sql.= " , total_localtax2=".price2num($this->total_localtax2).""; } - $sql.= " , fk_product_fournisseur_price='".$this->fk_fournprice."'"; - $sql.= " , buy_price_ht='".price2num($this->pa_ht)."'"; + $sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null"); + $sql.= " , buy_price_ht=".price2num($this->pa_ht); if (strlen($this->special_code)) $sql.= " , special_code=".$this->special_code; $sql.= " , fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null"); if (! empty($this->rang)) $sql.= ", rang=".$this->rang; $sql.= " WHERE rowid = ".$this->rowid; - + dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) From 23a7aae08455b0f6f145c289db23c8dc633ecb47 Mon Sep 17 00:00:00 2001 From: fhenry Date: Tue, 23 Apr 2013 14:48:34 +0200 Subject: [PATCH 047/167] [ bug #841 ] Erreur compta/index --- htdocs/compta/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 1222a5bdb4a..3afacfb243e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -210,7 +210,7 @@ if ($search_user > 0) } if (! $sall) { - $sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.increment, f.total, f.total_ttc,'; + $sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.increment, f.total,f.tva, f.total_ttc,'; $sql.= ' f.datef, f.date_lim_reglement,'; $sql.= ' f.paye, f.fk_statut, f.note,'; $sql.= ' s.nom, s.rowid'; From 854b9df96de947c83a5689a02c19e4e940712eee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 16:18:26 +0200 Subject: [PATCH 048/167] Qual: Clean code of box management --- dev/skeletons/modMyModule.class.php | 10 +- htdocs/admin/boxes.php | 13 +- htdocs/core/ajax/box.php | 1 - htdocs/core/boxes/box_activity.php | 20 ++- htdocs/core/boxes/box_comptes.php | 15 +- htdocs/core/boxes/box_external_rss.php | 7 +- .../boxes/box_graph_invoices_permonth.php | 147 ++++++++++++++++++ htdocs/core/boxes/box_members.php | 13 +- htdocs/core/boxes/modules_boxes.php | 6 +- htdocs/core/class/html.formother.class.php | 14 +- htdocs/core/class/infobox.class.php | 31 ++-- htdocs/core/modules/DolibarrModules.class.php | 33 ++-- htdocs/core/modules/modFacture.class.php | 8 +- 13 files changed, 250 insertions(+), 68 deletions(-) create mode 100644 htdocs/core/boxes/box_graph_invoices_permonth.php diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 5711b61c4ac..4bb936ba339 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -133,7 +133,7 @@ class modMyModule extends DolibarrModules $this->tabs = array(); // Dictionnaries - if (! isset($conf->mymodule->enabled)) + if (! isset($conf->mymodule->enabled)) { $conf->mymodule=new stdClass(); $conf->mymodule->enabled=0; @@ -158,14 +158,8 @@ class modMyModule extends DolibarrModules // Boxes // Add here list of php file(s) stored in core/boxes that contains class to show a box. $this->boxes = array(); // List of boxes - $r=0; // Example: - /* - $this->boxes[$r][1] = "myboxa.php"; - $r++; - $this->boxes[$r][1] = "myboxb.php"; - $r++; - */ + //$this->boxes=array(array(0=>array('file'=>'myboxa.php','note'=>'','enabledbydefaulton'=>'Home'),1=>array('file'=>'myboxb.php','note'=>''),2=>array('file'=>'myboxc.php','note'=>''));); // Permissions $this->rights = array(); // Permission array used by this module diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 6fb5e458945..0b19d96040c 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -36,9 +36,8 @@ $rowid = GETPOST('rowid','int'); $action = GETPOST('action','alpha'); $errmesg=''; -// Definition des positions possibles pour les boites -$pos_array = array(0); // Positions possibles pour une boite (0,1,2,...) -$pos_name = array(0=>$langs->trans("Home")); // Nom des positions 0=Homepage, 1=... +// Define possible position of boxes +$pos_name = getStaticMember('InfoBox','listOfPages'); $boxes = array(); @@ -360,7 +359,7 @@ foreach($boxtoadd as $box) // Pour chaque position possible, on affiche un lien d'activation si boite non deja active pour cette position print ''; - print $form->selectarray("pos",$pos_name); + print $form->selectarray("pos",$pos_name,0,0,0,0,'',1); print ''; print ''; print ' '; @@ -406,7 +405,9 @@ foreach($boxactivated as $key => $box) print "\n".''."\n"; print ''; - print ''.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel).''; + print ''.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); + //if (! empty($box->graph)) print ' ('.$langs->trans("Graph").')'; + print ''; print ''; if ($box->note == '(WarningUsingThisBoxSlowDown)') { @@ -415,7 +416,7 @@ foreach($boxactivated as $key => $box) } else print ($box->note?$box->note:' '); print ''; - print '' . (isset($pos_name[$box->position])?$pos_name[$box->position]:'') . ''; + print '' . (empty($pos_name[$box->position])?'':$langs->trans($pos_name[$box->position])) . ''; $hasnext=($key < (count($boxactivated)-1)); $hasprevious=($key != 0); print ''.($key+1).''; diff --git a/htdocs/core/ajax/box.php b/htdocs/core/ajax/box.php index 324339f5b25..50305655dcd 100644 --- a/htdocs/core/ajax/box.php +++ b/htdocs/core/ajax/box.php @@ -68,7 +68,6 @@ if ($boxorder && $zone != '' && $userid > 0) // boxorder value is the target order: "A:idboxA1,idboxA2,A-B:idboxB1,idboxB2,B" dol_syslog("AjaxBox boxorder=".$boxorder." zone=".$zone." userid=".$userid, LOG_DEBUG); - //$infobox=new InfoBox($db); $result=InfoBox::saveboxorder($db,$zone,$boxorder,$userid); } diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 87e555958e8..ad0da9451e9 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -41,9 +41,23 @@ class box_activity extends ModeleBoxes var $info_box_head = array(); var $info_box_contents = array(); - // FIXME: Use a cache to save data because this slow down too much main home page. This box slow down too seriously software. - // FIXME: Removed number_format (not compatible with all languages) - // FIXME: Pb into some status + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param) + { + global $conf; + + $this->db=$db; + // FIXME: Use a cache to save data because this slow down too much main home page. This box slow down too seriously software. + // FIXME: Removed number_format (not compatible with all languages) + // FIXME: Pb into some status + $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous FIXME) + } /** * Charge les donnees en memoire pour affichage ulterieur diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 5fc8d2add91..2df5f0dd002 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -39,22 +39,23 @@ class box_comptes extends ModeleBoxes var $db; var $param; var $enabled = 1; - + var $info_box_head = array(); var $info_box_contents = array(); - + /** - * Constructor + * Constructor * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler + * @param string $param More parameters */ - function __construct($db) + function __construct($db,$param='') { global $conf, $user; - + $this->db = $db; - + // disable module for such cases $listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL); if (! in_array('banque',$listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index faf8f872ecc..09b56cff52e 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -39,11 +39,12 @@ class box_external_rss extends ModeleBoxes var $depends = array("externalrss"); var $db; - var $param; + var $paramdef; // Params of box definition (not user params) var $info_box_head = array(); var $info_box_contents = array(); + /** * Constructor * @@ -53,7 +54,7 @@ class box_external_rss extends ModeleBoxes function __construct($db,$param) { $this->db=$db; - $this->param=$param; + $this->paramdef=$param; } /** @@ -71,7 +72,7 @@ class box_external_rss extends ModeleBoxes $this->max=$max; // On recupere numero de param de la boite - preg_match('/^([0-9]+) /',$this->param,$reg); + preg_match('/^([0-9]+) /',$this->paramdef,$reg); $site=$reg[1]; // Create dir nor required diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php new file mode 100644 index 00000000000..c0e6ce00447 --- /dev/null +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -0,0 +1,147 @@ + + * + * 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/core/boxes/box_invoice_permonth.php + * \ingroup factures + * \brief Box to show graph of invoices per month + */ +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; + + +/** + * Class to manage the box to show last invoices + */ +class box_graph_invoices_permonth extends ModeleBoxes +{ + var $boxcode="invoicespermonth"; + var $boximg="object_bill"; + var $boxlabel="BoxInvoicesPerMonth"; + var $depends = array("facture"); + + var $db; + + var $info_box_head = array(); + var $info_box_contents = array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param) + { + global $conf; + + $this->db=$db; + $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; + } + + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + function loadBox($max=5) + { + global $conf, $user, $langs, $db; + + $this->max=$max; + + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $facturestatic=new Facture($db); + + $text = $langs->trans("BoxInvoicesPerMonth",$max); + $this->info_box_head = array( + 'text' => $text, + 'limit'=> dol_strlen($text) + ); + + if ($user->rights->facture->lire) + { + $sql = "SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.datef as df"; + $sql.= ", f.paye, f.fk_statut, f.datec, f.tms"; + $sql.= ", s.nom, s.rowid as socid"; + $sql.= ", f.date_lim_reglement as datelimite"; + $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= ")"; + $sql.= " WHERE f.fk_soc = s.rowid"; + $sql.= " AND f.entity = ".$conf->entity; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; + $sql.= " ORDER BY f.tms DESC"; + $sql.= $db->plimit($max, 0); + + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $now=dol_now(); + + $i = 0; + $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; + + while ($i < $num) + { + $objp = $db->fetch_object($result); + $datelimite=$db->jdate($objp->datelimite); + $datec=$db->jdate($objp->datec); + + $picto='bill'; + if ($objp->type == 1) $picto.='r'; + if ($objp->type == 2) $picto.='a'; + $late = ''; + if ($objp->paye == 0 && ($objp->fk_statut != 2 && $objp->fk_statut != 3) && $datelimite < ($now - $conf->facture->client->warning_delay)) { $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));} + + $i++; + } + + $this->info_box_contents[0][0] = array('td' => 'align="center"','text2'=>'xxxxxxx'); + } + else + { + $this->info_box_contents[0][0] = array( 'td' => 'align="left"', + 'maxlength'=>500, + 'text' => ($db->error().' sql='.$sql)); + } + + } + else { + $this->info_box_contents[0][0] = array('td' => 'align="left"', + 'text' => $langs->trans("ReadPermissionNotAllowed")); + } + } + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ + function showBox($head = null, $contents = null) + { + parent::showBox($this->info_box_head, $this->info_box_contents); + } + +} + +?> diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index 91d3cd918b9..fdb6db8c7f5 100755 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -39,25 +39,26 @@ class box_members extends ModeleBoxes var $db; var $param; var $enabled = 1; - + var $info_box_head = array(); var $info_box_contents = array(); /** - * Constructor + * Constructor * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler + * @param string $param More parameters */ - function __construct($db) + function __construct($db,$param='') { global $conf, $user; $this->db = $db; - + // disable module for such cases $listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL); - if (! in_array('banque',$listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users + if (! in_array('adherent',$listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users } /** diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index c681395f5af..c930fece2e5 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -40,6 +40,7 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" var $box_order; var $fk_user; var $sourcefile; + var $class; var $box_id; var $note; @@ -47,9 +48,10 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" /** * Constructor * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler + * @param string $param More parameters */ - function __construct($db) + function __construct($db,$param='') { $this->db=$db; } diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index a0d63e42b4a..73427b71455 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -886,7 +886,9 @@ class FormOther foreach($boxactivated as $box) { if (! empty($boxidactivatedforuser[$box->id])) continue; // Already visible for user - $arrayboxtoactivatelabel[$box->id]=$langs->transnoentitiesnoconv($box->boxlabel); // We keep only boxes not shown for user, to show into combo list + $label=$langs->transnoentitiesnoconv($box->boxlabel); + if (preg_match('/graph/',$box->class)) $label.=' ('.$langs->trans("Graph").')'; + $arrayboxtoactivatelabel[$box->id]=$label; // We keep only boxes not shown for user, to show into combo list } $form=new Form($db); @@ -897,7 +899,7 @@ class FormOther if (! empty($conf->use_javascript_ajax)) { print ''."\n"; } diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index 1a4cd9d4244..07ca9026482 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -27,6 +27,9 @@ */ class InfoBox { + static $listOfPages = array(0=>'Home'); // Nom des positions 0=Home, 1=... + + /** * Return array of boxes qualified for area and user * @@ -57,17 +60,16 @@ class InfoBox $sql.= " ORDER BY b.box_order"; } else - { + { $sql = "SELECT d.rowid as box_id, d.file, d.note, d.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."boxes_def as d"; - if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) { - + if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) + { $sql.= " WHERE entity IN (1,".$conf->entity.")"; // TODO add method for define another master entity - - } else { - + } + else + { $sql.= " WHERE entity = ".$conf->entity; - } } @@ -95,18 +97,24 @@ class InfoBox $relsourcefile = "/core/boxes/".$boxname.".php"; } + // TODO PERF Do not make "dol_include_once" here, nor "new" later. This means, we must store a 'depends' field to store modules list, then + // the "enabled" condition for modules forbidden for external users and the depends condition can be done. + // Goal is to avoid making a new instance for each boxes returned by select. + dol_include_once($relsourcefile); if (class_exists($boxname)) { - $box=new $boxname($db,$obj->note); + $box=new $boxname($db,$obj->note); // Constructor may set properties like box->enabled. obj->note is note into box def, not user params. + //$box=new stdClass(); // box properties $box->rowid = (empty($obj->rowid) ? '' : $obj->rowid); $box->id = (empty($obj->box_id) ? '' : $obj->box_id); - $box->position = (empty($obj->position) ? '' : $obj->position); + $box->position = ($obj->position == '' ? '' : $obj->position); // '0' must staty '0' $box->box_order = (empty($obj->box_order) ? '' : $obj->box_order); $box->fk_user = (empty($obj->fk_user) ? 0 : $obj->fk_user); - $box->sourcefile=$relsourcefile; + $box->sourcefile= $relsourcefile; + $box->class = $boxname; if ($mode == 'activated' && ! is_object($user)) // List of activated box was not yet personalized into database { if (is_numeric($box->box_order)) @@ -119,6 +127,8 @@ class InfoBox $box->box_id = (empty($obj->box_id) ? '' : $obj->box_id); $box->note = (empty($obj->note) ? '' : $obj->note); + // Filter on box->enabled (fused for example by box_comptes) and box->depends + //$enabled=1; $enabled=$box->enabled; if (isset($box->depends) && count($box->depends) > 0) { @@ -131,6 +141,7 @@ class InfoBox //print 'xx module='.$module.' enabled='.$enabled; if ($enabled) $boxes[]=$box; + else unset($box); } } $j++; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 1885662a512..3134ae4162a 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -502,7 +502,9 @@ abstract class DolibarrModules */ function insert_boxes() { - global $conf; + require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; + + global $conf; $err=0; @@ -510,9 +512,12 @@ abstract class DolibarrModules { foreach ($this->boxes as $key => $value) { - //$titre = $this->boxes[$key][0]; - $file = isset($this->boxes[$key][1])?$this->boxes[$key][1]:''; - $note = isset($this->boxes[$key][2])?$this->boxes[$key][2]:''; + $file = isset($this->boxes[$key]['file'])?$this->boxes[$key]['file']:''; + $note = isset($this->boxes[$key]['note'])?$this->boxes[$key]['note']:''; + $enabledbydefaulton = isset($this->boxes[$key]['enabledbydefaulton'])?$this->boxes[$key]['enabledbydefaulton']:'Home'; + + if (empty($file)) $file = isset($this->boxes[$key][1])?$this->boxes[$key][1]:''; // For backward compatibility + if (empty($note)) $note = isset($this->boxes[$key][2])?$this->boxes[$key][2]:''; // For backward compatibility $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."boxes_def"; $sql.= " WHERE file = '".$this->db->escape($file)."'"; @@ -544,12 +549,19 @@ abstract class DolibarrModules { $lastid=$this->db->last_insert_id(MAIN_DB_PREFIX."boxes_def","rowid"); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (box_id,position,box_order,fk_user,entity)"; - $sql.= " VALUES (".$lastid.", 0, '0', 0, ".$conf->entity.")"; + $pos_name = getStaticMember('InfoBox','listOfPages'); + foreach ($pos_name as $key2 => $val2) + { + //print 'key2='.$key2.'-val2='.$val2."
\n"; + if ($enabledbydefaulton && $val2 != $enabledbydefaulton) continue; // Not enabled by default onto this page. - dol_syslog(get_class($this)."::insert_boxes sql=".$sql); - $resql=$this->db->query($sql); - if (! $resql) $err++; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (box_id,position,box_order,fk_user,entity)"; + $sql.= " VALUES (".$lastid.", ".$key2.", '0', 0, ".$conf->entity.")"; + + dol_syslog(get_class($this)."::insert_boxes onto page ".$key2."=".$val2." sql=".$sql); + $resql=$this->db->query($sql); + if (! $resql) $err++; + } } if (! $err) @@ -563,9 +575,10 @@ abstract class DolibarrModules $this->db->rollback(); } } + // else box already registered into database } else - { + { $this->error=$this->db->lasterror(); dol_syslog(get_class($this)."::insert_boxes ".$this->error, LOG_ERR); $err++; diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 4d18c3d8757..6b243b4d22e 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -97,12 +97,8 @@ class modFacture extends DolibarrModules $r++; // Boxes - $this->boxes = array(); - $r=0; - $this->boxes[$r][1] = "box_factures_imp.php"; - $r++; - $this->boxes[$r][1] = "box_factures.php"; - $r++; + //$this->boxes = array(0=>array(1=>'box_factures_imp.php'),1=>array(1=>'box_factures.php')); + $this->boxes = array(0=>array('file'=>'box_factures_imp.php','enabledbydefaulton'=>'Home'),1=>array('file'=>'box_factures.php','enabledbydefaulton'=>'Home'),2=>array('file'=>'box_graph_invoices_permonth.php','enabledbydefaulton'=>'Home')); // Permissions $this->rights = array(); From b3e20501863d833a58d51ca0055306661cbd04f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 23:44:49 +0200 Subject: [PATCH 049/167] Fix: Remove warning --- htdocs/contrat/class/contrat.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index afbc82ab391..39d4d7aac60 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -284,14 +284,14 @@ class Contrat extends CommonObject global $langs, $conf; $error=0; - + // Definition du nom de module de numerotation de commande $soc = new Societe($this->db); $soc->fetch($this->socid); - + // Class of company linked to order $result=$soc->set_as_client(); - + // Define new ref if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) { @@ -552,8 +552,8 @@ class Contrat extends CommonObject $line->libelle = $objp->description; $line->desc = $objp->description; $line->qty = $objp->qty; - $line->statut = $objp->statut; - $line->ref = $objp->ref; + $line->statut = $objp->statut; + $line->ref = ''; $line->tva_tx = $objp->tva_tx; $line->localtax1_tx = $objp->localtax1_tx; $line->localtax2_tx = $objp->localtax2_tx; @@ -667,7 +667,7 @@ class Contrat extends CommonObject $error=0; $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."contrat"); - + // Mise a jour ref $sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id; if ($this->db->query($sql)) From d5f3f47782ef77eeb979288be100e945660bf3ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Apr 2013 03:56:13 +0200 Subject: [PATCH 050/167] New: Use div for tabs. --- htdocs/core/lib/company.lib.php | 6 +- htdocs/core/lib/functions.lib.php | 20 +-- htdocs/langs/en_US/boxes.lang | 4 +- htdocs/langs/fr_FR/boxes.lang | 4 +- htdocs/societe/soc.php | 7 +- htdocs/theme/amarok/img/warning.png | Bin 3269 -> 618 bytes htdocs/theme/amarok/style.css.php | 163 ++++++++++++++++--- htdocs/theme/eldy/style.css.php | 233 +++++++++++++++++----------- htdocs/user/param_ihm.php | 22 ++- 9 files changed, 322 insertions(+), 137 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 695b6deb2c1..a684046b180 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -491,7 +491,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='') */ function show_contacts($conf,$langs,$db,$object,$backtopage='') { - global $user; + global $user,$conf; global $bc; $i=-1; @@ -507,7 +507,9 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') if ($user->rights->societe->contact->creer) { $addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); - $buttoncreate=''.$addcontact.' '.img_picto($addcontact,'filenew').''."\n"; + $buttoncreate=''.$addcontact; + if (empty($conf->dol_optimize_smallscreen)) $buttoncreate.=' '.img_picto($addcontact,'filenew'); + $buttoncreate.=''."\n"; } print "\n"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b2c2998a462..47af55726f9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -590,7 +590,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p { global $conf; - $out="\n".'
'."\n"; + $out="\n".'
'."\n"; // Show title $showtitle=1; @@ -615,15 +615,16 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p // Show tabs for ($i = 0 ; $i <= $maxkey ; $i++) { + $out.='
'; if (isset($links[$i][2]) && $links[$i][2] == 'image') { if (!empty($links[$i][0])) { - $out.=''.$links[$i][1].''."\n"; + $out.=''.$links[$i][1].''."\n"; } else { - $out.=''.$links[$i][1].''."\n"; + $out.=''.$links[$i][1].''."\n"; } } else if (! empty($links[$i][1])) @@ -632,13 +633,14 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p if ((is_numeric($active) && $i == $active) || (! is_numeric($active) && $active == $links[$i][2])) { - $out.=''.$links[$i][1].''."\n"; + $out.=''.$links[$i][1].''."\n"; } else { - $out.=''.$links[$i][1].''."\n"; + $out.=''.$links[$i][1].''."\n"; } } + $out.='
'; } $out.="
\n"; @@ -815,7 +817,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e if (! is_object($outputlangs)) $outputlangs=$langs; if (! $format) $format='daytextshort'; $reduceformat=(! empty($conf->dol_optimize_smallscreen) && in_array($format,array('day','hour')))?1:0; - + // Change predefined format into computer format. If found translation in lang file we use it, otherwise we use default. if ($format == 'day') $format=($outputlangs->trans("FormatDateShort")!="FormatDateShort"?$outputlangs->trans("FormatDateShort"):$conf->format_date_short); else if ($format == 'hour') $format=($outputlangs->trans("FormatHourShort")!="FormatHourShort"?$outputlangs->trans("FormatHourShort"):$conf->format_hour_short); @@ -840,7 +842,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e $format=str_replace('%Y','%y',$format); $format=str_replace('yyyy','yy',$format); } - + // If date undefined or "", we return "" if (dol_strlen($time) == 0) return ''; // $time=0 allowed (it means 01/01/1970 00:00:00) @@ -1081,9 +1083,9 @@ function dol_print_size($size,$shortvalue=0,$shortunit=0) { global $conf,$langs; $level=1024; - + if (! empty($conf->dol_optimize_smallscreen)) $shortunit=1; - + // Set value text if (empty($shortvalue) || $size < ($level*10)) { diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index 18c6d541505..56b9a3513fd 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -75,7 +75,9 @@ NoRecordedProducts=No recorded products/services NoRecordedProspects=No recorded prospects NoContractedProducts=No products/services contracted NoRecordedContracts=No recorded contracts -# Latest supplier orders BoxLatestSupplierOrders=Latest supplier orders BoxTitleLatestSupplierOrders=%s latest supplier orders NoSupplierOrder=No recorded supplier order +BoxInvoicesPerMonth=Invoices per month +BoxOrdersPerMonth=Orders per month +BoxProposalsPerMonth=Proposals per month \ No newline at end of file diff --git a/htdocs/langs/fr_FR/boxes.lang b/htdocs/langs/fr_FR/boxes.lang index cd61aa64d93..3bd974ca461 100644 --- a/htdocs/langs/fr_FR/boxes.lang +++ b/htdocs/langs/fr_FR/boxes.lang @@ -75,7 +75,9 @@ NoRecordedProducts=Pas de produit/service enregistré NoRecordedProspects=Pas de prospect enregistré NoContractedProducts=Pas de produit/service contracté NoRecordedContracts=Pas de contrat enregistré -# Dernières commandes fournisseur BoxLatestSupplierOrders=Dernières commandes fournisseur BoxTitleLatestSupplierOrders=Les %s dernières commandes fournisseur enregistrées NoSupplierOrder=Pas de commandes fournisseur enregistrées +BoxInvoicesPerMonth=Factures par mois +BoxOrdersPerMonth=Commandes par mois +BoxProposalsPerMonth=Proposition par mois \ No newline at end of file diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index eb22a97a41b..f67f39cac28 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -887,7 +887,7 @@ else print "}\n"; print ''; print "\n"; - $s.=''.$langs->trans("VATIntraCheck").''; + $s.=''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); } else @@ -923,7 +923,8 @@ else print ''; // Capital - print ''.$langs->trans('Capital').' '.$langs->trans("Currency".$conf->currency).''; + print ''.$langs->trans('Capital').' '; + print ''.$langs->trans("Currency".$conf->currency).''; // Local Taxes //TODO: Place into a function to control showing by country or study better option @@ -982,7 +983,7 @@ else } // Ajout du logo - print ''; + print ''; print ''.$langs->trans("Logo").''; print ''; print ''; diff --git a/htdocs/theme/amarok/img/warning.png b/htdocs/theme/amarok/img/warning.png index 7c2c5f117f8d08b1bb627e27eff0762188f419ed..ae8e35e781d8ecc65ee5aa4805d657a875349be1 100755 GIT binary patch literal 618 zcmWkqQAkr!7(Oe@r5RTy6qdHpOSfR%X$BJncinQEI_KTWxlELcmY5da5iOsriCC^_ zsVUvw8uZ|V9tQSs!Ius_orj=91RWoYPJwlLsT*0{jt}4W@qc{($Im|#jkH#jRhIz( zDndcO!u8ND?0Y$%T>7xZ#hnTyQZ3_y1F7NbW6t>S=pYy!9CthGoI_u3?y4j;I3=mE zp{`M?cb=9!lJvvT{*Z5$ra~Qo(zknThtC~*eP-k*w+`G0_Gkc!FdKV1Z#|Hx-RAyyq0BW1YkoU1T)NQlZqn9VcB9X$~+X$ zQZ!WQ0JCKvh#kRTU|cDK;q1Q>+q0p;)K94o;XP&+r1H2t$pM zV)4|gZT>7b0iwHlg!!ORViuYjG??(m+k0h230FT~etP%O{U_7Yk8{(xb evx`&Nl}Q_Tv+1b4*HrbF9|%H$h<{D)zw;kUL?|!- literal 3269 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 D@&H-2 diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index ef50c010fec..894b6612f32 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -116,6 +116,66 @@ $colortext='40,40,40'; $fontsize=empty($conf->dol_optimize_smallscreen)?'12':'14'; $fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'14'; +$colorback1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$user->conf->THEME_ELDY_TOPMENU_BACK1); +$colorback2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK2)?$colorback2:$conf->global->THEME_ELDY_TOPMENU_BACK2) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK2)?$colorback2:$user->conf->THEME_ELDY_TOPMENU_BACK2); +$colorbacktab1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1)?$colorbacktab1:$conf->global->THEME_ELDY_VERMENU_BACK1) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1)?$colorbacktab1:$user->conf->THEME_ELDY_VERMENU_BACK1); +$colorbacktab1b =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1b)?$colorbacktab1:$conf->global->THEME_ELDY_VERMENU_BACK1b) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1b)?$colorbacktab1b:$user->conf->THEME_ELDY_VERMENU_BACK1b); +$colorbacktab2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK2)?$colorbacktab2:$conf->global->THEME_ELDY_VERMENU_BACK2) :(empty($user->conf->THEME_ELDY_VERMENU_BACK2)?$colorbacktab2:$user->conf->THEME_ELDY_VERMENU_BACK2); +$colorbacktitle1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTITLE1) ?$colorbacktitle1:$conf->global->THEME_ELDY_BACKTITLE1) :(empty($user->conf->THEME_ELDY_BACKTITLE1)?$colorbacktitle1:$user->conf->THEME_ELDY_BACKTITLE1); +$colorbacktitle2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTITLE2) ?$colorbacktitle2:$conf->global->THEME_ELDY_BACKTITLE2) :(empty($user->conf->THEME_ELDY_BACKTITLE2)?$colorbacktitle2:$user->conf->THEME_ELDY_BACKTITLE2); +$colorbacktabcard1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABCARD1) ?$colorbacktabcard1:$conf->global->THEME_ELDY_BACKTABCARD1) :(empty($user->conf->THEME_ELDY_BACKTABCARD1)?$colorbacktabcard1:$user->conf->THEME_ELDY_BACKTABCARD1); +$colorbacktabcard2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABCARD2) ?$colorbacktabcard2:$conf->global->THEME_ELDY_BACKTABCARD2) :(empty($user->conf->THEME_ELDY_BACKTABCARD2)?$colorbacktabcard2:$user->conf->THEME_ELDY_BACKTABCARD2); +$colorbacktabactive =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABACTIVE)?$colorbacktabactive:$conf->global->THEME_ELDY_BACKTABACTIVE):(empty($user->conf->THEME_ELDY_BACKTABACTIVE)?$colorbacktabactive:$user->conf->THEME_ELDY_BACKTABACTIVE); +$colorbacklineimpair1=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR1) ?$colorbacklineimpair1:$conf->global->THEME_ELDY_LINEIMPAIR1):(empty($user->conf->THEME_ELDY_LINEIMPAIR1)?$colorbacklineimpair1:$user->conf->THEME_ELDY_LINEIMPAIR1); +$colorbacklineimpair2=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR2) ?$colorbacklineimpair2:$conf->global->THEME_ELDY_LINEIMPAIR2):(empty($user->conf->THEME_ELDY_LINEIMPAIR2)?$colorbacklineimpair2:$user->conf->THEME_ELDY_LINEIMPAIR2); +$colorbacklineimpairhover=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIRHOVER) ?$colorbacklineimpairhover:$conf->global->THEME_ELDY_LINEIMPAIRHOVER):(empty($user->conf->THEME_ELDY_LINEIMPAIRHOVER)?$colorbacklineimpairhover:$user->conf->THEME_ELDY_LINEIMPAIRHOVER); +$colorbacklinepair1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR1) ?$colorbacklinepair1:$conf->global->THEME_ELDY_LINEPAIR1) :(empty($user->conf->THEME_ELDY_LINEPAIR1)?$colorbacklinepair1:$user->conf->THEME_ELDY_LINEPAIR1); +$colorbacklinepair2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR2) ?$colorbacklinepair2:$conf->global->THEME_ELDY_LINEPAIR2) :(empty($user->conf->THEME_ELDY_LINEPAIR2)?$colorbacklinepair2:$user->conf->THEME_ELDY_LINEPAIR2); +$colorbacklinepairhover =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIRHOVER) ?$colorbacklinepairhover:$conf->global->THEME_ELDY_LINEPAIRHOVER) :(empty($user->conf->THEME_ELDY_LINEPAIRHOVER)?$colorbacklinepairhover:$user->conf->THEME_ELDY_LINEPAIRHOVER); +$colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKBODY) ?$colorbackbody:$conf->global->THEME_ELDY_BACKBODY) :(empty($user->conf->THEME_ELDY_BACKBODY)?$colorbackbody:$user->conf->THEME_ELDY_BACKBODY); +$colortext =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXT) ?$colortext:$conf->global->THEME_ELDY_TEXT) :(empty($user->conf->THEME_ELDY_TEXT)?$colortext:$user->conf->THEME_ELDY_TEXT); +$fontsize =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE1) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE1) :(empty($user->conf->THEME_ELDY_FONT_SIZE1)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE1); +$fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE2) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE2) :(empty($user->conf->THEME_ELDY_FONT_SIZE2)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE2); +// No hover by default, we keep only if we set var THEME_ELDY_USE_HOVER +if ((! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($user->conf->THEME_ELDY_USE_HOVER)) + || (empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($conf->global->THEME_ELDY_USE_HOVER))) +{ + $colorbacklineimpairhover=''; + $colorbacklinepairhover=''; +} + +// Set text color to black or white +$tmppart=explode(',',$colorback1); +$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : ''); +$tmpval+=(! empty($tmppart[2]) ? $tmppart[2] : ''); +$tmpval+=(! empty($tmppart[3]) ? $tmppart[3] : ''); +//print $tmpval; +if ($tmpval < 340) $colortextmain='FFFFFF'; +else $colortextmain='101010'; + +$usecss3=true; +if ($conf->browser->name == 'ie' && round($conf->browser->version,2) < 10) $usecss3=false; +elseif ($conf->browser->name == 'iceweasel') $usecss3=false; +elseif ($conf->browser->name == 'epiphany') $usecss3=false; + +print '/*'."\n"; +print 'colred='.$colred.' colgreen='.$colgreen.' colblue='.$colblue."\n"; +print 'isred='.$isred.' isgreen='.$isgreen.' isblue='.$isblue."\n"; +print 'colorbacklineimpair1='.$colorbacklineimpair1."\n"; +print 'colorbacklineimpair2='.$colorbacklineimpair2."\n"; +print 'colorbacklineimpairhover='.$colorbacklineimpairhover."\n"; +print 'colorbacklinepair1='.$colorbacklinepair1."\n"; +print 'colorbacklinepair2='.$colorbacklinepair2."\n"; +print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; +print 'usecss3='.$usecss3."\n"; +print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; +print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; +print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; +print 'dol_no_mouse_hover='.$dol_no_mouse_hover."\n"; +print 'dol_use_jmobile='.$dol_use_jmobile."\n"; +print '*/'."\n"; + +if (! empty($conf->dol_optimize_smallscreen)) $fontsize=11; ?> @@ -352,7 +412,6 @@ div.tmenu ul li a.tmenusel {/* texte du menu principal sélectionné */ body.body center { color:white; margin-top: 100px; } form#login { - display:block; border:solid 1px rgba(0,0,0,.4); border-top:solid 1px #ffffff; background-color:#c7d0db; @@ -372,7 +431,7 @@ form#login { margin-right:auto; margin-bottom:25px; padding:20px 20px 10px; - width:500px; + max-width:500px; border-radius:12px; box-shadow:0 0 16px rgba(0,0,0,.8); } @@ -509,9 +568,9 @@ div.vmenu { display:none; width:170px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 3px 0px 6px #CCC; + -webkit-box-shadow: 3px 0px 6px #CCC; + box-shadow: 3px 0px 6px #CCC; } @@ -541,7 +600,7 @@ div.vmenu { .menu_contenu { background-color:#ffffff; - padding-left:12px; + padding-left:6px; border-top:solid 1px rgba(0,0,0,.05); } @@ -561,7 +620,7 @@ div.vmenu { .blockvmenusearch .menu_titre { margin-top:6px; text-align:left; - padding-left:18px; + padding-left:0px; } #blockvmenuhelp { @@ -818,13 +877,17 @@ a.help:link, a.help:visited, a.help:hover, a.help:active { font-size: } -.tab:hover {color:#333333;} +a.tab:hover {color:#333333;} /* ============================================================================== */ @@ -892,8 +951,8 @@ td.vmenu { div.fiche { padding:8px 6px 10px; - margin-: dol_optimize_smallscreen) || empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))?'16':'24'; ?>px; - margin-: dol_optimize_smallscreen)?'12':'6'; ?>px; + margin-: global->MAIN_MENU_USE_JQUERY_LAYOUT))?($dol_hide_leftmenu?'4':'16'):'24')); ?>px; + margin-: dol_optimize_smallscreen)?'12':'4')); ?>px; } div.fichecenter { @@ -1956,3 +2015,63 @@ div.jnotify-background { box-shadow: 4px 4px 4px #AAA !important; } + +/* ============================================================================== */ +/* JMobile */ +/* ============================================================================== */ + +li.ui-li-divider .ui-link { + color: #FFF !important; +} +.ui-btn-inner { + padding-left: 10px; + padding-right: 10px; + white-space: normal; +} +.ui-select .ui-btn-icon-right .ui-btn-inner { + padding-right: 36px; +} +.fiche .ui-controlgroup { + margin: 0px; + padding-bottom: 0px; +} +div.ui-controlgroup-controls div.tabsElem +{ + margin-top: 2px; + margin-right: 8px; +} +div.ui-controlgroup-controls div.tabsElem a +{ + -moz-box-shadow: 0 -3px 6px rgba(0,0,0,.2); + -webkit-box-shadow: 0 -3px 6px rgba(0,0,0,.2); + box-shadow: 0 -3px 6px rgba(0,0,0,.2); + border: none; +} +div.ui-controlgroup-horizontal + +a.tab span.ui-btn-inner, a.tab span.ui-btn-inner span.ui-btn-text +{ + border: none; + padding: 0; +} + +.ui-body-c { + border: none; + text-shadow: none; +} +.ui-link { + color: rgb() !important; +} + +div.tabsElem a.ui-btn-corner-all { + -webkit-border-bottom-left-radius: 0px; + -moz-border-radius-bottomleft: 0px; + border-bottom-left-radius: 0px; + -webkit-border-bottom-right-radius: 0px; + -moz-border-radius-bottomright: 0px; + border-bottom-right-radius: 0px; +} + +close(); +?> diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index de15a44705f..0d2b18a39f5 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -116,16 +116,16 @@ $fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'14'; // Eldy colors if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) { - $conf->global->THEME_ELDY_TOPMENU_BACK1='180,196,216'; // topmenu - $conf->global->THEME_ELDY_TOPMENU_BACK2='190,206,226'; - $conf->global->THEME_ELDY_VERMENU_BACK1='253,253,253'; // vmenu - $conf->global->THEME_ELDY_VERMENU_BACK1b='226,228,230'; // vmenu (not menu) - $conf->global->THEME_ELDY_VERMENU_BACK2='232,234,236'; + $conf->global->THEME_ELDY_TOPMENU_BACK1='200,216,246'; // topmenu + $conf->global->THEME_ELDY_TOPMENU_BACK2='190,206,236'; + $conf->global->THEME_ELDY_VERMENU_BACK1='255,255,255'; // vmenu + $conf->global->THEME_ELDY_VERMENU_BACK1b='230,232,232'; // vmenu (not menu) + $conf->global->THEME_ELDY_VERMENU_BACK2='240,240,240'; $conf->global->THEME_ELDY_BACKTITLE1='140,160,185'; // title of arrays $conf->global->THEME_ELDY_BACKTITLE2='210,220,235'; - $conf->global->THEME_ELDY_BACKTABCARD1='231,232,235'; // card - $conf->global->THEME_ELDY_BACKTABCARD2='220,224,227'; - $conf->global->THEME_ELDY_BACKTABACTIVE='220,224,227'; + $conf->global->THEME_ELDY_BACKTABCARD1='240,240,240'; // card + $conf->global->THEME_ELDY_BACKTABCARD2='234,234,234'; + $conf->global->THEME_ELDY_BACKTABACTIVE='234,234,234'; $conf->global->THEME_ELDY_BACKBODY='#ffffff url('.$img_head.') 0 0 no-repeat;'; $conf->global->THEME_ELDY_LINEIMPAIR1='242,242,242'; $conf->global->THEME_ELDY_LINEIMPAIR2='248,248,248'; @@ -134,7 +134,12 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) $conf->global->THEME_ELDY_LINEPAIR2='255,255,255'; $conf->global->THEME_ELDY_LINEPAIRHOVER='238,246,252'; $conf->global->THEME_ELDY_BACKBODY='#ffffff url('.$img_head.') 0 0 no-repeat;'; - $conf->global->THEME_ELDY_TEXT='48,102,102'; + $conf->global->THEME_ELDY_TEXT='50,50,160'; + if ($dol_use_jmobile) + { + $conf->global->THEME_ELDY_BACKTABCARD1='255,255,255'; // topmenu + $conf->global->THEME_ELDY_BACKTABCARD2='255,255,255'; + } } $colorback1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$user->conf->THEME_ELDY_TOPMENU_BACK1); @@ -274,9 +279,9 @@ input[type=image] { background-color: transparent; border: none; box-shadow: non -moz-border-radius:0px 5px 0px 5px; -webkit-border-radius:0px 5px 0px 5px; border-radius:0px 5px 0px 5px; - -moz-box-shadow: 2px 2px 3px #CCC; - -webkit-box-shadow: 2px 2px 3px #CCC; - box-shadow: 2px 2px 3px #CCC; + -moz-box-shadow: 2px 2px 3px #DDD; + -webkit-box-shadow: 2px 2px 3px #DDD; + box-shadow: 2px 2px 3px #DDD; } .button:focus { font-family: ; @@ -301,9 +306,9 @@ input[type=image] { background-color: transparent; border: none; box-shadow: non -moz-border-radius:0px 5px 0px 5px; -webkit-border-radius:0px 5px 0px 5px; border-radius:0px 5px 0px 5px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; } form { padding:0px; @@ -463,20 +468,25 @@ div.tmenudiv { height: px; - /* background-image: -o-linear-gradient(bottom, rgb() 75%, rgb() 100%); */ - /* background-image: -moz-linear-gradient(bottom, rgb() 75%, rgb() 100%);*/ - /* background-image: -webkit-linear-gradient(bottom, rgb() 40%, rgb() 60%, rgb() 100%);*/ - /* background-image: -ms-linear-gradient(bottom, rgb() 75%, rgb() 100%);*/ - /* background-image: linear-gradient(bottom, rgb() 75%, rgb() 100%); */ - background: url() 50% 0% repeat-x; - border-bottom: 1px solid rgb(); +background-image: linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); +background-image: -o-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); +background-image: -moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); +background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); +background-image: -ms-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); +background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.3)), color-stop(1, rgba(0,0,0,.3)) ); + +/*background-image: rgb(); + + background-image: -o-linear-gradient(bottom, rgb() 75%, rgb() 100%); + background-image: -moz-linear-gradient(bottom, rgb() 75%, rgb() 100%); + background-image: -webkit-linear-gradient(bottom, rgb() 40%, rgb() 60%, rgb() 100%); + background-image: -ms-linear-gradient(bottom, rgb() 75%, rgb() 100%); + background-image: linear-gradient(bottom, rgb() 75%, rgb() 100%);*/ box-shadow: 0 0 6px rgba(0, 0, 0, .4) !important; - border-bottom: 1px solid #DDDDDD; - background-image: url(); - background-position:top; - background-repeat:repeat-x; + background-image: rgb(); + color: #000000; text-decoration: none; @@ -533,7 +543,6 @@ ul.tmenu { /* t r b l */ margin: 0px 0px 0px 0px; list-style: none; height: px; - background: url() 0 0 repeat-x !important; } li.tmenu, li.tmenusel { @@ -772,9 +781,9 @@ form#login { border: 1px solid #C0C0C0; background-color: #E0E0E0; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; border-radius: 8px; border:solid 1px rgba(168,168,168,.4); @@ -899,14 +908,14 @@ div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks background-repeat:repeat-x; border-left: 1px solid #CCCCCC; - border-right: 1px solid #BBBBBB; - border-bottom: 1px solid #BBBBBB; + border-right: 1px solid #DDDDDD; + border-bottom: 1px solid #DDDDDD; border-top: 1px solid #DDDDDD; border-radius: 5px; -moz-border-radius: 5px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; } div.blockvmenusearch @@ -936,9 +945,9 @@ div.blockvmenusearch border-bottom: 1px solid #BBBBBB; border-radius: 5px; -moz-border-radius: 5px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; } div.blockvmenubookmarksold @@ -970,9 +979,9 @@ div.blockvmenubookmarksold border-bottom: 1px solid #BBBBBB; border-radius: 5px; -moz-border-radius: 5px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; } div.blockvmenuhelp @@ -1272,13 +1281,15 @@ img.toolbarbutton { /* ============================================================================== */ /* Onglets */ /* ============================================================================== */ - div.tabs { - top: 20px; - margin: 1px 0px 2px 0px; - padding: 0px 6px 0px 0px; + margin: 0px 0px 2px 6px; + padding: 0px 6px 3px 0px; text-align: ; + + clear:both; + height:100%; } +div.tabsElem { margin-top: 8px; } /* To avoid overlap of tabs when not browser */ div.tabBar { color: #; @@ -1305,9 +1316,9 @@ div.tabBar { background: #dee7ec url() repeat-x; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; } @@ -1334,17 +1345,24 @@ a.tabTitle { a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { font-family: ; - padding: 4px 6px 2px 6px; + padding: 5px 12px 5px; + /* padding: 3px 6px 2px 6px;*/ margin: 0em 0.2em; text-decoration: none; white-space: nowrap; + -moz-border-radius:6px 6px 0px 0px; -webkit-border-radius:6px 6px 0px 0px; border-radius:6px 6px 0px 0px; - border-: 1px solid #555555; - border-: 1px solid #D8D8D8; - border-top: 1px solid #D8D8D8; + -moz-box-shadow: 0 -1px 4px rgba(0,0,0,.1); + -webkit-box-shadow: 0 -1px 4px rgba(0,0,0,.1); + box-shadow: 0 -1px 4px rgba(0,0,0,.1); + + border-bottom: none; + border-right: 1px solid #CCCCCC; + border-left: 1px solid #D0D0D0; + border-top: 1px solid #D8D8D8; background-image: -o-linear-gradient(bottom, rgb() 35%, rgb() 100%); @@ -1352,6 +1370,8 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { background-image: -webkit-linear-gradient(bottom, rgb() 35%, rgb() 100%); background-image: -ms-linear-gradient(bottom, rgb() 35%, rgb() 100%); background-image: linear-gradient(bottom, rgb() 35%, rgb() 100%); + + background: white url() 50% 0 repeat-x; background: #dee7ec; @@ -1371,7 +1391,10 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active color: #; /* font-weight: normal !important; */ } - +a.tab:hover +{ + background: #EEEEEE url() 50% 0 repeat-x; +} a.tabimage { color: #434956; font-family: ; @@ -1419,9 +1442,9 @@ div.divButAction { margin-bottom: 1.4em; } -moz-border-radius:0px 5px 0px 5px; -webkit-border-radius:0px 5px 0px 5px; border-radius:0px 5px 0px 5px; - -moz-box-shadow: 2px 2px 3px #CCC; - -webkit-box-shadow: 2px 2px 3px #CCC; - box-shadow: 2px 2px 3px #CCC; + -moz-box-shadow: 2px 2px 3px #DDD; + -webkit-box-shadow: 2px 2px 3px #DDD; + box-shadow: 2px 2px 3px #DDD; } .butAction:hover { @@ -1450,9 +1473,9 @@ div.divButAction { margin-bottom: 1.4em; } -moz-border-radius:0px 5px 0px 5px; -webkit-border-radius:0px 5px 0px 5px; border-radius:0px 5px 0px 5px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; } global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { ?> @@ -1556,9 +1579,9 @@ table.noborder, table.formdoc { margin: 0px 0px 2px 0px; /*padding: 1px 2px 1px 2px;*/ - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; -moz-border-radius: 0.2em; -webkit-border-radius: 0.2em; @@ -1617,9 +1640,9 @@ table.liste { margin-bottom: 2px; margin-top: 0px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; } table.liste td { padding-right: 2px; @@ -1628,18 +1651,15 @@ table.liste td { div.liste_titre, tr.liste_titre, tr.liste_titre_sel { height: 20px !important; - background: #7699A9; + background: rgb(); background-repeat: repeat-x; - - + background-image: -o-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -moz-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -webkit-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -ms-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: linear-gradient(bottom, rgb() 15%, rgb() 100%); - - background-image: url(); - + color: #; font-family: ; font-weight: normal; @@ -1730,15 +1750,15 @@ tr.liste_total td { /* Disable shadows */ .noshadow { - -moz-box-shadow: 0px 0px 0px #CCC !important; - -webkit-box-shadow: 0px 0px 0px #CCC !important; - box-shadow: 0px 0px 0px #CCC !important; + -moz-box-shadow: 0px 0px 0px #DDD !important; + -webkit-box-shadow: 0px 0px 0px #DDD !important; + box-shadow: 0px 0px 0px #DDD !important; } div.tabBar .noborder { - -moz-box-shadow: 0px 0px 0px #CCC !important; - -webkit-box-shadow: 0px 0px 0px #CCC !important; - box-shadow: 0px 0px 0px #CCC !important; + -moz-box-shadow: 0px 0px 0px #DDD !important; + -webkit-box-shadow: 0px 0px 0px #DDD !important; + box-shadow: 0px 0px 0px #DDD !important; } @@ -1747,9 +1767,9 @@ div.tabBar .noborder { */ .boxtable { - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 4px 4px 4px #DDD; + -webkit-box-shadow: 4px 4px 4px #DDD; + box-shadow: 4px 4px 4px #DDD; margin-bottom: 8px !important; } @@ -1762,18 +1782,15 @@ div.tabBar .noborder { tr.box_titre { height: 20px; - background: #7699A9; - - + background: rgb(); + background-repeat: repeat-x; + background-image: -o-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -moz-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -webkit-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -ms-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: linear-gradient(bottom, rgb() 15%, rgb() 100%); - - background-image: url(); - - background-repeat: repeat-x; + color: #; font-family: , sans-serif; font-weight: normal; @@ -2371,9 +2388,9 @@ a.cke_dialog_ui_button -moz-border-radius:0px 5px 0px 5px !important; -webkit-border-radius:0px 5px 0px 5px !important; border-radius:0px 5px 0px 5px !important; - -moz-box-shadow: 4px 4px 4px #CCC !important; - -webkit-box-shadow: 4px 4px 4px #CCC !important; - box-shadow: 4px 4px 4px #CCC !important; + -moz-box-shadow: 4px 4px 4px #DDD !important; + -webkit-box-shadow: 4px 4px 4px #DDD !important; + box-shadow: 4px 4px 4px #DDD !important; } .cke_dialog_ui_hbox_last { @@ -2556,11 +2573,43 @@ li.ui-li-divider .ui-link { color: #FFF !important; } .ui-btn-inner { - padding-left: 12px; + padding-left: 10px; + padding-right: 10px; + white-space: normal; } .ui-select .ui-btn-icon-right .ui-btn-inner { padding-right: 36px; } +.fiche .ui-controlgroup { + margin: 0px; + padding-bottom: 0px; +} +div.ui-controlgroup-controls div.tabsElem +{ + margin-top: 2px; +} +div.ui-controlgroup-controls div.tabsElem a +{ + -moz-box-shadow: 0 -3px 6px rgba(0,0,0,.2); + -webkit-box-shadow: 0 -3px 6px rgba(0,0,0,.2); + box-shadow: 0 -3px 6px rgba(0,0,0,.2); + border: none; +} +a.tab span.ui-btn-inner +{ + border: none; + padding: 0; +} + +.ui-body-c { + border: none; + text-shadow: none; +} +.ui-link { + color: rgb() !important; +} + + /* Warning: setting this make screen not beeing refreshed after a combo selection */ /*.ui-body-c { background: #fff; @@ -2570,7 +2619,7 @@ li.ui-li-divider .ui-link { background: #eee !important; } .ui-bar-b { - border: 1px solid #ccc !important; + border: 1px solid #CCC !important; background: #aaa !important; font-weight: bold !important; color: #444 !important; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index a779894d1db..7d4f11a2fdd 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -119,6 +119,16 @@ llxHeader(); $head = user_prepare_head($fuser); $title = $langs->trans("User"); + +if ($action == 'edit') +{ + print '
'; + print ''; + print ''; + print ''; +} + + dol_fiche_head($head, 'guisetup', $title, 0, 'user'); @@ -158,11 +168,6 @@ if ($action == 'edit') }); '; - print ''; - print ''; - print ''; - print ''; - clearstatcache(); $var=true; @@ -198,13 +203,15 @@ if ($action == 'edit') // Theme show_theme($fuser,(($user->admin || empty($dolibarr_main_demo))?1:0),true); - print '
'; + dol_fiche_end(); + print '
'; print ''; print '     '; print ''; print '
'; + print ''; } @@ -241,7 +248,8 @@ else // Skin show_theme($fuser,0,true); - print ''; + dol_fiche_end(); + print '
'; if (empty($user->admin) && ! empty($dolibarr_main_demo)) From a8ea2a9d068a80408847749646b566382976f376 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Apr 2013 04:06:13 +0200 Subject: [PATCH 051/167] Prepare code for small screens --- htdocs/theme/amarok/style.css.php | 2 +- htdocs/theme/auguria/style.css.php | 4 ++-- htdocs/theme/bureau2crea/style.css.php | 4 ++-- htdocs/theme/cameleo/style.css.php | 4 ++-- htdocs/user/fiche.php | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 894b6612f32..8f190c664e0 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -2001,7 +2001,7 @@ div.ecmjqft { bottom: 4px !important; text-align: center; - min-width: 500px; + min-width: px; width: auto; padding-left: 10px !important; padding-right: 10px !important; diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 6068aebf385..38129cbb0f8 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -253,7 +253,7 @@ div.fichehalfright { dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?> } div.ficheaddleft { - dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } + dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } else print "margin-top: 10px;\n"; ?> } @@ -2186,7 +2186,7 @@ div.ecmjqft { bottom: 4px !important; text-align: center; - min-width: 500px; + min-width: px; width: auto; padding-left: 10px !important; padding-right: 10px !important; diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index ea565c5d1f4..0becc3f0234 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -298,7 +298,7 @@ div.fichehalfright { dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?> } div.ficheaddleft { - dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } + dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } else print "margin-top: 10px;\n"; ?> } @@ -2414,7 +2414,7 @@ div.ecmjqft { bottom: 4px !important; text-align: center; - min-width: 500px; + min-width: px; width: auto; padding-left: 10px !important; padding-right: 10px !important; diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index ddc88ac61d9..fad419cf922 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -263,7 +263,7 @@ div.fichehalfright { dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?> } div.ficheaddleft { - dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } + dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; } else print "margin-top: 10px;\n"; ?> } @@ -2240,7 +2240,7 @@ div.ecmjqft { bottom: 4px !important; text-align: center; - min-width: 500px; + min-width: px; width: auto; padding-left: 10px !important; padding-right: 10px !important; diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 892d5fc4ac3..98d3e85d343 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -1545,7 +1545,7 @@ else if ($caneditfield) { if ($object->photo) print "
\n"; - print ''; + print '
'; if ($object->photo) print ''; print ''; print ''; From cbf44bf17502b179bd1835215b1750ca9049dd20 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Apr 2013 12:10:04 +0200 Subject: [PATCH 052/167] Change to be compatible with jmobile --- htdocs/theme/amarok/style.css.php | 2 +- htdocs/theme/auguria/style.css.php | 11 +++++++++ htdocs/theme/bureau2crea/style.css.php | 33 +++++++++++++++++++++++++- htdocs/theme/cameleo/style.css.php | 11 +++++++++ 4 files changed, 55 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 8f190c664e0..cf243f769e3 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -2047,7 +2047,6 @@ div.ui-controlgroup-controls div.tabsElem a box-shadow: 0 -3px 6px rgba(0,0,0,.2); border: none; } -div.ui-controlgroup-horizontal a.tab span.ui-btn-inner, a.tab span.ui-btn-inner span.ui-btn-text { @@ -2072,6 +2071,7 @@ div.tabsElem a.ui-btn-corner-all { border-bottom-right-radius: 0px; } + close(); ?> diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 38129cbb0f8..bf9b9c7aeee 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -2202,6 +2202,17 @@ div.ecmjqft { box-shadow: 0px 0px 10px #AAA; } + +/* ============================================================================== */ +/* JMobile */ +/* ============================================================================== */ + +.ui-body-c { + border: none; + text-shadow: none; +} + + close(); ?> diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 0becc3f0234..5bf68effb41 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -1107,7 +1107,6 @@ div.tabs a.tab { color: #FFFFFF; text-decoration: none; position: relative; - float: left; padding: 0px 10px 0px 10px; } @@ -2421,6 +2420,38 @@ div.ecmjqft { } +/* ============================================================================== */ +/* JMobile */ +/* ============================================================================== */ + +.ui-btn-inner { + padding-left: 10px; + padding-right: 10px; + white-space: normal; +} + +div.ui-controlgroup-controls div.tabsElem, div.ui-controlgroup-controls div.tabsElem a.tab +{ + height: 22px; +} + +a.tab span.ui-btn-inner +{ + border: none; + padding: 0; +} +div.tabs a.tab#active span.ui-btn-inner, div.tabs a.tab#active span.ui-btn-text, div.tabs a.tab span.ui-btn-inner, div.tabs a.tab span.ui-btn-text { + background-image: none; + color: #D45416; + height: 22px +} + +.ui-body-c { + border: none; + text-shadow: none; +} + + close(); ?> diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index fad419cf922..a1e3e7a44c9 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -2247,6 +2247,17 @@ div.ecmjqft { } + +/* ============================================================================== */ +/* JMobile */ +/* ============================================================================== */ + +.ui-body-c { + border: none; + text-shadow: none; +} + + close(); ?> From f7aa90b3b31721062d735293d62c4712186b0c10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Apr 2013 12:43:23 +0200 Subject: [PATCH 053/167] Add user help --- htdocs/langs/en_US/users.lang | 3 ++- htdocs/langs/fr_FR/users.lang | 3 ++- htdocs/user/fiche.php | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index b922617ef31..35ef2cfb386 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -115,4 +115,5 @@ YourQuotaOfUsersIsReached=Your quota of active users is reached ! NbOfUsers=Nb of users DontDowngradeSuperAdmin=Only a superadmin can downgrade a superadmin HierarchicalResponsible=Hierarchical responsible -HierarchicView=Hierarchical view \ No newline at end of file +HierarchicView=Hierarchical view +UseTypeFieldToChange=Use field Type to change \ No newline at end of file diff --git a/htdocs/langs/fr_FR/users.lang b/htdocs/langs/fr_FR/users.lang index 2b6e398d035..bb5b7fb608b 100644 --- a/htdocs/langs/fr_FR/users.lang +++ b/htdocs/langs/fr_FR/users.lang @@ -115,4 +115,5 @@ YourQuotaOfUsersIsReached=Votre quota d'utilisateurs actifs est atteint ! NbOfUsers=Nb d'utilisateurs DontDowngradeSuperAdmin=Seul un superadmin peut rétrograder un superadmin HierarchicalResponsible=Responsable hierarchique -HierarchicView=Vue hiérarchique \ No newline at end of file +HierarchicView=Vue hiérarchique +UseTypeFieldToChange=Modifier le champ Type pour changer \ No newline at end of file diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 98d3e85d343..275fd83f1a5 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -1848,6 +1848,7 @@ else { print $langs->trans("ThisUserIsNot"); } + print ' ('.$langs->trans("UseTypeFieldToChange").')'; print ''; print "\n"; } From bca399623fbe9cb4ce03fbd2c853f762721f53bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Apr 2013 12:44:36 +0200 Subject: [PATCH 054/167] Fix: finish merge --- htdocs/core/modules/syslog/mod_syslog_file.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php index a628ee02d3e..e7e2c01372d 100644 --- a/htdocs/core/modules/syslog/mod_syslog_file.php +++ b/htdocs/core/modules/syslog/mod_syslog_file.php @@ -96,17 +96,9 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface /** * Return the parsed logfile path * -<<<<<<< HEAD * @param string $suffixinfilename When output is a file, append this suffix into default log filename. * @return string -======= -<<<<<<< OURS * @return string -======= - * @param string $suffixinfilename When output is a file, append this suffix into default log filename. - * @return string ->>>>>>> THEIRS ->>>>>>> refs/remotes/origin/3.3 */ private function getFilename($suffixinfilename='') { From c17775b9a1c14ce95a61bc7441fa310ec9b9bb62 Mon Sep 17 00:00:00 2001 From: jfefe Date: Wed, 24 Apr 2013 13:39:39 +0200 Subject: [PATCH 055/167] Minor interface improvements (theme eldy) : link uderline on hover / bold in array titles --- htdocs/theme/eldy/style.css.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 0d2b18a39f5..739ce3b2602 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -224,7 +224,9 @@ body { trans("DIRECTION").";\n"; ?> } -a:link, a:visited, a:hover, a:active { font-family: ; font-weight: bold; color: #000000; text-decoration: none; } +a:link, a:visited, a:hover, a:active { font-family: ; font-weight: bold; color: #4A4A4A; text-decoration: none; } + +a:hover { text-decoration: underline; color: #000000;} input:focus, textarea:focus, button:focus, select:focus { box-shadow: 0 0 4px #8091BF; @@ -1662,7 +1664,7 @@ div.liste_titre, tr.liste_titre, tr.liste_titre_sel color: #; font-family: ; - font-weight: normal; + font-weight: bold; border-bottom: 1px solid #FDFFFF; white-space: ; text-align: ; @@ -1670,7 +1672,7 @@ div.liste_titre, tr.liste_titre, tr.liste_titre_sel tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre { font-family: ; - font-weight: normal; + /*font-weight: normal;*/ border-bottom: 1px solid #FDFFFF; white-space: ; } @@ -1793,7 +1795,7 @@ tr.box_titre { color: #; font-family: , sans-serif; - font-weight: normal; + font-weight: bold; border-bottom: 1px solid #FDFFFF; white-space: nowrap; } From fb1c306b31d3f0624f0bf1c7b9693f32c3915a35 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Apr 2013 13:56:05 +0200 Subject: [PATCH 056/167] Update nl --- htdocs/langs/nl_NL/admin.lang | 10 +++++----- htdocs/langs/nl_NL/commercial.lang | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/langs/nl_NL/admin.lang b/htdocs/langs/nl_NL/admin.lang index 97efffdbe5e..d4025c49bbb 100644 --- a/htdocs/langs/nl_NL/admin.lang +++ b/htdocs/langs/nl_NL/admin.lang @@ -296,7 +296,7 @@ TestSubmitForm = Invoer testformulier Module0Name = Gebruikers & groepen Module0Desc = Beheer gebruikers en groepen Module1Name = Beheer derde partijen -Module1Desc = Beheer van derde partijen (afnemers, leveranciers en contactpersonen). Ook kunt u hier sjabloondocumenten uploaden. +Module1Desc = Beheer van derde partijen (klanten, leveranciers en contactpersonen). Ook kunt u hier sjabloondocumenten uploaden. Module2Name = Commercieel Module2Desc = Commercieel beheer Module10Name = Boekhouding @@ -307,10 +307,10 @@ Module22Name = EMailings Module22Desc = Administratie en verzending van bulk-e-mails Module23Name = Energie Module23Desc = Monitoring van het verbruik van energie -Module25Name = Afnemersopdrachten -Module25Desc = Verkoopopdrachten +Module25Name = Bestellingen klanten +Module25Desc = Beheer van de bestellingen door klanten Module30Name = Facturen -Module30Desc = Factuur- en creditnotabeheer voor afnemers. Factuurbeheer voor leveranciers +Module30Desc = Factuur- en creditnotabeheer voor klanten. Factuurbeheer voor leveranciers Module40Name = Leveranciers Module40Desc = Leveranciersbeheer (inkoopopdrachten en -facturen) Module42Name = Syslog @@ -341,7 +341,7 @@ Module70Name = Interventies Module70Desc = Interventiesbeheer Module75Name = Reisnotities en -kosten Module75Desc = Beheer van reisnotities en -kosten -Module80Name = Expedities +Module80Name = Verzendingen Module80Desc = Beheer afnemersverzending en -ontvangst Module85Name = Bank en Contant Module85Desc = Beheer van bank- en / of kasrekeningen diff --git a/htdocs/langs/nl_NL/commercial.lang b/htdocs/langs/nl_NL/commercial.lang index dfa9cc16955..960fb1daef5 100644 --- a/htdocs/langs/nl_NL/commercial.lang +++ b/htdocs/langs/nl_NL/commercial.lang @@ -4,8 +4,8 @@ Commercial = Commercieel CommercialArea = Commerciële gedeelte CommercialCard = Commerciele details CustomerArea = Afnemersdetails -Customer = Afnemer -Customers = Afnemers +Customer = Klant +Customers = Klanten Prospect = Prospect Prospects = Prospecten DeleteAction = Verwijder een actie From 95f6b576b2da6540318bf48f2f73a0a1151a6180 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Apr 2013 14:20:23 +0200 Subject: [PATCH 057/167] Look: Minor fix --- htdocs/theme/amarok/style.css.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index cf243f769e3..deb5485aa39 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -577,7 +577,7 @@ div.vmenu { .blockvmenupair .menu_titre, .blockvmenuimpair .menu_titre { height:22px; line-height:22px; - text-align:center; + /* text-align:center; */ background-color:rgba(0,0,0,.08); background-image:linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); background-image:-o-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); @@ -591,7 +591,7 @@ div.vmenu { color-stop(0, rgba(255,255,255,.3)), color-stop(1, rgba(0,0,0,.3)) ); - padding-left:3px; + padding-left:5px; border-top:solid 1px rgba(255,255,255,.5); border-bottom:solid 1px rgba(0,0,0,.5); } From 304cf641c0c2f3a0949abab8830a262a761a415f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Apr 2013 14:39:34 +0200 Subject: [PATCH 058/167] Prepare 3.4 --- build/rpm/dolibarr_fedora.spec | 3 ++- build/rpm/dolibarr_generic.spec | 3 ++- build/rpm/dolibarr_mandriva.spec | 3 ++- build/rpm/dolibarr_opensuse.spec | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 95b3fc0f179..f805e7cf470 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -165,7 +165,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/commande -%_datadir/dolibarr/htdocs/commissions %_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/contact @@ -187,8 +186,10 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin +%_datadir/dolibarr/htdocs/opensurvey %_datadir/dolibarr/htdocs/paybox %_datadir/dolibarr/htdocs/paypal +%_datadir/dolibarr/htdocs/printipp %_datadir/dolibarr/htdocs/product %_datadir/dolibarr/htdocs/projet %_datadir/dolibarr/htdocs/public diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index cee4ab9f6ec..1961ebbf161 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -241,7 +241,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/commande -%_datadir/dolibarr/htdocs/commissions %_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/contact @@ -263,8 +262,10 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin +%_datadir/dolibarr/htdocs/opensurvey %_datadir/dolibarr/htdocs/paybox %_datadir/dolibarr/htdocs/paypal +%_datadir/dolibarr/htdocs/printipp %_datadir/dolibarr/htdocs/product %_datadir/dolibarr/htdocs/projet %_datadir/dolibarr/htdocs/public diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 62758af82b4..9c36baf79d9 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -162,7 +162,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/commande -%_datadir/dolibarr/htdocs/commissions %_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/contact @@ -184,8 +183,10 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin +%_datadir/dolibarr/htdocs/opensurvey %_datadir/dolibarr/htdocs/paybox %_datadir/dolibarr/htdocs/paypal +%_datadir/dolibarr/htdocs/printipp %_datadir/dolibarr/htdocs/product %_datadir/dolibarr/htdocs/projet %_datadir/dolibarr/htdocs/public diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index eb2bbc859f4..99f7c94a986 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -173,7 +173,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/commande -%_datadir/dolibarr/htdocs/commissions %_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/contact @@ -195,8 +194,10 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin +%_datadir/dolibarr/htdocs/opensurvey %_datadir/dolibarr/htdocs/paybox %_datadir/dolibarr/htdocs/paypal +%_datadir/dolibarr/htdocs/printipp %_datadir/dolibarr/htdocs/product %_datadir/dolibarr/htdocs/projet %_datadir/dolibarr/htdocs/public From 08808c58cd1fc20b054674663d18588d045ff666 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Apr 2013 14:46:50 +0200 Subject: [PATCH 059/167] Prepare 3.3.2 --- build/rpm/dolibarr_fedora.spec | 1 - build/rpm/dolibarr_generic.spec | 1 - build/rpm/dolibarr_mandriva.spec | 1 - build/rpm/dolibarr_opensuse.spec | 1 - 4 files changed, 4 deletions(-) diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 41dff2735ff..8f36bc14805 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -165,7 +165,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/commande -%_datadir/dolibarr/htdocs/commissions %_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/contact diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 9fe677e6f42..3e0bb99f586 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -241,7 +241,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/commande -%_datadir/dolibarr/htdocs/commissions %_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/contact diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index f31988aed20..dad739ba8b9 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -162,7 +162,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/commande -%_datadir/dolibarr/htdocs/commissions %_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/contact diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 3c59a8a075c..efe8152687b 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -173,7 +173,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/categories %_datadir/dolibarr/htdocs/comm %_datadir/dolibarr/htdocs/commande -%_datadir/dolibarr/htdocs/commissions %_datadir/dolibarr/htdocs/compta %_datadir/dolibarr/htdocs/conf %_datadir/dolibarr/htdocs/contact From d2a718d0e6c22d3e78f630daca78f11cd6507eb6 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Wed, 24 Apr 2013 15:18:42 +0200 Subject: [PATCH 060/167] fix undefined offset --- htdocs/includes/nusoap/lib/nusoap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/nusoap/lib/nusoap.php b/htdocs/includes/nusoap/lib/nusoap.php index 501e5669ce9..403d74b13e9 100644 --- a/htdocs/includes/nusoap/lib/nusoap.php +++ b/htdocs/includes/nusoap/lib/nusoap.php @@ -2217,7 +2217,7 @@ class soap_transport_http extends nusoap_base { } $this->use_curl = $use_curl; preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev); - $this->setHeader('User-Agent', $this->title.'/'.$this->version.' ('.$rev[1].')'); + if (isset($rev[1])) $this->setHeader('User-Agent', $this->title.'/'.$this->version.' ('.$rev[1].')'); } /** From 026195689b8f820ec0880bf6e230b9d4ffe7fcff Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Wed, 24 Apr 2013 15:22:37 +0200 Subject: [PATCH 061/167] fix undefined offset --- htdocs/includes/nusoap/lib/nusoap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/nusoap/lib/nusoap.php b/htdocs/includes/nusoap/lib/nusoap.php index 501e5669ce9..403d74b13e9 100644 --- a/htdocs/includes/nusoap/lib/nusoap.php +++ b/htdocs/includes/nusoap/lib/nusoap.php @@ -2217,7 +2217,7 @@ class soap_transport_http extends nusoap_base { } $this->use_curl = $use_curl; preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev); - $this->setHeader('User-Agent', $this->title.'/'.$this->version.' ('.$rev[1].')'); + if (isset($rev[1])) $this->setHeader('User-Agent', $this->title.'/'.$this->version.' ('.$rev[1].')'); } /** From 9a2b72f8f8f9ea3aa92bebd114b8d3c92862b63b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Apr 2013 15:49:43 +0200 Subject: [PATCH 062/167] Compatibility with jmobile --- htdocs/core/class/html.form.class.php | 6 ++++-- htdocs/theme/amarok/style.css.php | 6 ++++++ htdocs/theme/auguria/style.css.php | 15 ++++++++++++++ htdocs/theme/bureau2crea/style.css.php | 16 +++++++++++++-- htdocs/theme/cameleo/style.css.php | 28 ++++++++++++++++++++++++++ 5 files changed, 67 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 97658572831..49f7268b875 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3775,14 +3775,16 @@ class Form */ function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='') { + global $langs,$conf; + $ret=''; if (empty($fieldid)) $fieldid='rowid'; if (empty($fieldref)) $fieldref='ref'; //print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam"; $object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid); - $previous_ref = $object->ref_previous?''.img_previous().'':''; - $next_ref = $object->ref_next?''.img_next().'':''; + $previous_ref = $object->ref_previous?''.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Previous"),'previous.png'):' ').'':''; + $next_ref = $object->ref_next?''.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Next"),'next.png'):' ').'':''; //print "xx".$previous_ref."x".$next_ref; if ($previous_ref || $next_ref || $morehtml) { diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index deb5485aa39..b54ed11fc69 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -2071,6 +2071,12 @@ div.tabsElem a.ui-btn-corner-all { border-bottom-right-radius: 0px; } +.ui-btn-icon-left .ui-icon { + left: 8px; +} +.ui-btn-icon-right .ui-icon { + right: 8px; +} close(); diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index bf9b9c7aeee..f6c6e177696 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -2212,6 +2212,21 @@ div.ecmjqft { text-shadow: none; } +div.tabsElem a.ui-btn-corner-all { + -webkit-border-bottom-left-radius: 0px; + -moz-border-radius-bottomleft: 0px; + border-bottom-left-radius: 0px; + -webkit-border-bottom-right-radius: 0px; + -moz-border-radius-bottomright: 0px; + border-bottom-right-radius: 0px; +} + +.ui-btn-icon-left .ui-icon { + left: 8px; +} +.ui-btn-icon-right .ui-icon { + right: 8px; +} close(); diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 5bf68effb41..15ad13654e3 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -2430,9 +2430,15 @@ div.ecmjqft { white-space: normal; } +div.ui-controlgroup +{ + height: auto; + background-image: none; +} + div.ui-controlgroup-controls div.tabsElem, div.ui-controlgroup-controls div.tabsElem a.tab { - height: 22px; + height: auto; } a.tab span.ui-btn-inner @@ -2443,7 +2449,7 @@ a.tab span.ui-btn-inner div.tabs a.tab#active span.ui-btn-inner, div.tabs a.tab#active span.ui-btn-text, div.tabs a.tab span.ui-btn-inner, div.tabs a.tab span.ui-btn-text { background-image: none; color: #D45416; - height: 22px + height: auto; } .ui-body-c { @@ -2451,6 +2457,12 @@ div.tabs a.tab#active span.ui-btn-inner, div.tabs a.tab#active span.ui-btn-text, text-shadow: none; } +.ui-btn-icon-left .ui-icon { + left: 8px; +} +.ui-btn-icon-right .ui-icon { + right: 8px; +} close(); diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index a1e3e7a44c9..74f5bc86278 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -2257,6 +2257,34 @@ div.ecmjqft { text-shadow: none; } +div.ui-controlgroup +{ + height: auto; + background-image: none; +} + +div.ui-controlgroup-controls div.tabsElem, div.ui-controlgroup-controls div.tabsElem a.tab +{ + height: auto; +} + +a.tab span.ui-btn-inner +{ + border: none; + padding: 0; +} +div.tabs a.tab#active span.ui-btn-inner, div.tabs a.tab#active span.ui-btn-text, div.tabs a.tab span.ui-btn-inner, div.tabs a.tab span.ui-btn-text { + background-image: none; + color: #D45416; + height: auto; +} + +.ui-btn-icon-left .ui-icon { + left: 8px; +} +.ui-btn-icon-right .ui-icon { + right: 8px; +} close(); From d3d2ffe43e38a82000651da02b87d6af396a7cee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Apr 2013 16:16:41 +0200 Subject: [PATCH 063/167] Qual: A better error management for suse rpm package --- build/rpm/README | 1 + htdocs/install/etape1.php | 3 ++- htdocs/langs/en_US/errors.lang | 1 + htdocs/langs/fr_FR/errors.lang | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build/rpm/README b/build/rpm/README index 6f2e6634f4b..cd581a0eef4 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -28,6 +28,7 @@ with format RPM (for Redhat, OpenSuse, Mandriva, ...). # On OpenSuse # yast --install dolibarr-...rpm To install package and dependencies # yast --remove dolibarr To remove package +# Log of Yast available into /var/log/YaST2/y2log # # On Mageia (after su - root) # urpmi dolibarr-...rpm To install package and dependencies diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index 53f1aba9e19..486748f92a7 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -196,7 +196,8 @@ if (! $error) elseif ($db->error && ! (! empty($_POST["db_create_database"]) && $db->connected)) { // Note: you may experience error here with message "No such file or directory" when mysql was installed for the first time but not yet launched. - print '
'.$db->error.'
'; + if ($db->error == "No such file or directory") print '
'.$langs->trans("ErrorToConnectToMysqlCheckInstance").'
'; + else print '
'.$db->error.'
'; if (! $db->connected) print $langs->trans("BecauseConnectionFailedParametersMayBeWrong").'

'; //print ''; print $langs->trans("ErrorGoBackAndCorrectParameters"); diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 3cfee357c81..a9de1c511a8 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -121,6 +121,7 @@ ErrorFailedToAddToMailmanList=Failed to add record %s to Mailman list %s or SPIP ErrorFailedToRemoveToMailmanList=Failed to remove record %s to Mailman list %s or SPIP base ErrorNewValueCantMatchOldValue=New value can't be equal to old one ErrorFailedToValidatePasswordReset=Failed to reinit password. May be the reinit was already done (this link can be used only one time). If not, try to restart the reinit process. +ErrorToConnectToMysqlCheckInstance=Connect to database fails. Check Mysql server is running (in most cases, you can launch it from command line with 'sudo /etc/init.d/mysql start'). # Warnings WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 5081f66d5f7..08c14dc5c35 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -122,6 +122,7 @@ ErrorFailedToAddToMailmanList=Echec de l'ajout de %s à la liste Mailman %s ou b ErrorFailedToRemoveToMailmanList=Echec de la suppression de %s de la liste Mailman %s ou base SPIP ErrorNewValueCantMatchOldValue=La nouvelle valeur ne peut être égale à l'ancienne ErrorFailedToValidatePasswordReset=Echec de la réinitialisation du mot de passe. Il est possible que ce lien ait déjà été utilisé (l'utilisation de ce lien ne fonctionne qu'une fois). Si ce n'est pas le cas, essayer de recommencer le processus de réinit de mot de passe depuis le début. +ErrorToConnectToMysqlCheckInstance=Echec de la connection au serveur de base de donnée. Vérifier que Mysql est bien lancé (dans la plupart des cas, vous pouvez le lancer depuis la ligne de commande par la commande 'sudo /etc/init.d/mysql start'). # Warnings WarningMandatorySetupNotComplete=Les informations de configuration obligatoire doivent être renseignées From 9ce7e44f006bbe5e1c3c119b3f29dd6df66ef42c Mon Sep 17 00:00:00 2001 From: fhenry Date: Wed, 24 Apr 2013 16:47:15 +0200 Subject: [PATCH 064/167] use price method rather than price2num. price are use in all PDF, so it should be the same on ODT --- htdocs/core/class/commondocgenerator.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 0f4264b223f..c56516257f7 100755 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -245,10 +245,10 @@ abstract class CommonDocGenerator $array_key.'_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code)!='PaymentType'.$object->mode_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code):$object->mode_reglement), $array_key.'_payment_term_code'=>$object->cond_reglement_code, $array_key.'_payment_term'=>($outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code)!='PaymentCondition'.$object->cond_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code):$object->cond_reglement), - $array_key.'_total_ht'=>price2num($object->total_ht2,2), - $array_key.'_total_vat'=>price2num($object->total_tva,2), - $array_key.'_total_ttc'=>price2num($object->total_ttc,2), - $array_key.'_total_discount_ht' => price2num($object->getTotalDiscount(),2), + $array_key.'_total_ht'=>price($object->total_ht2), + $array_key.'_total_vat'=>price($object->total_tva), + $array_key.'_total_ttc'=>price($object->total_ttc), + $array_key.'_total_discount_ht' => price($object->getTotalDiscount()), $array_key.'_vatrate'=>vatrate($object->tva), $array_key.'_note_private'=>$object->note, $array_key.'_note'=>$object->note_public, @@ -293,12 +293,12 @@ abstract class CommonDocGenerator 'line_product_label'=>$line->product_label, 'line_desc'=>$line->desc, 'line_vatrate'=>vatrate($line->tva_tx,true,$line->info_bits), - 'line_up'=>price2num($line->subprice, 2), + 'line_up'=>price($line->subprice), 'line_qty'=>$line->qty, 'line_discount_percent'=>($line->remise_percent?$line->remise_percent.'%':''), - 'line_price_ht'=>price2num($line->total_ht,2), - 'line_price_ttc'=>price2num($line->total_ttc,2), - 'line_price_vat'=>price2num($line->total_tva,2), + 'line_price_ht'=>price($line->total_ht), + 'line_price_ttc'=>price($line->total_ttc), + 'line_price_vat'=>price($line->total_tva), 'line_date_start'=>$line->date_start, 'line_date_end'=>$line->date_end ); From 74e7dc319dfd741c1a94663c3bad3d8ebfd69a2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Apr 2013 16:52:17 +0200 Subject: [PATCH 065/167] Fix: package adodb and nusoap not available on opensuse --- build/rpm/README | 6 +++--- build/rpm/install.forced.php.generic | 2 ++ build/rpm/install.forced.php.opensuse | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index cd581a0eef4..ffdb6d24a53 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -26,9 +26,9 @@ with format RPM (for Redhat, OpenSuse, Mandriva, ...). # restorecon -R -v /file Restore values into files (cancel chcon, validate semanage) # # On OpenSuse -# yast --install dolibarr-...rpm To install package and dependencies -# yast --remove dolibarr To remove package -# Log of Yast available into /var/log/YaST2/y2log +# zypper install dolibarr-...rpm To install package and dependencies +# zypper remove dolibarr To remove package +# zypper search xxx To search a package # # On Mageia (after su - root) # urpmi dolibarr-...rpm To install package and dependencies diff --git a/build/rpm/install.forced.php.generic b/build/rpm/install.forced.php.generic index 0d8b1214ad1..718eade3696 100755 --- a/build/rpm/install.forced.php.generic +++ b/build/rpm/install.forced.php.generic @@ -18,4 +18,6 @@ $force_install_dolibarrlogin='admin'; $force_install_nophpinfo='1'; $force_install_lockinstall='444'; +// Value to overwrite path to use shared libraries/fonts instead of embedded one +// We don't force any external lib with generic package ?> \ No newline at end of file diff --git a/build/rpm/install.forced.php.opensuse b/build/rpm/install.forced.php.opensuse index 90c4d6ab182..06a0074b04d 100755 --- a/build/rpm/install.forced.php.opensuse +++ b/build/rpm/install.forced.php.opensuse @@ -19,10 +19,10 @@ $force_install_nophpinfo='1'; $force_install_lockinstall='444'; // Value to overwrite path to use shared libraries/fonts instead of embedded one -$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; +//$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; //$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; //$force_dolibarr_lib_GEOIP_PATH=''; -$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; +//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; //$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; $force_dolibarr_lib_PHPEXCEL_PATH=''; $force_dolibarr_lib_TCPDF_PATH=''; From 436b6259c05e2fd56610365ad1470e712126ad7d Mon Sep 17 00:00:00 2001 From: simnandez Date: Wed, 24 Apr 2013 16:57:46 +0200 Subject: [PATCH 066/167] Fix: finish merge --- htdocs/core/modules/syslog/mod_syslog_file.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php index 4d482f017cf..1df48c997dc 100644 --- a/htdocs/core/modules/syslog/mod_syslog_file.php +++ b/htdocs/core/modules/syslog/mod_syslog_file.php @@ -96,12 +96,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface /** * Return the parsed logfile path * -<<<<<<< OURS * @return string -======= - * @param string $suffixinfilename When output is a file, append this suffix into default log filename. - * @return string ->>>>>>> THEIRS */ private function getFilename() { From e1120dfe08e3df25d3ede6d69e9c9ad140e0fa0f Mon Sep 17 00:00:00 2001 From: jfefe Date: Wed, 24 Apr 2013 17:10:54 +0200 Subject: [PATCH 067/167] Use MAIN_DOC_USE_TIMING on proposals (ODT) --- .../doc/doc_generic_proposal_odt.modules.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index d4e485562a4..cac782b3412 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -275,16 +275,27 @@ class doc_generic_proposal_odt extends ModelePDFPropales { //print "srctemplatepath=".$srctemplatepath; // Src filename $newfile=basename($srctemplatepath); - $newfiletmp=preg_replace('/\.odt/i','',$newfile); + $newfiletmp=preg_replace('/\.od(t|s)/i','',$newfile); $newfiletmp=preg_replace('/template_/i','',$newfiletmp); $newfiletmp=preg_replace('/modele_/i','',$newfiletmp); + $newfiletmp=$objectref.'_'.$newfiletmp; - //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; - $file=$dir.'/'.$newfiletmp.'.odt'; + + // Get extension (ods or odt) + $newfileformat=substr($newfile, strrpos($newfile, '.')+1); + if ( ! empty($conf->global->MAIN_DOC_USE_TIMING)) + { + $filename=$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.'.$newfileformat; + } + else + { + $filename=$newfiletmp.'.'.$newfileformat; + } + $file=$dir.'/'.$filename; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; - //print "conf->societe->dir_temp=".$conf->societe->dir_temp; + //print "conf->propal->dir_temp=".$conf->propal->dir_temp; dol_mkdir($conf->propal->dir_temp); From 9ea1f2c4edb7dd4e6f1d538829ecaa0abe53a7be Mon Sep 17 00:00:00 2001 From: jfefe Date: Wed, 24 Apr 2013 17:13:47 +0200 Subject: [PATCH 068/167] Use MAIN_DOC_USE_TIMING on invoices (odt) --- .../doc/doc_generic_invoice_odt.modules.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 8aa417c83c0..36460b19277 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -336,12 +336,24 @@ class doc_generic_invoice_odt extends ModelePDFFactures { //print "srctemplatepath=".$srctemplatepath; // Src filename $newfile=basename($srctemplatepath); - $newfiletmp=preg_replace('/\.odt/i','',$newfile); + $newfiletmp=preg_replace('/\.od(t|s)/i','',$newfile); $newfiletmp=preg_replace('/template_/i','',$newfiletmp); $newfiletmp=preg_replace('/modele_/i','',$newfiletmp); + $newfiletmp=$objectref.'_'.$newfiletmp; + + // Get extension (ods or odt) + $newfileformat=substr($newfile, strrpos($newfile, '.')+1); + if ( ! empty($conf->global->MAIN_DOC_USE_TIMING)) + { + $filename=$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.'.$newfileformat; + } + else + { + $filename=$newfiletmp.'.'.$newfileformat; + } + $file=$dir.'/'.$filename; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; - $file=$dir.'/'.$newfiletmp.'.odt'; //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; From d9551abb70fcb1cfde64d4b6f86c993d87defd89 Mon Sep 17 00:00:00 2001 From: fhenry Date: Wed, 24 Apr 2013 17:32:08 +0200 Subject: [PATCH 069/167] Fix trad for Extrafield from table --- htdocs/langs/ca_ES/admin.lang | 1 + htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/es_ES/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + 4 files changed, 4 insertions(+) diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 2ef97b1cb26..fc0264e1826 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -354,6 +354,7 @@ ExtrafieldPhone=Telèfon ExtrafieldPrice=Preu ExtrafieldMail=Correu ExtrafieldSelect=Llista de selecció +ExtrafieldSelectList=Llista de selecció de table ExtrafieldSeparator=Separador ExtrafieldCheckBox=Casella de verificació ExtrafieldRadio=Botó de selecció excloent diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 13cd8e505f8..d569e0a261d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -359,6 +359,7 @@ ExtrafieldPhone = Phone ExtrafieldPrice = Price ExtrafieldMail = Email ExtrafieldSelect = Select list +ExtrafieldSelectList = Select from table ExtrafieldSeparator=Separator ExtrafieldCheckBox=Checkbox ExtrafieldRadio=Radio button diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 86b6cba5a97..fe4aeba479c 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -356,6 +356,7 @@ ExtrafieldPhone=Teléfono ExtrafieldPrice=Precio ExtrafieldMail=Correo ExtrafieldSelect=Lista de selección +ExtrafieldSelectList=Llista de selección de table ExtrafieldSeparator=Separador ExtrafieldCheckBox=Casilla de verificación ExtrafieldRadio=Botón de selección excluyente diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 3b1d3c2f7bc..1dbd9f6df48 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -356,6 +356,7 @@ ExtrafieldPhone = Téléphone ExtrafieldPrice = Prix ExtrafieldMail = Email ExtrafieldSelect = Liste de sélection +ExtrafieldSelectList = Liste issue d'une table ExtrafieldSeparator = Séparateur de champ ExtrafieldCheckBox=Case à cocher ExtrafieldRadio=Case d'option From 20b9331b3cc22837272f1d8c2b442d0c343577cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Apr 2013 18:58:01 +0200 Subject: [PATCH 070/167] Fix: W3C --- htdocs/main.inc.php | 2 +- htdocs/theme/cameleo/style.css.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 30677ea5b9c..a756661e603 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1549,7 +1549,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me print ''; // Link to Dolibarr wiki pages diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index 74f5bc86278..e2427115470 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -130,7 +130,6 @@ input.button[type=submit] { /*border: 2px solid #063953;*/ color: #FFF; padding: 0px 10px 0px 10px; - margin: 0px 10px 0px 10px; text-decoration: none; white-space: nowrap; /*display: block; From 7b1616d0c550c8ae0814cbfca13344a0d5f3de87 Mon Sep 17 00:00:00 2001 From: fhenry Date: Wed, 24 Apr 2013 19:14:03 +0200 Subject: [PATCH 071/167] Better management extrafield from list of table --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 7 ++++--- htdocs/core/tpl/admin_extrafields_edit.tpl.php | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 44cc7a78bc0..1ca0b29708c 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -47,8 +47,8 @@ else if (type == 'varchar') { size.val('255').removeAttr('disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); } else if (type == 'boolean') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();} else if (type == 'price') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();} - else if (type == 'select') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();} - else if (type == 'sellist') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();} + else if (type == 'select') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();} + else if (type == 'sellist') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();} else if (type == 'checkbox') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();} else if (type == 'radio') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();} else if (type == 'separate') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); required.val('').attr('disabled','disabled'); default_value.val('').attr('disabled','disabled'); jQuery("#value_choice").hide();} @@ -87,7 +87,8 @@
'.$langs->trans("Delete").'

'.$langs->trans("PhotoFile").'
+ +
-textwithpicto('', $langs->trans("ExtrafieldParamHelp".$type),1,0)?>
textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0)?>textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0)?>
diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index d3b06545fa2..18ea7623d66 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -66,6 +66,8 @@ if((($type == 'select') || ($type == 'checkbox') ||(($type == 'radio'))) && is_a $param_chain .= $key.', '.$value."\n"; } } +}elseif ($type== 'sellist') { + $param_chain = array_keys($param['options'])[0]; } ?> From 3896b99badd91261b2c8fc755f287c7165886808 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Apr 2013 19:14:59 +0200 Subject: [PATCH 072/167] Add UK with GB. --- htdocs/compta/bank/class/account.class.php | 2 +- htdocs/core/class/commonobject.class.php | 1 + htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/societe/class/societe.class.php | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 21a669d618a..78c3c6998fd 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -974,7 +974,7 @@ class Account extends CommonObject $country_code=$this->getCountryCode(); if (in_array($country_code,array('CH','DE','FR','ES','GA','IT'))) return 1; // France, Spain, Gabon - if (in_array($country_code,array('AU','BE','CA','DK','GR','GB','ID','IE','IR','KR','NL','NZ','US'))) return 2; // Australia, Great Britain... + if (in_array($country_code,array('AU','BE','CA','DK','GR','GB','ID','IE','IR','KR','NL','NZ','UK','US'))) return 2; // Australia, Great Britain... return 0; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 73d7e7b0e5d..01165bb466a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2443,6 +2443,7 @@ abstract class CommonObject 'SE', // Sweden 'SK', // Slovakia 'SI', // Slovenia + 'UK', // United Kingdom //'CH', // Switzerland - No. Swizerland in not in EEC ); //print "dd".$this->country_code; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 47af55726f9..3418c6419fd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -699,7 +699,7 @@ function dol_bc($var,$moreclass='') function dol_format_address($object,$withcountry=0,$sep="\n") { $ret=''; - $countriesusingstate=array('AU','US','IN','GB','ES'); + $countriesusingstate=array('AU','US','IN','GB','ES','UK'); // Address $ret .= $object->address; @@ -713,7 +713,7 @@ function dol_format_address($object,$withcountry=0,$sep="\n") } if ($object->zip) $ret .= ', '.$object->zip; } - else if (in_array($object->country_code,array('GB'))) // UK: title firstname name \n address lines \n town state \n zip \n country + else if (in_array($object->country_code,array('GB','UK'))) // UK: title firstname name \n address lines \n town state \n zip \n country { $ret .= ($ret ? $sep : '' ).$object->town; if ($object->state && in_array($object->country_code,$countriesusingstate)) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 0c1b8016938..e630dbf899d 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1463,7 +1463,7 @@ class Societe extends CommonObject { $lien = ''; - - $InfoFieldList = explode(":", $param); - + + $InfoFieldList = explode(":", array_keys($param['options'])[0]); + + var_export($param['options']); // 0 1 : tableName // 1 2 : label field name Nom du champ contenant le libelle // 2 3 : key fields name (if differ of rowid) @@ -703,6 +704,7 @@ class ExtraFields $sql = 'SELECT '.$keyList.', '.$InfoFieldList[1]; $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0]; + dol_syslog(get_class($this).':showInputField:$type=sellist sql='.$sql); $resql = $this->db->query($sql); if ($resql) @@ -828,15 +830,16 @@ class ExtraFields } elseif ($type == 'sellist') { - $InfoFieldList = explode(":", $params); + $InfoFieldList = explode(":", array_keys($params['options'])[0]); $keyList='rowid'; if (count($InfoFieldList)==3) $keyList=$InfoFieldList[2]; + $sql = 'SELECT '.$InfoFieldList[1]; $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0]; - $sql.= ' where '.$keyList.'="'.$value.'"'; - + $sql.= ' where '.$keyList.'="'.$this->db->escape($value).'"'; + dol_syslog(get_class($this).':showOutputField:$type=sellist sql='.$sql); $resql = $this->db->query($sql); if ($resql) { From cd7f94d515ffa724cc6acb1bbab3360e6320a6f0 Mon Sep 17 00:00:00 2001 From: fhenry Date: Wed, 24 Apr 2013 23:19:01 +0200 Subject: [PATCH 074/167] [ bug #849 ] BUG PGSQL --- htdocs/compta/facture/impayees.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 5737c9bb99a..1a8ddd3b6a6 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -227,7 +227,7 @@ if ($search_societe) $sql .= " AND s.nom LIKE '%".$search_societe."%'"; if ($search_montant_ht) $sql .= " AND f.total = '".$search_montant_ht."'"; if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$search_montant_ttc."'"; if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".GETPOST('sf_ref') . "%'"; -$sql.= " GROUP BY f.facnumber,f.increment,f.total,f.total_ttc,f.datef, f.date_lim_reglement,f.paye, f.rowid, f.fk_statut, f.type,s.nom, s.rowid"; +$sql.= " GROUP BY s.nom,s.rowid,f.facnumber, f.increment, f.total, f.tva, f.total_ttc,f.datef, f.date_lim_reglement, f.rowid,f.fk_statut,f.type "; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; $sql.= " ORDER BY "; $listfield=explode(',',$sortfield); From 7fdf2f34821e0aa8153470b01675abea59eed0a9 Mon Sep 17 00:00:00 2001 From: fhenry Date: Wed, 24 Apr 2013 23:54:02 +0200 Subject: [PATCH 075/167] Fix for php 5 --- htdocs/core/class/extrafields.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index f9629f9bdf2..d261af08416 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -688,8 +688,8 @@ class ExtraFields elseif ($type == 'sellist') { $out=' -     - +     + diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 76b2b2d23f5..0453633afc4 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -1403,7 +1403,7 @@ else print ''; // Zip / Town - print ''.$langs->trans("Zip").' / '.$langs->trans("Town").''.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town.''; + print ''.$langs->trans("Zip").' / '.$langs->trans("Town").''.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town.''; // Country print ''.$langs->trans("Country").''; diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index 27ddd052225..d4beb3ecdd9 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -304,7 +304,7 @@ if ($resql) // Type $membertypestatic->id=$objp->type_id; $membertypestatic->libelle=$objp->type; - print ''; + print ''; print $membertypestatic->getNomUrl(1,32); print ''; @@ -315,21 +315,21 @@ if ($resql) print "".dol_print_email($objp->email,0,0,1)."\n"; // Statut - print ''; + print ''; print $memberstatic->LibStatut($objp->statut,$objp->cotisation,$datefin,2); print ""; // End of subscription date if ($datefin) { - print ''; + print ''; print dol_print_date($datefin,'day'); if ($datefin < ($now - $conf->adherent->cotisation->warning_delay) && $objp->statut > 0) print " ".img_warning($langs->trans("SubscriptionLate")); print ''; } else { - print ''; + print ''; if ($objp->cotisation == 'yes') { print $langs->trans("SubscriptionNotReceived"); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 2120d2d2a83..d221619acf4 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -540,7 +540,7 @@ if ($rowid > 0) print "".$objp->login."\n"; // Type - /*print ''; + /*print ''; $membertypestatic->id=$objp->type_id; $membertypestatic->libelle=$objp->type; print $membertypestatic->getNomUrl(1,12); @@ -554,14 +554,14 @@ if ($rowid > 0) print "".dol_print_email($objp->email,0,0,1)."\n"; // Statut - print ''; + print ''; print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2); print ""; // Date fin cotisation if ($datefin) { - print ''; + print ''; if ($datefin < time() && $objp->statut > 0) { print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate")); @@ -574,7 +574,7 @@ if ($rowid > 0) } else { - print ''; + print ''; if ($objp->cotisation == 'yes') { print $langs->trans("SubscriptionNotReceived"); diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index d23d7c510ea..3e917ce03fc 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -199,13 +199,13 @@ while ($i <= $MAXAGENDA) $var=!$var; print ""; // Nb - print ''.$langs->trans("AgendaExtNb",$key).""; + print ''.$langs->trans("AgendaExtNb",$key).""; // Name print ''; // URL print ''; // Color (Possible colors are limited by Google) - print ''; + print ''; //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); print $formother->selectColor((GETPOST("agenda_ext_color".$key)?GETPOST("agenda_ext_color".$key):$conf->global->$color), "agenda_ext_color".$key, 'extsitesconfig', 1, '', 'hideifnotset'); print ''; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 6ba81a5cbee..9fc80d8b3f7 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -165,7 +165,7 @@ while ($i < $nbofbank) print ''.$bankorder[$i][0]."\n"; print $bankorder[$i][1]; print ''; - print ''; + print ''; $tmparray=explode(' ',$bankorder[$i][2]); foreach($tmparray as $key => $val) { diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 861a15bfebc..898d20648ec 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -234,7 +234,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''."\n"; @@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir) print ''; // Show example of numbering model - print ''; // Show example of numbering model - print ''; // Show example of numbering module - print ''; print ''; print ''; print ''; -print ''; +print ''; print "\n"; clearstatcache(); diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 35768104e39..ac2d89c1169 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -319,7 +319,7 @@ print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("Infos").'
'; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 5e32dd097d0..24a4ba180c2 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -146,7 +146,7 @@ if (is_resource($handle)) print '
'; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index ef64ad34527..d82169b7be3 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1111,7 +1111,7 @@ if ($id) $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?$obj->code:'').'&id='.$id.'&'; // Active - print '
'; + print ''; if ($iserasable) print ''.$actl[$obj->active].''; else { diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 28e5b912de2..1ac15bed9ed 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -266,7 +266,7 @@ foreach ($dirmodels as $reldir) print ''; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; @@ -361,7 +361,7 @@ print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status").''.$langs->trans("Default").''.$langs->trans("Infos").''.$langs->trans("Infos").'
'; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''."\n"; @@ -371,7 +371,7 @@ foreach ($dirmodels as $reldir) print ''; // Show example of numbering module - print ''; // Show example of numbering model - print ''; // Show example of numbering module - print ''; //User - print ''; + print ''; print ''; // User - print ''; // Show example of numbering module - print ''; print ''; -print ''; @@ -142,7 +142,7 @@ $var=!$var; print ''; print ''; -print ''; @@ -152,7 +152,7 @@ $var=!$var; print ''; print ''; -print ''; print ''; @@ -161,7 +161,7 @@ $var=!$var; print ''; print ''; -print ''; print ''; @@ -170,7 +170,7 @@ $var=!$var; print ''; print ''; -print ''; print ''; @@ -179,7 +179,7 @@ $var=!$var; print ''; print ''; -print ''; print ''; @@ -188,7 +188,7 @@ $var=!$var; print ''; print ''; -print ''; print ''; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 9c4bfc67af4..83d2d5f8947 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -247,7 +247,7 @@ foreach ($arrayhandler as $key => $module) print ''; // Show example of numbering module - print ''; print ''; -print ''; print ''; -print ''; print ''; print ''; -print ''; print ''; // Show example of numbering model - print ''; // Show example of numbering module - print ''; - print '> - - + - - + +
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("Infos").'
'; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 023593ea2a7..95b2bffffb5 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -263,7 +263,7 @@ foreach ($dirmodels as $reldir) print '
'; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 677e2b3773b..9bee4befa03 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -253,7 +253,7 @@ foreach ($dirmodels as $reldir) print '
'; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index f7bd7ad95d7..67388dbb330 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -305,7 +305,7 @@ if ($action == 'create') print '
'.$langs->trans('DetailMenuHandler').'
'.$langs->trans('MenuForUsers').'
'.$langs->trans('MenuForUsers').'
'.$langs->trans('MenuHandler').''.$handler.''.$langs->trans('DetailMenuHandler').'
'.$langs->trans('MenuForUsers').'
'.$langs->trans('MenuForUsers').''; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index ac3c911577b..5fe56bafaea 100755 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -132,7 +132,7 @@ $var=!$var; print '
'.$langs->trans("ConnectionTimeout").''; print ''; +print ''; print 'global->MAIN_USE_CONNECT_TIMEOUT).'">'; print ' '.strtolower($langs->trans("Seconds")); print '
'.$langs->trans("ResponseTimeout").''; print ''; +print ''; print ''; print ' '.strtolower($langs->trans("Seconds")); print '
'.$langs->trans("MAIN_PROXY_USE").''; print ''; +print ''; print $form->selectyesno('MAIN_PROXY_USE',$conf->global->MAIN_PROXY_USE,1); print '
'.$langs->trans("MAIN_PROXY_HOST").''; print ''; +print ''; print ''; print '
'.$langs->trans("MAIN_PROXY_PORT").''; print ''; +print ''; print ''; print '
'.$langs->trans("MAIN_PROXY_USER").''; print ''; +print ''; print ''; print '
'.$langs->trans("MAIN_PROXY_PASS").''; print ''; +print ''; print ''; print '
'; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index f24a63ba76e..b78a201b9d1 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -154,7 +154,7 @@ print '
'.$langs->trans("SessionTimeOut").''; print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor"))); print ''; +print ''; print ' '.strtolower($langs->trans("Seconds")); print ''; @@ -250,7 +250,7 @@ $max=@ini_get('upload_max_filesize'); if ($max) print ' '.$langs->trans("MustBeLowerThanPHPLimit",$max*1024,$langs->trans("Kb")).'.'; else print ' '.$langs->trans("NoMaxSizeByPHPLimit").'.'; print ''; +print ''; print ' '.$langs->trans("Kb"); print ''; @@ -265,7 +265,7 @@ print '
'.$langs->trans("UMask").''; print $form->textwithpicto('',$langs->trans("UMaskExplanation")); print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index d99698473a4..b724774237c 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -251,7 +251,7 @@ foreach ($dirmodels as $reldir) print ''; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index f80e6c3b28b..2b4feda1b8d 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -251,7 +251,7 @@ foreach ($dirmodels as $reldir) print '
'; + print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 075f975adb2..f42f846e9d6 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -192,7 +192,7 @@ foreach ($syslogModules as $moduleName) print $module->getName(); print '
'; + print ''; $setuparray=$module->configure(); if ($setuparray) { diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php index fec29ea5fd0..a3f046f4510 100644 --- a/htdocs/admin/tools/eaccelerator.php +++ b/htdocs/admin/tools/eaccelerator.php @@ -165,11 +165,11 @@ function create_script_table($list) foreach($list as $script) { ?>
+ KB () ()
@@ -199,10 +199,10 @@ function create_key_table($list) ?> > - - + + KB - '; // Date - print ''.dol_print_date($db->jdate($obj->dateevent),'%Y-%m-%d %H:%M:%S').''; + print ''.dol_print_date($db->jdate($obj->dateevent),'%Y-%m-%d %H:%M:%S').''; // Code print ''.$obj->type.''; // IP - print ''; + print ''; print dol_print_ip($obj->ip); print ''; // Login - print ''; + print ''; if ($obj->fk_user) { $userstatic->id=$obj->fk_user; diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 0193ed9d833..780e4427078 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -151,16 +151,16 @@ if ($savehandler == 'files') print ''.$sessionentry['login'].''; // ID - print ''; + print ''; if ("$key" == session_id()) print $form->textwithpicto($key,$langs->trans("YourSession")); else print $key; print ''; // Date creation - print ''.dol_print_date($sessionentry['creation'],'%Y-%m-%d %H:%M:%S').''; + print ''.dol_print_date($sessionentry['creation'],'%Y-%m-%d %H:%M:%S').''; // Date modification - print ''.dol_print_date($sessionentry['modification'],'%Y-%m-%d %H:%M:%S').''; + print ''.dol_print_date($sessionentry['modification'],'%Y-%m-%d %H:%M:%S').''; // Age print ''.$sessionentry['age'].''; diff --git a/htdocs/bookmarks/liste.php b/htdocs/bookmarks/liste.php index 371870047d9..c3634b6c726 100644 --- a/htdocs/bookmarks/liste.php +++ b/htdocs/bookmarks/liste.php @@ -170,7 +170,7 @@ if ($resql) print ''.$obj->position.""; // Actions - print ''; + print ''; if ($user->rights->bookmark->creer) { print "
bid."&backtopage=".urlencode($_SERVER["PHP_SELF"])."\">".img_edit()." "; diff --git a/htdocs/cashdesk/tpl/ticket.tpl.php b/htdocs/cashdesk/tpl/ticket.tpl.php index ddce4bf1e83..cae461fe7fc 100644 --- a/htdocs/cashdesk/tpl/ticket.tpl.php +++ b/htdocs/cashdesk/tpl/ticket.tpl.php @@ -140,9 +140,9 @@ print $object->ref; \n"; -echo '\n"; -echo '\n"; +echo '\n"; +echo '\n"; +echo '\n"; ?>
'.$langs->trans("TotalHT").''.price2num($obj_facturation->prixTotalHt(),'MT')." ".$conf->currency."
'.$langs->trans("TotalVAT").''.price2num($obj_facturation->montantTva(),'MT')." ".$conf->currency."
'.$langs->trans("TotalTTC").''.price2num($obj_facturation->prixTotalTtc(),'MT')." ".$conf->currency."
'.$langs->trans("TotalHT").''.price2num($obj_facturation->prixTotalHt(),'MT')." ".$conf->currency."
'.$langs->trans("TotalVAT").''.price2num($obj_facturation->montantTva(),'MT')." ".$conf->currency."
'.$langs->trans("TotalTTC").''.price2num($obj_facturation->prixTotalTtc(),'MT')." ".$conf->currency."
diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index ec2a2b49d63..a930637f627 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -277,7 +277,7 @@ if ($socid) // Assujeti a TVA ou pas print ''; - print ''.$langs->trans('VATIsUsed').''; + print ''.$langs->trans('VATIsUsed').''; print yn($soc->tva_assuj); print ''; print ''; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 57cffd387de..36ed1bd4ded 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -258,7 +258,7 @@ if ($object->type == 0) { $var=!$var; print "\t\n"; - print ''; + print ''; print $prod->getNomUrl(1,'category'); print "\n"; print ''.$prod->libelle."\n"; @@ -309,7 +309,7 @@ if ($object->type == 1) $var=!$var; print "\t\n"; - print ''; + print ''; print $soc->getNomUrl(1,'category_supplier'); print "\n"; // Link to delete from category @@ -361,7 +361,7 @@ if($object->type == 2) $i++; $var=!$var; print "\t\n"; - print ''; + print ''; print $soc->getNomUrl(1,'category'); print "\n"; // Link to delete from category @@ -413,7 +413,7 @@ if ($object->type == 3) { $var=!$var; print "\t\n"; - print ''; + print ''; $member->ref=$member->login; print $member->getNomUrl(1,0,'category'); print "\n"; diff --git a/htdocs/comm/action/contact.php b/htdocs/comm/action/contact.php index b3819ce3a04..87a13f28c55 100644 --- a/htdocs/comm/action/contact.php +++ b/htdocs/comm/action/contact.php @@ -266,7 +266,7 @@ if ($id > 0 || ! empty($ref)) // Ligne ajout pour contact interne print ""; - print ''; + print ''; print img_object('','user').' '.$langs->trans("Users"); print ''; @@ -298,7 +298,7 @@ if ($id > 0 || ! empty($ref)) $var=!$var; print ""; - print ''; + print ''; print img_object('','contact').' '.$langs->trans("ThirdPartyContacts"); print ''; diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 4b4917715b5..618a6e4fa3e 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -473,7 +473,7 @@ if ($action == 'create') // Date start $datep=$actioncomm->datep; if (GETPOST('datep','int',1)) $datep=dol_stringtotime(GETPOST('datep','int',1),0); - print ''.$langs->trans("DateActionStart").''; + print ''.$langs->trans("DateActionStart").''; if (GETPOST("afaire") == 1) $form->select_date($datep,'ap',1,1,0,"action",1,1,0,0,'fulldayend'); else if (GETPOST("afaire") == 2) $form->select_date($datep,'ap',1,1,1,"action",1,1,0,0,'fulldayend'); else $form->select_date($datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart'); @@ -514,12 +514,12 @@ if ($action == 'create') // Assigned to $var=false; - print ''.$langs->trans("ActionAffectedTo").''; + print ''.$langs->trans("ActionAffectedTo").''; $form->select_users(GETPOST("affectedto")?GETPOST("affectedto"):(! empty($actioncomm->usertodo->id) && $actioncomm->usertodo->id > 0 ? $actioncomm->usertodo->id : $user->id),'affectedto',1); print ''; // Busy - print ''.$langs->trans("Busy").''; + print ''.$langs->trans("Busy").''; print ''; print ''; @@ -536,7 +536,7 @@ if ($action == 'create') print ''; // Societe, contact - print '
'.$langs->trans("ActionOnCompany").''; + print '
'.$langs->trans("ActionOnCompany").''; if (GETPOST('socid','int') > 0) { $societe = new Societe($db); @@ -711,7 +711,7 @@ if ($id > 0) if ($backtopage) print ''; dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action'); - + print ''; // Ref @@ -732,7 +732,7 @@ if ($id > 0) print ''; // Date start - print ''; // Status - print ''; @@ -756,19 +756,19 @@ if ($id > 0) print '
'.$langs->trans("EventOnFullDay").'fulldayevent?' checked="checked"':'').'>
'.$langs->trans("DateActionStart").''; + print '
'.$langs->trans("DateActionStart").''; if (GETPOST("afaire") == 1) $form->select_date($act->datep,'ap',1,1,0,"action",1,1,0,0,'fulldaystart'); else if (GETPOST("afaire") == 2) $form->select_date($act->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart'); else $form->select_date($act->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart'); @@ -745,7 +745,7 @@ if ($id > 0) print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; $percent=GETPOST("percentage")?GETPOST("percentage"):$act->percentage; print $htmlactions->form_select_status_action('formaction',$percent,1); print '


'; // Assigned to - print ''; // Busy - print ''; // Realised by if ($conf->global->AGENDA_ENABLE_DONEBY) { - print ''; } @@ -838,7 +838,7 @@ if ($id > 0) print '
'.$langs->trans("ActionAffectedTo").''; + print '
'.$langs->trans("ActionAffectedTo").''; print $form->select_dolusers($act->usertodo->id>0?$act->usertodo->id:-1,'affectedto',1); print '
'.$langs->trans("Busy").''; + print '
'.$langs->trans("Busy").''; print 'transparency?' checked="checked"':'').'">'; print '
'.$langs->trans("ActionDoneBy").''; + print '
'.$langs->trans("ActionDoneBy").''; print $form->select_dolusers($act->userdone->id> 0?$act->userdone->id:-1,'doneby',1); print '
'; dol_fiche_end(); - + print '
'; print '     '; print '
'; @@ -848,7 +848,7 @@ if ($id > 0) else { dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action'); - + // Affichage fiche action en mode visu print ''; @@ -916,7 +916,7 @@ if ($id > 0) print ''; // Status - print ''; @@ -926,19 +926,19 @@ if ($id > 0) print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; print $act->getLibStatut(4); print '


'; // Assigned to - print ''; // Busy - print ''; // Done by if ($conf->global->AGENDA_ENABLE_DONEBY) { - print ''; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 813c2578374..fd9df1ea848 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -780,7 +780,7 @@ if (empty($action) || $action == 'show_month') // View by month { $style='cal_other_month cal_past'; if ($iter_day == 6) $style.=' cal_other_month_right'; - echo ' \n"; } @@ -796,7 +796,7 @@ if (empty($action) || $action == 'show_month') // View by month if ($today) $style='cal_today'; if ($curtime < $todaytms) $style.=' cal_past'; - echo ' \n"; } @@ -805,7 +805,7 @@ if (empty($action) || $action == 'show_month') // View by month { $style='cal_other_month'; if ($iter_day == 6) $style.=' cal_other_month_right'; - echo ' \n"; } @@ -855,7 +855,7 @@ elseif ($action == 'show_week') // View by week if ($todayarray['mday']==$tmpday && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1; if ($today) $style='cal_today'; - echo ' \n"; } @@ -863,7 +863,7 @@ elseif ($action == 'show_week') // View by week { $style='cal_current_month'; if ($iter_day == 6) $style.=' cal_other_month_right'; - echo ' \n"; } @@ -892,7 +892,7 @@ else // View by day echo ' \n"; echo " \n"; echo " \n"; - echo ' \n"; @@ -947,7 +947,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print '
'."\n"; $curtime = dol_mktime(0, 0, 0, $month, $day, $year); print '
'.$langs->trans("ActionAffectedTo").''; + print '
'.$langs->trans("ActionAffectedTo").''; if ($act->usertodo->id > 0) print $act->usertodo->getNomUrl(1); print '
'.$langs->trans("Busy").''; + print '
'.$langs->trans("Busy").''; print yn(($act->transparency > 0)?1:0); print '
'.$langs->trans("ActionDoneBy").''; + print '
'.$langs->trans("ActionDoneBy").''; if ($act->userdone->id > 0) print $act->userdone->getNomUrl(1); print '
'; + echo ' '; show_day_events($db, $max_day_in_prev_month + $tmpday, $prev_month, $prev_year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam); echo " '; + echo ' '; show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam); echo " '; + echo ' '; show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam); echo "'; + echo ' '; show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300); echo " '; + echo ' '; show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300); echo "'.$langs->trans("Day".$arraytimestamp['wday'])."
'; + echo ' '; $maxnbofchar=80; show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300); echo "
'; - print ''; - print ''; - print ''; - print ''; @@ -354,7 +354,7 @@ if ($resql) print ''; // Status/Percent - print ''; + print ''; print "\n"; $i++; diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index ae8026d2b68..88b136b8167 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -236,7 +236,7 @@ if ($id > 0) print ""; // Zip / Town - print ''; + print ''; print '"; print ''; @@ -261,7 +261,7 @@ if ($id > 0) // Assujeti a TVA ou pas print ''; - print ''; print ''; @@ -271,10 +271,10 @@ if ($id > 0) { if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") { - print ''; - print ''; } @@ -503,14 +503,14 @@ if ($id > 0) { $objp = $db->fetch_object($resql); print ""; - print '\n"; print ''; - print ''; + print ''; $var=!$var; $i++; } @@ -579,10 +579,10 @@ if ($id > 0) $objp = $db->fetch_object($resql); $var=!$var; print ""; - print '\n"; print ''; - print ''; + print ''; $i++; } $db->free($resql); @@ -631,14 +631,14 @@ if ($id > 0) $objp = $db->fetch_object($resql); $var=!$var; print ""; - print '\n"; print '\n"; print ''; - print '\n"; @@ -692,7 +692,7 @@ if ($id > 0) $fichinter_static->statut=$objp->fk_statut; print ""; - print ''."\n"; + print ''."\n"; //print ''."\n"; print ''."\n"; print ''."\n"; @@ -753,7 +753,7 @@ if ($id > 0) $objp = $db->fetch_object($resql); $var=!$var; print ""; - print ''; - print ''; + print ''; print "\n"; $i++; } diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index de442152c14..367ab558194 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -157,19 +157,19 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $obj = $db->fetch_object($resql); $var=!$var; - print ''; - print ''; - print ''; + print ''; $i++; $total += $obj->total_ht; } @@ -224,15 +224,15 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { $var=!$var; $obj = $db->fetch_object($resql); - print ''; - print ''; + print ''; - print ''; + print ''; $i++; $total += $obj->total_ttc; } @@ -295,7 +295,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire) $companystatic->client=$objp->client; $companystatic->canvas=$objp->canvas; print ''; - print ''; + print ''; print '"; @@ -351,7 +351,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire) $companystatic->name=$objp->name; $companystatic->canvas=$objp->canvas; print ''; - print ''; + print ''; print ''; print ''; $var=!$var; @@ -481,16 +481,16 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) print ''; // Ref - print '
'; + print '
'; print ''; - print ''; + print ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { //$param='month='.$monthshown.'&year='.$year; @@ -966,7 +966,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print ''; } print '
'; + print '
'; //$curtime = dol_mktime (0, 0, 0, $month, $day, $year); $i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array(); @@ -1034,7 +1034,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print '
'; print '
  • '; print ''; - print ''; // Status - Percent - print '
    '; + print ''; if ($event->type_code == 'BIRTHDAY') // It's a birthday { print $event->getNomUrl(1,$maxnbofchar,'cal_event','birthday','contact'); @@ -1155,7 +1155,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print ''; + print ''; if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT') print $event->getLibStatut(3,1); else print ' '; print '
    '; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 9e7a7a959bb..c0b8430b75e 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -276,7 +276,7 @@ if ($resql) //print dol_trunc($obj->label,12); //print '
'; + print ''; print dol_print_date($db->jdate($obj->dp),"day"); $late=0; if ($obj->percent == 0 && $obj->dp && $db->jdate($obj->dp) < ($now - $delay_warning)) $late=1; @@ -286,7 +286,7 @@ if ($resql) if ($late) print img_warning($langs->trans("Late")).' '; print ''; + print ''; print dol_print_date($db->jdate($obj->dp2),"day"); print ''.$actionstatic->LibStatut($obj->percent,6).''.$actionstatic->LibStatut($obj->percent,6).'
'.$langs->trans('Zip').' / '.$langs->trans('Town').'
'.$langs->trans('Zip').' / '.$langs->trans('Town').''.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town."
'.$langs->trans('VATIsUsed').''; + print ''.$langs->trans('VATIsUsed').''; print yn($object->tva_assuj); print '
'.$langs->trans('LocalTax1IsUsedES').''; + print '
'.$langs->trans('LocalTax1IsUsedES').''; print yn($object->localtax1_assuj); print '
'.$langs->trans('LocalTax2IsUsedES').''; + print '
'.$langs->trans('LocalTax2IsUsedES').''; print yn($object->localtax2_assuj); print '
'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.''."\n"; + print ''.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.''."\n"; if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) { print " ".img_warning(); } print ''.dol_print_date($db->jdate($objp->dp),'day')."'.price($objp->total_ht).''.$propal_static->LibStatut($objp->fk_statut,5).'
'.$propal_static->LibStatut($objp->fk_statut,5).'
'.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."\n"; + print ''.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."\n"; print ''.dol_print_date($db->jdate($objp->dc),'day')."'.price($objp->total_ht).''.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'
'.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'
'; + print ''; $contrat->id=$objp->id; $contrat->ref=$objp->ref?$objp->ref:$objp->id; print $contrat->getNomUrl(1,12); print "'.dol_print_date($db->jdate($objp->dc),'day')." '; + print ''; $contrat->fetch_lines(); print $contrat->getLibStatut(4); print "
'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.''.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.''.dol_print_date($db->jdate($objp->startdate)).''.convertSecondToTime($objp->duration).''.$fichinter_static->getLibStatut(5).'
'; + print ''; $facturestatic->id=$objp->facid; $facturestatic->ref=$objp->facnumber; $facturestatic->type=$objp->type; @@ -769,7 +769,7 @@ if ($id > 0) } print ''.price($objp->total_ttc).''.($facturestatic->LibStatut($objp->paye,$objp->statut,5,$objp->am)).''.($facturestatic->LibStatut($objp->paye,$objp->statut,5,$objp->am)).'
'; + print '
'; $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; print $propalstatic->getNomUrl(1); print ''; + print ''; $companystatic->id=$obj->socid; $companystatic->name=$obj->name; $companystatic->client=$obj->client; $companystatic->canvas=$obj->canvas; print $companystatic->getNomUrl(1,'customer',16); print ''.price($obj->total_ht).'
'.price($obj->total_ht).'
'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.''; + print '
'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.''; $companystatic->id=$obj->socid; $companystatic->name=$obj->name; $companystatic->client=$obj->client; $companystatic->canvas=$obj->canvas; print $companystatic->getNomUrl(1,'customer',16); print ''.price($obj->total_ttc).'
'.price($obj->total_ttc).'
'.$companystatic->getNomUrl(1,'customer',48).''.$companystatic->getNomUrl(1,'customer',48).''; print $companystatic->getLibCustProspStatut(); print "
'.$companystatic->getNomUrl(1,'supplier',44).''.$companystatic->getNomUrl(1,'supplier',44).''.dol_print_date($db->jdate($objp->dm),'day').'
'; + print ''; $propalstatic->id=$obj->propalid; $propalstatic->ref=$obj->ref; print ''; - print ''; - print ''; print ''; - print ''; - print '"; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/comm/mailing/liste.php b/htdocs/comm/mailing/liste.php index 1a09441b499..b05f859f54e 100644 --- a/htdocs/comm/mailing/liste.php +++ b/htdocs/comm/mailing/liste.php @@ -161,10 +161,10 @@ if ($result) print ''; } // Last send - print ''; + print ''; print ''; // Status - print ''; // Terms of payment - print ''; @@ -1561,7 +1561,7 @@ else // Ref client print '
'; + print ''; print $propalstatic->getNomUrl(1); print ''; + print ''; if ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); print ''; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 22c7de7c5f2..c533a01c5c5 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -483,7 +483,7 @@ if ($object->fetch($id) >= 0) if ($obj->statut == 0) { print ' '.$langs->trans("MailingStatusNotSent"); + print ''.$langs->trans("MailingStatusNotSent"); if ($user->rights->mailing->creer) { print ''.img_delete($langs->trans("RemoveRecipient")); } @@ -492,7 +492,7 @@ if ($object->fetch($id) >= 0) else { print ''.$obj->date_envoi.''; + print ''; if ($obj->statut==-1) print $langs->trans("MailingStatusError").' '.img_error(); if ($obj->statut==1) print $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($obj->statut==2) print $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 8c1be3b3926..088ee43a02a 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -176,7 +176,7 @@ if ($result) $var=!$var; print "
'.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.''.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.''.dol_trunc($obj->titre,38).''.dol_print_date($db->jdate($obj->date_creat),'day').''.($obj->nbemail?$obj->nbemail:"0").''.dol_print_date($db->jdate($obj->date_envoi),'day').''.dol_print_date($db->jdate($obj->date_envoi),'day').''; + print ''; if ($filteremail) { if ($obj->sendstatut==-1) print $langs->trans("MailingStatusError").' '.img_error(); diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 2a7c92dce56..ab536ddee63 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1290,7 +1290,7 @@ if ($action == 'create') print '
'.$langs->trans("ValidityDuration").' '.$langs->trans("days").'
'.$langs->trans('PaymentConditionsShort').''; + print '
'.$langs->trans('PaymentConditionsShort').''; $form->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id'); print '
'; - print '
'; + print ''; if ($action != 'refclient' && ! empty($object->brouillon)) print ''; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 971f6d10a86..2a31d4a48b7 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -184,7 +184,7 @@ if (! empty($conf->propal->enabled)) $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; - print ''; + print ''; $companystatic->id=$obj->socid; $companystatic->name=$obj->socname; @@ -242,17 +242,17 @@ if ($resql) $obj = $db->fetch_object($resql); print ""; - print '
'; print $langs->trans('RefCustomer').''; print ''.img_edit($langs->trans('Modify')).''.$propalstatic->getNomUrl(1).''.$propalstatic->getNomUrl(1).'
'; + print ''; $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; print ''; - print ''; - print ''; @@ -321,16 +321,16 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) print ''; // Ref - print '
'; + print ''; print $propalstatic->getNomUrl(1); print ''; + print ''; print ' '; print '
'; + print ''; $propalstatic->id=$obj->propalid; $propalstatic->ref=$obj->ref; print ''; - print ''; - print ''; print '"; - print '
'; + print ''; print $propalstatic->getNomUrl(1); print ''; + print ''; if ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); print ''; @@ -403,17 +403,17 @@ if (! empty($conf->propal->enabled)) $var=!$var; $obj = $db->fetch_object($resql); print "
'; + print ''; $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; print ''; - print ''; - print ''; @@ -475,17 +475,17 @@ if (! empty($conf->propal->enabled)) $var=!$var; $obj = $db->fetch_object($resql); print ""; - print '
'; + print ''; print $propalstatic->getNomUrl(1); print ''; + print ''; print ' '; print '
'; + print ''; $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; print ''; - print ''; - print ''; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 1d4d5b82c24..4787cb3ae3e 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -301,17 +301,17 @@ if ($result) $now = dol_now(); $var=!$var; print ''; - print '
'; + print ''; print $propalstatic->getNomUrl(1); print ''; + print ''; print ' '; print '
'; + print ''; $objectstatic->id=$objp->propalid; $objectstatic->ref=$objp->ref; print ''; - print ''; - print ''; @@ -333,7 +333,7 @@ if ($result) print ''; // Customer ref - print ''; diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index bd0f6376f1f..873ef051612 100755 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -402,12 +402,12 @@ if ($resql) print $prospectstatic->getLibProspLevel(); print ""; // Statut - print '"; //$sts = array(-1,0,1,2,3); - print ''; print ''; // Need 120+ for format with AM/PM print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -342,7 +342,7 @@ if ($socid > 0) print ''; if ($obj->description == '(CREDIT_NOTE)') { - print ''; } - print ''; + print ''; print ''; print ''; print ''; @@ -373,7 +373,7 @@ if ($socid > 0) print ''; if ($user->rights->societe->creer || $user->rights->facture->creer) { - print ''; print ''; // Need 120+ for format with AM/PM print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -499,7 +499,7 @@ if ($socid > 0) print ''; if ($obj->description == '(CREDIT_NOTE)') { - print ''; } - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 4801305a091..1166dcbd8e1 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1565,7 +1565,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ""; // Conditions de reglement - print ''; @@ -1907,7 +1907,7 @@ else // Ref commande client print '
'; + print ''; print $objectstatic->getNomUrl(1); print ''; + print ''; if ($objp->fk_statut == 1 && $db->jdate($objp->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); print ''; + print ''; print $objp->ref_client; print ''; + print ''; print $prospectstatic->LibProspStatut($obj->fk_stcomm,2); print "'; + print ''; foreach ($sts as $key => $value) { if ($value <> $obj->fk_stcomm) diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 7f92b7e65c0..56dec89394d 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -323,7 +323,7 @@ if ($socid > 0) print '
'.$langs->trans("Date").''.$langs->trans("ReasonDiscount").''.$langs->trans("ConsumedBy").''.$langs->trans("ConsumedBy").''.$langs->trans("AmountHT").''.$langs->trans("VATRate").''.$langs->trans("AmountTTC").''.dol_print_date($db->jdate($obj->dc),'dayhour').''; + print ''; $facturestatic->id=$obj->fk_facture_source; $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; @@ -351,7 +351,7 @@ if ($socid > 0) } elseif ($obj->description == '(DEPOSIT)') { - print ''; + print ''; $facturestatic->id=$obj->fk_facture_source; $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; @@ -364,7 +364,7 @@ if ($socid > 0) print $obj->description; print ''.$langs->trans("NotConsumed").''.$langs->trans("NotConsumed").''.price($obj->amount_ht).''.price2num($obj->tva_tx,'MU').'%'.price($obj->amount_ttc).''; + print ''; print 'rowid.'">'.img_picto($langs->trans("SplitDiscount"),'split').''; print '   '; print 'rowid.'">'.img_delete($langs->trans("RemoveDiscount")).''; @@ -459,7 +459,7 @@ if ($socid > 0) print '
'.$langs->trans("Date").''.$langs->trans("ReasonDiscount").''.$langs->trans("ConsumedBy").''.$langs->trans("ConsumedBy").''.$langs->trans("AmountHT").''.$langs->trans("VATRate").''.$langs->trans("AmountTTC").''.dol_print_date($db->jdate($obj->dc),'dayhour').''; + print ''; $facturestatic->id=$obj->fk_facture_source; $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; @@ -508,7 +508,7 @@ if ($socid > 0) } elseif ($obj->description == '(DEPOSIT)') { - print ''; + print ''; $facturestatic->id=$obj->fk_facture_source; $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; @@ -521,7 +521,7 @@ if ($socid > 0) print $obj->description; print ''.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.''.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.''.price($obj->amount_ht).''.price2num($obj->tva_tx,'MU').'%'.price($obj->amount_ttc).'
'.$langs->trans('PaymentConditionsShort').''; + print '
'.$langs->trans('PaymentConditionsShort').''; $form->select_conditions_paiements($cond_reglement_id,'cond_reglement_id',-1,1); print '
'; - print '
'; + print ''; if ($action != 'refcustomer' && $object->brouillon) print ''; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index e0e2e09df73..d8b45e1b9af 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -195,7 +195,7 @@ if (! empty($conf->commande->enabled)) $var=!$var; $obj = $db->fetch_object($resql); print ""; - print '"; print ''; $i++; @@ -247,17 +247,17 @@ if ($resql) $obj = $db->fetch_object($resql); print ""; - print '
'; print $langs->trans('RefCustomer').''; print ''.img_edit($langs->trans('Modify')).'
'; + print ''; print "rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'
'; + print ''; $commandestatic->id=$obj->rowid; $commandestatic->ref=$obj->ref; print ''; - print ''; - print ''; @@ -316,17 +316,17 @@ if (! empty($conf->commande->enabled)) $var=!$var; $obj = $db->fetch_object($resql); print ""; - print '
'; + print ''; print $commandestatic->getNomUrl(1); print ''; + print ''; print ' '; print '
'; + print ''; $commandestatic->id=$obj->rowid; $commandestatic->ref=$obj->ref; print ''; - print ''; - print ''; @@ -387,17 +387,17 @@ if (! empty($conf->commande->enabled)) $var=!$var; $obj = $db->fetch_object($resql); print ""; - print '
'; + print ''; print $commandestatic->getNomUrl(1); print ''; + print ''; print ' '; print '
'; + print ''; $commandestatic->id=$obj->rowid; $commandestatic->ref=$obj->ref; print ''; - print ''; - print ''; diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index b628dc2d5db..7ba7ddc82bd 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -304,17 +304,17 @@ if ($resql) $objp = $db->fetch_object($resql); $var=!$var; print ''; - print '
'; + print ''; print $commandestatic->getNomUrl(1); print ''; + print ''; print ' '; print '
'; + print ''; $generic_commande->id=$objp->rowid; $generic_commande->ref=$objp->ref; print ''; - print ''; - print ''; @@ -375,10 +375,10 @@ if ($resql) print ''; // Amount HT - print ''; + print ''; // Statut - print ''; + print ''; print ''; @@ -391,10 +391,10 @@ if ($resql) { $var=!$var; print ''; - print ''; + print ''; // Total HT - print ''; - print ''; + print ''; + print ''; print ''; } diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 42a39dd9fa8..664f9ce0f1b 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -607,17 +607,17 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) $objp = $db->fetch_object($resql); $var=!$var; print ''; - print '
'; + print ''; print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut)); print ''; + print ''; if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning"); print ''.price($objp->total_ht).''.price($objp->total_ht).''.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).''.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).'
'.$langs->trans('TotalHT').''.$langs->trans('TotalHT').''.price($total).' '.price($total).' 
'; + print ''; $generic_commande->id=$objp->rowid; $generic_commande->ref=$objp->ref; print ''; - print ''; - print ''; @@ -642,7 +642,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) print ''; // Statut - print ''; + print ''; // Checkbox print ''; print ''; - print ''; - print ''; @@ -505,9 +505,9 @@ if ($id > 0 || ! empty($ref)) print ''; - print '\n"; + print '\n"; - print '\n"; // Payment type @@ -636,11 +636,11 @@ if ($id > 0 || ! empty($ref)) // Amount if ($objp->amount < 0) { - print ''."\n"; + print ''."\n"; } else { - print ''."\n"; + print ''."\n"; } // Balance diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php index e38ce88633a..da28602314a 100644 --- a/htdocs/compta/bank/rappro.php +++ b/htdocs/compta/bank/rappro.php @@ -238,10 +238,10 @@ if ($resql) print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; + print ''; print "\n"; @@ -258,12 +258,12 @@ if ($resql) // print "rowid."\">"; // Date op - print ''; + print ''; // Date value if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate)) { - print ''; + print ''; // Description print '"; // Date operation - print ''; + print ''; // Date de valeur - print '\n"; // Num cheque - print ''; + print ''; // Libelle print '"; // Ref - print ''; // Date ope - print '\n"; + print '\n"; // Date value - print '\n"; + print '\n"; // Payment type print "
'; + print ''; print $generic_commande->getNomUrl(1,$objp->fk_statut); print ''; + print ''; if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning"); print ''.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).''.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).''; diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 7830abef655..2aad34cd229 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -351,10 +351,10 @@ if ($id > 0 || ! empty($ref)) print '
'; + print ''; $form->select_date($dateop,'op',0,0,0,'transaction'); print ''; + print ''; $form->select_types_paiements((GETPOST('operation')?GETPOST('operation'):($object->courant == 2 ? 'LIQ' : '')),'operation','1,2',2,1); print ''; print '
'.dol_print_date($db->jdate($objp->do),"day")."'.dol_print_date($db->jdate($objp->do),"day")."'.dol_print_date($db->jdate($objp->dv),"day"); + print ''.dol_print_date($db->jdate($objp->dv),"day"); print "'.price($objp->amount * -1).' '.price($objp->amount * -1).'   '.price($objp->amount).'  '.price($objp->amount).''.$langs->trans("DateValueShort").''.$langs->trans("Type").''.$langs->trans("Description").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Action").''.$langs->trans("ToConciliate").''.$langs->trans("ToConciliate").'
'.dol_print_date($db->jdate($objp->do),"day").''.dol_print_date($db->jdate($objp->do),"day").''; + print ''; print ''.dol_print_date($db->jdate($objp->dv),"day").""; print '   '; print ''; @@ -282,7 +282,7 @@ if ($resql) // Type + Number $label=($langs->trans("PaymentType".$objp->type)!="PaymentType".$objp->type)?$langs->trans("PaymentType".$objp->type):$objp->type; // $objp->type is a code if ($label=='SOLD') $label=''; - print ''.$label.($objp->num_chq?' '.$objp->num_chq:'').''.$label.($objp->num_chq?' '.$objp->num_chq:'').''; @@ -390,7 +390,7 @@ if ($resql) // If not already reconciliated if ($user->rights->banque->modifier) { - print ''; + print ''; print ''; print img_edit(); @@ -418,7 +418,7 @@ if ($resql) if ($db->jdate($objp->do) <= $now) { - print ''; + print ''; print 'rowid])?' checked="checked"':'').'>'; // print ''; // print '   '; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 044b4b70ebc..2a6ddd762d3 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -281,10 +281,10 @@ else print "
'.dol_print_date($db->jdate($objp->do),"day").''.dol_print_date($db->jdate($objp->do),"day").''; + print ''; print ''; print img_previous().' '; print dol_print_date($db->jdate($objp->dv),"day") .' '; @@ -293,7 +293,7 @@ else print "'.$objp->fk_type.' '.($objp->num_chq?$objp->num_chq:'').''.$objp->fk_type.' '.($objp->num_chq?$objp->num_chq:'').''; diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index 9117a099fb5..bdfda680d6d 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -209,15 +209,15 @@ if ($resql) print "
'; + print ''; print "rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid."   "; print ''.dol_print_date($db->jdate($objp->do),"day")."'.dol_print_date($db->jdate($objp->do),"day")."'.dol_print_date($db->jdate($objp->dv),"day")."'.dol_print_date($db->jdate($objp->dv),"day").""; @@ -266,7 +266,7 @@ if ($resql) } // Bank account - print ''; + print ''; $bankaccountstatic->id=$objp->bankid; $bankaccountstatic->label=$objp->bankref; print $bankaccountstatic->getNomUrl(1); diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 05c60f59294..2c26a5d6361 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -205,7 +205,7 @@ if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly') $total = 0 ; print ''; print ''; - print ''; + print ''; print ""; print '"; print '"; diff --git a/htdocs/compta/dons/index.php b/htdocs/compta/dons/index.php index 13c4301dad5..36c1e897c44 100644 --- a/htdocs/compta/dons/index.php +++ b/htdocs/compta/dons/index.php @@ -175,7 +175,7 @@ if ($resql) $donation_static->id=$obj->rowid; $donation_static->ref=$obj->ref?$obj->ref:$obj->rowid; - print ''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 6c190bac20b..f9d8aefda2f 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -49,6 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $langs->load('bills'); $langs->load('companies'); $langs->load('products'); +$langs->load('banks'); $langs->load('main'); if (! empty($conf->margin->enabled)) $langs->load('margins'); @@ -878,17 +879,17 @@ else if ($action == 'add' && $user->rights->facture->creer) if ($_POST['type'] == 3) { $typeamount=GETPOST('typedeposit','alpha'); $valuedeposit=GETPOST('valuedeposit','int'); - + if ($typeamount=='amount') { $amountdeposit=$valuedeposit; }else { $amountdeposit=0; - + dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); - + $classname = ucfirst($subelement); $srcobject = new $classname($db); - + dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add deposit line"); $result=$srcobject->fetch($object->origin_id); if ($result > 0) @@ -900,7 +901,7 @@ else if ($action == 'add' && $user->rights->facture->creer) { $totalamount=+$lines[$i]->subprice; } - + if ($totalamount!=0) { $amountdeposit=($totalamount*$valuedeposit)/100; } @@ -910,9 +911,9 @@ else if ($action == 'add' && $user->rights->facture->creer) $mesgs[]=$srcobject->error; $error++; } - + } - + $result = $object->addline( $id, $langs->trans('Deposit'), @@ -940,7 +941,7 @@ else if ($action == 'add' && $user->rights->facture->creer) 0, $langs->trans('Deposit') ); - + }else { @@ -2117,7 +2118,7 @@ if ($action == 'create') // Deposit print '
'.$langs->trans("PeriodEndDate").''.$langs->trans("PeriodEndDate").'".$langs->trans("Label")."'.$langs->trans("ExpectedToPay")."'.$langs->trans("RefPayment")."'; + print ''; print $donation_static->getNomUrl(1); print '
'; print ''; - print ''; + print ''; $desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1); print ''; if (($origin=='propal') ) { @@ -2340,21 +2341,21 @@ if ($action == 'create') $form->select_produits('','idprod'.$i,'',$conf->product->limit_size); print ''; print ''; - print ''; + print ''; print ''; // Si le module service est actif, on propose des dates de debut et fin a la ligne if (! empty($conf->service->enabled)) { - print ''; @@ -3090,7 +3091,7 @@ else if ($id > 0 || ! empty($ref)) else print $langs->trans('ExcessReceived'); print ' :'; print ''; - print ''; + print ''; } else // Credit note { @@ -3108,7 +3109,7 @@ else if ($id > 0 || ! empty($ref)) else print $langs->trans('ExcessPaydBack'); print ' :'; print ''; - print ''; + print ''; // Sold credit note //print ''; diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 240ad867358..441da8c959e 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -332,7 +332,7 @@ if ($resql) print ""; $classname = "impayee"; - print '
'.$desc.'%% '; + print ''; print ''; - print ''; - print '
'; + print ''; print $langs->trans('From').' '; - print ''; + print ''; print $form->select_date('','date_start'.$i,$usehm,$usehm,1,"add"); print '
'; + print ''; print $langs->trans('to').' '; - print ''; + print ''; print $form->select_date('','date_end'.$i,$usehm,$usehm,1,"add"); print '
'; print '
'.price($resteapayeraffiche).' 
 
'.price($sign * $resteapayeraffiche).' 
 
'.$langs->trans('TotalTTC').' :
'; + print ''; $facturestatic->id=$objp->facid; $facturestatic->ref=$objp->facnumber; @@ -341,12 +341,12 @@ if ($resql) print ''; // Ref - print ''; // Warning picto - print ''; @@ -385,7 +385,7 @@ if ($resql) //print ''; // Status of invoice - print ''; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 952fc760af5..ca2a94d35e2 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -322,7 +322,7 @@ if ($resql) $datelimit=$db->jdate($objp->datelimite); print ''; - print '
'; + print ''; print $facturestatic->getNomUrl(1); print ''; + print ''; if ($date_limit < ($now - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late")); print ''.((! empty($objp->am) || ! empty($cn))?price($objp->total_ttc-$objp->am-$cn):' ').''; + print ''; print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am); print '
'; + print ''; $facturestatic->id=$objp->facid; $facturestatic->ref=$objp->facnumber; @@ -332,7 +332,7 @@ if ($resql) print ''; - print ''; @@ -377,7 +377,7 @@ if ($resql) print ''; // Affiche statut de la facture - print '"; //print ""; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index bfc50b11ae8..0b4a341e1c2 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -54,7 +54,8 @@ $endyear=$year; * View */ -$langs->load("bills"); +$langs->load("bills"); +$langs->load("companies"); $form=new Form($db); diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index ad4d032d5a9..5889d50e069 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -217,19 +217,19 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) while ($i < $num && $i < 20) { $obj = $db->fetch_object($resql); - print ''; - print ''; - print ''; + print ''; print ''; $tot_ttc+=$obj->total_ttc; $i++; @@ -369,16 +369,16 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $obj = $db->fetch_object($resql); print ''; - print '
'; + print ''; print $facturestatic->getNomUrl(1,'',200,0,$notetoshow); print $objp->increment; print ''.(! empty($paiement)?price($paiement).' '.$langs->getCurrencySymbol($conf->currency):' ').''; + print ''; print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$paiement,$objp->type); print " 
'; + print '
'; $facturestatic->ref=$obj->facnumber; $facturestatic->id=$obj->rowid; $facturestatic->type=$obj->type; print $facturestatic->getNomUrl(1,''); print ''; + print ''; $companystatic->id=$obj->socid; $companystatic->nom=$obj->nom; $companystatic->client=1; print $companystatic->getNomUrl(1,'',16); print ''.price($obj->total_ttc).''.price($obj->total_ttc).'
'; + print ''; print ''; - print ''; - print ''; print '"; - print '
'; + print ''; $facturestatic->ref=$obj->facnumber; $facturestatic->id=$obj->rowid; $facturestatic->type=$obj->type; print $facturestatic->getNomUrl(1,''); print ''; + print ''; if ($obj->fk_statut == 1 && ! $obj->paye && $db->jdate($obj->datelimite) < ($now - $conf->facture->client->warning_delay)) print img_warning($langs->trans("Late")); print ''; @@ -761,16 +761,16 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us $obj = $db->fetch_object($resql); print "
'; + print ''; $commandestatic->id=$obj->rowid; $commandestatic->ref=$obj->ref; print ''; - print ''; - print ''; print ''; - print '
'; + print ''; print $commandestatic->getNomUrl(1); print ''; + print ''; print ' '; print ''; @@ -861,16 +861,16 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $obj = $db->fetch_object($resql); print '
'; + print ''; print ''; - print ''; - print ''; print ''; print ''; - print '\n"; + print '\n"; print "\n"; } diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index 2d5e77a4065..0d46cd7ae11 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -59,7 +59,7 @@ function pt ($db, $sql, $date) $total = 0; print '
'; + print ''; $facturestatic->ref=$obj->facnumber; $facturestatic->id=$obj->rowid; $facturestatic->type=$obj->type; print $facturestatic->getNomUrl(1,''); print ''; + print ''; if ($db->jdate($obj->datelimite) < ($now - $conf->facture->client->warning_delay)) print img_warning($langs->trans("Late")); print ''; diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 2676dc78e94..d82e7fabad9 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -275,7 +275,7 @@ if (is_array($coll_list)) $diff = $x_paye_sum; print '
'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''.price(price2num($diff,'MT'))."'.price(price2num($diff,'MT'))."
'; print ''; - print ''; + print ''; print ''; print ''."\n"; print "\n"; @@ -69,10 +69,10 @@ function pt ($db, $sql, $date) $obj = $db->fetch_object($result); $var=!$var; print ''; - print '\n"; + print '\n"; $total = $total + $obj->mm; - print '\n"; + print '\n"; print "\n"; $i++; @@ -179,9 +179,9 @@ for ($m = 1 ; $m < 13 ; $m++ ) if ($i > 2) { print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; $i = 0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 0cc7e2008e6..78c81f9ab9c 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -151,7 +151,7 @@ if ($socid > 0) // Author $userstatic->id=$objf->userid; $userstatic->login=$objf->login; - print ''; @@ -191,7 +191,7 @@ if ($socid > 0) // Author $userstatic->id=$objp->userid; $userstatic->login=$objp->login; - print ''; diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 516f1bb9326..2c5f1736d1b 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -204,7 +204,7 @@ if ($resql) // Due date print ''; - print ''; + print ''; print ''; $i++; diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 64abd53ae15..2d90767cffb 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -352,7 +352,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) // Montant total if ($total[$annee] || ($annee >= $minyear && $annee <= max($nowyear,$maxyear))) { - print '"; + print '"; } else { @@ -364,7 +364,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) { if ($total[$annee-1] && $total[$annee]) { $percent=(round(($total[$annee]-$total[$annee-1])/$total[$annee-1],4)*100); - print ''; + print ''; } if ($total[$annee-1] && ! $total[$annee]) { diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 956edd92ff7..a5e0e7fdbb9 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -316,7 +316,7 @@ if (is_array($coll_list)) $diff = $x_coll_sum - $x_paye_sum; print ''; print ''; - print '\n"; + print '\n"; print "\n"; } diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 53473ed68ff..354d8c86535 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -64,7 +64,7 @@ function pt ($db, $sql, $date) $total = 0; print '
'.$date.''.$date.''.$langs->trans("Amount").' 
'.$obj->dm."'.$obj->dm."'.price($obj->mm)." '.price($obj->mm)." 
'.$langs->trans("SubTotal").':'.price($subtotalcoll).''.price($subtotalpaye).''.price($subtotalpaye).''.price($subtotalcoll).''.price($subtotalpaye).''.price($subtotalpaye).' 
'; + print ''; print $userstatic->getLoginUrl(1); print ''; + print ''; print $userstatic->getLoginUrl(1); print ''.dol_print_date($db->jdate($obj->date_ech), 'day').''.$chargesociale_static->LibStatut($obj->paye,5).''.$chargesociale_static->LibStatut($obj->paye,5).'
'.($total[$annee]?price($total[$annee]):"0")."'.($total[$annee]?price($total[$annee]):"0")."'.($percent>=0?"+$percent":"$percent").'%'.($percent>=0?"+$percent":"$percent").'%
'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''.price(price2num($diff,'MT'))."'.price(price2num($diff,'MT'))."
'; print ''; - print ''; + print ''; print ''; print ''."\n"; print "\n"; @@ -74,10 +74,10 @@ function pt ($db, $sql, $date) $obj = $db->fetch_object($result); $var=!$var; print ''; - print '\n"; + print '\n"; $total = $total + $obj->mm; - print '\n"; + print '\n"; print "\n"; $i++; @@ -188,9 +188,9 @@ for ($m = 1 ; $m < 13 ; $m++ ) if ($i > 2) { print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; $i = 0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; diff --git a/htdocs/compta/tva/quadri.php b/htdocs/compta/tva/quadri.php index e5aa35a1c05..393a9ee4efc 100644 --- a/htdocs/compta/tva/quadri.php +++ b/htdocs/compta/tva/quadri.php @@ -293,13 +293,13 @@ if ($conf->global->COMPTA_MODE == "CREANCES-DETTES") } print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; print ''; diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index cf03b860ba6..88c1be06409 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -617,7 +617,7 @@ else $diff = $x_coll_sum - $x_paye_sum; print ''; print ''; - print '\n"; + print '\n"; print "\n"; $i++; diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index d3ef925158b..ae5a1190c49 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -1171,10 +1171,10 @@ else } if ($conf->margin->enabled) - print ''; + print ''; // Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme) - print ''; print ''; print ''; - print ''; + print ''; if ($conf->margin->enabled) { print ''; - print ''; - print ''; - print ''; @@ -481,12 +481,12 @@ if ($resql) $var=!$var; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index 868b8cc1a0d..ea42df9e01d 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -247,7 +247,7 @@ if ($resql) if ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5) print img_warning($langs->trans("Late")); else print '    '; print ''; - print ''; - print ''; // No width to allow autodim + print ''; // No width to allow autodim print "\n"; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 49f7268b875..003045d737f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -103,7 +103,7 @@ class Form } else { - $ret.='
'.$date.''.$date.''.$langs->trans("Amount").' 
'.$obj->dm."'.$obj->dm."'.price($obj->mm)." '.price($obj->mm)." 
'.$langs->trans("SubTotal").':'.price($subtotalcoll).''.price($subtotalpaye).''.price($subtotal).''.price($subtotalcoll).''.price($subtotalpaye).''.price($subtotal).' 
'.$langs->trans("Total").':'.price($subtot_coll_total).''.price($subtot_coll_vat).''.price($subtot_coll_total).''.price($subtot_coll_vat).''.price($subtot_paye_total).''.price($subtot_paye_vat).''.price($subtot_paye_total).''.price($subtot_paye_vat).''.price($total).''; + print ''.price($total).''; print '
'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''.price(price2num($diff,'MT'))."'.price(price2num($diff,'MT'))."
'.price($objp->pa_ht).''.price($objp->pa_ht).''; + print ''; if ($user->rights->contrat->creer && count($arrayothercontracts) && ($object->statut >= 0)) { print ''; @@ -1272,7 +1272,7 @@ else print '%%'; if ($objp->fk_product) diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 2e9ab1b1cb6..845eaad86bb 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -334,7 +334,7 @@ if ($result) $var=!$var; print '
'; + print ''; $staticcontrat->ref=($obj->ref?$obj->ref:$obj->cid); $staticcontrat->id=$obj->cid; print $staticcontrat->getNomUrl(1,16); @@ -400,7 +400,7 @@ if ($resql) $obj = $db->fetch_object($resql); $var=!$var; print '
'; + print ''; $staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat); $staticcontrat->id=$obj->fk_contrat; print $staticcontrat->getNomUrl(1,16); @@ -426,7 +426,7 @@ if ($resql) $staticcompany->nom=$obj->nom; print $staticcompany->getNomUrl(1,'',20); print ''; + print ''; $dateend=$db->jdate($obj->date_fin_validite); print $staticcontratligne->LibStatut($obj->statut, 3, ($dateend && $dateend < $now)?1:0); print '
'; + print ''; $staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat); $staticcontrat->id=$obj->fk_contrat; print $staticcontrat->getNomUrl(1,16); print ''; + print ''; if ($obj->fk_product > 0) { $productstatic->id=$obj->fk_product; @@ -561,12 +561,12 @@ if ($resql) $var=!$var; print '
'; + print ''; $staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat); $staticcontrat->id=$obj->fk_contrat; print $staticcontrat->getNomUrl(1,16); print ''; + print ''; if ($obj->fk_product > 0) { $productstatic->id=$obj->fk_product; diff --git a/htdocs/contrat/liste.php b/htdocs/contrat/liste.php index 2155b3d9720..2042b5c45f7 100644 --- a/htdocs/contrat/liste.php +++ b/htdocs/contrat/liste.php @@ -133,7 +133,7 @@ if ($resql) $obj = $db->fetch_object($resql); $var=!$var; print '
'; + print ''; print img_object($langs->trans("ShowContract"),"contract").' '.(isset($obj->ref) ? $obj->ref : $obj->cid) .''; if ($obj->nb_late) print img_warning($langs->trans("Late")); print ''; + print ''; if ($obj->cstatut == 0) // If contract is draft, we say line is also draft { print $contractstatic->LibStatut(0,5,($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < $now)); diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 6c6a6d8d036..cbc8e7ee5b7 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -114,7 +114,7 @@ class box_actions extends ModeleBoxes 'text' => dol_trunc($objp->nom,24), 'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid); - $this->info_box_contents[$i][4] = array('td' => 'align="left" nowrap="nowrap"', + $this->info_box_contents[$i][4] = array('td' => 'align="left" class="nowrap"', 'text' => dol_print_date($datelimite, "dayhour")); $this->info_box_contents[$i][5] = array('td' => 'align="right"', diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index cf2ee151ebe..7dea6ed7f04 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -114,7 +114,7 @@ class box_contracts extends ModeleBoxes $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => dol_print_date($datec,'day')); - $this->info_box_contents[$i][5] = array('td' => 'align="right" nowrap="nowrap"', + $this->info_box_contents[$i][5] = array('td' => 'align="right" class="nowrap"', 'text' => $contractstatic->getLibStatut(6), 'asis'=>1 ); diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index 78a81139654..765224baccc 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -112,7 +112,7 @@ class box_ficheinter extends ModeleBoxes $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => dol_print_date($datec,'day')); - $this->info_box_contents[$i][5] = array('td' => 'align="right" nowrap="nowrap"', + $this->info_box_contents[$i][5] = array('td' => 'align="right" class="nowrap"', 'text' => $ficheinterstatic->getLibStatut(6), 'asis'=>1 ); diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index 7eda1bc04b3..c9e668b271e 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -120,7 +120,7 @@ class box_produits extends ModeleBoxes $this->info_box_contents[$i][2] = array('td' => 'align="right"', 'text' => $price); - $this->info_box_contents[$i][3] = array('td' => 'align="left" nowrap="nowrap"', + $this->info_box_contents[$i][3] = array('td' => 'align="left" class="nowrap"', 'text' => $price_base_type); $this->info_box_contents[$i][4] = array('td' => 'align="right"', diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index 57c2cc4de4c..a003451d8e9 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -127,7 +127,7 @@ class box_produits_alerte_stock extends ModeleBoxes $this->info_box_contents[$i][2] = array('td' => 'align="right"', 'text' => $price); - $this->info_box_contents[$i][3] = array('td' => 'align="left" nowrap="nowrap"', + $this->info_box_contents[$i][3] = array('td' => 'align="left" class="nowrap"', 'text' => $price_base_type); $this->info_box_contents[$i][4] = array('td' => 'align="center"', diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index c930fece2e5..cf9e7f6fd32 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -164,7 +164,7 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" } if ($conf->use_javascript_ajax) { - print ''; + print ''; // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object print img_picto($langs->trans("MoveBox",$this->box_id),'grip','class="boxhandle hideonsmartphone" style="cursor:move;"'); print img_picto($langs->trans("Close",$this->box_id),'close','class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose'.$this->box_id.'"'); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 01165bb466a..5b47b3811fb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2744,7 +2744,7 @@ abstract class CommonObject print '
'; + $ret.=''; if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.=''; @@ -2878,7 +2878,7 @@ class Form print ''; print ''; print '
'; $ret.=$langs->trans($text); $ret.='id.$moreparam.'">'.img_edit($langs->trans('Edit'),1).'
'; - print ''; - print ''; - print '"; // Show file name with link to download - $out.= ''; // Show file date $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"])); - $out.= ''; + $out.= ''; if ($delallowed) { diff --git a/htdocs/core/filemanagerdol/browser/default/frmupload.php b/htdocs/core/filemanagerdol/browser/default/frmupload.php index 18496585bd2..dd58eded713 100755 --- a/htdocs/core/filemanagerdol/browser/default/frmupload.php +++ b/htdocs/core/filemanagerdol/browser/default/frmupload.php @@ -124,12 +124,12 @@ window.onload = function()
'; + print '
'; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice @@ -2893,7 +2893,7 @@ class Form if ($filter) $newfilter.=' AND ('.$filter.')'; $nbqualifiedlines=$this->select_remises($selected,$htmlname,$newfilter,$socid,$maxvalue); print ''; + print ''; if ($nbqualifiedlines > 0) { print '   '.$options.''; + print ''; $max=$conf->global->MAIN_UPLOAD_DOC; // En Kb $maxphp=@ini_get('upload_max_filesize'); // En inconnu @@ -479,7 +479,7 @@ class FormFile $out.= "
'; + $out.= ''; $out.= ''; + $out.= ''.dol_print_size($size).''.dol_print_date($date, 'dayhour').''.dol_print_date($date, 'dayhour').'
- diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index a11fdac4dda..2e2d764b861 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -60,40 +60,40 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt print '
+ Upload a new file in this folder
- +
  
'; if ($canedit || ! empty($conf->projet->enabled)) { - print '
'; + print '
'; print ''; if ($canedit) { print ''; - print ''; print ''; print ''; - print ''; print ''; - print ''; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); print ''; - print ''; - print ''; } @@ -114,7 +114,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt print ''; // Buttons - print ''; // Enabled - print ''; + print ''; // Perms - print ''; + print ''; print '
'; + print ''; print $langs->trans("ActionsAskedBy"); - print '  '; + print '  '; print $form->select_dolusers($filtera,'userasked',1,'',!$canedit); print '
'; + print ''; print $langs->trans("or").' '.$langs->trans("ActionsToDoBy"); - print '  '; + print '  '; print $form->select_dolusers($filtert,'usertodo',1,'',!$canedit); print '
'; + print ''; print $langs->trans("or").' '.$langs->trans("ActionsDoneBy"); - print '  '; + print '  '; print $form->select_dolusers($filterd,'userdone',1,'',!$canedit); print '
'; + print ''; print $langs->trans("Type"); - print '  '; + print '  '; print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0)); @@ -103,9 +103,9 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt if (! empty($conf->projet->enabled) && $user->rights->projet->lire) { print '
'; + print ''; print $langs->trans("Project").'   '; - print ''; + print ''; select_projects($socid?$socid:-1, $pid, 'projectid', 64); print '
'; + print ''; print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' '; print '
'; print img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone"').' '; @@ -127,7 +127,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt // Legend if ($conf->use_javascript_ajax && is_array($showextcals)) { - print '
'; + print ''; print ''."\n"; } // jQuery jMobile - if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || ! empty($conf->dol_use_jmobile)) + if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || (! empty($conf->dol_use_jmobile) && $conf->dol_use_jmobile > 0)) { print ''."\n"; } diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 5d3290a259d..864bd9cb5af 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -196,4 +196,4 @@ else // Open and return file if (is_object($db)) $db->close(); -?> +?> \ No newline at end of file From b21a13b789ae17b22fc3ec7bb611282e6a7267e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Apr 2013 20:29:21 +0200 Subject: [PATCH 150/167] Fix: compatibility with jmobile --- htdocs/opensurvey/admin/index.php | 7 +++++-- htdocs/societe/soc.php | 5 +++-- htdocs/theme/amarok/style.css.php | 11 +++++++++++ htdocs/theme/auguria/style.css.php | 11 +++++++++++ htdocs/theme/bureau2crea/style.css.php | 11 +++++++++++ htdocs/theme/cameleo/style.css.php | 11 +++++++++++ htdocs/theme/eldy/style.css.php | 13 ++++++++++++- 7 files changed, 64 insertions(+), 5 deletions(-) diff --git a/htdocs/opensurvey/admin/index.php b/htdocs/opensurvey/admin/index.php index 9617a9c7ee6..6ab9c74dc24 100755 --- a/htdocs/opensurvey/admin/index.php +++ b/htdocs/opensurvey/admin/index.php @@ -29,7 +29,8 @@ require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); // Security check if (!$user->admin) accessforbidden(); - +$langs->load("admin"); +$langs->load("other"); /* @@ -40,7 +41,9 @@ $langs->load("opensurvey"); llxHeader(); -print_fiche_titre($langs->trans("OpenSurveyArea")); +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("OpenSurveyArea"),$linkback,'setup'); +print '
'; echo $langs->trans("OpenSurveyNothingToSetup").'

'."\n"; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 4fc8caa37ee..043cd4ead71 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Brian Fraval - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Patrick Raguin @@ -699,6 +699,7 @@ else print ''."\n"; print "
\n"; + print '
'; print $langs->trans("ThirdPartyType").':   '; print ' '.$langs->trans("Company/Fundation"); @@ -706,7 +707,7 @@ else print ' '.$langs->trans("Individual"); print ' ('.$langs->trans("ToCreateContactWithSameName").')'; - print "
\n"; + print '
'; print "
\n"; } diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 8383576e80d..5788b0f011f 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -2095,6 +2095,17 @@ div.tabsElem a.ui-btn-corner-all { right: 8px; } +div.ui-radio +{ + display: inline-block; +} +.ui-radio input { + height: auto; + width: auto; + margin: 0; + position: static; +} + close(); ?> diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 6f4ebcb058d..f998fdc4e9c 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -2247,6 +2247,17 @@ div.tabsElem a.ui-btn-corner-all { right: 8px; } +div.ui-radio +{ + display: inline-block; +} +.ui-radio input { + height: auto; + width: auto; + margin: 0; + position: static; +} + close(); ?> diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 8d20ba1bec2..f87364fef9b 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -2475,6 +2475,17 @@ div.tabs a.tab#active span.ui-btn-inner, div.tabs a.tab#active span.ui-btn-text, right: 8px; } +div.ui-radio +{ + display: inline-block; +} +.ui-radio input { + height: auto; + width: auto; + margin: 0; + position: static; +} + close(); ?> diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index fb295e4b5e9..3203e556e82 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -2303,6 +2303,17 @@ div.tabs a.tab#active span.ui-btn-inner, div.tabs a.tab#active span.ui-btn-text, right: 8px; } +div.ui-radio +{ + display: inline-block; +} +.ui-radio input { + height: auto; + width: auto; + margin: 0; + position: static; +} + close(); ?> diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b6711ab76eb..9b7020700e3 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -274,6 +274,7 @@ textarea:disabled { } input[type=checkbox] { background-color: transparent; border: none; box-shadow: none; } input[type=image] { background-color: transparent; border: none; box-shadow: none; } + .button { font-family: ; background-image: url(); @@ -2640,11 +2641,21 @@ a.ui-link { text-overflow: hidden; } -/* Warning: setting this make screen not beeing refreshed after a combo selection */ +/* Warning: setting this may make screen not beeing refreshed after a combo selection */ .ui-body-c { background: #fff; } +div.ui-radio +{ + display: inline-block; +} +.ui-radio input { + height: auto; + width: auto; + margin: 0; + position: static; +} close(); From ce47a7d7312e1f88f42f204962e69ba59bfa5dd8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Apr 2013 20:53:23 +0200 Subject: [PATCH 151/167] printSearchForm hook match specifications --- htdocs/main.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index e46e91b0318..52c82c86b69 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1500,7 +1500,12 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me // Execute hook printSearchForm $parameters=array(); - $searchform.=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + $searchform.=$hookmanager->resPrint; + } + else $searchform=$hookmanager->resPrint; // Define $bookmarks if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) From f6c2bd4928495d6bb945af0bfcf93a51d0c5178b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Apr 2013 23:25:28 +0200 Subject: [PATCH 152/167] Fix: Uniformize menu conditions --- htdocs/admin/menus/edit.php | 8 ++++++-- htdocs/core/menus/init_menu_auguria.sql | 2 +- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 67388dbb330..bf382be58ed 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -444,10 +444,14 @@ elseif ($action == 'edit') print '
'.$langs->trans('DetailTarget').'
'.$langs->trans('Enabled').''.$langs->trans('DetailEnabled').'
'.$langs->trans('Enabled').''.$langs->trans('DetailEnabled'); + if (! empty($menu->enabled)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->enabled,1)).')'; + print '
'.$langs->trans('Rights').''.$langs->trans('DetailRight').'
'.$langs->trans('Rights').''.$langs->trans('DetailRight'); + if (! empty($menu->perms)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->perms,1)).')'; + print '
'; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 9beedd143be..b71009b1ba9 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -9,7 +9,7 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__; -- table llx_menu -- insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', 1__+MAX_llx_menu__, __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__); -insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur', '$conf->societe->enabled || $conf->fournisseur->enabled', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); +insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur', '( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'Products/Services', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|contrat|ficheinter', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|facture|deplacement|don|tax', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->deplacement->lire || $user->rights->don->lire || $user->rights->tax->charges->lire', '', 2, 50, __ENTITY__); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4c5ac9a0f0e..f13698ad1a1 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -977,6 +977,7 @@ ClassNotFoundIntoPathWarning=Class %s not found into PHP path YesInSummer=Yes in summer OnlyFollowingModulesAreOpenedToExternalUsers=Note, only following modules are opened to external users (whatever are permission of such users): SuhosinSessionEncrypt=Session storage encrypted by Suhosin +ConditionIsCurrently=Condition is currently %s ##### Module password generation PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase. diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index b18b9f06270..4bb7b833596 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -977,6 +977,7 @@ TranslationDesc=Le choix de la langue affichée à l'écran se modifie:
* Soi ClassNotFoundIntoPathWarning=La class %s n'a pas été trouvée dans le path PHP YesInSummer=Oui en été OnlyFollowingModulesAreOpenedToExternalUsers=Remarque, seuls les modules suivants sont ouverts aux utilisateurs externes (quelque soit les permissions de ces utilisateurs): +ConditionIsCurrently=La condition est actuellement %s ##### Module password generation= undefined PasswordGenerationStandard= Renvoie un mot de passe généré selon algorithme interne Dolibarr: 8 caractères, chiffres et caractères en minuscules mélangés. From 9bbe5014e60c54cbab173c8ca2aac00206edc014 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Apr 2013 23:50:40 +0200 Subject: [PATCH 153/167] Fix: Bad field size on old installations --- htdocs/install/mysql/migration/3.3.0-3.4.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 8dbbad43832..755de6d1034 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -18,6 +18,8 @@ -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); +ALTER TABLE llx_menu MODIFY COLUMN leftmenu varchar(100); + create table llx_adherent_type_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, From 840dcfec38961b3f3e81dd4ecaa61f3fbf846b70 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Apr 2013 09:25:42 +0200 Subject: [PATCH 154/167] Fix: Bad detection of PDF format. --- htdocs/core/lib/functions2.lib.php | 16 ++++++++++------ htdocs/core/lib/invoice2.lib.php | 2 +- htdocs/core/lib/pdf.lib.php | 13 +++++++------ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index dc6c57002c9..d8f86063e18 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -105,14 +105,18 @@ function dolGetModulesDirs($subdir='') /** * Try to guess default paper format according to language into $langs * - * @return string Defautl paper format code + * @param Translate $outputlangs Output lang to use to autodetect output format if setup not done + * @return string Default paper format code */ -function dol_getDefaultFormat() +function dol_getDefaultFormat($outputlangs='') { global $langs; + $selected='EUA4'; - if ($langs->defaultlang == 'ca_CA') $selected='CAP4'; // Canada - if ($langs->defaultlang == 'en_US') $selected='USLetter'; // US + if (empty($outputlangs) || ! is_object($outputlangs)) $outputlangs=$langs; + + if ($outputlangs->defaultlang == 'ca_CA') $selected='CAP4'; // Canada + if ($outputlangs->defaultlang == 'en_US') $selected='USLetter'; // US return $selected; } @@ -739,7 +743,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'),$counterpadded,$maskLike); if ($maskrefclient) $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'),str_pad("",dol_strlen($maskrefclient),"_"),$maskLike); if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),$masktype_value,$maskLike); - + $ref=''; $sql = "SELECT ".$field." as ref"; $sql.= " FROM ".MAIN_DB_PREFIX.$table; @@ -748,7 +752,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $sql.= " AND entity IN (".getEntity($table, 1).")"; if ($where) $sql.=$where; if ($sqlwhere) $sql.=' AND '.$sqlwhere; - + dol_syslog("functions2::get_next_value sql=".$sql); $resql=$db->query($sql); if ($resql) diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index 057dffd7d13..715ff2f877a 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -174,7 +174,7 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte // Define format of output PDF - $formatarray=pdf_getFormat(); + $formatarray=pdf_getFormat($langs); $page_largeur = $formatarray['width']; $page_hauteur = $formatarray['height']; $format = array($page_largeur,$page_hauteur); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 4fc377f896c..a9f882dd4e1 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -29,11 +29,12 @@ /** - * Return array with format properties of default PDF format -* -* @return array Array('width'=>w,'height'=>h,'unit'=>u); -*/ -function pdf_getFormat() + * Return array with format properties of default PDF format + * + * @param Translate $outputlangs Output lang to use to autodetect output format if setup not done + * @return array Array('width'=>w,'height'=>h,'unit'=>u); + */ +function pdf_getFormat($outputlangs='') { global $conf,$db; @@ -43,7 +44,7 @@ function pdf_getFormat() if (empty($conf->global->MAIN_PDF_FORMAT)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $pdfformat=dol_getDefaultFormat(); + $pdfformat=dol_getDefaultFormat($outputlangs); } else $pdfformat=$conf->global->MAIN_PDF_FORMAT; From 1d68a0129877f13ebfced5a349646334113ebd61 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Mon, 29 Apr 2013 12:49:03 +0300 Subject: [PATCH 155/167] Update projects.lang Add Link element on elements page --- htdocs/langs/fr_FR/projects.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index d73ade4b1a1..78661416180 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -105,3 +105,5 @@ TypeContact_project_task_internal_CONTRIBUTOR=Intervenant TypeContact_project_task_external_CONTRIBUTOR=Intervenant # Documents models DocumentModelBaleine=Modèle de rapport de projet complet (logo...) +SelectElement=Eléments associable au projet : +AddElement=Associer From 830aff99e48b2602781dbc7927592e275755f12e Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Mon, 29 Apr 2013 12:54:29 +0300 Subject: [PATCH 156/167] Update element.php add feature: join element from element page --- htdocs/projet/element.php | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 12b4eb5f472..ce9189ce1c6 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -135,58 +135,89 @@ $listofreferent=array( 'propal'=>array( 'title'=>"ListProposalsAssociatedProject", 'class'=>'Propal', + 'table'=>'propal', 'test'=>$conf->propal->enabled), 'order'=>array( 'title'=>"ListOrdersAssociatedProject", 'class'=>'Commande', + 'table'=>'commande', 'test'=>$conf->commande->enabled), 'invoice'=>array( 'title'=>"ListInvoicesAssociatedProject", 'class'=>'Facture', + 'table'=>'facture', 'test'=>$conf->facture->enabled), 'invoice_predefined'=>array( 'title'=>"ListPredefinedInvoicesAssociatedProject", 'class'=>'FactureRec', + 'table'=>'facture_rec', 'test'=>$conf->facture->enabled), 'order_supplier'=>array( 'title'=>"ListSupplierOrdersAssociatedProject", 'class'=>'CommandeFournisseur', + 'table'=>'commande_fournisseur', 'test'=>$conf->fournisseur->enabled), 'invoice_supplier'=>array( 'title'=>"ListSupplierInvoicesAssociatedProject", 'class'=>'FactureFournisseur', + 'table'=>'facture_fourn', 'test'=>$conf->fournisseur->enabled), 'contract'=>array( 'title'=>"ListContractAssociatedProject", 'class'=>'Contrat', + 'table'=>'contrat', 'test'=>$conf->contrat->enabled), 'intervention'=>array( 'title'=>"ListFichinterAssociatedProject", 'class'=>'Fichinter', + 'table'=>'fichinter', 'disableamount'=>1, 'test'=>$conf->ficheinter->enabled), 'trip'=>array( 'title'=>"ListTripAssociatedProject", 'class'=>'Deplacement', + 'table'=>'deplacement', 'disableamount'=>1, 'test'=>$conf->deplacement->enabled), 'agenda'=>array( 'title'=>"ListActionsAssociatedProject", 'class'=>'ActionComm', - 'disableamount'=>1, + 'table'=>'actioncomm', + 'disableamount'=>1, 'test'=>$conf->agenda->enabled) ); +if ($action=="addelement") +{ + $tablename = GETPOST("tablename"); + $elementselectid = GETPOST("elementselect"); + $project->update_element($tablename, $elementselectid); +} + foreach ($listofreferent as $key => $value) { $title=$value['title']; $classname=$value['class']; + $tablename=$value['table']; $qualified=$value['test']; if ($qualified) { print '
'; print_titre($langs->trans($title)); + + $selectList=$project->select_element($tablename); + if ($selectList) + { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'.$langs->trans("SelectElement").''.$selectList.'
'; + print ''; + } print ''; print ''; From d9363f441a44a555e4216f96c34656d2e504d8f5 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Mon, 29 Apr 2013 13:02:58 +0300 Subject: [PATCH 157/167] Update project.class.php Add feature to add element in elements page of a project --- htdocs/projet/class/project.class.php | 79 +++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 3dd0910f7f0..d602c54aaee 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1275,7 +1275,86 @@ class Project extends CommonObject } return $result; } + + /** + * Build Select List of element associable to a project + * + * @param TableName Table of the element to update + * @return string The HTML select list of element + */ + function select_element($Tablename) + { + global $db; + $projectkey="fk_projet"; + switch ($Tablename) + { + case "facture": + case "facture_fourn": + $sql = "SELECT rowid, facnumber as ref"; + break; + case "facture_rec": + $sql = "SELECT rowid, titre as ref"; + break; + case "actioncomm": + $sql = "SELECT id as rowid, label as ref"; + $projectkey="fk_project"; + break; + default: + $sql = "SELECT rowid, ref"; + break; + } + + $sql.= " FROM ".MAIN_DB_PREFIX.$Tablename; + $sql.= " WHERE ".$projectkey." is null"; + $sql.= " AND fk_soc=".$this->societe->id; + $sql.= " ORDER BY ref DESC"; + + dol_syslog("Project.Lib::select_element sql=".$sql); + + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + if ($num > 0) + { + $sellist = ''; + } + return $sellist ; + } + } + + /** + * Associate element to a project + * + * @param TableName Table of the element to update + * @param ElementSelectId Key-rowid of the line of the element to update + * @return int 1 if OK or < 0 if KO + */ + function update_element($TableName, $ElementSelectId) + { + global $db; + $sql="update ".MAIN_DB_PREFIX.$TableName; + if ($TableName=="actioncomm") + { + $sql.= " SET fk_project=".$this->id; + $sql.= " WHERE id=".$ElementSelectId; + } + else + { + $sql.= " SET fk_projet=".$this->id; + $sql.= " WHERE rowid=".$ElementSelectId; + } + $resql=$db->query($sql); + } } ?> From 00adb1b9ab4938f778c3050d39ad814fc6deec47 Mon Sep 17 00:00:00 2001 From: simnandez Date: Mon, 29 Apr 2013 12:46:07 +0200 Subject: [PATCH 158/167] Fix: [ bug #855 ] Holiday approval email in French --- ChangeLog | 1 + htdocs/holiday/fiche.php | 17 ++-- htdocs/langs/ca_ES/holiday.lang | 154 ++++++++++++++++++++++++++++++++ htdocs/langs/en_US/holiday.lang | 14 +++ htdocs/langs/es_ES/holiday.lang | 14 +++ htdocs/langs/fr_FR/holiday.lang | 14 +++ 6 files changed, 206 insertions(+), 8 deletions(-) create mode 100644 htdocs/langs/ca_ES/holiday.lang diff --git a/ChangeLog b/ChangeLog index e1d7f482be2..993eff9c2da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,7 @@ English Dolibarr ChangeLog - Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres) - Fix: [ bug #857 ] Invoice created from shipment does not have the order discount - Fix: [ bug #856 ] (Holidays module) Mail error if destination user doesn't have an email +- Fix: [ bug #855 ] Holiday approval email in French ***** ChangeLog for 3.3.1 compared to 3.3 ***** diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index 3d3572f20cd..f562eb5734b 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -2,6 +2,7 @@ /* Copyright (C) 2011 Dimitri Mouillard * Copyright (C) 2012 Laurent Destailleur * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 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 @@ -296,7 +297,7 @@ if ($action == 'confirm_send') // Content $message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->prenom.",\n"; $message.= "\n"; - $message.= "Veuillez trouver ci-dessous une demande de congés payés à valider.\n"; + $message.= $langs->transnoentities("HolidaysToValidateBody")."\n"; $delayForRequest = $cp->getConfCP('delayForRequest'); //$delayForRequest = $delayForRequest * (60*60*24); @@ -309,7 +310,7 @@ if ($action == 'confirm_send') if($cp->date_debut < $nextMonth) { $message.= "\n"; - $message.= "Cette demande de congés payés à été effectué dans un délai de moins de ".$cp->getConfCP('delayForRequest')." jours avant ceux-ci.\n"; + $message.= $langs->transnoentities("HolidaysToValidateDelay",$cp->getConfCP('delayForRequest'))."\n"; } } @@ -320,7 +321,7 @@ if ($action == 'confirm_send') if ($nbopenedday > $cp->getCPforUser($cp->fk_user)) { $message.= "\n"; - $message.= "L'utilisateur ayant fait cette demande de congés payés n'a pas le solde requis.\n"; + $message.= $langs->transnoentities("HolidaysToValidateAlertSolde")."\n"; } } @@ -411,7 +412,7 @@ if($action == 'confirm_valid') // Content $message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->prenom.",\n"; $message.= "\n"; - $message.= "Votre demande de congés payés du ".dol_print_date($cp->date_debut,'day')." au ".dol_print_date($cp->date_fin,'day')." vient d'être validée!\n"; + $message.= $langs->transnoentities("HolidaysValidatedBody", dol_print_date($cp->date_debut,'day'),dol_print_date($cp->date_fin,'day'))."\n"; $message.= "- ".$langs->transnoentitiesnoconv("ValidatedBy")." : ".$expediteur->prenom." ".$expediteur->nom."\n"; $message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/fiche.php?id=".$cp->rowid."\n\n"; $message.= "\n"; @@ -485,9 +486,9 @@ if ($action == 'confirm_refuse') // Content $message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->prenom.",\n"; $message.= "\n"; - $message.= "Votre demande de congés payés ".dol_print_date($cp->date_debut,'day')." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($cp->date_fin,'day')." vient d'être refusée pour le motif suivant :\n"; - $message.= $_POST['detail_refuse']."\n\n"; - $message.= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".$expediteur->prenom." ".$expediteur->nom."\n"; + $message.= $langs->transnoentities("HolidaysRefusedBody", dol_print_date($cp->date_debut,'day'), dol_print_date($cp->date_fin,'day'))."\n"; + $message.= GETPOST('detail_refuse','alpha')."\n\n"; + $message.= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n"; $message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/fiche.php?id=".$cp->rowid."\n\n"; $message.= "\n"; @@ -562,7 +563,7 @@ if ($action == 'confirm_cancel' && $_GET['confirm'] == 'yes') // Content $message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->prenom.",\n"; $message.= "\n"; - $message.= "Votre demande de congés ".dol_print_date($cp->date_debut,'day')." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($cp->date_fin,'day')." va été annulée.\n"; + $message.= $langs->transnoentities("HolidaysCanceledBody", dol_print_date($cp->date_debut,'day'), dol_print_date($cp->date_fin,'day'))."\n"; $message.= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".$expediteur->prenom." ".$expediteur->nom."\n"; $message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/fiche.php?id=".$cp->rowid."\n\n"; $message.= "\n"; diff --git a/htdocs/langs/ca_ES/holiday.lang b/htdocs/langs/ca_ES/holiday.lang new file mode 100644 index 00000000000..d77e31fbb7f --- /dev/null +++ b/htdocs/langs/ca_ES/holiday.lang @@ -0,0 +1,154 @@ +# Dolibarr language file - ca_ES - holiday +CHARSET= UTF-8 + +Holidays=Vacacions +CPTitreMenu=Vacacions +MenuReportMonth=Estat mensual +MenuAddCP=Nova petició +NotActiveModCP=Heu d'activar el mòdul Vacacions per veure aquesta pàgina. +NotConfigModCP=Heu de configurar el mòdul Vacacions per veure aquesta pàgina. per configurar, feu clic aquí. +NoCPforUser=No té peticions de vacances. +AddCP=Crear petició de vacances +CPErrorSQL=S'ha produït un error de SQL: +Employe=Empleat +DateDebCP=Data inici +DateFinCP=Data fi +DateCreateCP=Data de creació +DraftCP=Esborrany +ToValidateCP=En espera de validació +ValidateCP=Validada +CancelCP=Anul·lada +RefuseCP=Rebutjada +ValidatorCP=Validador +ListeCP=Llista de vacances +ValidateByCP=Serà validada per +DescCP=Descripció +SendRequestCP=Enviar la petició de vacances +DelayToRequestCP=Les peticions de vacances s'han de fer almenys %s dies abans. +MenuConfCP=Definir les vacances +UpdateAllCP=Actualitzar les vacances +SoldeCPUser=El seu saldo de vacances és de %s dies. +ErrorEndDateCP=Ha d'indicar una data de fi superior a la data d'inici. +ErrorSQLCreateCP=S'ha produït un error de SQL durant la creació: +ErrorIDFicheCP=S'ha produït un error, aquesta sol·licitud de vacances no existeix. +ReturnCP=Tornar a la pàgina anterior +ErrorUserViewCP=No està autoritzat a llegir aquesta petició de vacances. +InfosCP=Informació de la petició de vacances +InfosWorkflowCP=Informació del workflow +DateCreateCP=Data de creació +RequestByCP=Comandada per +TitreRequestCP=Fitxa vacances +NbUseDaysCP=Nombre de dies de vacances consumits +EditCP=Modificar +DeleteCP=Eliminar +ActionValidCP=Validar +ActionRefuseCP=Rebutjar +ActionCancelCP=Anul·lar +StatutCP=Estat +SendToValidationCP=Enviar validació +TitleDeleteCP=Eliminar la petició de vacances +ConfirmDeleteCP=Està segur de voler eliminar aquesta petició de vacances? +ErrorCantDeleteCP=Error, no té vacances per eliminar aquesta petició de vacances. +CantCreateCP=No té vacances per realitzar peticions de vacances. +InvalidValidatorCP=Ha d'indicar un validador per a la seva petició de vacances. +UpdateButtonCP=Actualitzar +CantUpdate=No pot actualitzar aquesta petició de vacances. +NoDateDebut=Ha d'indicar una data d'inici. +NoDateFin=Ha d'indicar una data de fi. +ErrorDureeCP=La seva petició de vacances no conté cap dia hàbil. +TitleValidCP=Validar la petició de vacances +ConfirmValidCP=Esteu segur de voler validar aquesta petició de vacances? +DateValidCP=Data de validació +TitleToValidCP=Enviar la petició de vacances +ConfirmToValidCP=Esteu segur de voler enviar la petició de vacances? +TitleRefuseCP=Rebutjar la petició de vacances +ConfirmRefuseCP=Esteu segur de voler rebutjar la petició de vacances? +NoMotifRefuseCP=Ha de seleccionar un motiu per rebutjar aquesta petició. +TitleCancelCP=Anul·lar la petició de vacances +ConfirmCancelCP=Esteu segur de voler anul·lar la petició de vacances? +DetailRefusCP=Motiu del rebuig +DateRefusCP=Data del rebuig +DateCancelCP=Data de l'anul·lació +DefineEventUserCP=Assignar permís excepcional a un usuari +addEventToUserCP=Assignar aquest permís +MotifCP=Motiu +UserCP=Usuari +ErrorAddEventToUserCP=S'ha produït un error en l'assignació del permís excepcional. +AddEventToUserOkCP=S'ha afegit el permís excepcional. +MenuLogCP=Veure els logs de vacances +LogCP=Logs d'actualitzacions de vacances +ActionByCP=Realitzat per +UserUpdateCP=Per a l'usuari +ActionTypeCP=Tipus +PrevSoldeCP=Saldo anterior +NewSoldeCP=Nou saldo +alreadyCPexist=Ja s'ha efectuat una petició de vacances per a aquest període. +UserName=Nom Cognoms +Employee=Empleat +FirstDayOfHoliday=Primer dia lliure +LastDayOfHoliday=Últim dí lliure +Morning=Matí +Afternoon=Vesprada +HolidaysMonthlyUpdate=Actualització mensual +ManualUpdate=Actualització manual + +## Configuration du Module ## +ConfCP=Configuració del mòdul Vacacions +DescOptionCP=Descripció de l'opció +ValueOptionCP=Valor +GroupToValidateCP=Grup amb possibilitat d'aprovar les vacances +ConfirmConfigCP=Validar la configuració +LastUpdateCP=Darrera actualització automàtica de vacances +UpdateConfCPOK=Actualització efectuada correctament. +ErrorUpdateConfCP=S'ha produït un error durant l'actualització, torne a provar. +AddCPforUsers=Afegiu els saldos de vacances dels usuaris fent clic aquí. +DelayForSubmitCP=Antelació mínima per sol·licitar vacances +AlertValidatorDelayCP=Advertir a l'usuari validador si la petició no respecta el límit previst +AlertValidorSoldeCP=Advertir a l'usuari validador si l'usuari demana vacances superiors al seu saldo +nbUserCP=Nombre d'usuaris presos en compte en el mòdul vacances +nbHolidayDeductedCP=Nombre de dies retribuïts a deduir per dia de vacances +nbHolidayEveryMonthCP=Nombre de vacances afegides per mes +Module27130Name=Gestió de les vacances +TitleOptionMainCP=Ajustaments principals de vacances +TitleOptionEventCP=Ajustaments de vacances enllaçats a esdeveniments +ValidEventCP=Validar +UpdateEventCP=Actualitzar els esdeveniments +CreateEventCP=Crear +NameEventCP=Nom de l'esdeveniment +OkCreateEventCP=S'ha afegit l'esdeveniment correctament. +ErrorCreateEventCP=Error en la creació de l'esdeveniment. +UpdateEventOkCP=S'ha actualitzat l'esdeveniment correctament. +ErrorUpdateEventCP=Error en l'actualització de l'esdeveniment. +DeleteEventCP=Eliminar l'esdeveniment +DeleteEventOkCP=S'ha eliminat l'esdeveniment. +ErrorDeleteEventCP=Error en l'eliminació de l'esdeveniment. +TitleDeleteEventCP=Eliminar un permís excepcional +TitleCreateEventCP=Crear un permís excepcional +TitleUpdateEventCP=Modificar o eliminar un permís excepcional +DeleteEventOptionCP=Eliminar +UpdateEventOptionCP=Actualitzar +ErrorMailNotSend=S'ha produït un error en l'enviament del correu electrònic: +NoCPforMonth=Sense vacances aquest mes. +Jours=dies +nbJours=Número de dies +TitleAdminCP=Configuració de les vacances + +#Messages +Hello=Hola +HolidaysToValidate=Dies retribuïts a validar +HolidaysToValidateBody=A continuació trobareu una sol·licitud de dies retribuïts per validar +HolidaysToValidateDelay=Aquesta sol·licitud de dies retribuïts tindrà lloc en un termini de menys de %s dies. +HolidaysToValidateAlertSolde=L'usuari que ha realitzat la sol·licitud de dies retribuïts no disposa de suficients dies disponibles. +HolidaysValidated=Dies retribuïts validats +HolidaysValidatedBody=La seva sol·licitud de dies retribuïts des de %s al %s ha estat validada. +HolidaysRefused=Dies retribuïts denegats +HolidaysRefusedBody=La seva sol·licitud de dies retribuïts des de %s al %s ha estat denegada pel següent motiu: +HolidaysCanceled=Dies retribuïts cancel·lats +HolidaysCanceledBody=La seva sol·licitud de dies retribuïts des de %s al %s ha estat cancel·lada. + +Permission20001=Consultar/crear/modificar les seves vacances +Permission20002=Consultar/modificar totes les sol·licituds de permisos retribuïts +Permission20003=Eliminar les sol·licituds de permisos retribuïts +Permission20004=Definir els permisos retribuïts dels usuaris +Permission20005=Consultar l'historial de modificacions de permisos retribuïts +Permission20006=Accedir a l'informe mensual de permisos retribuïts \ No newline at end of file diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index bf96666c8f5..bc2358dad2b 100755 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -131,6 +131,20 @@ NoCPforMonth=No leave this month. Jours=days nbJours=Number days TitleAdminCP=Configuration of Holidays + +#Messages +Hello=Hello +HolidaysToValidate=Validate holidays +HolidaysToValidateBody=Below is a request for holidays to validate +HolidaysToValidateDelay=This request for holidays will take place within a period of less than %s days. +HolidaysToValidateAlertSolde=The user who made this request for holidays do not have enough available days. +HolidaysValidated=Validated holidays +HolidaysValidatedBody=Your request for holidays for %s to %s has been validated. +HolidaysRefused=Denied holidays +HolidaysRefusedBody=Your request for holidays for %s to %s has been denied for the following reason : +HolidaysCanceled=Canceled holidays +HolidaysCanceledBody=Your request for holidays for %s to %s has been canceled. + Permission20001=Read/create/modify their holidays Permission20002=Read/modify all requests of holidays Permission20003=Delete their holidays requests diff --git a/htdocs/langs/es_ES/holiday.lang b/htdocs/langs/es_ES/holiday.lang index 75621b274bd..325dbc1b7bf 100644 --- a/htdocs/langs/es_ES/holiday.lang +++ b/htdocs/langs/es_ES/holiday.lang @@ -132,6 +132,20 @@ NoCPforMonth=Sin vacaciones este mes. Jours=días nbJours=Número de días TitleAdminCP=Configuración de las vacaciones + +#Messages +Hello=Hola +HolidaysToValidate=Días retribuidos a validar +HolidaysToValidateBody=A continuación encontrará una solicitud de días retribuidos para validar +HolidaysToValidateDelay=Esta solicitud de días retribuidos tendrá lugar en un plazo de menos de %s días. +HolidaysToValidateAlertSolde=El usuario que ha realizado la solicitud de días retribuidos no dispone de suficientes días disponibles. +HolidaysValidated=Días retribuidos validados +HolidaysValidatedBody=Su solicitud de días retribuidos desde el %s al %s ha sido validada. +HolidaysRefused=Días retribuidos denegados +HolidaysRefusedBody=Su solicitud de días retribuidos desde el %s al %s ha sido denegada por el siguiente motivo : +HolidaysCanceled=Días retribuidos cancelados +HolidaysCanceledBody=Su solicitud de días retribuidos desde el %s al %s ha sido cancelada. + Permission20001=Consultar/crear/modificar sus vacaciones Permission20002=Consultar/modificar todas las solicitudes de permisos retribuídos Permission20003=Eliminar las solicitudes de permisos retribuídos diff --git a/htdocs/langs/fr_FR/holiday.lang b/htdocs/langs/fr_FR/holiday.lang index 52c6ac37d9b..be368bf661a 100644 --- a/htdocs/langs/fr_FR/holiday.lang +++ b/htdocs/langs/fr_FR/holiday.lang @@ -130,6 +130,20 @@ NoCPforMonth=Aucun congé ce mois-ci. Jours=jours nbJours=Nombre jours TitleAdminCP=Configuration des Congés + +#Messages +Hello=Bonjour +HolidaysToValidate=Congés payés à valider +HolidaysToValidateBody=Veuillez trouver ci-dessous une demande de congés payés à valider. +HolidaysToValidateDelay=Cette demande de congés payés à été effectué dans un délai de moins de %s jours avant ceux-ci. +HolidaysToValidateAlertSolde=L'utilisateur ayant fait cette demande de congés payés n'a pas le solde requis. +HolidaysValidated=Congés payés validée +HolidaysValidatedBody=Votre demande de congés payés du %s au %s vient d'être validée! +HolidaysRefused=Congés payés refusée +HolidaysRefusedBody=Votre demande de congés payés %s à %s vient d'être refusée pour le motif suivant : +HolidaysCanceled=Congés payés annulée +HolidaysCanceledBody=Votre demande de congés %s à %s va été annulée. + Permission20001=Lire / Créer / modifier ses congès Permission20002=Lire / Modifier toutes les demandes de congés payés Permission20003=Supprimer des demandes de congés payés From 52b9a3ad9198e331e71e344d274f7b8813f4e2f9 Mon Sep 17 00:00:00 2001 From: simnandez Date: Mon, 29 Apr 2013 12:49:56 +0200 Subject: [PATCH 159/167] Update ChangeLog --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index fb2a50b131b..6d2db3baa5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -111,6 +111,8 @@ WARNING: If you used external modules, some of them may need to be upgraded due - Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary - Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres) - Fix: [ bug #857 ] Invoice created from shipment does not have the order discount +- Fix: [ bug #856 ] (Holidays module) Mail error if destination user doesn't have an email +- Fix: [ bug #855 ] Holiday approval email in French ***** ChangeLog for 3.3.1 compared to 3.3 ***** From fd85755461e71d8a8b38f166f2b89d711b905df3 Mon Sep 17 00:00:00 2001 From: simnandez Date: Mon, 29 Apr 2013 12:55:14 +0200 Subject: [PATCH 160/167] Fix: [ bug #855 ] Holiday approval email in French --- htdocs/holiday/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index f562eb5734b..8e2d8509002 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -488,7 +488,7 @@ if ($action == 'confirm_refuse') $message.= "\n"; $message.= $langs->transnoentities("HolidaysRefusedBody", dol_print_date($cp->date_debut,'day'), dol_print_date($cp->date_fin,'day'))."\n"; $message.= GETPOST('detail_refuse','alpha')."\n\n"; - $message.= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n"; + $message.= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".$expediteur->prenom." ".$expediteur->nom."\n"; $message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/fiche.php?id=".$cp->rowid."\n\n"; $message.= "\n"; From b9429fc98e81ae94491ab4f6225f16fa30042fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Mon, 29 Apr 2013 17:24:02 +0200 Subject: [PATCH 161/167] Fixed a bug when showing users to define holidays --- htdocs/holiday/admin/holiday.php | 18 ++++++++++-------- htdocs/holiday/class/holiday.class.php | 4 ++-- htdocs/holiday/define_holiday.php | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/htdocs/holiday/admin/holiday.php b/htdocs/holiday/admin/holiday.php index 6e7216332ea..e3a20662f5d 100644 --- a/htdocs/holiday/admin/holiday.php +++ b/htdocs/holiday/admin/holiday.php @@ -322,16 +322,18 @@ print ''."\n\n"; dol_fiche_end(); -/*$var=!$var; -print $langs->trans('nbUserCP').': '."\n"; -print $cp->getConfCP('nbUser')."
\n"; +/*$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 '
'; +$var=!$var; +print $langs->trans('LastUpdateCP').': '."\n"; +if ($cp->getConfCP('lastUpdate')) print dol_print_date($db->jdate($cp->getConfCP('lastUpdate')),'dayhour','tzuser'); +else print $langs->trans('None'); +print "
\n"; + +print '
'; print_fiche_titre($langs->trans('TitleOptionEventCP'),'',''); diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 15445162af3..55971e64375 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1151,7 +1151,7 @@ class Holiday extends CommonObject $obj = $this->db->fetch_object($resql); $tab_result[$i]['rowid'] = $obj->rowid; - $tab_result[$i]['name'] = $obj->name; + $tab_result[$i]['name'] = $obj->lastname; $tab_result[$i]['firstname'] = $obj->firstname; $i++; @@ -1191,7 +1191,7 @@ class Holiday extends CommonObject $obj = $this->db->fetch_object($resql); $tab_result[$i]['rowid'] = $obj->fk_user; - $tab_result[$i]['name'] = $obj->name; + $tab_result[$i]['name'] = $obj->lastname; $tab_result[$i]['firstname'] = $obj->firstname; $i++; diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 940c8b9a8be..3517fa1d11e 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -159,7 +159,7 @@ foreach($listUsers as $users) print '
'; print ''; From 8837caeb6fa23e8667575dd52a267d3ec2786e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Mon, 29 Apr 2013 17:57:24 +0200 Subject: [PATCH 162/167] Style improvement --- htdocs/holiday/define_holiday.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 3517fa1d11e..36e93d84271 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -145,8 +145,8 @@ print ''; print '
'.$users['rowid'].''; $userstatic->id=$users['rowid']; - $userstatic->lastname=$users['lastname']; + $userstatic->lastname=$users['name']; $userstatic->firstname=$users['firstname']; print $userstatic->getNomUrl(1); print '
'; print ""; print ''; -print ''; -print ''; +print ''; +print ''; print ''; print ''; @@ -163,7 +163,7 @@ foreach($listUsers as $users) $userstatic->firstname=$users['firstname']; print $userstatic->getNomUrl(1); print ''; - print ''."\n"; print ''."\n"; From 7dd457d2df04455e3343729f9a623b0b29f3355e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Mon, 29 Apr 2013 18:01:26 +0200 Subject: [PATCH 163/167] Added DurationDays string to the table --- htdocs/holiday/index.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/holiday/index.php b/htdocs/holiday/index.php index 06c75411453..8343a805081 100644 --- a/htdocs/holiday/index.php +++ b/htdocs/holiday/index.php @@ -289,11 +289,11 @@ if($user->rights->holiday->lire_tous) { print ''; } @@ -359,7 +359,7 @@ if (! empty($holiday->holiday)) print ''; print ''; print ''."\n"; From da9cbc6e58e507b68d38dbf95a48f0ea69c04c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Mon, 29 Apr 2013 18:02:18 +0200 Subject: [PATCH 164/167] Corrected translation key --- htdocs/langs/bg_BG/holiday.lang | 2 +- htdocs/langs/en_US/holiday.lang | 2 +- htdocs/langs/es_ES/holiday.lang | 2 +- htdocs/langs/fr_FR/holiday.lang | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/bg_BG/holiday.lang b/htdocs/langs/bg_BG/holiday.lang index 250872e523e..614539960d5 100644 --- a/htdocs/langs/bg_BG/holiday.lang +++ b/htdocs/langs/bg_BG/holiday.lang @@ -21,7 +21,7 @@ DateDebCP=Начална дата DateFinCP=Крайна дата DateCreateCP=Дата на създаване DraftCP=Проект -ToApproveCP=Очаква одобрение +ToReviewCP=Очаква одобрение ApprovedCP=Утвърден CancelCP=Отменен RefuseCP=Отказ diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index e2bf8d85209..5453b2b88e6 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -15,7 +15,7 @@ DateDebCP=Start date DateFinCP=End date DateCreateCP=Creation date DraftCP=Draft -ToApproveCP=Awaiting approval +ToReviewCP=Awaiting approval ApprovedCP=Approved CancelCP=Canceled RefuseCP=Refused diff --git a/htdocs/langs/es_ES/holiday.lang b/htdocs/langs/es_ES/holiday.lang index a4c5c786980..5c234575d25 100644 --- a/htdocs/langs/es_ES/holiday.lang +++ b/htdocs/langs/es_ES/holiday.lang @@ -15,7 +15,7 @@ DateDebCP=Fecha inicio DateFinCP=Fecha fin DateCreateCP=Fecha de creación DraftCP=Borrador -ToApproveCP=En espera de aprobación +ToReviewCP=En espera de aprobación ApprovedCP=Aprobada CancelCP=Anulada RefuseCP=Rechazada diff --git a/htdocs/langs/fr_FR/holiday.lang b/htdocs/langs/fr_FR/holiday.lang index 5b133dbba9e..938ffaa155d 100644 --- a/htdocs/langs/fr_FR/holiday.lang +++ b/htdocs/langs/fr_FR/holiday.lang @@ -15,7 +15,7 @@ DateDebCP=Date Début DateFinCP=Date Fin DateCreateCP=Date de création DraftCP=Brouillon -ToApproveCP=En attente d'approbation +ToReviewCP=En attente d'approbation ApprovedCP=Approuvé CancelCP=Annulée RefuseCP=Refusée From bf36376215000d4120e4148314b703a95f2bcce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Mon, 29 Apr 2013 18:05:11 +0200 Subject: [PATCH 165/167] Corrected ca_ES translations Translations made by Juanjo Menent (simnandez) --- htdocs/langs/ca_ES/holiday.lang | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/ca_ES/holiday.lang b/htdocs/langs/ca_ES/holiday.lang index d77e31fbb7f..60adaa8faf3 100644 --- a/htdocs/langs/ca_ES/holiday.lang +++ b/htdocs/langs/ca_ES/holiday.lang @@ -15,13 +15,13 @@ DateDebCP=Data inici DateFinCP=Data fi DateCreateCP=Data de creació DraftCP=Esborrany -ToValidateCP=En espera de validació -ValidateCP=Validada +ToReviewCP=A l'espera d'aprovació +ApprvedCP=Aprovada CancelCP=Anul·lada RefuseCP=Rebutjada ValidatorCP=Validador ListeCP=Llista de vacances -ValidateByCP=Serà validada per +ReviewedByCP=Serà revisada per DescCP=Descripció SendRequestCP=Enviar la petició de vacances DelayToRequestCP=Les peticions de vacances s'han de fer almenys %s dies abans. From 8a266058c1b5e872b0887add231492235f351578 Mon Sep 17 00:00:00 2001 From: simnandez Date: Tue, 30 Apr 2013 12:05:21 +0200 Subject: [PATCH 166/167] Removed duplicated changelog entries and ordered fixes by bug ID --- ChangeLog | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d2db3baa5e..3f6221ac9c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -92,27 +92,25 @@ WARNING: If you used external modules, some of them may need to be upgraded due ***** ChangeLog for 3.3.2 compared to 3.3.1 ***** - Fix: Dutch (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 -- 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: [ bug #816 ] Sales journal does not reflect localtaxes -- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price - Fix: Orderstoinvoice didn't act as expected when no order was checked - Fix: Bad link to all proposals into Third party card if customer is prospect - Fix: [ bug #774 ] Bug on creating event with box "all day" crossed +- Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment - Fix: [ bug #789 ] VAT not being calculated in POS -- Fix: [ bug #794 ] Lost filter on zipcode in prospect list +- Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated +- Fix: [ bug #794 ] Lost filter on zipcode in prospect list +- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price - Fix: [ bug #810 ] Cannot update ODT template path +- Fix: [ bug #816 ] Sales journal does not reflect localtaxes +- Fix: [ bug #817 ] Purchases journal does not reflect localtaxes - Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary - Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres) -- Fix: [ bug #857 ] Invoice created from shipment does not have the order discount -- Fix: [ bug #856 ] (Holidays module) Mail error if destination user doesn't have an email - Fix: [ bug #855 ] Holiday approval email in French +- Fix: [ bug #856 ] (Holidays module) Mail error if destination user doesn't have an email +- Fix: [ bug #857 ] Invoice created from shipment does not have the order discount ***** ChangeLog for 3.3.1 compared to 3.3 ***** From 0b8d78c4f60bb96a39e65899040d9f8d51de3e3d Mon Sep 17 00:00:00 2001 From: fhenry Date: Tue, 30 Apr 2013 18:23:44 +0200 Subject: [PATCH 167/167] [ bug #865 ] Dolibarr navigation array in project/task do not work Conflicts: htdocs/projet/fiche.php Change-Id: I7607f97d21cc695c9b295d94f5abcb64fe25f3af --- htdocs/projet/class/project.class.php | 2 ++ htdocs/projet/fiche.php | 28 ++++++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index d602c54aaee..e6376bbe7eb 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -36,6 +36,7 @@ class Project extends CommonObject public $table_element = 'projet'; //!< Name of table without prefix where object is stored public $table_element_line = 'projet_task'; public $fk_element = 'fk_projet'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; var $ref; @@ -52,6 +53,7 @@ class Project extends CommonObject var $statuts_short; var $statuts; var $oldcopy; + /** * Constructor diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index a9d3895879d..17e5975a272 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -44,12 +44,6 @@ if ($id == '' && $ref == '' && ($action != "create" && $action != "add" && $acti $mine = GETPOST('mode')=='mine' ? 1 : 0; //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects - -// Security check -$socid=0; -if ($user->societe_id > 0) $socid=$user->societe_id; -$result = restrictedArea($user, 'projet', $id); - // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('projectcard')); @@ -61,6 +55,11 @@ if ($object->id > 0) $object->fetch_thirdparty(); } +// Security check +$socid=0; +if ($user->societe_id > 0) $socid=$user->societe_id; +$result = restrictedArea($user, 'projet', $object->id); + // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); @@ -137,7 +136,7 @@ if ($action == 'add' && $user->rights->projet->creer) $object->datec=dol_now(); $object->date_start=$date_start; $object->date_end=$date_end; - + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -209,7 +208,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer) $object->public = GETPOST('public','alpha'); $object->date_start = empty($_POST["project"])?'':$date_start; $object->date_end = empty($_POST["projectend"])?'':$date_end; - + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -560,7 +559,7 @@ else { print $object->showOptionals($extrafields,'edit'); } - + print '
'.$langs->trans('ID').''.$langs->trans('UserName').''.$langs->trans('Available').''.$langs->trans('UserName').''.$langs->trans('Available').''.$langs->trans('UpdateButtonCP').'
'; + print ''; print ''; print ' '.$langs->trans('days').''; - $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; + $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; $form->select_users($search_valideur,"search_valideur",1,"",0,$valideurarray,''); print ''.dol_print_date($infos_CP['date_fin'],'day').''; $nbopenedday=num_open_day($infos_CP['date_debut'], $infos_CP['date_fin'], 0, 1, $infos_CP['halfday']); - print $nbopenedday; + print $nbopenedday.' '.$langs->trans('DurationDays'); print ''.$holidaystatic->LibStatut($infos_CP['statut'],5).'
'; print '

'; @@ -741,10 +740,13 @@ else print '
'; - // List of actions on element - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; - $formactions=new FormActions($db); - $somethingshown=$formactions->showactions($object,'project',$socid); + if (!empty($object->id)) + { + // List of actions on element + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; + $formactions=new FormActions($db); + $somethingshown=$formactions->showactions($object,'project',$socid); + } print '
'; }