From 68e42bc24e5817458445925bcbecf20839809be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Salvador?= Date: Mon, 6 Jan 2014 11:28:41 +0100 Subject: [PATCH 1/9] fixed wrong thumbnails directory --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 748388ff99c..ecb90bb66ce 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2946,7 +2946,7 @@ class Product extends CommonObject // Objet $obj=array(); $obj['photo']=$photo; - if ($photo_vignette && dol_is_file($dirthumb.$photo_vignette)) $obj['photo_vignette']=$dirthumb . $photo_vignette; + if ($photo_vignette && dol_is_file($dirthumb.$photo_vignette)) $obj['photo_vignette']='thumbs/' . $photo_vignette; else $obj['photo_vignette']=""; $tabobj[$nbphoto-1]=$obj; From c0c555b78f38496e954f75a77fc9cebec7ab4a11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Jan 2014 15:16:56 +0100 Subject: [PATCH 2/9] Fix: A lot of fix into sticker sheet dimension management. Fix: Size of font too large to print sticker pages. Conflicts: htdocs/core/modules/member/doc/pdf_standard.class.php htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php --- htdocs/core/lib/format_cards.lib.php | 76 ++++++++++--------- .../modules/member/doc/pdf_standard.class.php | 18 +++-- .../doc/pdf_standardlabel.class.php | 18 +++-- 3 files changed, 64 insertions(+), 48 deletions(-) diff --git a/htdocs/core/lib/format_cards.lib.php b/htdocs/core/lib/format_cards.lib.php index 5f18cb1a976..e45ff13be59 100644 --- a/htdocs/core/lib/format_cards.lib.php +++ b/htdocs/core/lib/format_cards.lib.php @@ -27,56 +27,59 @@ global $_Avery_Labels; - +// Unit of metric are defined into field 'metric' in mm. +// To get into inch, just /25.4 +// Size of pages available on: http://www.worldlabel.com/Pages/pageaverylabels.htm +// _PosX = marginLeft+(_COUNTX*(width+SpaceX)); $_Avery_Labels = array ( - '5160'=>array('name'=>'5160 (Letter)', + '5160'=>array('name'=>'Avery-5160, WL-875WX', 'paper-size'=>'letter', 'metric'=>'mm', - 'marginLeft'=>1.762, - 'marginTop'=>10.7, + 'marginLeft'=>5.58165, // 0.21975 inch + 'marginTop'=>12.7, // 0.5 inch 'NX'=>3, 'NY'=>10, - 'SpaceX'=>3.175, + 'SpaceX'=>3.556, // 0.14 inch 'SpaceY'=>0, - 'width'=>66.675, - 'height'=>25.4, - 'font-size'=>8), - '5161'=>array('name'=>'5161 (Letter)', + 'width'=>65.8749, // 2.59350 inch + 'height'=>25.4, // 1 inch + 'font-size'=>7), + '5161'=>array('name'=>'Avery-5161, WL-75WX', 'paper-size'=>'letter', 'metric'=>'mm', - 'marginLeft'=>0.967, - 'marginTop'=>10.7, + 'marginLeft'=>4.445, // 0.175 inch + 'marginTop'=>12.7, 'NX'=>2, 'NY'=>10, - 'SpaceX'=>3.967, + 'SpaceX'=>3.968, // 0.15625 inch 'SpaceY'=>0, - 'width'=>101.6, - 'height'=>25.4, - 'font-size'=>8), - '5162'=>array('name'=>'5162 (Letter)', + 'width'=>101.6, // 4 inch + 'height'=>25.4, // 1 inch + 'font-size'=>7), + '5162'=>array('name'=>'Avery-5162, WL-100WX', 'paper-size'=>'letter', 'metric'=>'mm', - 'marginLeft'=>0.97, - 'marginTop'=>20.224, + 'marginLeft'=>3.8735, // 0.1525 inch + 'marginTop'=>22.352, // 0.88 inch 'NX'=>2, 'NY'=>7, - 'SpaceX'=>4.762, + 'SpaceX'=>4.954, // 0.195 inch 'SpaceY'=>0, - 'width'=>100.807, - 'height'=>35.72, + 'width'=>101.6, // 4 inch + 'height'=>33.781, // 1.33 inch 'font-size'=>8), - '5163'=>array('name'=>'5163 (Letter)', + '5163'=>array('name'=>'Avery-5163, WL-125WX', 'paper-size'=>'letter', 'metric'=>'mm', - 'marginLeft'=>1.762, - 'marginTop'=>10.7, + 'marginLeft'=>4.572, // 0.18 inch + 'marginTop'=>12.7, // 0.5 inch 'NX'=>2, 'NY'=>5, - 'SpaceX'=>3.175, + 'SpaceX'=>3.556, // 0.14 inch 'SpaceY'=>0, - 'width'=>101.6, - 'height'=>50.8, - 'font-size'=>8), + 'width'=>101.6, // 4 inch + 'height'=>50.8, // 2 inch + 'font-size'=>10), /* Bugged '5164'=>array('name'=>'5164 (Letter)', 'paper-size'=>'letter', 'metric'=>'in', @@ -89,7 +92,7 @@ $_Avery_Labels = array ( 'width'=>4.0, 'height'=>3.33, 'font-size'=>12), */ - '8600'=>array('name'=>'8600 (Letter)', + '8600'=>array('name'=>'Avery-8600', 'paper-size'=>'letter', 'metric'=>'mm', 'marginLeft'=>7.1, @@ -100,8 +103,8 @@ $_Avery_Labels = array ( 'SpaceY'=>3.1, 'width'=>66.6, 'height'=>25.4, - 'font-size'=>8), - 'L7163'=>array('name'=>'L7163 (A4)', + 'font-size'=>7), + 'L7163'=>array('name'=>'Avery-L7163', 'paper-size'=>'A4', 'metric'=>'mm', 'marginLeft'=>5, @@ -112,8 +115,9 @@ $_Avery_Labels = array ( 'SpaceY'=>0, 'width'=>99.1, 'height'=>38.1, - 'font-size'=>10), - 'AVERYC32010'=>array('name'=>'AVERY-C32010 (A4)', + 'font-size'=>8), + // 85.0 x 54.0 mm + 'AVERYC32010'=>array('name'=>'Avery-C32010', 'paper-size'=>'A4', 'metric'=>'mm', 'marginLeft'=>15, @@ -125,7 +129,7 @@ $_Avery_Labels = array ( 'width'=>85, 'height'=>54, 'font-size'=>10), - 'CARD'=>array('name'=>'Dolibarr Business cards (A4)', + 'CARD'=>array('name'=>'Dolibarr Business cards', 'paper-size'=>'A4', 'metric'=>'mm', 'marginLeft'=>15, @@ -139,5 +143,9 @@ $_Avery_Labels = array ( 'font-size'=>10) ); +foreach($_Avery_Labels as $key => $val) +{ + $_Avery_Labels[$key]['name'].=' ('.$_Avery_Labels[$key]['paper-size'].' - '.$_Avery_Labels[$key]['NX'].'x'.$_Avery_Labels[$key]['NY'].')'; +} ?> \ No newline at end of file diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 00aba591add..4f8e909d2b1 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -114,7 +114,9 @@ class pdf_standard /** - * On imprime une etiquette + * Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0) + * - %LOGO% is replace with company logo + * - %PHOTO% is replace with photo provided as parameter * * @param PDF &$pdf PDF * @param string $textleft Textleft @@ -184,25 +186,27 @@ class pdf_standard $pdf->image($backgroundimage,$_PosX,$_PosY,$this->_Width,$this->_Height); } + $xleft=2; $ytop=2; + // Top if ($header!='') { if ($this->code == "CARD") { $pdf->SetDrawColor(128,128,128); - $pdf->Line($_PosX, $_PosY+$this->_Line_Height+1, $_PosX+$this->_Width, $_PosY+$this->_Line_Height+1); + $pdf->Line($_PosX, $_PosY+$this->_Line_Height+1, $_PosX+$this->_Width, $_PosY+$this->_Line_Height+1); // Only 1 mm and not ytop for top text $pdf->SetDrawColor(0,0,0); } - $pdf->SetXY($_PosX, $_PosY+1); - $pdf->Cell($this->_Width, $this->_Line_Height, $outputlangs->convToOutputCharset($header),0,1,'C'); + $pdf->SetXY($_PosX+$xleft, $_PosY+1); // Only 1 mm and not ytop for top text + $pdf->Cell($this->_Width-2*$xleft, $this->_Line_Height, $outputlangs->convToOutputCharset($header),0,1,'C'); } - $xleft=2; $ytop=2+(empty($header)?0:1+$this->_Line_Height); - $maxwidthtouse=round(($this->_Width - 2*$xleft)*$imgscalewidth); $maxheighttouse=round(($this->_Height - 2*$ytop)*$imgscaleheight); - $defaultratio=($maxwidthtouse/$maxheighttouse); + $ytop+=(empty($header)?0:(1+$this->_Line_Height)); // Define widthtouse and heighttouse + $maxwidthtouse=round(($this->_Width - 2*$xleft)*$imgscalewidth); $maxheighttouse=round(($this->_Height - 2*$ytop)*$imgscaleheight); + $defaultratio=($maxwidthtouse/$maxheighttouse); $widthtouse=$maxwidthtouse; $heighttouse=0; // old value for image $tmp=dol_getImageSize($photo, false); if ($tmp['height']) diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index c05f168d2a8..9c6d1eb3353 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -113,7 +113,9 @@ class pdf_standardlabel } /** - * On imprime une etiquette + * Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0) + * - %LOGO% is replace with company logo + * - %PHOTO% is replace with photo provided as parameter * * @param PDF &$pdf PDF * @param string $textleft Text left @@ -172,25 +174,27 @@ class pdf_standardlabel $pdf->image($backgroundimage,$_PosX,$_PosY,$this->_Width,$this->_Height); } + $xleft=2; $ytop=2; + // Top if ($header!='') { if ($this->code == "CARD") { $pdf->SetDrawColor(128,128,128); - $pdf->Line($_PosX, $_PosY+$this->_Line_Height+1, $_PosX+$this->_Width, $_PosY+$this->_Line_Height+1); + $pdf->Line($_PosX, $_PosY+$this->_Line_Height+1, $_PosX+$this->_Width, $_PosY+$this->_Line_Height+1); // Only 1 mm and not ytop for top text $pdf->SetDrawColor(0,0,0); } - $pdf->SetXY($_PosX, $_PosY+1); - $pdf->Cell($this->_Width, $this->_Line_Height, $outputlangs->convToOutputCharset($header),0,1,'C'); + $pdf->SetXY($_PosX+$xleft, $_PosY+1); // Only 1 mm and not ytop for top text + $pdf->Cell($this->_Width-2*$xleft, $this->_Line_Height, $outputlangs->convToOutputCharset($header),0,1,'C'); } - $xleft=2; $ytop=2+(empty($header)?0:1+$this->_Line_Height); - $maxwidthtouse=round(($this->_Width - 2*$xleft)*$imgscalewidth); $maxheighttouse=round(($this->_Height - 2*$ytop)*$imgscaleheight); - $defaultratio=($maxwidthtouse/$maxheighttouse); + $ytop+=(empty($header)?0:(1+$this->_Line_Height)); // Define widthtouse and heighttouse + $maxwidthtouse=round(($this->_Width - 2*$xleft)*$imgscalewidth); $maxheighttouse=round(($this->_Height - 2*$ytop)*$imgscaleheight); + $defaultratio=($maxwidthtouse/$maxheighttouse); $widthtouse=$maxwidthtouse; $heighttouse=0; // old value for image $tmp=dol_getImageSize($photo, false); if ($tmp['height']) From 63ecb859d62aafa03f15f8e2e88b0ef09b9c30a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Jan 2014 20:40:30 +0100 Subject: [PATCH 3/9] Fix: Missing alias befofe field into sql request and removed bad join on table making some record to disappear. --- htdocs/comm/action/index.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index c97b841e3a1..f3b4f5e1d5e 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -312,11 +312,9 @@ $sql.= ' a.priority, a.fulldayevent, a.location,'; $sql.= ' a.fk_soc, a.fk_contact,'; $sql.= ' ca.code'; $sql.= ' FROM ('.MAIN_DB_PREFIX.'c_actioncomm as ca,'; -$sql.= " ".MAIN_DB_PREFIX.'user as u,'; $sql.= " ".MAIN_DB_PREFIX."actioncomm as a)"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; $sql.= ' WHERE a.fk_action = ca.id'; -$sql.= ' AND a.fk_user_author = u.rowid'; $sql.= ' AND a.entity IN ('.getEntity().')'; if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'"; if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); @@ -325,28 +323,28 @@ if ($user->societe_id) $sql.= ' AND a.fk_soc = '.$user->societe_id; // To limit if ($action == 'show_day') { $sql.= " AND ("; - $sql.= " (datep BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,$day,$year))."'"; + $sql.= " (a.datep BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,$day,$year))."'"; $sql.= " AND '".$db->idate(dol_mktime(23,59,59,$month,$day,$year))."')"; $sql.= " OR "; - $sql.= " (datep2 BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,$day,$year))."'"; + $sql.= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,$day,$year))."'"; $sql.= " AND '".$db->idate(dol_mktime(23,59,59,$month,$day,$year))."')"; $sql.= " OR "; - $sql.= " (datep < '".$db->idate(dol_mktime(0,0,0,$month,$day,$year))."'"; - $sql.= " AND datep2 > '".$db->idate(dol_mktime(23,59,59,$month,$day,$year))."')"; + $sql.= " (a.datep < '".$db->idate(dol_mktime(0,0,0,$month,$day,$year))."'"; + $sql.= " AND a.datep2 > '".$db->idate(dol_mktime(23,59,59,$month,$day,$year))."')"; $sql.= ')'; } else { // To limit array $sql.= " AND ("; - $sql.= " (datep BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; // Start 7 days before + $sql.= " (a.datep BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; // Start 7 days before $sql.= " AND '".$db->idate(dol_mktime(23,59,59,$month,28,$year)+(60*60*24*10))."')"; // End 7 days after + 3 to go from 28 to 31 $sql.= " OR "; - $sql.= " (datep2 BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; + $sql.= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; $sql.= " AND '".$db->idate(dol_mktime(23,59,59,$month,28,$year)+(60*60*24*10))."')"; $sql.= " OR "; - $sql.= " (datep < '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; - $sql.= " AND datep2 > '".$db->idate(dol_mktime(23,59,59,$month,28,$year)+(60*60*24*10))."')"; + $sql.= " (a.datep < '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; + $sql.= " AND a.datep2 > '".$db->idate(dol_mktime(23,59,59,$month,28,$year)+(60*60*24*10))."')"; $sql.= ')'; } if ($type) $sql.= " AND ca.id = ".$type; @@ -1012,7 +1010,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa // Must defined rule to choose color of who to use. // event->usertodo->id will still contains user id of owner // event->userstodo will be an array in future. - // $color=$user->color; + // $color=$user->color; } else if ($event->type_code == 'ICALEVENT') { From e959568a1d75dae9f1d3acc96b7074ac781510fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Salvador?= Date: Wed, 8 Jan 2014 17:06:52 +0100 Subject: [PATCH 4/9] Added details to the contact created by create_individual --- htdocs/societe/class/societe.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 664be4b9a05..941a5445ff1 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -306,6 +306,12 @@ class Societe extends CommonObject $contact->socid = $this->id; // fk_soc $contact->statut = 1; $contact->priv = 0; + $contact->country_id = $this->country_id; + $contact->address = $this->address; + $contact->email = $this->email; + $contact->zip = $this->zip; + $contact->town = $this->town; + $contact->phone_pro = $this->phone; $result = $contact->create($user); if ($result < 0) { $this->error = $contact->error; From 2c310e26a6d769a14c2d23218972e8c4497fbf56 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Jan 2014 01:37:41 +0100 Subject: [PATCH 5/9] Fix: Missing lang file --- htdocs/fourn/facture/fiche.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 7402272fe73..21883b8ede6 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -50,9 +50,11 @@ if (!empty($conf->projet->enabled)) { $langs->load('bills'); +$langs->load('compta'); $langs->load('suppliers'); $langs->load('companies'); $langs->load('products'); +$langs->load('banks'); $mesg=''; $errors=array(); From 28204d66b1046ff8a5c62b87bd1955495689e4e2 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 10 Jan 2014 10:35:42 +0100 Subject: [PATCH 6/9] Update modFacture.class.php remplace price by subprice on export invoice --- htdocs/core/modules/modFacture.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 4e88c561306..76647f4a1b5 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -178,10 +178,10 @@ class modFacture extends DolibarrModules $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // 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_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.special_code'=>'SpecialCode','fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancyBuyCode'); + $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",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.subprice'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.special_code'=>'SpecialCode','fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancyBuyCode'); //$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.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); - $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.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.special_code'=>'Numeric','fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text'); - $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",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.special_code'=>'invoice_line','fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_sell'=>'product'); + $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.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.subprice'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.special_code'=>'Numeric','fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text'); + $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",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.subprice'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.special_code'=>'invoice_line','fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_sell'=>'product'); $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.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 ffeb2778e59de27d891026b004015373cde8f97f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Jan 2014 19:23:36 +0100 Subject: [PATCH 7/9] Fix: path to image must not be hardcoded but use dol_buildpath or img_picto with param src=1. --- htdocs/fourn/facture/impayees.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index 87c3c7e6dc8..f7d62f8692e 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -217,7 +217,7 @@ if ($user->rights->fournisseur->facture->lire) print ''; print ''; print ''; - print ''; + print ''; print ''; print "\n"; From 4d298b1891d4e2036a50539529b326b56096e425 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Jan 2014 20:02:41 +0100 Subject: [PATCH 8/9] Update code comments and add log warning to help debug --- htdocs/core/class/conf.class.php | 12 ++++++++---- htdocs/main.inc.php | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 64dd4c8b9fa..903694128f9 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -156,15 +156,19 @@ class Conf if ($value && preg_match('/^MAIN_MODULE_/',$key)) { - // If this is constant for a new tab page activated by a module. + // If this is constant for a new tab page activated by a module. It initializes modules_parts['tabs']. if (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i',$key)) { $partname = 'tabs'; $params=explode(':',$value,2); if (! isset($this->modules_parts[$partname]) || ! is_array($this->modules_parts[$partname])) { $this->modules_parts[$partname] = array(); } - $this->modules_parts[$partname][$params[0]][]=$value; + $this->modules_parts[$partname][$params[0]][]=$value; // $value may be a string or an array } - // If this is constant for all generic part activated by a module + // If this is constant for all generic part activated by a module. It initializes + // modules_parts['login'], modules_parts['menus'], modules_parts['substitutions'], modules_parts['triggers'], modules_parts['tpl'], + // modules_parts['models'], modules_parts['theme'] + // modules_parts['sms'], + // modules_parts['css'], ... elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i',$key,$reg)) { $modulename = strtolower($reg[1]); @@ -176,7 +180,7 @@ class Conf else if (in_array($partname,array('models','theme'))) $value = '/'.$modulename.'/'; else if (in_array($partname,array('sms'))) $value = $modulename; else if ($value == 1) $value = '/'.$modulename.'/core/modules/'.$partname.'/'; // ex: partname = societe - $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value)); + $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value)); // $value may be a string or an array } // If this is a module constant (must be at end) elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)$/i',$key,$reg)) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index e8342224c4b..d931eb526f3 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1047,6 +1047,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs $filescss=(array) $filescss; // To be sure filecss is an array foreach($filescss as $cssfile) { + if (empty($cssfile)) dol_syslog("Warning: module ".$modcss." declared a css path file into its descriptor that is empty.", LOG_WARNING); // cssfile is a relative path print ''."\n".''."\n"; From 0f329e72efb871dc9f1bf1ca759a9d421f8a57c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Jan 2014 20:22:35 +0100 Subject: [PATCH 9/9] Fix: MAIN_FORCETHEME was not working when user set its own theme --- htdocs/main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d931eb526f3..9e48cb25812 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -680,8 +680,8 @@ if (! defined('NOLOGIN')) if (isset($user->conf->MAIN_SIZE_LISTE_LIMIT)) $conf->liste_limit = $user->conf->MAIN_SIZE_LISTE_LIMIT; // Can be 0 if (isset($user->conf->PRODUIT_LIMIT_SIZE)) $conf->product->limit_size = $user->conf->PRODUIT_LIMIT_SIZE; // Can be 0 - // Replace conf->css by personalized value - if (isset($user->conf->MAIN_THEME) && $user->conf->MAIN_THEME) + // Replace conf->css by personalized value if theme not forced + if (empty($conf->global->MAIN_FORCETHEME) && ! empty($user->conf->MAIN_THEME)) { $conf->theme=$user->conf->MAIN_THEME; $conf->css = "/theme/".$conf->theme."/style.css.php";