@@ -221,11 +221,11 @@ discard block |
||
221 | 221 | unset($object->barcode_type_code); |
222 | 222 | unset($object->barcode_type_label); |
223 | 223 | |
224 | - unset($object->mode_reglement); // We use mode_reglement_id now |
|
225 | - unset($object->cond_reglement); // We use cond_reglement_id now |
|
226 | - unset($object->note); // We use note_public or note_private now |
|
227 | - unset($object->contact); // We use contact_id now |
|
228 | - unset($object->thirdparty); // We use thirdparty_id or fk_soc or socid now |
|
224 | + unset($object->mode_reglement); // We use mode_reglement_id now |
|
225 | + unset($object->cond_reglement); // We use cond_reglement_id now |
|
226 | + unset($object->note); // We use note_public or note_private now |
|
227 | + unset($object->contact); // We use contact_id now |
|
228 | + unset($object->thirdparty); // We use thirdparty_id or fk_soc or socid now |
|
229 | 229 | |
230 | 230 | unset($object->project); // Should be fk_project |
231 | 231 | unset($object->fk_projet); // Should be fk_project |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | |
289 | 289 | unset($object->prefix_comm); |
290 | 290 | |
291 | - if (!isset($object->table_element) || ! in_array($object->table_element, array('expensereport_det', 'ticket'))) { |
|
291 | + if (!isset($object->table_element) || !in_array($object->table_element, array('expensereport_det', 'ticket'))) { |
|
292 | 292 | unset($object->comments); |
293 | 293 | } |
294 | 294 |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | print '<td class="center tdlastresultcode" title="'.dol_escape_htmltag($obj->lastresult).'">'; |
687 | 687 | if ($obj->lastresult != '') { |
688 | 688 | if (empty($obj->lastresult) || $obj->status == Cronjob::STATUS_DISABLED) { |
689 | - print $obj->lastresult; // Print '0' |
|
689 | + print $obj->lastresult; // Print '0' |
|
690 | 690 | } else { |
691 | 691 | print '<span class="error">'.dol_escape_htmltag(dol_trunc($obj->lastresult)).'</div>'; |
692 | 692 | } |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | if ($user->hasRight('cron', 'execute')) { |
745 | 745 | if (!empty($obj->status)) { |
746 | 746 | print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=execute&token='.newToken(); |
747 | - print(!getDolGlobalString('CRON_KEY') ? '' : '&securitykey=' . getDolGlobalString('CRON_KEY')); |
|
747 | + print(!getDolGlobalString('CRON_KEY') ? '' : '&securitykey='.getDolGlobalString('CRON_KEY')); |
|
748 | 748 | print($sortfield ? '&sortfield='.$sortfield : ''); |
749 | 749 | print($sortorder ? '&sortorder='.$sortorder : ''); |
750 | 750 | print $param."\" title=\"".dol_escape_htmltag($langs->trans('CronExecute'))."\">".img_picto($langs->trans('CronExecute'), "play", '', 0, 0, 0, '', 'marginleftonly').'</a>'; |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | $this->titre = $obj->title; // deprecated |
686 | 686 | $this->title = $obj->title; |
687 | 687 | $this->ref = $obj->title; |
688 | - $this->subtype = $obj->subtype; |
|
688 | + $this->subtype = $obj->subtype; |
|
689 | 689 | $this->suspended = $obj->suspended; |
690 | 690 | $this->total_ht = $obj->total_ht; |
691 | 691 | $this->total_tva = $obj->total_tva; |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | //$this->special_code = $obj->special_code; |
712 | 712 | $this->frequency = $obj->frequency; |
713 | 713 | $this->unit_frequency = $obj->unit_frequency; |
714 | - $this->rule_for_lines_dates = $obj->rule_for_lines_dates; |
|
714 | + $this->rule_for_lines_dates = $obj->rule_for_lines_dates; |
|
715 | 715 | $this->date_when = $this->db->jdate($obj->date_when); |
716 | 716 | $this->date_last_gen = $this->db->jdate($obj->date_last_gen); |
717 | 717 | $this->nb_gen_done = $obj->nb_gen_done; |
@@ -805,35 +805,35 @@ discard block |
||
805 | 805 | $objp = $this->db->fetch_object($result); |
806 | 806 | $line = new FactureLigneRec($this->db); |
807 | 807 | |
808 | - $line->id = $objp->rowid; |
|
808 | + $line->id = $objp->rowid; |
|
809 | 809 | $line->rowid = $objp->rowid; |
810 | - $line->fk_facture = $objp->fk_facture; |
|
811 | - $line->fk_parent_line = $objp->fk_parent_line; |
|
810 | + $line->fk_facture = $objp->fk_facture; |
|
811 | + $line->fk_parent_line = $objp->fk_parent_line; |
|
812 | 812 | $line->desc = $objp->description; // Description line |
813 | 813 | $line->description = $objp->description; // Description line |
814 | - $line->ref = $objp->product_ref; // Ref product |
|
814 | + $line->ref = $objp->product_ref; // Ref product |
|
815 | 815 | $line->product_ref = $objp->product_ref; // Ref product |
816 | - $line->libelle = $objp->product_label; // deprecated |
|
816 | + $line->libelle = $objp->product_label; // deprecated |
|
817 | 817 | $line->product_label = $objp->product_label; // Label product |
818 | 818 | $line->product_desc = $objp->product_desc; // Description product |
819 | 819 | $line->product_type = $objp->product_type; // Type of line |
820 | - $line->fk_product_type = $objp->fk_product_type; // Type of product |
|
820 | + $line->fk_product_type = $objp->fk_product_type; // Type of product |
|
821 | 821 | $line->qty = $objp->qty; |
822 | - $line->subprice = $objp->subprice; |
|
822 | + $line->subprice = $objp->subprice; |
|
823 | 823 | |
824 | 824 | $line->label = $objp->custom_label; // @deprecated |
825 | 825 | |
826 | 826 | $line->vat_src_code = $objp->vat_src_code; |
827 | - $line->tva_tx = $objp->tva_tx; |
|
827 | + $line->tva_tx = $objp->tva_tx; |
|
828 | 828 | $line->localtax1_tx = $objp->localtax1_tx; |
829 | 829 | $line->localtax2_tx = $objp->localtax2_tx; |
830 | 830 | $line->localtax1_type = $objp->localtax1_type; |
831 | 831 | $line->localtax2_type = $objp->localtax2_type; |
832 | 832 | $line->remise_percent = $objp->remise_percent; |
833 | 833 | //$line->fk_remise_except = $objp->fk_remise_except; |
834 | - $line->fk_product = $objp->fk_product; |
|
835 | - $line->date_start_fill = $objp->date_start_fill; |
|
836 | - $line->date_end_fill = $objp->date_end_fill; |
|
834 | + $line->fk_product = $objp->fk_product; |
|
835 | + $line->date_start_fill = $objp->date_start_fill; |
|
836 | + $line->date_end_fill = $objp->date_end_fill; |
|
837 | 837 | $line->info_bits = $objp->info_bits; |
838 | 838 | $line->total_ht = $objp->total_ht; |
839 | 839 | $line->total_tva = $objp->total_tva; |
@@ -849,15 +849,15 @@ discard block |
||
849 | 849 | $line->marge_tx = (string) $marginInfos[1]; |
850 | 850 | $line->marque_tx = (string) $marginInfos[2]; |
851 | 851 | $line->rang = $objp->rang; |
852 | - $line->special_code = $objp->special_code; |
|
853 | - $line->fk_unit = $objp->fk_unit; |
|
854 | - $line->fk_contract_line = $objp->fk_contract_line; |
|
852 | + $line->special_code = $objp->special_code; |
|
853 | + $line->fk_unit = $objp->fk_unit; |
|
854 | + $line->fk_contract_line = $objp->fk_contract_line; |
|
855 | 855 | |
856 | 856 | $line->extraparams = !empty($objp->extraparams) ? (array) json_decode($objp->extraparams, true) : array(); |
857 | 857 | |
858 | 858 | // Ne plus utiliser |
859 | - $line->price = $objp->price; |
|
860 | - $line->remise = $objp->remise; |
|
859 | + $line->price = $objp->price; |
|
860 | + $line->remise = $objp->remise; |
|
861 | 861 | |
862 | 862 | $line->fetch_optionals(); |
863 | 863 | |
@@ -1451,7 +1451,7 @@ discard block |
||
1451 | 1451 | |
1452 | 1452 | $facture->type = self::TYPE_STANDARD; |
1453 | 1453 | $facture->subtype = $facturerec->subtype; |
1454 | - $facture->statut = self::STATUS_DRAFT; // deprecated |
|
1454 | + $facture->statut = self::STATUS_DRAFT; // deprecated |
|
1455 | 1455 | $facture->status = self::STATUS_DRAFT; |
1456 | 1456 | $facture->date = (empty($facturerec->date_when) ? $now : $facturerec->date_when); // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. |
1457 | 1457 | $facture->socid = $facturerec->socid; |
@@ -1610,7 +1610,7 @@ discard block |
||
1610 | 1610 | } |
1611 | 1611 | $result .= $linkend; |
1612 | 1612 | global $action; |
1613 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
1613 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
1614 | 1614 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
1615 | 1615 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
1616 | 1616 | if ($reshook > 0) { |
@@ -1869,7 +1869,7 @@ discard block |
||
1869 | 1869 | |
1870 | 1870 | if (empty($option) || $option != 'nolines') { |
1871 | 1871 | // Lines |
1872 | - $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
1872 | + $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
1873 | 1873 | $xnbp = 0; |
1874 | 1874 | while ($xnbp < $nbp) { |
1875 | 1875 | $line = new FactureLigne($this->db); |
@@ -2061,7 +2061,7 @@ discard block |
||
2061 | 2061 | $resSuspend = $this->setValueFrom('suspended', 1); |
2062 | 2062 | |
2063 | 2063 | if ($resSuspend <= 0) { |
2064 | - dol_syslog(__METHOD__ . '::setValueFrom Error : ' . $this->error, LOG_ERR); |
|
2064 | + dol_syslog(__METHOD__.'::setValueFrom Error : '.$this->error, LOG_ERR); |
|
2065 | 2065 | return -1; |
2066 | 2066 | } |
2067 | 2067 | } |
@@ -2401,9 +2401,9 @@ discard block |
||
2401 | 2401 | if ($result) { |
2402 | 2402 | $objp = $this->db->fetch_object($result); |
2403 | 2403 | |
2404 | - $this->id = $objp->rowid; |
|
2405 | - $this->fk_facture = $objp->fk_facture; |
|
2406 | - $this->fk_parent_line = $objp->fk_parent_line; |
|
2404 | + $this->id = $objp->rowid; |
|
2405 | + $this->fk_facture = $objp->fk_facture; |
|
2406 | + $this->fk_parent_line = $objp->fk_parent_line; |
|
2407 | 2407 | $this->label = $objp->custom_label; // Label line |
2408 | 2408 | $this->desc = $objp->description; // Description line |
2409 | 2409 | $this->description = $objp->description; // Description line |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * the Free Software Foundation. |
8 | 8 | */ |
9 | 9 | |
10 | -require_once __DIR__ . '/abstractdocument.controller.class.php'; |
|
10 | +require_once __DIR__.'/abstractdocument.controller.class.php'; |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * \file htdocs/webportal/controllers/shareddocuments.controller.class.php |
@@ -77,14 +77,14 @@ discard block |
||
77 | 77 | |
78 | 78 | // 1. Prepare data for this controller |
79 | 79 | $shared_dir_name = getDolGlobalString('WEBPORTAL_SHARED_DOCS_DIR', 'Documentscomptes'); |
80 | - $dir_ged_partage = $conf->ecm->dir_output . '/' . $shared_dir_name; |
|
81 | - $shared_dir_relative_path = 'ecm/' . $shared_dir_name; |
|
80 | + $dir_ged_partage = $conf->ecm->dir_output.'/'.$shared_dir_name; |
|
81 | + $shared_dir_relative_path = 'ecm/'.$shared_dir_name; |
|
82 | 82 | $fileList = dol_dir_list($dir_ged_partage, 'files', 0, '', '', 'date', SORT_DESC); |
83 | 83 | |
84 | 84 | // 2. Define the link builder function |
85 | 85 | /** @param array<string, mixed> $file */ |
86 | - $linkBuilder = function (array $file) use ($shared_dir_relative_path) { |
|
87 | - return DOL_URL_ROOT . '/document.php?modulepart=ecm&file=' . urlencode($shared_dir_relative_path . '/' . $file['name']); |
|
86 | + $linkBuilder = function(array $file) use ($shared_dir_relative_path) { |
|
87 | + return DOL_URL_ROOT.'/document.php?modulepart=ecm&file='.urlencode($shared_dir_relative_path.'/'.$file['name']); |
|
88 | 88 | }; |
89 | 89 | |
90 | 90 | // 3. Call the parent method to display the table |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | |
20 | 20 | |
21 | -require_once __DIR__ . '/abstractdocument.controller.class.php'; |
|
21 | +require_once __DIR__.'/abstractdocument.controller.class.php'; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * \file htdocs/webportal/controllers/documentlist.controller.class.php |
@@ -90,15 +90,15 @@ discard block |
||
90 | 90 | |
91 | 91 | if (!empty($thirdparty) && $thirdparty->id) { |
92 | 92 | // 1. Prepare data |
93 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; |
|
93 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; |
|
94 | 94 | $client_dir_name = dol_sanitizeFileName($thirdparty->ref); |
95 | - $dir_ged_tiers = $conf->societe->dir_output . '/' . $client_dir_name; |
|
95 | + $dir_ged_tiers = $conf->societe->dir_output.'/'.$client_dir_name; |
|
96 | 96 | $fileList = dol_dir_list($dir_ged_tiers, 'files', 0, '', '', 'date', SORT_DESC); |
97 | 97 | |
98 | 98 | // 2. Define the link builder function |
99 | 99 | /** @param array<string, mixed> $file */ |
100 | - $linkBuilder = function (array $file) use ($client_dir_name) { |
|
101 | - return DOL_URL_ROOT . '/document.php?modulepart=societe&attachment=1&file=' . urlencode($client_dir_name . '/' . $file['name']); |
|
100 | + $linkBuilder = function(array $file) use ($client_dir_name) { |
|
101 | + return DOL_URL_ROOT.'/document.php?modulepart=societe&attachment=1&file='.urlencode($client_dir_name.'/'.$file['name']); |
|
102 | 102 | }; |
103 | 103 | |
104 | 104 | // 3. Call the parent method to display the table |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * the Free Software Foundation. |
8 | 8 | */ |
9 | 9 | |
10 | -require_once __DIR__ . '/../class/controller.class.php'; |
|
10 | +require_once __DIR__.'/../class/controller.class.php'; |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * \file htdocs/webportal/controllers/abstractdocument.controller.class.php |
@@ -37,14 +37,14 @@ discard block |
||
37 | 37 | { |
38 | 38 | global $langs; |
39 | 39 | |
40 | - echo '<h2>' . htmlspecialchars($title) . '</h2>'; |
|
40 | + echo '<h2>'.htmlspecialchars($title).'</h2>'; |
|
41 | 41 | |
42 | 42 | if (is_array($fileList) && count($fileList) > 0) { |
43 | 43 | echo '<table class="table" width="100%">'; |
44 | 44 | echo '<thead><tr>'; |
45 | - echo '<th>' . $langs->trans('File') . '</th>'; |
|
46 | - echo '<th style="text-align: right; white-space: nowrap;">' . $langs->trans('Size') . '</th>'; |
|
47 | - echo '<th style="text-align: right; white-space: nowrap;">' . $langs->trans('DateM') . '</th>'; |
|
45 | + echo '<th>'.$langs->trans('File').'</th>'; |
|
46 | + echo '<th style="text-align: right; white-space: nowrap;">'.$langs->trans('Size').'</th>'; |
|
47 | + echo '<th style="text-align: right; white-space: nowrap;">'.$langs->trans('DateM').'</th>'; |
|
48 | 48 | echo '</tr></thead>'; |
49 | 49 | echo '<tbody>'; |
50 | 50 | |
@@ -53,15 +53,15 @@ discard block |
||
53 | 53 | $downloadLink = $linkBuilder($file); |
54 | 54 | |
55 | 55 | echo '<tr>'; |
56 | - echo '<td><a href="' . $downloadLink . '" target="_blank">' . htmlspecialchars($file['name']) . '</a></td>'; |
|
57 | - echo '<td style="text-align: right;">' . dol_print_size($file['size']) . '</td>'; |
|
58 | - echo '<td style="text-align: right;">' . dol_print_date($file['date'], 'dayhour') . '</td>'; |
|
56 | + echo '<td><a href="'.$downloadLink.'" target="_blank">'.htmlspecialchars($file['name']).'</a></td>'; |
|
57 | + echo '<td style="text-align: right;">'.dol_print_size($file['size']).'</td>'; |
|
58 | + echo '<td style="text-align: right;">'.dol_print_date($file['date'], 'dayhour').'</td>'; |
|
59 | 59 | echo '</tr>'; |
60 | 60 | } |
61 | 61 | |
62 | 62 | echo '</tbody></table>'; |
63 | 63 | } else { |
64 | - echo '<p>' . htmlspecialchars($noFileMessage) . '</p>'; |
|
64 | + echo '<p>'.htmlspecialchars($noFileMessage).'</p>'; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | echo '<br>'; |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * \brief File of context class for WebPortal |
24 | 24 | */ |
25 | 25 | |
26 | -require_once __DIR__ . '/controller.class.php'; |
|
27 | -require_once __DIR__ . '/webPortalTheme.class.php'; |
|
26 | +require_once __DIR__.'/controller.class.php'; |
|
27 | +require_once __DIR__.'/webPortalTheme.class.php'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Class Context |
@@ -183,16 +183,16 @@ discard block |
||
183 | 183 | |
184 | 184 | $this->db = $db; |
185 | 185 | |
186 | - $this->tplDir = __DIR__ . '/../'; |
|
186 | + $this->tplDir = __DIR__.'/../'; |
|
187 | 187 | |
188 | 188 | $this->getControllerUrl(); |
189 | 189 | |
190 | 190 | $this->topMenu = new stdClass(); |
191 | 191 | |
192 | - $this->tplPath = realpath(__DIR__ . '/../../public/webportal/tpl'); |
|
192 | + $this->tplPath = realpath(__DIR__.'/../../public/webportal/tpl'); |
|
193 | 193 | |
194 | 194 | $this->controller = GETPOST('controller', 'aZ09'); // for security, limited to 'aZ09' |
195 | - $this->action = GETPOST('action', 'aZ09');// for security, limited to 'aZ09' |
|
195 | + $this->action = GETPOST('action', 'aZ09'); // for security, limited to 'aZ09' |
|
196 | 196 | |
197 | 197 | if (empty($this->controller)) { |
198 | 198 | $this->controller = 'default'; |
@@ -234,21 +234,21 @@ discard block |
||
234 | 234 | { |
235 | 235 | global $hookmanager; |
236 | 236 | |
237 | - $defaultControllersPath = __DIR__ . '/../controllers/'; |
|
237 | + $defaultControllersPath = __DIR__.'/../controllers/'; |
|
238 | 238 | |
239 | 239 | // define controllers definition |
240 | - $this->addControllerDefinition('login', $defaultControllersPath . 'login.controller.class.php', 'LoginController'); |
|
241 | - $this->addControllerDefinition('default', $defaultControllersPath . 'default.controller.class.php', 'DefaultController'); |
|
242 | - $this->addControllerDefinition('document', $defaultControllersPath . 'document.controller.class.php', 'DocumentController'); |
|
243 | - $this->addControllerDefinition('propallist', $defaultControllersPath . 'propallist.controller.class.php', 'PropalListController'); |
|
244 | - $this->addControllerDefinition('orderlist', $defaultControllersPath . 'orderlist.controller.class.php', 'OrderListController'); |
|
245 | - $this->addControllerDefinition('invoicelist', $defaultControllersPath . 'invoicelist.controller.class.php', 'InvoiceListController'); |
|
246 | - $this->addControllerDefinition('membercard', $defaultControllersPath . 'membercard.controller.class.php', 'MemberCardController'); |
|
247 | - $this->addControllerDefinition('partnershipcard', $defaultControllersPath . 'partnershipcard.controller.class.php', 'PartnershipCardController'); |
|
240 | + $this->addControllerDefinition('login', $defaultControllersPath.'login.controller.class.php', 'LoginController'); |
|
241 | + $this->addControllerDefinition('default', $defaultControllersPath.'default.controller.class.php', 'DefaultController'); |
|
242 | + $this->addControllerDefinition('document', $defaultControllersPath.'document.controller.class.php', 'DocumentController'); |
|
243 | + $this->addControllerDefinition('propallist', $defaultControllersPath.'propallist.controller.class.php', 'PropalListController'); |
|
244 | + $this->addControllerDefinition('orderlist', $defaultControllersPath.'orderlist.controller.class.php', 'OrderListController'); |
|
245 | + $this->addControllerDefinition('invoicelist', $defaultControllersPath.'invoicelist.controller.class.php', 'InvoiceListController'); |
|
246 | + $this->addControllerDefinition('membercard', $defaultControllersPath.'membercard.controller.class.php', 'MemberCardController'); |
|
247 | + $this->addControllerDefinition('partnershipcard', $defaultControllersPath.'partnershipcard.controller.class.php', 'PartnershipCardController'); |
|
248 | 248 | //** below the addition of DocumentListController adding files by third party attached documents |
249 | - $this->addControllerDefinition('documentlist', $defaultControllersPath . 'documentlist.controller.class.php', 'DocumentListController'); |
|
249 | + $this->addControllerDefinition('documentlist', $defaultControllersPath.'documentlist.controller.class.php', 'DocumentListController'); |
|
250 | 250 | //** Below is the addition to the menu of the DocumentUtileController.class.php controller in order to share via the GED (documents) "Documentscomptes" |
251 | - $this->addControllerDefinition('documentutile', $defaultControllersPath . 'documentutile.controller.class.php', 'DocumentUtileController'); |
|
251 | + $this->addControllerDefinition('documentutile', $defaultControllersPath.'documentutile.controller.class.php', 'DocumentUtileController'); |
|
252 | 252 | |
253 | 253 | // Hooks for init controller |
254 | 254 | $hookmanager->initHooks(array('webportaldao')); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $length = strlen($needle); |
283 | 283 | $isControllerFile = $length > 0 ? substr($fileName, -$length) === $needle : true; |
284 | 284 | if (!$isControllerFile) { |
285 | - $this->setError('Error: controller definition ' . $fileName); |
|
285 | + $this->setError('Error: controller definition '.$fileName); |
|
286 | 286 | return false; |
287 | 287 | } |
288 | 288 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $rootUrl .= '/'; |
318 | 318 | } |
319 | 319 | } else { |
320 | - $rootUrl = dol_buildpath('/public/webportal/', 3); // Return the public URL for external access |
|
320 | + $rootUrl = dol_buildpath('/public/webportal/', 3); // Return the public URL for external access |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | return $rootUrl; |
@@ -402,9 +402,9 @@ discard block |
||
402 | 402 | if (!empty($Tparams)) { |
403 | 403 | $TCompiledAttr = array(); |
404 | 404 | foreach ($Tparams as $key => $value) { |
405 | - $TCompiledAttr[] = $key . '=' . $value; |
|
405 | + $TCompiledAttr[] = $key.'='.$value; |
|
406 | 406 | } |
407 | - $url .= '?' . implode("&", $TCompiledAttr); |
|
407 | + $url .= '?'.implode("&", $TCompiledAttr); |
|
408 | 408 | } |
409 | 409 | |
410 | 410 | // if $moreParams is a string |
@@ -436,13 +436,13 @@ discard block |
||
436 | 436 | |
437 | 437 | $ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on'); |
438 | 438 | $sp = strtolower($s['SERVER_PROTOCOL']); |
439 | - $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : ''); |
|
439 | + $protocol = substr($sp, 0, strpos($sp, '/')).(($ssl) ? 's' : ''); |
|
440 | 440 | $port = $s['SERVER_PORT']; |
441 | - $port = ((!$ssl && $port == '80') || ($ssl && $port == '443')) ? '' : ':' . $port; |
|
441 | + $port = ((!$ssl && $port == '80') || ($ssl && $port == '443')) ? '' : ':'.$port; |
|
442 | 442 | $host = ($use_forwarded_host && isset($s['HTTP_X_FORWARDED_HOST'])) ? $s['HTTP_X_FORWARDED_HOST'] : (isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : null); |
443 | - $host = isset($host) ? $host : $s['SERVER_NAME'] . $port; |
|
443 | + $host = isset($host) ? $host : $s['SERVER_NAME'].$port; |
|
444 | 444 | |
445 | - $url = $protocol . '://' . $host; |
|
445 | + $url = $protocol.'://'.$host; |
|
446 | 446 | |
447 | 447 | if ($withRequestUri) { |
448 | 448 | $url .= $s['REQUEST_URI']; |
@@ -577,10 +577,10 @@ discard block |
||
577 | 577 | public function setEventMessages($mesg, $mesgs, $style = 'mesgs') |
578 | 578 | { |
579 | 579 | if (empty($mesg) && empty($mesgs)) { |
580 | - dol_syslog(__METHOD__ . ' Try to add a message in stack, but value to add is empty message', LOG_WARNING); |
|
580 | + dol_syslog(__METHOD__.' Try to add a message in stack, but value to add is empty message', LOG_WARNING); |
|
581 | 581 | } else { |
582 | 582 | if (!in_array((string) $style, array('mesgs', 'warnings', 'errors'))) { |
583 | - dol_print_error(null, 'Bad parameter style=' . $style . ' for setEventMessages'); |
|
583 | + dol_print_error(null, 'Bad parameter style='.$style.' for setEventMessages'); |
|
584 | 584 | } |
585 | 585 | if (empty($mesgs)) { |
586 | 586 | $this->setEventMessage($mesg, $style); |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | { |
666 | 666 | $token = $this->newToken(); |
667 | 667 | if ($token) { |
668 | - return '&' . $this->tokenKey . '=' . $this->newToken(); |
|
668 | + return '&'.$this->tokenKey.'='.$this->newToken(); |
|
669 | 669 | } |
670 | 670 | |
671 | 671 | return null; |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | { |
681 | 681 | $token = $this->newToken(); |
682 | 682 | if ($token) { |
683 | - return '<input type="hidden" name="' . $this->tokenKey . '" value="' . $this->newToken() . '" />'; |
|
683 | + return '<input type="hidden" name="'.$this->tokenKey.'" value="'.$this->newToken().'" />'; |
|
684 | 684 | } |
685 | 685 | |
686 | 686 | return null; |
@@ -698,14 +698,14 @@ discard block |
||
698 | 698 | $id = 0; |
699 | 699 | |
700 | 700 | $sql = "SELECT sa.rowid as id, sa.pass_crypted"; |
701 | - $sql .= " FROM " . $this->db->prefix() . "societe_account as sa"; |
|
702 | - $sql .= " WHERE sa.login = '" . $this->db->escape($login) . "'"; |
|
701 | + $sql .= " FROM ".$this->db->prefix()."societe_account as sa"; |
|
702 | + $sql .= " WHERE sa.login = '".$this->db->escape($login)."'"; |
|
703 | 703 | //$sql .= " AND BINARY sa.pass_crypted = '" . $this->db->escape($pass) . "'"; // case sensitive |
704 | 704 | $sql .= " AND sa.site = 'dolibarr_portal'"; |
705 | 705 | $sql .= " AND sa.status = 1"; |
706 | - $sql .= " AND sa.entity IN (" . getEntity('societe') . ")"; |
|
706 | + $sql .= " AND sa.entity IN (".getEntity('societe').")"; |
|
707 | 707 | |
708 | - dol_syslog(__METHOD__ . ' Try to find the third-party account id for login"' . $login . '" and site="dolibarr_portal"', LOG_DEBUG); |
|
708 | + dol_syslog(__METHOD__.' Try to find the third-party account id for login"'.$login.'" and site="dolibarr_portal"', LOG_DEBUG); |
|
709 | 709 | $result = $this->db->query($sql); |
710 | 710 | if ($result) { |
711 | 711 | if ($this->db->num_rows($result) == 1) { |
@@ -736,13 +736,13 @@ discard block |
||
736 | 736 | if ($passok) { |
737 | 737 | $id = $obj->id; |
738 | 738 | } else { |
739 | - dol_syslog(__METHOD__ .' Authentication KO bad password for ' . $login . ', cryptType=' . $cryptType, LOG_NOTICE); |
|
739 | + dol_syslog(__METHOD__.' Authentication KO bad password for '.$login.', cryptType='.$cryptType, LOG_NOTICE); |
|
740 | 740 | sleep(1); // Brut force protection. Must be same delay when login is not valid |
741 | 741 | return -3; |
742 | 742 | } |
743 | 743 | } |
744 | 744 | } else { |
745 | - dol_syslog(__METHOD__ . ' Many third-party account found for login"' . $login . '" and site="dolibarr_portal"', LOG_ERR); |
|
745 | + dol_syslog(__METHOD__.' Many third-party account found for login"'.$login.'" and site="dolibarr_portal"', LOG_ERR); |
|
746 | 746 | return -2; |
747 | 747 | } |
748 | 748 | } else { |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $confirm = GETPOST('confirm', 'alpha'); |
60 | 60 | $cancel = GETPOST('cancel', 'aZ09'); |
61 | 61 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'projecttasklist'; |
62 | -$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
62 | +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
63 | 63 | //$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
64 | 64 | $optioncss = GETPOST('optioncss', 'aZ'); |
65 | 65 | $backtopage = GETPOST('backtopage', 'alpha'); |
@@ -102,20 +102,20 @@ discard block |
||
102 | 102 | $search_date_start_startmonth = GETPOSTINT('search_date_start_startmonth'); |
103 | 103 | $search_date_start_startyear = GETPOSTINT('search_date_start_startyear'); |
104 | 104 | $search_date_start_startday = GETPOSTINT('search_date_start_startday'); |
105 | -$search_date_start_start = dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear); // Use tzserver |
|
105 | +$search_date_start_start = dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear); // Use tzserver |
|
106 | 106 | $search_date_start_endmonth = GETPOSTINT('search_date_start_endmonth'); |
107 | 107 | $search_date_start_endyear = GETPOSTINT('search_date_start_endyear'); |
108 | 108 | $search_date_start_endday = GETPOSTINT('search_date_start_endday'); |
109 | -$search_date_start_end = dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear); // Use tzserver |
|
109 | +$search_date_start_end = dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear); // Use tzserver |
|
110 | 110 | |
111 | 111 | $search_date_end_startmonth = GETPOSTINT('search_date_end_startmonth'); |
112 | 112 | $search_date_end_startyear = GETPOSTINT('search_date_end_startyear'); |
113 | 113 | $search_date_end_startday = GETPOSTINT('search_date_end_startday'); |
114 | -$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver |
|
114 | +$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver |
|
115 | 115 | $search_date_end_endmonth = GETPOSTINT('search_date_end_endmonth'); |
116 | 116 | $search_date_end_endyear = GETPOSTINT('search_date_end_endyear'); |
117 | 117 | $search_date_end_endday = GETPOSTINT('search_date_end_endday'); |
118 | -$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); // Use tzserver |
|
118 | +$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); // Use tzserver |
|
119 | 119 | |
120 | 120 | $object = new Project($db); |
121 | 121 | $taskstatic = new Task($db); |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | $param .= '&search_date_end_endday='.urlencode((string) ($search_date_end_endday)); |
562 | 562 | } |
563 | 563 | if ($search_date_end_end) { |
564 | - $param .= '&search_date_end_end=' . urlencode((string) $search_date_end_end); |
|
564 | + $param .= '&search_date_end_end='.urlencode((string) $search_date_end_end); |
|
565 | 565 | } |
566 | 566 | if ($search_planedworkload) { |
567 | 567 | $param .= '&search_planedworkload='.urlencode($search_planedworkload); |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) { |
608 | 608 | $tmpurl = $_SESSION['pageforbacktolist']['project']; |
609 | 609 | $tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl); |
610 | - $linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?'). 'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; |
|
610 | + $linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; |
|
611 | 611 | } else { |
612 | 612 | $linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; |
613 | 613 | } |
@@ -777,8 +777,8 @@ discard block |
||
777 | 777 | |
778 | 778 | $defaultref = ''; |
779 | 779 | $classnamemodtask = getDolGlobalString('PROJECT_TASK_ADDON', 'mod_task_simple'); |
780 | - if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').".php")) { |
|
781 | - require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').'.php'; |
|
780 | + if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').".php")) { |
|
781 | + require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').'.php'; |
|
782 | 782 | $modTask = new $classnamemodtask(); |
783 | 783 | '@phan-var-force ModeleNumRefTask $modTask'; |
784 | 784 | $defaultref = $modTask->getNextValue($object->thirdparty, $object); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | /** |
158 | 158 | * @var string |
159 | 159 | */ |
160 | - public $price_formated; // used by takepos/ajax/ajax.php |
|
160 | + public $price_formated; // used by takepos/ajax/ajax.php |
|
161 | 161 | |
162 | 162 | /** |
163 | 163 | * Selling price with tax |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | /** |
170 | 170 | * @var string |
171 | 171 | */ |
172 | - public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
172 | + public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
173 | 173 | |
174 | 174 | /** |
175 | 175 | * Minimum price net |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | /** |
521 | 521 | * @var ?int |
522 | 522 | */ |
523 | - public $weight_units; // scale -3, 0, 3, 6 |
|
523 | + public $weight_units; // scale -3, 0, 3, 6 |
|
524 | 524 | /** |
525 | 525 | * @var float|string |
526 | 526 | */ |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | /** |
529 | 529 | * @var ?int |
530 | 530 | */ |
531 | - public $length_units; // scale -3, 0, 3, 6 |
|
531 | + public $length_units; // scale -3, 0, 3, 6 |
|
532 | 532 | /** |
533 | 533 | * @var float|string |
534 | 534 | */ |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | /** |
537 | 537 | * @var ?int |
538 | 538 | */ |
539 | - public $width_units; // scale -3, 0, 3, 6 |
|
539 | + public $width_units; // scale -3, 0, 3, 6 |
|
540 | 540 | /** |
541 | 541 | * @var float|string|null |
542 | 542 | */ |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | /** |
545 | 545 | * @var ?int |
546 | 546 | */ |
547 | - public $height_units; // scale -3, 0, 3, 6 |
|
547 | + public $height_units; // scale -3, 0, 3, 6 |
|
548 | 548 | /** |
549 | 549 | * @var float|string|null |
550 | 550 | */ |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | /** |
553 | 553 | * @var ?int |
554 | 554 | */ |
555 | - public $surface_units; // scale -3, 0, 3, 6 |
|
555 | + public $surface_units; // scale -3, 0, 3, 6 |
|
556 | 556 | /** |
557 | 557 | * @var float|string|null |
558 | 558 | */ |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | /** |
561 | 561 | * @var ?int |
562 | 562 | */ |
563 | - public $volume_units; // scale -3, 0, 3, 6 |
|
563 | + public $volume_units; // scale -3, 0, 3, 6 |
|
564 | 564 | |
565 | 565 | /** |
566 | 566 | * @var float|string|null |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | /** |
570 | 570 | * @var ?int |
571 | 571 | */ |
572 | - public $net_measure_units; // scale -3, 0, 3, 6 |
|
572 | + public $net_measure_units; // scale -3, 0, 3, 6 |
|
573 | 573 | |
574 | 574 | /** |
575 | 575 | * @var ?string |
@@ -883,7 +883,7 @@ discard block |
||
883 | 883 | 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000), |
884 | 884 | //'tosell' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), |
885 | 885 | //'tobuy' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), |
886 | - 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
886 | + 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
887 | 887 | 'stockable_product' => array('type' => 'integer', 'label' => 'stockable_product', 'enabled' => 1, 'visible' => 1, 'default' => '1', 'notnull' => 1, 'index' => 1, 'position' => 502), |
888 | 888 | ); |
889 | 889 | |
@@ -1205,9 +1205,9 @@ discard block |
||
1205 | 1205 | |
1206 | 1206 | // update accountancy for this entity |
1207 | 1207 | if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
1208 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " .((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
1208 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
1209 | 1209 | |
1210 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
1210 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
1211 | 1211 | $sql .= " fk_product"; |
1212 | 1212 | $sql .= ", entity"; |
1213 | 1213 | $sql .= ", accountancy_code_buy"; |
@@ -1218,13 +1218,13 @@ discard block |
||
1218 | 1218 | $sql .= ", accountancy_code_sell_export"; |
1219 | 1219 | $sql .= ") VALUES ("; |
1220 | 1220 | $sql .= $this->id; |
1221 | - $sql .= ", " . ((int) $conf->entity); |
|
1222 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1223 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
1224 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
1225 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1226 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
1227 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
1221 | + $sql .= ", ".((int) $conf->entity); |
|
1222 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1223 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
1224 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
1225 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1226 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
1227 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
1228 | 1228 | $sql .= ")"; |
1229 | 1229 | $result = $this->db->query($sql); |
1230 | 1230 | if (!$result) { |
@@ -1612,12 +1612,12 @@ discard block |
||
1612 | 1612 | $sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null'); |
1613 | 1613 | $sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'"; |
1614 | 1614 | if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
1615 | - $sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1616 | - $sql .= ", accountancy_code_buy_intra = '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
1617 | - $sql .= ", accountancy_code_buy_export = '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
1618 | - $sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1619 | - $sql .= ", accountancy_code_sell_intra= '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
1620 | - $sql .= ", accountancy_code_sell_export= '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
1615 | + $sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1616 | + $sql .= ", accountancy_code_buy_intra = '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
1617 | + $sql .= ", accountancy_code_buy_export = '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
1618 | + $sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1619 | + $sql .= ", accountancy_code_sell_intra= '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
1620 | + $sql .= ", accountancy_code_sell_export= '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
1621 | 1621 | } |
1622 | 1622 | $sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (float) $this->desiredstock : "null"); |
1623 | 1623 | $sql .= ", cost_price = ".($this->cost_price != '' ? ((float) $this->cost_price) : 'null'); |
@@ -1652,9 +1652,9 @@ discard block |
||
1652 | 1652 | |
1653 | 1653 | // update accountancy for this entity |
1654 | 1654 | if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
1655 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
1655 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
1656 | 1656 | |
1657 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
1657 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
1658 | 1658 | $sql .= " fk_product"; |
1659 | 1659 | $sql .= ", entity"; |
1660 | 1660 | $sql .= ", accountancy_code_buy"; |
@@ -1665,13 +1665,13 @@ discard block |
||
1665 | 1665 | $sql .= ", accountancy_code_sell_export"; |
1666 | 1666 | $sql .= ") VALUES ("; |
1667 | 1667 | $sql .= ((int) $this->id); |
1668 | - $sql .= ", " . ((int) $conf->entity); |
|
1669 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1670 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
1671 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
1672 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1673 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
1674 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
1668 | + $sql .= ", ".((int) $conf->entity); |
|
1669 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1670 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
1671 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
1672 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1673 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
1674 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
1675 | 1675 | $sql .= ")"; |
1676 | 1676 | $result = $this->db->query($sql); |
1677 | 1677 | if (!$result) { |
@@ -1749,7 +1749,7 @@ discard block |
||
1749 | 1749 | $error++; |
1750 | 1750 | } else { |
1751 | 1751 | // to keep old entries with the new dir |
1752 | - require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php'; |
|
1752 | + require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; |
|
1753 | 1753 | $ecmfiles = new EcmFiles($this->db); |
1754 | 1754 | $ecmfiles->updateAfterRename("produit/".dol_sanitizeFileName($this->oldcopy->ref), "produit/".dol_sanitizeFileName($this->ref)); |
1755 | 1755 | } |
@@ -2047,7 +2047,7 @@ discard block |
||
2047 | 2047 | } |
2048 | 2048 | } elseif (isset($this->multilangs[$key])) { |
2049 | 2049 | if (empty($this->multilangs[$key]["label"])) { |
2050 | - $this->errors[] = $key . ' : ' . $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
2050 | + $this->errors[] = $key.' : '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
2051 | 2051 | return -1; |
2052 | 2052 | } |
2053 | 2053 | |
@@ -2245,7 +2245,7 @@ discard block |
||
2245 | 2245 | */ |
2246 | 2246 | private function getArrayForPriceCompare($level = 0) |
2247 | 2247 | { |
2248 | - $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly'); |
|
2248 | + $testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly'); |
|
2249 | 2249 | |
2250 | 2250 | foreach ($testExit as $field) { |
2251 | 2251 | if (!isset($this->$field)) { |
@@ -2398,7 +2398,7 @@ discard block |
||
2398 | 2398 | $price_base_type = $custprice_line->price_base_type; |
2399 | 2399 | $tva_tx = $custprice_line->tva_tx; |
2400 | 2400 | if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { |
2401 | - $tva_tx .= ' (' . $custprice_line->default_vat_code . ')'; |
|
2401 | + $tva_tx .= ' ('.$custprice_line->default_vat_code.')'; |
|
2402 | 2402 | } |
2403 | 2403 | $tva_npr = $custprice_line->recuperableonly; |
2404 | 2404 | if (empty($tva_tx)) { |
@@ -2467,7 +2467,7 @@ discard block |
||
2467 | 2467 | $price_base_type = $custprice_line->price_base_type; |
2468 | 2468 | $tva_tx = $custprice_line->tva_tx; |
2469 | 2469 | if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { |
2470 | - $tva_tx .= ' (' . $custprice_line->default_vat_code . ')'; |
|
2470 | + $tva_tx .= ' ('.$custprice_line->default_vat_code.')'; |
|
2471 | 2471 | } |
2472 | 2472 | $tva_npr = $custprice_line->recuperableonly; |
2473 | 2473 | if (empty($tva_tx)) { |
@@ -2952,12 +2952,12 @@ discard block |
||
2952 | 2952 | |
2953 | 2953 | // For MultiCompany |
2954 | 2954 | // PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity |
2955 | - $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
2956 | - $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses. |
|
2955 | + $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
2956 | + $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses. |
|
2957 | 2957 | $visibleWarehousesEntities = $conf->entity; |
2958 | 2958 | if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) { |
2959 | 2959 | if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) { |
2960 | - $checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
2960 | + $checkPMPPerEntity = $this->db->query("SELECT pmp FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
2961 | 2961 | if ($this->db->num_rows($checkPMPPerEntity) > 0) { |
2962 | 2962 | $separatedEntityPMP = true; |
2963 | 2963 | } |
@@ -2965,7 +2965,7 @@ discard block |
||
2965 | 2965 | global $mc; |
2966 | 2966 | $separatedStock = true; |
2967 | 2967 | if (isset($mc->sharings['stock']) && !empty($mc->sharings['stock'])) { |
2968 | - $visibleWarehousesEntities .= "," . implode(",", $mc->sharings['stock']); |
|
2968 | + $visibleWarehousesEntities .= ",".implode(",", $mc->sharings['stock']); |
|
2969 | 2969 | } |
2970 | 2970 | } |
2971 | 2971 | if ($separatedEntityPMP) { |
@@ -2984,10 +2984,10 @@ discard block |
||
2984 | 2984 | $sql .= " FROM ".$this->db->prefix()."product as p"; |
2985 | 2985 | $sql .= " LEFT JOIN ".$this->db->prefix()."product_extrafields as pef ON pef.fk_object=p.rowid"; |
2986 | 2986 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') || $separatedEntityPMP) { |
2987 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
2987 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
2988 | 2988 | } |
2989 | 2989 | if ($separatedStock) { |
2990 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))"; |
|
2990 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))"; |
|
2991 | 2991 | } |
2992 | 2992 | |
2993 | 2993 | if ($id) { |
@@ -3156,15 +3156,15 @@ discard block |
||
3156 | 3156 | $sql .= " WHERE entity IN (".getEntity('productprice').")"; |
3157 | 3157 | $sql .= " AND price_level=".((int) $i); |
3158 | 3158 | $sql .= " AND fk_product = ".((int) $this->id); |
3159 | - $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
3160 | - $sql .= " LIMIT 1"; // Only the first one |
|
3159 | + $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
3160 | + $sql .= " LIMIT 1"; // Only the first one |
|
3161 | 3161 | $resql = $this->db->query($sql); |
3162 | 3162 | if ($resql) { |
3163 | 3163 | $result = $this->db->fetch_array($resql); |
3164 | 3164 | |
3165 | 3165 | $this->multiprices[$i] = $result ? $result["price"] : null; |
3166 | 3166 | $this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null; |
3167 | - $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
3167 | + $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
3168 | 3168 | $this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null; |
3169 | 3169 | $this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null; |
3170 | 3170 | // Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on |
@@ -3389,7 +3389,7 @@ discard block |
||
3389 | 3389 | $obj = $this->db->fetch_object($result); |
3390 | 3390 | $this->stats_mo['customers_'.$role] = $obj->nb_customers ? $obj->nb_customers : 0; |
3391 | 3391 | $this->stats_mo['nb_'.$role] = $obj->nb ? $obj->nb : 0; |
3392 | - $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
3392 | + $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
3393 | 3393 | } else { |
3394 | 3394 | $this->error = $this->db->error(); |
3395 | 3395 | $error++; |
@@ -4914,7 +4914,7 @@ discard block |
||
4914 | 4914 | //Addition of a product with the highest rank +1 |
4915 | 4915 | $sql = "INSERT INTO ".$this->db->prefix()."product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)"; |
4916 | 4916 | $sql .= " VALUES (".((int) $id_pere).", ".((int) $id_fils).", ".price2num($qty, 'MS').", ".((int) $incdec).", ".((int) $rank).")"; |
4917 | - if (! $this->db->query($sql)) { |
|
4917 | + if (!$this->db->query($sql)) { |
|
4918 | 4918 | dol_print_error($this->db); |
4919 | 4919 | return -1; |
4920 | 4920 | } else { |
@@ -5035,7 +5035,7 @@ discard block |
||
5035 | 5035 | $sql = "UPDATE ".$this->db->prefix()."product_association"; |
5036 | 5036 | $sql .= " SET rang = ".((int) $cpt); |
5037 | 5037 | $sql .= " WHERE rowid = ".((int) $objrank->rowid); |
5038 | - if (! $this->db->query($sql)) { |
|
5038 | + if (!$this->db->query($sql)) { |
|
5039 | 5039 | dol_print_error($this->db); |
5040 | 5040 | return -1; |
5041 | 5041 | } |
@@ -5476,7 +5476,7 @@ discard block |
||
5476 | 5476 | if (isset($this->sousprods) && is_array($this->sousprods)) { |
5477 | 5477 | foreach ($this->sousprods as $prod_name => $desc_product) { |
5478 | 5478 | if (is_array($desc_product)) { |
5479 | - $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
5479 | + $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
5480 | 5480 | } |
5481 | 5481 | } |
5482 | 5482 | } |
@@ -5631,7 +5631,7 @@ discard block |
||
5631 | 5631 | $sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens |
5632 | 5632 | $sql .= " ORDER BY pa.rang"; |
5633 | 5633 | |
5634 | - dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG); |
|
5634 | + dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level.' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG); |
|
5635 | 5635 | |
5636 | 5636 | // Protection against infinite loop |
5637 | 5637 | if ($level > 30) { |
@@ -5694,7 +5694,7 @@ discard block |
||
5694 | 5694 | $parent[$this->label][$keyChild] = $valueChild; |
5695 | 5695 | } |
5696 | 5696 | foreach ($parent as $key => $value) { // key=label, value is array of children |
5697 | - $this->sousprods[$key] = $value; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
5697 | + $this->sousprods[$key] = $value; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
5698 | 5698 | } |
5699 | 5699 | } |
5700 | 5700 | |
@@ -5730,7 +5730,7 @@ discard block |
||
5730 | 5730 | if (!empty($this->entity) && $permissiontoreadproduct) { |
5731 | 5731 | $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, '1'); |
5732 | 5732 | if ($this->nbphoto > 0) { |
5733 | - $datas['photo'] = '<div class="photointooltip floatright">'."\n" . $tmpphoto . '</div>'; |
|
5733 | + $datas['photo'] = '<div class="photointooltip floatright">'."\n".$tmpphoto.'</div>'; |
|
5734 | 5734 | } |
5735 | 5735 | } |
5736 | 5736 | |
@@ -5740,7 +5740,7 @@ discard block |
||
5740 | 5740 | $datas['picto'] = img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>'; |
5741 | 5741 | } |
5742 | 5742 | if (isset($this->status) && isset($this->status_buy)) { |
5743 | - $datas['status'] = ' '.$this->getLibStatut(5, 0) . ' '.$this->getLibStatut(5, 1); |
|
5743 | + $datas['status'] = ' '.$this->getLibStatut(5, 0).' '.$this->getLibStatut(5, 1); |
|
5744 | 5744 | } |
5745 | 5745 | |
5746 | 5746 | if (!empty($this->ref)) { |
@@ -5793,7 +5793,7 @@ discard block |
||
5793 | 5793 | $labelsurfacevolume .= ($labelsurfacevolume ? " - " : "")."<b>".$langs->trans("Volume").'</b>: '.$this->volume.' '.measuringUnitString(0, 'volume', $this->volume_units); |
5794 | 5794 | } |
5795 | 5795 | if ($labelsurfacevolume) { |
5796 | - $datas['surface'] = "<br>" . $labelsurfacevolume; |
|
5796 | + $datas['surface'] = "<br>".$labelsurfacevolume; |
|
5797 | 5797 | } |
5798 | 5798 | } |
5799 | 5799 | if ($this->isService() && !empty($this->duration_value)) { |
@@ -5835,9 +5835,9 @@ discard block |
||
5835 | 5835 | } |
5836 | 5836 | // show categories for this record only in ajax to not overload lists |
5837 | 5837 | if (isModEnabled('category') && !$nofetch) { |
5838 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
5838 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
5839 | 5839 | $form = new Form($this->db); |
5840 | - $datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
5840 | + $datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
5841 | 5841 | } |
5842 | 5842 | } |
5843 | 5843 | |
@@ -6364,7 +6364,7 @@ discard block |
||
6364 | 6364 | if (isModEnabled("supplier_order")) { |
6365 | 6365 | $filterStatus = getDolGlobalString('SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK', '3,4'); |
6366 | 6366 | if (isset($includedraftpoforvirtual)) { |
6367 | - $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them |
|
6367 | + $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them |
|
6368 | 6368 | } |
6369 | 6369 | $result = $this->load_stats_commande_fournisseur(0, $filterStatus, 1, $dateofvirtualstock); |
6370 | 6370 | if ($result < 0) { |
@@ -6405,7 +6405,7 @@ discard block |
||
6405 | 6405 | } elseif (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER')) { |
6406 | 6406 | if (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER_INCLUDE_DRAFT')) { // By default, draft means "does not exist", so we do not include them by default, except if option is on |
6407 | 6407 | $tmpnewprod = dol_clone($this, 1); |
6408 | - $result = $tmpnewprod->load_stats_commande(0, '0', 1); // Get qty in draft orders |
|
6408 | + $result = $tmpnewprod->load_stats_commande(0, '0', 1); // Get qty in draft orders |
|
6409 | 6409 | $this->stock_theorique += $tmpnewprod->stats_commande['qty']; |
6410 | 6410 | } |
6411 | 6411 | } elseif (getDolGlobalString('STOCK_CALCULATE_ON_BILL') && $weBillOrderOrShipmentReception == 'order') { |
@@ -6422,7 +6422,7 @@ discard block |
||
6422 | 6422 | } elseif (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER')) { // Warning: stock change "on approval", not on validation ! |
6423 | 6423 | if (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER_INCLUDE_DRAFT')) { // By default, draft means "does not exist", so we do not include them by default, except if option is on |
6424 | 6424 | $tmpnewprod = dol_clone($this, 1); |
6425 | - $result = $tmpnewprod->load_stats_commande_fournisseur(0, '0', 1); // Get qty in draft orders |
|
6425 | + $result = $tmpnewprod->load_stats_commande_fournisseur(0, '0', 1); // Get qty in draft orders |
|
6426 | 6426 | $this->stock_theorique += $this->stats_commande_fournisseur['qty']; |
6427 | 6427 | } |
6428 | 6428 | $this->stock_theorique -= $stock_reception_fournisseur; |
@@ -6881,7 +6881,7 @@ discard block |
||
6881 | 6881 | if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) { |
6882 | 6882 | $dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']); |
6883 | 6883 | foreach ($dirsociete as $dirroot) { |
6884 | - $res = dol_include_once($dirroot . getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
6884 | + $res = dol_include_once($dirroot.getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
6885 | 6885 | if ($res) { |
6886 | 6886 | break; |
6887 | 6887 | } |
@@ -7245,7 +7245,7 @@ discard block |
||
7245 | 7245 | } |
7246 | 7246 | $return .= '</div>'; |
7247 | 7247 | $return .= '<div class="info-box-content">'; |
7248 | - $return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl() . '</span>'; |
|
7248 | + $return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.$this->getNomUrl().'</span>'; |
|
7249 | 7249 | if ($selected >= 0) { |
7250 | 7250 | $return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>'; |
7251 | 7251 | } |