Skip to content

Commit 75590f1

Browse files
authored
Merge pull request #33078 from hregis/fix_20_sql_order_twice
FIX wrong ODT path for multicompany
2 parents 909fa44 + 9ebbf5b commit 75590f1

14 files changed

+34
-34
lines changed

htdocs/core/modules/modAdherent.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function __construct($db)
182182

183183
$this->const[$r][0] = "MEMBER_ADDON_PDF_ODT_PATH";
184184
$this->const[$r][1] = "chaine";
185-
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/members";
185+
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/members";
186186
$this->const[$r][3] = "";
187187
$this->const[$r][4] = 0;
188188
$r++;
@@ -438,8 +438,8 @@ public function init($options = '')
438438

439439
// ODT template
440440
/*
441-
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/orders/template_order.odt';
442-
$dirodt=DOL_DATA_ROOT.'/doctemplates/orders';
441+
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/members/template_member.odt';
442+
$dirodt=DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/members';
443443
$dest=$dirodt.'/template_order.odt';
444444
445445
if (file_exists($src) && ! file_exists($dest)) {

htdocs/core/modules/modBom.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function __construct($db)
127127
$this->const = array(
128128
1 => array('BOM_ADDON_PDF', 'chaine', 'generic_bom_odt', 'Name of PDF model of BOM', 0),
129129
2 => array('BOM_ADDON', 'chaine', 'mod_bom_standard', 'Name of numbering rules of BOM', 0),
130-
3 => array('BOM_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT/doctemplates/boms', '', 0)
130+
3 => array('BOM_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT'.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/boms', '', 0)
131131
);
132132

133133
// Some keys to add into the overwriting translation tables
@@ -479,7 +479,7 @@ public function init($options = '')
479479

480480
// ODT template
481481
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/boms/template_bom.odt';
482-
$dirodt = DOL_DATA_ROOT.'/doctemplates/boms';
482+
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/boms';
483483
$dest = $dirodt.'/template_bom.odt';
484484

485485
if (file_exists($src) && !file_exists($dest)) {

htdocs/core/modules/modContrat.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function __construct($db)
8787

8888
$this->const[$r][0] = "CONTRACT_ADDON_PDF_ODT_PATH";
8989
$this->const[$r][1] = "chaine";
90-
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/contracts";
90+
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/contracts";
9191
$this->const[$r][3] = "";
9292
$this->const[$r][4] = 0;
9393
$r++;
@@ -230,7 +230,7 @@ public function init($options = '')
230230

231231
//ODT template
232232
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/contracts/template_contract.odt';
233-
$dirodt = DOL_DATA_ROOT.'/doctemplates/contracts';
233+
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/contracts';
234234
$dest = $dirodt.'/template_contract.odt';
235235

236236
if (file_exists($src) && !file_exists($dest)) {

htdocs/core/modules/modExpedition.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function __construct($db)
9999

100100
$this->const[$r][0] = "EXPEDITION_ADDON_PDF_ODT_PATH";
101101
$this->const[$r][1] = "chaine";
102-
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/shipments";
102+
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/shipments";
103103
$this->const[$r][3] = "";
104104
$this->const[$r][4] = 0;
105105
$r++;
@@ -120,7 +120,7 @@ public function __construct($db)
120120

121121
$this->const[$r][0] = "DELIVERY_ADDON_PDF_ODT_PATH";
122122
$this->const[$r][1] = "chaine";
123-
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/deliveries";
123+
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/deliveries";
124124
$this->const[$r][3] = "";
125125
$this->const[$r][4] = 0;
126126
$r++;
@@ -343,7 +343,7 @@ public function init($options = '')
343343

344344
//ODT template
345345
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/shipments/template_shipment.odt';
346-
$dirodt = DOL_DATA_ROOT.'/doctemplates/shipments';
346+
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/shipments';
347347
$dest = $dirodt.'/template_shipment.odt';
348348

349349
if (file_exists($src) && !file_exists($dest)) {

htdocs/core/modules/modFournisseur.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ public function __construct($db)
117117
// Add ability ODT for Supplier orders
118118
$this->const[$r][0] = "SUPPLIER_ORDER_ADDON_PDF_ODT_PATH";
119119
$this->const[$r][1] = "chaine";
120-
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/supplier_orders";
120+
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/supplier_orders";
121121
$this->const[$r][3] = '';
122122
$this->const[$r][4] = 0;
123123
$r++;
124124

125125
// Add ability ODT for Supplier Invoices
126126
$this->const[$r][0] = "SUPPLIER_INVOICE_ADDON_PDF_ODT_PATH";
127127
$this->const[$r][1] = "chaine";
128-
$this->const[$r][2] = "";
128+
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/supplier_invoices";
129129
$this->const[$r][3] = "";
130130
$this->const[$r][4] = 0;
131131
$r++;
@@ -972,7 +972,7 @@ public function init($options = '')
972972

973973
//ODT template for Supplier Orders
974974
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_orders/template_supplier_order.odt';
975-
$dirodt = DOL_DATA_ROOT.'/doctemplates/supplier_orders';
975+
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/supplier_orders';
976976
$dest = $dirodt.'/template_supplier_order.odt';
977977

978978
if (file_exists($src) && !file_exists($dest)) {
@@ -993,7 +993,7 @@ public function init($options = '')
993993

994994
//ODT template for Supplier Invoice
995995
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_invoices/template_supplier_invoices.odt';
996-
$dirodt = DOL_DATA_ROOT.'/doctemplates/supplier_invoices';
996+
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/supplier_invoices';
997997
$dest = $dirodt.'/template_supplier_invoices.odt';
998998

999999
if (file_exists($src) && !file_exists($dest)) {

htdocs/core/modules/modHoliday.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function __construct($db)
111111

112112
$this->const[$r][0] = "HOLIDAY_ADDON_PDF_ODT_PATH";
113113
$this->const[$r][1] = "chaine";
114-
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/holiday";
114+
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/holiday";
115115
$this->const[$r][3] = "";
116116
$this->const[$r][4] = 0;
117117
$r++;
@@ -308,7 +308,7 @@ public function init($options = '')
308308

309309
//ODT template
310310
/*$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/holiday/template_holiday.odt';
311-
$dirodt=DOL_DATA_ROOT.'/doctemplates/holiday';
311+
$dirodt=DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/holiday';
312312
$dest=$dirodt.'/template_order.odt';
313313
314314
if (file_exists($src) && ! file_exists($dest))

htdocs/core/modules/modMrp.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function __construct($db)
138138
$this->const = array(
139139
//1=>array('MRP_MO_ADDON_PDF', 'chaine', 'vinci', 'Name of default PDF model of MO', 0),
140140
2=>array('MRP_MO_ADDON', 'chaine', 'mod_mo_standard', 'Name of numbering rules of MO', 0),
141-
3=>array('MRP_MO_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT/doctemplates/mrps', '', 0)
141+
3=>array('MRP_MO_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT'.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/mrps', '', 0)
142142
);
143143

144144
// Some keys to add into the overwriting translation tables
@@ -442,7 +442,7 @@ public function init($options = '')
442442

443443
// ODT template
444444
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/mrps/template_mo.odt';
445-
$dirodt = DOL_DATA_ROOT.'/doctemplates/mrps';
445+
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/mrps';
446446
$dest = $dirodt.'/template_mo.odt';
447447

448448
if (file_exists($src) && !file_exists($dest)) {

htdocs/core/modules/modProjet.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function __construct($db)
9292

9393
$this->const[$r][0] = "PROJECT_ADDON_PDF_ODT_PATH";
9494
$this->const[$r][1] = "chaine";
95-
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/projects";
95+
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/projects";
9696
$this->const[$r][3] = "";
9797
$this->const[$r][4] = 0;
9898
$r++;
@@ -113,7 +113,7 @@ public function __construct($db)
113113

114114
$this->const[$r][0] = "PROJECT_TASK_ADDON_PDF_ODT_PATH";
115115
$this->const[$r][1] = "chaine";
116-
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/tasks";
116+
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/tasks";
117117
$this->const[$r][3] = "";
118118
$this->const[$r][4] = 0;
119119
$r++;
@@ -379,7 +379,7 @@ public function init($options = '')
379379

380380
//ODT template for project
381381
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/projects/template_project.odt';
382-
$dirodt = DOL_DATA_ROOT.'/doctemplates/projects';
382+
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/projects';
383383
$dest = $dirodt.'/template_project.odt';
384384

385385
if (file_exists($src) && !file_exists($dest)) {
@@ -395,7 +395,7 @@ public function init($options = '')
395395

396396
//ODT template for tasks
397397
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/tasks/template_task_summary.odt';
398-
$dirodt = DOL_DATA_ROOT.'/doctemplates/tasks';
398+
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/tasks';
399399
$dest = $dirodt.'/template_task_summary.odt';
400400

401401
if (file_exists($src) && !file_exists($dest)) {

htdocs/core/modules/modReception.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function __construct($db)
9191

9292
$this->const[$r][0] = "RECEPTION_ADDON_PDF_ODT_PATH";
9393
$this->const[$r][1] = "chaine";
94-
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/receptions";
94+
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/receptions";
9595
$this->const[$r][3] = "";
9696
$this->const[$r][4] = 0;
9797
$r++;
@@ -266,7 +266,7 @@ public function init($options = '')
266266

267267
//ODT template
268268
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/reception/template_reception.odt';
269-
$dirodt = DOL_DATA_ROOT.'/doctemplates/reception';
269+
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/reception';
270270
$dest = $dirodt.'/template_reception.odt';
271271

272272
if (file_exists($src) && !file_exists($dest)) {

htdocs/core/modules/modSociete.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function __construct($db)
101101

102102
$this->const[$r][0] = "COMPANY_ADDON_PDF_ODT_PATH";
103103
$this->const[$r][1] = "chaine";
104-
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/thirdparties";
104+
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/thirdparties";
105105
$this->const[$r][3] = "";
106106
$this->const[$r][4] = 0;
107107
$r++;
@@ -947,7 +947,7 @@ public function init($options = '')
947947

948948
//ODT template
949949
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/thirdparties/template_thirdparty.odt';
950-
$dirodt = DOL_DATA_ROOT.'/doctemplates/thirdparties';
950+
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/thirdparties';
951951
$dest = $dirodt.'/template_thirdparty.odt';
952952

953953
if (file_exists($src) && !file_exists($dest)) {

0 commit comments

Comments
 (0)