@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | 'const_anonymize' => 'DATAPOLICY_TIERS_CLIENT_ANONYMIZE_DELAY', |
75 | 75 | 'sql_template' => "SELECT s.rowid FROM ".$prefix."societe as s WHERE s.entity = __ENTITY__ AND s.client = ".Societe::CUSTOMER." AND s.fournisseur = 0 AND s.tms < DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH) AND NOT EXISTS (SELECT a.id FROM ".$prefix."actioncomm as a WHERE a.fk_soc = s.rowid AND a.tms > DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH)) AND NOT EXISTS (SELECT f.rowid FROM ".$prefix."facture as f WHERE f.fk_soc = s.rowid)", |
76 | 76 | 'class' => 'Societe', |
77 | - 'file' => DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php', |
|
77 | + 'file' => DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php', |
|
78 | 78 | 'anonymize_fields' => array('name' => 'MAKEANONYMOUS', 'name_alias' => 'MAKEANONYMOUS', 'address' => '---', 'town' => '---', 'zip' => '---', 'phone' => '---', 'email' => '---', 'url' => '---', 'fax' => '---', 'siret' => '---', 'siren' => '---', 'ape' => '---', 'idprof4' => '---', 'idprof5' => '---', 'idprof6' => '---', 'tva_intra' => '---', 'capital' => 0, 'socialnetworks' => [], 'geolat' => 0, 'geolong' => 0, 'ip' => '0.0.0.0'), |
79 | 79 | 'call_params' => array( |
80 | 80 | 'delete' => array('id', 'user'), // $object->delete($id, $user) |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | 'const_anonymize' => 'DATAPOLICY_TIERS_PROSPECT_ANONYMIZE_DELAY', |
90 | 90 | 'sql_template' => "SELECT s.rowid FROM ".$prefix."societe as s WHERE s.entity = __ENTITY__ AND s.client = ".Societe::PROSPECT." AND s.fournisseur = 0 AND s.tms < DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH) AND NOT EXISTS (SELECT a.id FROM ".$prefix."actioncomm as a WHERE a.fk_soc = s.rowid AND a.tms > DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH)) AND NOT EXISTS (SELECT f.rowid FROM ".$prefix."facture as f WHERE f.fk_soc = s.rowid)", |
91 | 91 | 'class' => 'Societe', |
92 | - 'file' => DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php', |
|
92 | + 'file' => DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php', |
|
93 | 93 | 'anonymize_fields' => array('name' => 'MAKEANONYMOUS', 'name_alias' => 'MAKEANONYMOUS', 'address' => '---', 'town' => '---', 'zip' => '---', 'phone' => '---', 'email' => '---', 'url' => '---', 'fax' => '---', 'siret' => '---', 'siren' => '---', 'ape' => '---', 'idprof4' => '---', 'idprof5' => '---', 'idprof6' => '---', 'tva_intra' => '---', 'capital' => 0, 'socialnetworks' => [], 'geolat' => 0, 'geolong' => 0, 'ip' => '0.0.0.0'), |
94 | 94 | 'call_params' => array( |
95 | 95 | 'delete' => array('id', 'user'), // $object->delete($id, $user) |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | 'const_anonymize' => 'DATAPOLICY_TIERS_PROSPECT_CLIENT_ANONYMIZE_DELAY', |
105 | 105 | 'sql_template' => "SELECT s.rowid FROM ".$prefix."societe as s WHERE s.entity = __ENTITY__ AND s.client = ".Societe::CUSTOMER_AND_PROSPECT." AND s.fournisseur = 0 AND s.tms < DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH) AND NOT EXISTS (SELECT a.id FROM ".$prefix."actioncomm as a WHERE a.fk_soc = s.rowid AND a.tms > DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH)) AND NOT EXISTS (SELECT f.rowid FROM ".$prefix."facture as f WHERE f.fk_soc = s.rowid)", |
106 | 106 | 'class' => 'Societe', |
107 | - 'file' => DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php', |
|
107 | + 'file' => DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php', |
|
108 | 108 | 'anonymize_fields' => array('name' => 'MAKEANONYMOUS', 'name_alias' => 'MAKEANONYMOUS', 'address' => '---', 'town' => '---', 'zip' => '---', 'phone' => '---', 'email' => '---', 'url' => '---', 'fax' => '---', 'siret' => '---', 'siren' => '---', 'ape' => '---', 'idprof4' => '---', 'idprof5' => '---', 'idprof6' => '---', 'tva_intra' => '---', 'capital' => 0, 'socialnetworks' => [], 'geolat' => 0, 'geolong' => 0, 'ip' => '0.0.0.0'), |
109 | 109 | 'call_params' => array( |
110 | 110 | 'delete' => array('id', 'user'), // $object->delete($id, $user) |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | 'sql_template' => "SELECT s.rowid FROM ".$prefix."societe as s WHERE s.entity = __ENTITY__ AND s.client = ".Societe::NO_CUSTOMER." AND s.fournisseur = 0 AND s.tms < DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH) AND NOT EXISTS (SELECT a.id FROM ".$prefix."actioncomm as a WHERE a.fk_soc = s.rowid AND a.tms > DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH)) AND NOT EXISTS (SELECT f.rowid FROM ".$prefix."facture as f WHERE f.fk_soc = s.rowid)", |
121 | 121 | 'sql_template_delete' => "SELECT s.rowid FROM ".$prefix."societe as s WHERE s.entity = __ENTITY__ AND s.client = ".Societe::NO_CUSTOMER." AND s.fournisseur = 0 AND s.tms < DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH) AND NOT EXISTS (SELECT a.id FROM ".$prefix."actioncomm as a WHERE a.fk_soc = s.rowid AND a.tms > DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH)) AND NOT EXISTS (SELECT f.rowid FROM ".$prefix."facture as f WHERE f.fk_soc = s.rowid)", |
122 | 122 | 'class' => 'Societe', |
123 | - 'file' => DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php', |
|
123 | + 'file' => DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php', |
|
124 | 124 | 'anonymize_fields' => array('name' => 'MAKEANONYMOUS', 'name_alias' => 'MAKEANONYMOUS', 'address' => '---', 'town' => '---', 'zip' => '---', 'phone' => '---', 'email' => '---', 'url' => '---', 'fax' => '---', 'siret' => '---', 'siren' => '---', 'ape' => '---', 'idprof4' => '---', 'idprof5' => '---', 'idprof6' => '---', 'tva_intra' => '---', 'capital' => 0, 'socialnetworks' => [], 'geolat' => 0, 'geolong' => 0, 'ip' => '0.0.0.0'), |
125 | 125 | 'call_params' => array( |
126 | 126 | 'delete' => array('id', 'user'), // $object->delete($id, $user) |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | 'const_anonymize' => 'DATAPOLICY_TIERS_FOURNISSEUR_ANONYMIZE_DELAY', |
136 | 136 | 'sql_template' => "SELECT s.rowid FROM ".$prefix."societe as s WHERE s.entity = __ENTITY__ AND s.fournisseur = 1 AND s.tms < DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH) AND NOT EXISTS (SELECT a.id FROM ".$prefix."actioncomm as a WHERE a.fk_soc = s.rowid AND a.tms > DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH)) AND NOT EXISTS (SELECT f.rowid FROM ".$prefix."facture as f WHERE f.fk_soc = s.rowid)", |
137 | 137 | 'class' => 'Societe', |
138 | - 'file' => DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php', |
|
138 | + 'file' => DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php', |
|
139 | 139 | 'anonymize_fields' => array('name' => 'MAKEANONYMOUS', 'name_alias' => 'MAKEANONYMOUS', 'address' => '---', 'town' => '---', 'zip' => '---', 'phone' => '---', 'email' => '---', 'url' => '---', 'fax' => '---', 'siret' => '---', 'siren' => '---', 'ape' => '---', 'idprof4' => '---', 'idprof5' => '---', 'idprof6' => '---', 'tva_intra' => '---', 'capital' => 0, 'socialnetworks' => [], 'geolat' => 0, 'geolong' => 0, 'ip' => '0.0.0.0'), |
140 | 140 | 'call_params' => array( |
141 | 141 | 'delete' => array('id', 'user'), // $object->delete($id, $user) |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | 'const_anonymize' => 'DATAPOLICY_CONTACT_CLIENT_ANONYMIZE_DELAY', |
152 | 152 | 'sql_template' => "SELECT c.rowid FROM ".$prefix."socpeople as c INNER JOIN ".$prefix."societe as s ON s.rowid = c.fk_soc WHERE c.entity = __ENTITY__ AND c.tms < DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH) AND s.client = ".Societe::CUSTOMER." AND s.fournisseur = 0 AND NOT EXISTS (SELECT a.id FROM ".$prefix."actioncomm as a WHERE a.fk_contact = c.rowid AND a.tms > DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH)) AND NOT EXISTS (SELECT f.rowid FROM ".$prefix."facture as f WHERE f.fk_soc = s.rowid)", |
153 | 153 | 'class' => 'Contact', |
154 | - 'file' => DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php', |
|
154 | + 'file' => DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php', |
|
155 | 155 | 'anonymize_fields' => array('lastname' => 'MAKEANONYMOUS', 'firstname' => 'MAKEANONYMOUS', 'poste' => '---', 'address' => '---', 'town' => '---', 'zip' => '---', 'phone_pro' => '---', 'phone_perso' => '---', 'phone_mobile' => '---', 'email' => '---', 'photo' => '', 'url' => '---', 'fax' => '---', 'socialnetworks' => [], 'geolat' => 0, 'geolong' => 0, 'ip' => '0.0.0.0'), |
156 | 156 | 'call_params' => array( |
157 | 157 | 'delete' => array('user'), // $object->delete($user) |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | 'const_anonymize' => 'DATAPOLICY_CONTACT_PROSPECT_ANONYMIZE_DELAY', |
167 | 167 | 'sql_template' => "SELECT c.rowid FROM ".$prefix."socpeople as c INNER JOIN ".$prefix."societe as s ON s.rowid = c.fk_soc WHERE c.entity = __ENTITY__ AND c.tms < DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH) AND s.client = ".Societe::PROSPECT." AND s.fournisseur = 0 AND NOT EXISTS (SELECT a.id FROM ".$prefix."actioncomm as a WHERE a.fk_contact = c.rowid AND a.tms > DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH)) AND NOT EXISTS (SELECT f.rowid FROM ".$prefix."facture as f WHERE f.fk_soc = s.rowid)", |
168 | 168 | 'class' => 'Contact', |
169 | - 'file' => DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php', |
|
169 | + 'file' => DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php', |
|
170 | 170 | 'anonymize_fields' => array('lastname' => 'MAKEANONYMOUS', 'firstname' => 'MAKEANONYMOUS', 'poste' => '---', 'address' => '---', 'town' => '---', 'zip' => '---', 'phone_pro' => '---', 'phone_perso' => '---', 'phone_mobile' => '---', 'email' => '---', 'photo' => '', 'url' => '---', 'fax' => '---', 'socialnetworks' => [], 'geolat' => 0, 'geolong' => 0, 'ip' => '0.0.0.0'), |
171 | 171 | 'call_params' => array( |
172 | 172 | 'delete' => array('user'), // $object->delete($user) |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | 'const_anonymize' => 'DATAPOLICY_CONTACT_PROSPECT_CLIENT_ANONYMIZE_DELAY', |
182 | 182 | 'sql_template' => "SELECT c.rowid FROM ".$prefix."socpeople as c INNER JOIN ".$prefix."societe as s ON s.rowid = c.fk_soc WHERE c.entity = __ENTITY__ AND c.tms < DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH) AND s.client = ".Societe::CUSTOMER_AND_PROSPECT." AND s.fournisseur = 0 AND NOT EXISTS (SELECT a.id FROM ".$prefix."actioncomm as a WHERE a.fk_contact = c.rowid AND a.tms > DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH)) AND NOT EXISTS (SELECT f.rowid FROM ".$prefix."facture as f WHERE f.fk_soc = s.rowid)", |
183 | 183 | 'class' => 'Contact', |
184 | - 'file' => DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php', |
|
184 | + 'file' => DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php', |
|
185 | 185 | 'anonymize_fields' => array('lastname' => 'MAKEANONYMOUS', 'firstname' => 'MAKEANONYMOUS', 'poste' => '---', 'address' => '---', 'town' => '---', 'zip' => '---', 'phone_pro' => '---', 'phone_perso' => '---', 'phone_mobile' => '---', 'email' => '---', 'photo' => '', 'url' => '---', 'fax' => '---', 'socialnetworks' => [], 'geolat' => 0, 'geolong' => 0, 'ip' => '0.0.0.0'), |
186 | 186 | 'call_params' => array( |
187 | 187 | 'delete' => array('user'), // $object->delete($user) |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | 'const_anonymize' => 'DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT_ANONYMIZE_DELAY', |
197 | 197 | 'sql_template' => "SELECT c.rowid FROM ".$prefix."socpeople as c INNER JOIN ".$prefix."societe as s ON s.rowid = c.fk_soc WHERE c.entity = __ENTITY__ AND c.tms < DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH) AND s.client = ".Societe::NO_CUSTOMER." AND s.fournisseur = 0 AND NOT EXISTS (SELECT a.id FROM ".$prefix."actioncomm as a WHERE a.fk_contact = c.rowid AND a.tms > DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH)) AND NOT EXISTS (SELECT f.rowid FROM ".$prefix."facture as f WHERE f.fk_soc = s.rowid)", |
198 | 198 | 'class' => 'Contact', |
199 | - 'file' => DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php', |
|
199 | + 'file' => DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php', |
|
200 | 200 | 'anonymize_fields' => array('lastname' => 'MAKEANONYMOUS', 'firstname' => 'MAKEANONYMOUS', 'poste' => '---', 'address' => '---', 'town' => '---', 'zip' => '---', 'phone_pro' => '---', 'phone_perso' => '---', 'phone_mobile' => '---', 'email' => '---', 'photo' => '', 'url' => '---', 'fax' => '---', 'socialnetworks' => [], 'geolat' => 0, 'geolong' => 0, 'ip' => '0.0.0.0'), |
201 | 201 | 'call_params' => array( |
202 | 202 | 'delete' => array('user'), // $object->delete($user) |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | 'const_anonymize' => 'DATAPOLICY_CONTACT_FOURNISSEUR_ANONYMIZE_DELAY', |
212 | 212 | 'sql_template' => "SELECT c.rowid FROM ".$prefix."socpeople as c INNER JOIN ".$prefix."societe as s ON s.rowid = c.fk_soc WHERE c.entity = __ENTITY__ AND c.tms < DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH) AND s.fournisseur = 1 AND NOT EXISTS (SELECT a.id FROM ".$prefix."actioncomm as a WHERE a.fk_contact = c.rowid AND a.tms > DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH)) AND NOT EXISTS (SELECT f.rowid FROM ".$prefix."facture as f WHERE f.fk_soc = s.rowid)", |
213 | 213 | 'class' => 'Contact', |
214 | - 'file' => DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php', |
|
214 | + 'file' => DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php', |
|
215 | 215 | 'anonymize_fields' => array('lastname' => 'MAKEANONYMOUS', 'firstname' => 'MAKEANONYMOUS', 'poste' => '---', 'address' => '---', 'town' => '---', 'zip' => '---', 'phone_pro' => '---', 'phone_perso' => '---', 'phone_mobile' => '---', 'email' => '---', 'photo' => '', 'url' => '---', 'fax' => '---', 'socialnetworks' => [], 'geolat' => 0, 'geolong' => 0, 'ip' => '0.0.0.0'), |
216 | 216 | 'call_params' => array( |
217 | 217 | 'delete' => array('user'), // $object->delete($user) |
@@ -233,10 +233,10 @@ discard block |
||
233 | 233 | 'const_anonymize' => 'DATAPOLICY_ADHERENT_ANONYMIZE_DELAY', |
234 | 234 | 'sql_template' => $sqltemplate, |
235 | 235 | 'class' => 'Adherent', |
236 | - 'file' => DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php', |
|
236 | + 'file' => DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php', |
|
237 | 237 | 'anonymize_fields' => array('lastname' => 'MAKEANONYMOUS', 'firstname' => 'MAKEANONYMOUS', 'societe' => '---', 'address' => '---', 'town' => '---', 'zip' => '---', 'phone' => '---', 'phone_perso' => '---', 'phone_mobile' => '---', 'email' => '---', 'birth' => '1900-01-01', 'photo' => '', 'url' => '---', 'fax' => '---', 'socialnetworks' => [], 'ip' => '0.0.0.0'), |
238 | 238 | 'call_params' => array( |
239 | - 'delete' => array('user'), // $object->delete($user) |
|
239 | + 'delete' => array('user'), // $object->delete($user) |
|
240 | 240 | 'update' => array('user') // $object->update($user) |
241 | 241 | ) |
242 | 242 | ); |
@@ -252,10 +252,10 @@ discard block |
||
252 | 252 | 'const_anonymize' => '', // Anonymization not applicable |
253 | 253 | 'sql_template_delete' => "SELECT c.rowid FROM ".$prefix."recruitment_recruitmentcandidature as c WHERE c.entity = __ENTITY__ AND c.tms < DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH) AND NOT EXISTS (SELECT ac.id FROM ".$prefix."actioncomm as ac WHERE ac.elementtype = 'recruitmentcandidature@recruitment' AND ac.fk_element = c.rowid AND ac.tms > DATE_SUB(__NOW__, INTERVAL __DELAY__ MONTH))", |
254 | 254 | 'class' => 'RecruitmentCandidature', |
255 | - 'file' => DOL_DOCUMENT_ROOT . '/recruitment/class/recruitmentcandidature.class.php', |
|
255 | + 'file' => DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php', |
|
256 | 256 | 'anonymize_fields' => array(), |
257 | 257 | 'call_params' => array( |
258 | - 'delete' => array('user'), // $object->delete($user) |
|
258 | + 'delete' => array('user'), // $object->delete($user) |
|
259 | 259 | 'update' => array('user') // $object->update($user) |
260 | 260 | ) |
261 | 261 | ); |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | // Iterate through each defined policy to apply its rules. |
297 | 297 | foreach ($dataPolicies as $policy) { |
298 | 298 | // Instantiate object only once per class type for efficiency. |
299 | - if (! isset($objectInstances[$policy['class']])) { |
|
299 | + if (!isset($objectInstances[$policy['class']])) { |
|
300 | 300 | require_once $policy['file']; |
301 | 301 | $classtoinit = $policy['class']; |
302 | 302 | $objectInstances[$policy['class']] = new $classtoinit($this->db); |
@@ -314,9 +314,9 @@ discard block |
||
314 | 314 | } |
315 | 315 | |
316 | 316 | // Finalize the transaction based on the outcome of all operations. |
317 | - if (! $this->errorCount) { |
|
317 | + if (!$this->errorCount) { |
|
318 | 318 | $this->db->commit(); |
319 | - $this->output = $this->nbupdated . ' record(s) anonymized, ' . $this->nbdeleted . ' record(s) deleted.'; |
|
319 | + $this->output = $this->nbupdated.' record(s) anonymized, '.$this->nbdeleted.' record(s) deleted.'; |
|
320 | 320 | } else { |
321 | 321 | $this->db->rollback(); |
322 | 322 | $this->error = implode("\n", $this->errorMessages); |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | */ |
340 | 340 | private function _processPolicyAction($policy, $action, $object, &$processedIds, $conf, $user) |
341 | 341 | { |
342 | - $constName = $policy['const_' . $action] ?? null; |
|
342 | + $constName = $policy['const_'.$action] ?? null; |
|
343 | 343 | $delay = $constName ? getDolGlobalInt($constName) : 0; |
344 | 344 | |
345 | 345 | if ($delay <= 0) { |
@@ -350,25 +350,25 @@ discard block |
||
350 | 350 | $sqlPlaceholders = array( |
351 | 351 | '__ENTITY__' => (string) $conf->entity, |
352 | 352 | '__DELAY__' => (string) $delay, |
353 | - '__NOW__' => "'" . $this->db->idate(dol_now()) . "'" |
|
353 | + '__NOW__' => "'".$this->db->idate(dol_now())."'" |
|
354 | 354 | ); |
355 | 355 | $sql = str_replace(array_keys($sqlPlaceholders), array_values($sqlPlaceholders), $policy['sql_template']); |
356 | 356 | |
357 | 357 | $resql = $this->db->query($sql); |
358 | 358 | |
359 | - if (! $resql) { |
|
359 | + if (!$resql) { |
|
360 | 360 | $this->errorCount++; |
361 | - $this->errorMessages[] = 'Error executing ' . $action . ' query for policy ' . $constName . ': ' . $this->db->lasterror(); |
|
361 | + $this->errorMessages[] = 'Error executing '.$action.' query for policy '.$constName.': '.$this->db->lasterror(); |
|
362 | 362 | |
363 | 363 | return; |
364 | 364 | } |
365 | 365 | |
366 | 366 | // Define the handler method for the action |
367 | - $handlerMethod = '_handle' . ucfirst($action); |
|
367 | + $handlerMethod = '_handle'.ucfirst($action); |
|
368 | 368 | |
369 | 369 | // Process the records found by the query |
370 | 370 | while ($obj = $this->db->fetch_object($resql)) { |
371 | - if (in_array($obj->rowid, $processedIds) || ! method_exists($this, $handlerMethod)) { |
|
371 | + if (in_array($obj->rowid, $processedIds) || !method_exists($this, $handlerMethod)) { |
|
372 | 372 | continue; |
373 | 373 | } |
374 | 374 | /** @var CommonObject $object */ |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | foreach ($policy['anonymize_fields'] as $field => $val) { |
417 | 417 | if ($val == 'MAKEANONYMOUS') { |
418 | 418 | // For each field with rule "MAKEANONYMOUS, set the new value, keeping the ID. |
419 | - $object->$field = $field . '-anon-' . $object->id; |
|
419 | + $object->$field = $field.'-anon-'.$object->id; |
|
420 | 420 | } else { |
421 | 421 | // For others, force the value, but only if not already empty. |
422 | 422 | if (!empty($object->$field)) { |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | |
449 | 449 | $paramConfig = $policy['call_params'][$method] ?? []; |
450 | 450 | |
451 | - return array_map(function (string $paramName) use ($availableArgs) { |
|
451 | + return array_map(function(string $paramName) use ($availableArgs) { |
|
452 | 452 | return $availableArgs[$paramName]; |
453 | 453 | }, $paramConfig); |
454 | 454 | } |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | { |
466 | 466 | if ($result <= 0) { |
467 | 467 | $this->errorCount++; |
468 | - $this->errorMessages[] = 'Failed to ' . $action . ' record ID ' . $object->id . ' from class ' . get_class($object) . '. Error: ' . $object->errorsToString(); |
|
468 | + $this->errorMessages[] = 'Failed to '.$action.' record ID '.$object->id.' from class '.get_class($object).'. Error: '.$object->errorsToString(); |
|
469 | 469 | } else { |
470 | 470 | if ($action === 'delete') { |
471 | 471 | $this->nbdeleted++; |
@@ -207,11 +207,11 @@ discard block |
||
207 | 207 | /** |
208 | 208 | * @var int Thirdparty ID |
209 | 209 | */ |
210 | - public $socid; // both socid and fk_soc are used |
|
210 | + public $socid; // both socid and fk_soc are used |
|
211 | 211 | /** |
212 | 212 | * @var int |
213 | 213 | */ |
214 | - public $fk_soc; // both socid and fk_soc are used |
|
214 | + public $fk_soc; // both socid and fk_soc are used |
|
215 | 215 | |
216 | 216 | /** |
217 | 217 | * @var string Thirdparty name |
@@ -801,11 +801,11 @@ discard block |
||
801 | 801 | global $conf; |
802 | 802 | $dn = ''; |
803 | 803 | if ($mode == 0) { |
804 | - $dn = getDolGlobalString('LDAP_KEY_CONTACTS') . "=".$info[getDolGlobalString('LDAP_KEY_CONTACTS')]."," . getDolGlobalString('LDAP_CONTACT_DN'); |
|
804 | + $dn = getDolGlobalString('LDAP_KEY_CONTACTS')."=".$info[getDolGlobalString('LDAP_KEY_CONTACTS')].",".getDolGlobalString('LDAP_CONTACT_DN'); |
|
805 | 805 | } elseif ($mode == 1) { |
806 | 806 | $dn = getDolGlobalString('LDAP_CONTACT_DN'); |
807 | 807 | } elseif ($mode == 2) { |
808 | - $dn = getDolGlobalString('LDAP_KEY_CONTACTS') . "=".$info[getDolGlobalString('LDAP_KEY_CONTACTS')]; |
|
808 | + $dn = getDolGlobalString('LDAP_KEY_CONTACTS')."=".$info[getDolGlobalString('LDAP_KEY_CONTACTS')]; |
|
809 | 809 | } |
810 | 810 | return $dn; |
811 | 811 | } |
@@ -954,12 +954,12 @@ discard block |
||
954 | 954 | // Update birthday alert |
955 | 955 | if (!empty($this->birthday_alert)) { |
956 | 956 | //check existing |
957 | - $sql_check = "SELECT rowid FROM " . MAIN_DB_PREFIX . "user_alert WHERE type = 1 AND fk_contact = " . ((int) $id) . " AND fk_user = " . ((int) $user->id); |
|
957 | + $sql_check = "SELECT rowid FROM ".MAIN_DB_PREFIX."user_alert WHERE type = 1 AND fk_contact = ".((int) $id)." AND fk_user = ".((int) $user->id); |
|
958 | 958 | $result_check = $this->db->query($sql_check); |
959 | 959 | if (!$result_check || ($this->db->num_rows($result_check) < 1)) { |
960 | 960 | //insert |
961 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "user_alert(type, fk_contact, fk_user) "; |
|
962 | - $sql .= "VALUES (1," . ((int) $id) . "," . ((int) $user->id) . ")"; |
|
961 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."user_alert(type, fk_contact, fk_user) "; |
|
962 | + $sql .= "VALUES (1,".((int) $id).",".((int) $user->id).")"; |
|
963 | 963 | $result = $this->db->query($sql); |
964 | 964 | if (!$result) { |
965 | 965 | $error++; |
@@ -969,8 +969,8 @@ discard block |
||
969 | 969 | $result = true; |
970 | 970 | } |
971 | 971 | } else { |
972 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_alert "; |
|
973 | - $sql .= "WHERE type=1 AND fk_contact=" . ((int) $id) . " AND fk_user=" . ((int) $user->id); |
|
972 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_alert "; |
|
973 | + $sql .= "WHERE type=1 AND fk_contact=".((int) $id)." AND fk_user=".((int) $user->id); |
|
974 | 974 | $result = $this->db->query($sql); |
975 | 975 | if (!$result) { |
976 | 976 | $error++; |
@@ -1071,37 +1071,37 @@ discard block |
||
1071 | 1071 | } elseif ($num) { // $num = 1 |
1072 | 1072 | $obj = $this->db->fetch_object($resql); |
1073 | 1073 | |
1074 | - $this->id = $obj->rowid; |
|
1075 | - $this->entity = $obj->entity; |
|
1076 | - $this->ref = $obj->rowid; |
|
1077 | - $this->ref_ext = $obj->ref_ext; |
|
1074 | + $this->id = $obj->rowid; |
|
1075 | + $this->entity = $obj->entity; |
|
1076 | + $this->ref = $obj->rowid; |
|
1077 | + $this->ref_ext = $obj->ref_ext; |
|
1078 | 1078 | |
1079 | 1079 | $this->civility_code = $obj->civility_code; |
1080 | 1080 | $this->civility = $obj->civility_code ? ($langs->trans("Civility".$obj->civility_code) != "Civility".$obj->civility_code ? $langs->trans("Civility".$obj->civility_code) : $obj->civility_code) : ''; |
1081 | 1081 | |
1082 | - $this->name_alias = $obj->name_alias; |
|
1082 | + $this->name_alias = $obj->name_alias; |
|
1083 | 1083 | $this->lastname = $obj->lastname; |
1084 | 1084 | $this->firstname = $obj->firstname; |
1085 | - $this->address = $obj->address; |
|
1086 | - $this->zip = $obj->zip; |
|
1087 | - $this->town = $obj->town; |
|
1085 | + $this->address = $obj->address; |
|
1086 | + $this->zip = $obj->zip; |
|
1087 | + $this->town = $obj->town; |
|
1088 | 1088 | |
1089 | 1089 | $this->date_creation = $this->db->jdate($obj->date_creation); |
1090 | 1090 | $this->date_modification = $this->db->jdate($obj->date_modification); |
1091 | 1091 | $this->user_creation_id = $obj->fk_user_creat; |
1092 | 1092 | $this->user_modification_id = $obj->fk_user_modif; |
1093 | 1093 | |
1094 | - $this->state_id = $obj->state_id; |
|
1094 | + $this->state_id = $obj->state_id; |
|
1095 | 1095 | $this->state_code = $obj->state_code; |
1096 | - $this->state = $obj->state; |
|
1096 | + $this->state = $obj->state; |
|
1097 | 1097 | |
1098 | 1098 | $this->country_id = $obj->country_id; |
1099 | - $this->country_code = $obj->country_id ? $obj->country_code : ''; |
|
1100 | - $this->country = $obj->country_id ? ($langs->trans('Country'.$obj->country_code) != 'Country'.$obj->country_code ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : ''; |
|
1099 | + $this->country_code = $obj->country_id ? $obj->country_code : ''; |
|
1100 | + $this->country = $obj->country_id ? ($langs->trans('Country'.$obj->country_code) != 'Country'.$obj->country_code ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : ''; |
|
1101 | 1101 | |
1102 | - $this->fk_soc = $obj->fk_soc; // Both fk_soc and socid are used |
|
1103 | - $this->socid = $obj->fk_soc; // Both fk_soc and socid are used |
|
1104 | - $this->socname = $obj->socname; |
|
1102 | + $this->fk_soc = $obj->fk_soc; // Both fk_soc and socid are used |
|
1103 | + $this->socid = $obj->fk_soc; // Both fk_soc and socid are used |
|
1104 | + $this->socname = $obj->socname; |
|
1105 | 1105 | $this->poste = $obj->poste; |
1106 | 1106 | $this->status = $obj->statut; |
1107 | 1107 | $this->statut = $obj->statut; |
@@ -1114,25 +1114,25 @@ discard block |
||
1114 | 1114 | $this->statut_commercial = $libelle; // libelle statut commercial |
1115 | 1115 | $this->stcomm_picto = $obj->stcomm_picto; // Picto statut commercial |
1116 | 1116 | |
1117 | - $this->phone_pro = trim($obj->phone); |
|
1118 | - $this->fax = trim($obj->fax); |
|
1119 | - $this->phone_perso = trim($obj->phone_perso); |
|
1120 | - $this->phone_mobile = trim($obj->phone_mobile); |
|
1117 | + $this->phone_pro = trim($obj->phone); |
|
1118 | + $this->fax = trim($obj->fax); |
|
1119 | + $this->phone_perso = trim($obj->phone_perso); |
|
1120 | + $this->phone_mobile = trim($obj->phone_mobile); |
|
1121 | 1121 | |
1122 | 1122 | $this->email = $obj->email; |
1123 | - $this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array()); |
|
1123 | + $this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array()); |
|
1124 | 1124 | $this->photo = $obj->photo; |
1125 | 1125 | $this->priv = $obj->priv; |
1126 | 1126 | $this->mail = $obj->email; |
1127 | 1127 | |
1128 | - $this->birthday = $this->db->jdate($obj->birthday); |
|
1129 | - $this->note = $obj->note_private; // deprecated |
|
1128 | + $this->birthday = $this->db->jdate($obj->birthday); |
|
1129 | + $this->note = $obj->note_private; // deprecated |
|
1130 | 1130 | $this->note_private = $obj->note_private; |
1131 | - $this->note_public = $obj->note_public; |
|
1131 | + $this->note_public = $obj->note_public; |
|
1132 | 1132 | $this->default_lang = $obj->default_lang; |
1133 | - $this->user_id = $obj->user_id; |
|
1133 | + $this->user_id = $obj->user_id; |
|
1134 | 1134 | $this->user_login = $obj->user_login; |
1135 | - $this->canvas = $obj->canvas; |
|
1135 | + $this->canvas = $obj->canvas; |
|
1136 | 1136 | |
1137 | 1137 | $this->import_key = $obj->import_key; |
1138 | 1138 | |
@@ -1499,7 +1499,7 @@ discard block |
||
1499 | 1499 | $datas['photo'] = $photo; |
1500 | 1500 | } |
1501 | 1501 | |
1502 | - $datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Contact").'</u> ' . $this->getLibStatut(4); |
|
1502 | + $datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Contact").'</u> '.$this->getLibStatut(4); |
|
1503 | 1503 | $datas['name'] = '<br><b>'.$langs->trans("Name").':</b> '.$this->getFullName($langs); |
1504 | 1504 | // if ($this->civility_id) $datas['civility'] = '<br><b>' . $langs->trans("Civility") . ':</b> '.$this->civility_id; // TODO Translate civilty_id code |
1505 | 1505 | if (!empty($this->poste)) { |
@@ -1957,7 +1957,7 @@ discard block |
||
1957 | 1957 | $error = 0; |
1958 | 1958 | |
1959 | 1959 | if (!isset($this->roles)) { |
1960 | - return 0; // Avoid to loose roles when property not set |
|
1960 | + return 0; // Avoid to loose roles when property not set |
|
1961 | 1961 | } |
1962 | 1962 | |
1963 | 1963 | $this->db->begin(); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $formbarcode = null; |
109 | 109 | |
110 | 110 | // Get parameters |
111 | -$id = GETPOSTINT('id'); |
|
111 | +$id = GETPOSTINT('id'); |
|
112 | 112 | if (getDolGlobalString('MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS')) { |
113 | 113 | $ref = (GETPOSTISSET('ref') ? GETPOST('ref', 'nohtml') : null); |
114 | 114 | } else { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $backtopage = GETPOST('backtopage', 'alpha'); |
121 | 121 | $confirm = GETPOST('confirm', 'alpha'); |
122 | 122 | $socid = GETPOSTINT('socid'); |
123 | -$duration_value = GETPOST('duration_value'); // duration value can be an empty string |
|
123 | +$duration_value = GETPOST('duration_value'); // duration value can be an empty string |
|
124 | 124 | $duration_unit = GETPOST('duration_unit', 'alpha'); |
125 | 125 | |
126 | 126 | $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | |
496 | 496 | // Quick edit for extrafields |
497 | 497 | if ($action == 'update_extras' && $permissiontoeditextra) { |
498 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
498 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
499 | 499 | |
500 | 500 | $attribute_name = GETPOST('attribute', 'aZ09'); |
501 | 501 | |
@@ -549,11 +549,11 @@ discard block |
||
549 | 549 | if (!$error) { |
550 | 550 | $units = GETPOSTINT('units'); |
551 | 551 | |
552 | - $object->entity = $conf->entity; |
|
553 | - $object->ref = (string) $ref; |
|
554 | - $object->label = GETPOST('label', $label_security_check); |
|
555 | - $object->price_base_type = GETPOST('price_base_type', 'aZ09'); |
|
556 | - $object->mandatory_period = empty(GETPOST("mandatoryperiod", 'alpha')) ? 0 : 1; |
|
552 | + $object->entity = $conf->entity; |
|
553 | + $object->ref = (string) $ref; |
|
554 | + $object->label = GETPOST('label', $label_security_check); |
|
555 | + $object->price_base_type = GETPOST('price_base_type', 'aZ09'); |
|
556 | + $object->mandatory_period = empty(GETPOST("mandatoryperiod", 'alpha')) ? 0 : 1; |
|
557 | 557 | if ($object->price_base_type == 'TTC') { |
558 | 558 | $object->price_ttc = GETPOSTFLOAT('price'); |
559 | 559 | } else { |
@@ -641,12 +641,12 @@ discard block |
||
641 | 641 | $object->duration_value = $duration_value; |
642 | 642 | $object->duration_unit = $duration_unit; |
643 | 643 | $object->fk_default_warehouse = GETPOSTINT('fk_default_warehouse'); |
644 | - $object->fk_default_workstation = GETPOSTINT('fk_default_workstation'); |
|
644 | + $object->fk_default_workstation = GETPOSTINT('fk_default_workstation'); |
|
645 | 645 | $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte') ? GETPOST('seuil_stock_alerte') : 0; |
646 | 646 | $object->desiredstock = GETPOST('desiredstock') ? GETPOST('desiredstock') : 0; |
647 | 647 | $object->canvas = GETPOST('canvas'); |
648 | 648 | $object->net_measure = GETPOST('net_measure'); |
649 | - $object->net_measure_units = GETPOST('net_measure_units') === '' ? null : GETPOSTINT('net_measure_units'); // This is not the fk_unit but the power of unit |
|
649 | + $object->net_measure_units = GETPOST('net_measure_units') === '' ? null : GETPOSTINT('net_measure_units'); // This is not the fk_unit but the power of unit |
|
650 | 650 | $object->weight = GETPOST('weight'); |
651 | 651 | $object->weight_units = GETPOST('weight_units'); // This is not the fk_unit but the power of unit |
652 | 652 | $object->length = GETPOST('size'); |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | } else { |
790 | 790 | if ($object->id > 0) { |
791 | 791 | // Need dol_clone methode 1 (same object class) because update product use hasbatch() method on oldcopy |
792 | - $object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
792 | + $object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
793 | 793 | |
794 | 794 | if (!getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) { |
795 | 795 | $object->ref = (string) $ref; |
@@ -814,7 +814,7 @@ discard block |
||
814 | 814 | $object->status_batch = GETPOSTINT('status_batch'); |
815 | 815 | $object->sell_or_eat_by_mandatory = GETPOSTINT('sell_or_eat_by_mandatory'); |
816 | 816 | $object->batch_mask = GETPOST('batch_mask', 'alpha'); |
817 | - $object->fk_default_warehouse = GETPOSTINT('fk_default_warehouse'); |
|
817 | + $object->fk_default_warehouse = GETPOSTINT('fk_default_warehouse'); |
|
818 | 818 | $object->fk_default_workstation = GETPOSTINT('fk_default_workstation'); |
819 | 819 | // removed from update view so GETPOST always empty |
820 | 820 | /* |
@@ -854,8 +854,8 @@ discard block |
||
854 | 854 | } |
855 | 855 | |
856 | 856 | // managed_in_stock |
857 | - $object->stockable_product = (int) GETPOSTISSET('stockable_product'); |
|
858 | - if ($object->status_batch > 0 && $object->stockable_product == 0 && isModEnabled('stock') && isModEnabled('productbatch')) { |
|
857 | + $object->stockable_product = (int) GETPOSTISSET('stockable_product'); |
|
858 | + if ($object->status_batch > 0 && $object->stockable_product == 0 && isModEnabled('stock') && isModEnabled('productbatch')) { |
|
859 | 859 | $object->stockable_product = 1; |
860 | 860 | setEventMessages($langs->trans('ForceBatchesNeedStockManagement'), null, 'warnings'); |
861 | 861 | } |
@@ -921,7 +921,7 @@ discard block |
||
921 | 921 | $object->accountancy_code_buy_export = $accountancy_code_buy_export; |
922 | 922 | } |
923 | 923 | if ($object->isService()) { |
924 | - $object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0 ; |
|
924 | + $object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0; |
|
925 | 925 | } |
926 | 926 | |
927 | 927 | |
@@ -1055,7 +1055,7 @@ discard block |
||
1055 | 1055 | $action = ""; |
1056 | 1056 | |
1057 | 1057 | $mesg = $langs->trans("ErrorProductAlreadyExists", $clone->ref); |
1058 | - $mesg .= ' <a href="' . $_SERVER["PHP_SELF"] . '?ref=' . $clone->ref . '">' . $langs->trans("ShowCardHere") . '</a>.'; |
|
1058 | + $mesg .= ' <a href="'.$_SERVER["PHP_SELF"].'?ref='.$clone->ref.'">'.$langs->trans("ShowCardHere").'</a>.'; |
|
1059 | 1059 | setEventMessages($mesg, null, 'errors'); |
1060 | 1060 | } else { |
1061 | 1061 | setEventMessages(empty($clone->error) ? '' : $langs->trans($clone->error), $clone->errors, 'errors'); |
@@ -1070,7 +1070,7 @@ discard block |
||
1070 | 1070 | } else { |
1071 | 1071 | $db->commit(); |
1072 | 1072 | $db->close(); |
1073 | - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); |
|
1073 | + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); |
|
1074 | 1074 | exit; |
1075 | 1075 | } |
1076 | 1076 | } else { |
@@ -2279,9 +2279,9 @@ discard block |
||
2279 | 2279 | if (isModEnabled('productbatch') && $object->hasbatch()) { |
2280 | 2280 | print '<tr><td><input type="hidden" id="stockable_product" name="stockable_product" value="on" /></td><td></td></tr>'; |
2281 | 2281 | } else { |
2282 | - print '<tr><td><label for="stockable_product">' . $langs->trans("StockableProduct") . '</label></td>'; |
|
2282 | + print '<tr><td><label for="stockable_product">'.$langs->trans("StockableProduct").'</label></td>'; |
|
2283 | 2283 | $checked = empty($object->stockable_product) ? "" : "checked"; |
2284 | - print '<td><input type="checkbox" id="stockable_product" name="stockable_product" '. $checked . ' /></td></tr>'; |
|
2284 | + print '<td><input type="checkbox" id="stockable_product" name="stockable_product" '.$checked.' /></td></tr>'; |
|
2285 | 2285 | } |
2286 | 2286 | |
2287 | 2287 | // Default warehouse |
@@ -2341,9 +2341,9 @@ discard block |
||
2341 | 2341 | print '</td></tr>'; |
2342 | 2342 | |
2343 | 2343 | if (isModEnabled('stock') && getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { |
2344 | - print '<tr><td>' . $langs->trans("StockableProduct") . '</td>'; |
|
2344 | + print '<tr><td>'.$langs->trans("StockableProduct").'</td>'; |
|
2345 | 2345 | $checked = $object->stockable_product == 1 ? "checked" : ""; |
2346 | - print '<td><input type="checkbox" id="stockable_product" name="stockable_product" ' . $checked . ' /></td></tr>'; |
|
2346 | + print '<td><input type="checkbox" id="stockable_product" name="stockable_product" '.$checked.' /></td></tr>'; |
|
2347 | 2347 | } |
2348 | 2348 | } else { |
2349 | 2349 | if (!getDolGlobalString('PRODUCT_DISABLE_NATURE')) { |
@@ -2810,7 +2810,7 @@ discard block |
||
2810 | 2810 | |
2811 | 2811 | // Stockable product / default warehouse |
2812 | 2812 | if (($object->isProduct() || getDolGlobalInt('STOCK_SUPPORTS_SERVICES')) && isModEnabled('stock')) { |
2813 | - print '<tr><td>' . $form->textwithpicto($langs->trans("StockableProduct"), $langs->trans('StockableProductDescription')) . '</td>'; |
|
2813 | + print '<tr><td>'.$form->textwithpicto($langs->trans("StockableProduct"), $langs->trans('StockableProductDescription')).'</td>'; |
|
2814 | 2814 | print '<td><input type="checkbox" readonly disabled '.($object->stockable_product == 1 ? 'checked' : '').'></td></tr>'; |
2815 | 2815 | |
2816 | 2816 | if ($object->isStockManaged()) { |
@@ -2867,7 +2867,7 @@ discard block |
||
2867 | 2867 | $result = $measuringUnits->fetchAll('', 'scale', 0, 0, ['t.active' => 1, 't.unit_type' => 'time']); |
2868 | 2868 | if ($result !== -1) { |
2869 | 2869 | foreach ($measuringUnits->records as $record) { |
2870 | - $durations[$record->short_label] = dol_ucfirst($record->label) . $plural; |
|
2870 | + $durations[$record->short_label] = dol_ucfirst($record->label).$plural; |
|
2871 | 2871 | } |
2872 | 2872 | } |
2873 | 2873 | print '<tr><td class="titlefieldmiddle">'.$langs->trans("Duration").'</td><td>'; |
@@ -3108,7 +3108,7 @@ discard block |
||
3108 | 3108 | } |
3109 | 3109 | |
3110 | 3110 | //Send |
3111 | - print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle'); |
|
3111 | + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); |
|
3112 | 3112 | |
3113 | 3113 | if (!isset($hookmanager->resArray['no_button_copy']) || $hookmanager->resArray['no_button_copy'] != 1) { |
3114 | 3114 | if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) { |
@@ -3290,7 +3290,7 @@ discard block |
||
3290 | 3290 | $modelmail = 'product_send'; |
3291 | 3291 | $defaulttopic = $object->label; |
3292 | 3292 | $diroutput = $conf->product->multidir_output[$object->entity]; |
3293 | - $trackid = 'prod' . $object->id; |
|
3293 | + $trackid = 'prod'.$object->id; |
|
3294 | 3294 | |
3295 | 3295 | include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; |
3296 | 3296 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | $langs->load("orders"); |
41 | 41 | |
42 | 42 | $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); |
43 | -'@phan-var-force Commande[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) |
|
43 | +'@phan-var-force Commande[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) |
|
44 | 44 | /** @var Commande[] $linkedObjectBlock */ |
45 | 45 | |
46 | 46 | $total = 0; |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $langs->load('ticket'); |
38 | 38 | |
39 | 39 | $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'datec', 'desc', 0, 0, 1); |
40 | -'@phan-var-force Ticket[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) |
|
40 | +'@phan-var-force Ticket[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) |
|
41 | 41 | /** @var Ticket[] $linkedObjectBlock */ |
42 | 42 | |
43 | 43 | $total = 0; |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | $this->note_private = $expedition->note_private; |
587 | 587 | $this->note_public = $expedition->note_public; |
588 | 588 | $this->fk_project = $expedition->fk_project; |
589 | - $this->date_delivery = ''; // Date of real reception. The Expedition->date_delivery is the planned one. |
|
589 | + $this->date_delivery = ''; // Date of real reception. The Expedition->date_delivery is the planned one. |
|
590 | 590 | $this->fk_delivery_address = $expedition->fk_delivery_address; |
591 | 591 | $this->socid = $expedition->socid; |
592 | 592 | $this->ref_customer = $expedition->ref_customer; |
@@ -827,7 +827,7 @@ discard block |
||
827 | 827 | $result .= $linkstart.$this->ref.$linkend; |
828 | 828 | |
829 | 829 | global $action; |
830 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
830 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
831 | 831 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
832 | 832 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
833 | 833 | if ($reshook > 0) { |
@@ -872,7 +872,7 @@ discard block |
||
872 | 872 | $line->label = $obj->custom_label; |
873 | 873 | $line->description = $obj->description; |
874 | 874 | $line->fk_product = $obj->fk_product; |
875 | - $line->qty_asked = $obj->qty_asked; |
|
875 | + $line->qty_asked = $obj->qty_asked; |
|
876 | 876 | $line->qty_shipped = $obj->qty_shipped; |
877 | 877 | |
878 | 878 | $line->product_label = $obj->product_label; // Product label |