Passed
Pull Request — master (#2)
by
unknown
26:19
created
dolibarr/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php 1 patch
Braces   +92 added lines, -60 removed lines patch added patch discarded remove patch
@@ -58,8 +58,14 @@  discard block
 block discarded – undo
58 58
 	 */
59 59
 	public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
60 60
 	{
61
-		if (empty($conf->ldap->enabled)) return 0;		// Module not active, we do nothing
62
-		if (defined('DISABLE_LDAP_SYNCHRO')) return 0;	// If constant defined, we do nothing
61
+		if (empty($conf->ldap->enabled)) {
62
+		    return 0;
63
+		}
64
+		// Module not active, we do nothing
65
+		if (defined('DISABLE_LDAP_SYNCHRO')) {
66
+		    return 0;
67
+		}
68
+		// If constant defined, we do nothing
63 69
 
64 70
 		if (! function_exists('ldap_connect'))
65 71
 		{
@@ -89,10 +95,11 @@  discard block
 block discarded – undo
89 95
 					$result=$ldap->add($dn,$info,$user);
90 96
 				}
91 97
 
92
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
98
+				if ($result < 0) {
99
+				    $this->error="ErrorLDAP ".$ldap->error;
100
+				}
93 101
 			}
94
-		}
95
-		elseif ($action == 'USER_MODIFY')
102
+		} elseif ($action == 'USER_MODIFY')
96 103
 		{
97 104
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
98 105
 			if (! empty($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE === 'dolibarr2ldap')
@@ -128,10 +135,11 @@  discard block
 block discarded – undo
128 135
 					$result=$ldap->update($dn,$info,$user,$olddn,$newrdn,$newparent);
129 136
 				}
130 137
 
131
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
138
+				if ($result < 0) {
139
+				    $this->error="ErrorLDAP ".$ldap->error;
140
+				}
132 141
 			}
133
-		}
134
-		elseif ($action == 'USER_NEW_PASSWORD')
142
+		} elseif ($action == 'USER_NEW_PASSWORD')
135 143
 		{
136 144
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
137 145
 			if (! empty($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE === 'dolibarr2ldap')
@@ -165,14 +173,14 @@  discard block
 block discarded – undo
165 173
 					$result=$ldap->update($dn,$info,$user,$olddn);
166 174
 				}
167 175
 
168
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
176
+				if ($result < 0) {
177
+				    $this->error="ErrorLDAP ".$ldap->error;
178
+				}
169 179
 			}
170
-		}
171
-		elseif ($action == 'USER_ENABLEDISABLE')
180
+		} elseif ($action == 'USER_ENABLEDISABLE')
172 181
 		{
173 182
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
174
-		}
175
-		elseif ($action == 'USER_DELETE')
183
+		} elseif ($action == 'USER_DELETE')
176 184
 		{
177 185
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
178 186
 			if (! empty($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE === 'dolibarr2ldap')
@@ -188,10 +196,11 @@  discard block
 block discarded – undo
188 196
 					$result=$ldap->delete($dn);
189 197
 				}
190 198
 
191
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
199
+				if ($result < 0) {
200
+				    $this->error="ErrorLDAP ".$ldap->error;
201
+				}
192 202
 			}
193
-		}
194
-		elseif ($action == 'USER_SETINGROUP')
203
+		} elseif ($action == 'USER_SETINGROUP')
195 204
 		{
196 205
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
197 206
 			if (! empty($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE === 'dolibarr2ldap')
@@ -226,10 +235,11 @@  discard block
 block discarded – undo
226 235
 					}
227 236
 				}
228 237
 
229
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
238
+				if ($result < 0) {
239
+				    $this->error="ErrorLDAP ".$ldap->error;
240
+				}
230 241
 			}
231
-		}
232
-		elseif ($action == 'USER_REMOVEFROMGROUP')
242
+		} elseif ($action == 'USER_REMOVEFROMGROUP')
233 243
 		{
234 244
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
235 245
 			if (! empty($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE === 'dolibarr2ldap')
@@ -264,7 +274,9 @@  discard block
 block discarded – undo
264 274
 					}
265 275
 				}
266 276
 
267
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
277
+				if ($result < 0) {
278
+				    $this->error="ErrorLDAP ".$ldap->error;
279
+				}
268 280
 			}
269 281
 		}
270 282
 
@@ -290,10 +302,11 @@  discard block
 block discarded – undo
290 302
 					$result=$ldap->add($dn,$info,$user);
291 303
 				}
292 304
 
293
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
305
+				if ($result < 0) {
306
+				    $this->error="ErrorLDAP ".$ldap->error;
307
+				}
294 308
 			}
295
-		}
296
-		elseif ($action == 'GROUP_MODIFY')
309
+		} elseif ($action == 'GROUP_MODIFY')
297 310
 		{
298 311
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
299 312
 			if (! empty($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE === 'dolibarr2ldap')
@@ -327,10 +340,11 @@  discard block
 block discarded – undo
327 340
 					$result=$ldap->update($dn,$info,$user,$olddn);
328 341
 				}
329 342
 
330
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
343
+				if ($result < 0) {
344
+				    $this->error="ErrorLDAP ".$ldap->error;
345
+				}
331 346
 			}
332
-		}
333
-		elseif ($action == 'GROUP_DELETE')
347
+		} elseif ($action == 'GROUP_DELETE')
334 348
 		{
335 349
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
336 350
 			if (! empty($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE === 'dolibarr2ldap')
@@ -346,7 +360,9 @@  discard block
 block discarded – undo
346 360
 					$result=$ldap->delete($dn);
347 361
 				}
348 362
 
349
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
363
+				if ($result < 0) {
364
+				    $this->error="ErrorLDAP ".$ldap->error;
365
+				}
350 366
 			}
351 367
 		}
352 368
 
@@ -367,10 +383,11 @@  discard block
 block discarded – undo
367 383
 					$result=$ldap->add($dn,$info,$user);
368 384
 				}
369 385
 
370
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
386
+				if ($result < 0) {
387
+				    $this->error="ErrorLDAP ".$ldap->error;
388
+				}
371 389
 			}
372
-		}
373
-		elseif ($action == 'CONTACT_MODIFY')
390
+		} elseif ($action == 'CONTACT_MODIFY')
374 391
 		{
375 392
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
376 393
 			if (! empty($conf->global->LDAP_CONTACT_ACTIVE))
@@ -404,10 +421,11 @@  discard block
 block discarded – undo
404 421
 					$result=$ldap->update($dn,$info,$user,$olddn);
405 422
 				}
406 423
 
407
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
424
+				if ($result < 0) {
425
+				    $this->error="ErrorLDAP ".$ldap->error;
426
+				}
408 427
 			}
409
-		}
410
-		elseif ($action == 'CONTACT_DELETE')
428
+		} elseif ($action == 'CONTACT_DELETE')
411 429
 		{
412 430
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
413 431
 			if (! empty($conf->global->LDAP_CONTACT_ACTIVE))
@@ -423,7 +441,9 @@  discard block
 block discarded – undo
423 441
 					$result=$ldap->delete($dn);
424 442
 				}
425 443
 
426
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
444
+				if ($result < 0) {
445
+				    $this->error="ErrorLDAP ".$ldap->error;
446
+				}
427 447
 			}
428 448
 		}
429 449
 
@@ -472,10 +492,11 @@  discard block
 block discarded – undo
472 492
 					}
473 493
 				}
474 494
 
475
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
495
+				if ($result < 0) {
496
+				    $this->error="ErrorLDAP ".$ldap->error;
497
+				}
476 498
 			}
477
-		}
478
-		elseif ($action == 'MEMBER_VALIDATE')
499
+		} elseif ($action == 'MEMBER_VALIDATE')
479 500
 		{
480 501
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
481 502
 			if (! empty($conf->global->LDAP_MEMBER_ACTIVE) && (string) $conf->global->LDAP_MEMBER_ACTIVE == '1')
@@ -495,11 +516,12 @@  discard block
 block discarded – undo
495 516
 						$result=$ldap->update($dn,$info,$user,$olddn);
496 517
 					}
497 518
 
498
-					if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
519
+					if ($result < 0) {
520
+					    $this->error="ErrorLDAP ".$ldap->error;
521
+					}
499 522
 				}
500 523
 			}
501
-		}
502
-		elseif ($action == 'MEMBER_SUBSCRIPTION')
524
+		} elseif ($action == 'MEMBER_SUBSCRIPTION')
503 525
 		{
504 526
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
505 527
 			if (! empty($conf->global->LDAP_MEMBER_ACTIVE) && (string) $conf->global->LDAP_MEMBER_ACTIVE == '1')
@@ -523,11 +545,12 @@  discard block
 block discarded – undo
523 545
 						$result=$ldap->update($dn,$info,$user,$olddn);
524 546
 					}
525 547
 
526
-					if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
548
+					if ($result < 0) {
549
+					    $this->error="ErrorLDAP ".$ldap->error;
550
+					}
527 551
 				}
528 552
 			}
529
-		}
530
-		elseif ($action == 'MEMBER_MODIFY')
553
+		} elseif ($action == 'MEMBER_MODIFY')
531 554
 		{
532 555
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
533 556
 			if (! empty($conf->global->LDAP_MEMBER_ACTIVE) && (string) $conf->global->LDAP_MEMBER_ACTIVE == '1')
@@ -618,10 +641,11 @@  discard block
 block discarded – undo
618 641
 					}
619 642
 				}
620 643
 
621
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
644
+				if ($result < 0) {
645
+				    $this->error="ErrorLDAP ".$ldap->error;
646
+				}
622 647
 			}
623
-		}
624
-		elseif ($action == 'MEMBER_NEW_PASSWORD')
648
+		} elseif ($action == 'MEMBER_NEW_PASSWORD')
625 649
 		{
626 650
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
627 651
 			if (! empty($conf->global->LDAP_MEMBER_ACTIVE) && (string) $conf->global->LDAP_MEMBER_ACTIVE == '1')
@@ -641,11 +665,12 @@  discard block
 block discarded – undo
641 665
 						$result=$ldap->update($dn,$info,$user,$olddn);
642 666
 					}
643 667
 
644
-					if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
668
+					if ($result < 0) {
669
+					    $this->error="ErrorLDAP ".$ldap->error;
670
+					}
645 671
 				}
646 672
 			}
647
-		}
648
-		elseif ($action == 'MEMBER_RESILIATE')
673
+		} elseif ($action == 'MEMBER_RESILIATE')
649 674
 		{
650 675
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
651 676
 			if (! empty($conf->global->LDAP_MEMBER_ACTIVE) && (string) $conf->global->LDAP_MEMBER_ACTIVE == '1')
@@ -665,11 +690,12 @@  discard block
 block discarded – undo
665 690
 						$result=$ldap->update($dn,$info,$user,$olddn);
666 691
 					}
667 692
 
668
-					if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
693
+					if ($result < 0) {
694
+					    $this->error="ErrorLDAP ".$ldap->error;
695
+					}
669 696
 				}
670 697
 			}
671
-		}
672
-		elseif ($action == 'MEMBER_DELETE')
698
+		} elseif ($action == 'MEMBER_DELETE')
673 699
 		{
674 700
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
675 701
 			if (! empty($conf->global->LDAP_MEMBER_ACTIVE) && (string) $conf->global->LDAP_MEMBER_ACTIVE == '1')
@@ -716,7 +742,9 @@  discard block
 block discarded – undo
716 742
 					}
717 743
 				}
718 744
 
719
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
745
+				if ($result < 0) {
746
+				    $this->error="ErrorLDAP ".$ldap->error;
747
+				}
720 748
 			}
721 749
 		}
722 750
 
@@ -742,10 +770,11 @@  discard block
 block discarded – undo
742 770
 					$result=$ldap->add($dn,$info,$user);
743 771
 				}
744 772
 
745
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
773
+				if ($result < 0) {
774
+				    $this->error="ErrorLDAP ".$ldap->error;
775
+				}
746 776
 			}
747
-		}
748
-		elseif ($action == 'MEMBER_TYPE_MODIFY')
777
+		} elseif ($action == 'MEMBER_TYPE_MODIFY')
749 778
 		{
750 779
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
751 780
 			if (! empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE) && (string) $conf->global->LDAP_MEMBER_TYPE_ACTIVE == '1')
@@ -783,10 +812,11 @@  discard block
 block discarded – undo
783 812
 					$result=$ldap->update($dn,$info,$user,$olddn);
784 813
 				}
785 814
 
786
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
815
+				if ($result < 0) {
816
+				    $this->error="ErrorLDAP ".$ldap->error;
817
+				}
787 818
 			}
788
-		}
789
-		elseif ($action == 'MEMBER_TYPE_DELETE')
819
+		} elseif ($action == 'MEMBER_TYPE_DELETE')
790 820
 		{
791 821
 			dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
792 822
 			if (! empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE) && (string) $conf->global->LDAP_MEMBER_TYPE_ACTIVE == '1')
@@ -802,7 +832,9 @@  discard block
 block discarded – undo
802 832
 					$result=$ldap->delete($dn);
803 833
 				}
804 834
 
805
-				if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
835
+				if ($result < 0) {
836
+				    $this->error="ErrorLDAP ".$ldap->error;
837
+				}
806 838
 			}
807 839
 		}
808 840
 
Please login to merge, or discard this patch.
dolibarr/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php 1 patch
Braces   +273 added lines, -188 removed lines patch added patch discarded remove patch
@@ -71,7 +71,10 @@  discard block
 block discarded – undo
71 71
 	 */
72 72
 	public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
73 73
 	{
74
-        if (empty($conf->agenda->enabled)) return 0;     // Module not active, we do nothing
74
+        if (empty($conf->agenda->enabled)) {
75
+            return 0;
76
+        }
77
+        // Module not active, we do nothing
75 78
 
76 79
 		$key = 'MAIN_AGENDA_ACTIONAUTO_'.$action;
77 80
 
@@ -82,7 +85,9 @@  discard block
 block discarded – undo
82 85
 
83 86
 		$langs->load("agenda");
84 87
 
85
-		if (empty($object->actiontypecode)) $object->actiontypecode='AC_OTH_AUTO';
88
+		if (empty($object->actiontypecode)) {
89
+		    $object->actiontypecode='AC_OTH_AUTO';
90
+		}
86 91
 
87 92
 		// Actions
88 93
 		if ($action == 'COMPANY_CREATE')
@@ -90,39 +95,46 @@  discard block
 block discarded – undo
90 95
             // Load translation files required by the page
91 96
             $langs->loadLangs(array("agenda","other","companies"));
92 97
 
93
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("NewCompanyToDolibarr",$object->name);
98
+            if (empty($object->actionmsg2)) {
99
+                $object->actionmsg2=$langs->transnoentities("NewCompanyToDolibarr",$object->name);
100
+            }
94 101
             $object->actionmsg=$langs->transnoentities("NewCompanyToDolibarr",$object->name);
95
-            if (! empty($object->prefix)) $object->actionmsg.=" (".$object->prefix.")";
102
+            if (! empty($object->prefix)) {
103
+                $object->actionmsg.=" (".$object->prefix.")";
104
+            }
96 105
 
97 106
 			$object->sendtoid=0;
98 107
 			$object->socid=$object->id;
99
-        }
100
-        elseif ($action == 'COMPANY_SENTBYMAIL')
108
+        } elseif ($action == 'COMPANY_SENTBYMAIL')
101 109
         {
102 110
             // Load translation files required by the page
103 111
             $langs->loadLangs(array("agenda","other","orders"));
104 112
 
105
-            if (empty($object->actionmsg2)) dol_syslog('Trigger called with property actionmsg2 on object not defined', LOG_ERR);
113
+            if (empty($object->actionmsg2)) {
114
+                dol_syslog('Trigger called with property actionmsg2 on object not defined', LOG_ERR);
115
+            }
106 116
 
107 117
             // Parameters $object->sendtoid defined by caller
108 118
             //$object->sendtoid=0;
109
-		}
110
-        elseif ($action == 'CONTRACT_VALIDATE')
119
+		} elseif ($action == 'CONTRACT_VALIDATE')
111 120
         {
112 121
             // Load translation files required by the page
113 122
             $langs->loadLangs(array("agenda","other","contracts"));
114 123
 
115
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ContractValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
124
+            if (empty($object->actionmsg2)) {
125
+                $object->actionmsg2=$langs->transnoentities("ContractValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
126
+            }
116 127
             $object->actionmsg=$langs->transnoentities("ContractValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
117 128
 
118 129
             $object->sendtoid=0;
119
-		}
120
-		elseif ($action == 'CONTRACT_SENTBYMAIL')
130
+		} elseif ($action == 'CONTRACT_SENTBYMAIL')
121 131
 		{
122 132
 			// Load translation files required by the page
123 133
             $langs->loadLangs(array("agenda","other","contracts"));
124 134
 
125
-			if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ContractSentByEMail",$object->ref);
135
+			if (empty($object->actionmsg2)) {
136
+			    $object->actionmsg2=$langs->transnoentities("ContractSentByEMail",$object->ref);
137
+			}
126 138
 			if (empty($object->actionmsg))
127 139
 			{
128 140
 				$object->actionmsg=$langs->transnoentities("ContractSentByEMail",$object->ref);
@@ -130,23 +142,25 @@  discard block
 block discarded – undo
130 142
 
131 143
 			// Parameters $object->sendtoid defined by caller
132 144
 			//$object->sendtoid=0;
133
-		}
134
-		elseif ($action == 'PROPAL_VALIDATE')
145
+		} elseif ($action == 'PROPAL_VALIDATE')
135 146
         {
136 147
             // Load translation files required by the page
137 148
             $langs->loadLangs(array("agenda","other","propal"));
138 149
 
139
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
150
+            if (empty($object->actionmsg2)) {
151
+                $object->actionmsg2=$langs->transnoentities("PropalValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
152
+            }
140 153
             $object->actionmsg=$langs->transnoentities("PropalValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
141 154
 
142 155
 			$object->sendtoid=0;
143
-		}
144
-        elseif ($action == 'PROPAL_SENTBYMAIL')
156
+		} elseif ($action == 'PROPAL_SENTBYMAIL')
145 157
         {
146 158
             // Load translation files required by the page
147 159
             $langs->loadLangs(array("agenda","other","propal"));
148 160
 
149
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProposalSentByEMail",$object->ref);
161
+            if (empty($object->actionmsg2)) {
162
+                $object->actionmsg2=$langs->transnoentities("ProposalSentByEMail",$object->ref);
163
+            }
150 164
             if (empty($object->actionmsg))
151 165
             {
152 166
                 $object->actionmsg=$langs->transnoentities("ProposalSentByEMail",$object->ref);
@@ -154,83 +168,91 @@  discard block
 block discarded – undo
154 168
 
155 169
             // Parameters $object->sendtoid defined by caller
156 170
             //$object->sendtoid=0;
157
-		}
158
-		elseif ($action == 'PROPAL_CLOSE_SIGNED')
171
+		} elseif ($action == 'PROPAL_CLOSE_SIGNED')
159 172
         {
160 173
             // Load translation files required by the page
161 174
             $langs->loadLangs(array("agenda","other","propal"));
162 175
 
163
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
176
+            if (empty($object->actionmsg2)) {
177
+                $object->actionmsg2=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
178
+            }
164 179
             $object->actionmsg=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
165 180
 
166 181
 			$object->sendtoid=0;
167
-		}
168
-		elseif ($action == 'PROPAL_CLASSIFY_BILLED')
182
+		} elseif ($action == 'PROPAL_CLASSIFY_BILLED')
169 183
         {
170 184
             // Load translation files required by the page
171 185
             $langs->loadLangs(array("agenda","other","propal"));
172 186
 
173
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClassifiedBilledInDolibarr",$object->ref);
187
+            if (empty($object->actionmsg2)) {
188
+                $object->actionmsg2=$langs->transnoentities("PropalClassifiedBilledInDolibarr",$object->ref);
189
+            }
174 190
             $object->actionmsg=$langs->transnoentities("PropalClassifiedBilledInDolibarr",$object->ref);
175 191
 
176 192
 			$object->sendtoid=0;
177
-		}
178
-		elseif ($action == 'PROPAL_CLOSE_REFUSED')
193
+		} elseif ($action == 'PROPAL_CLOSE_REFUSED')
179 194
         {
180 195
             // Load translation files required by the page
181 196
             $langs->loadLangs(array("agenda","other","propal"));
182 197
 
183
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
198
+            if (empty($object->actionmsg2)) {
199
+                $object->actionmsg2=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
200
+            }
184 201
             $object->actionmsg=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
185 202
 
186 203
 			$object->sendtoid=0;
187
-		}
188
-		elseif ($action == 'ORDER_VALIDATE')
204
+		} elseif ($action == 'ORDER_VALIDATE')
189 205
         {
190 206
             // Load translation files required by the page
191 207
             $langs->loadLangs(array("agenda","orders"));
192 208
 
193
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
209
+            if (empty($object->actionmsg2)) {
210
+                $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
211
+            }
194 212
             $object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
195 213
 
196 214
 			$object->sendtoid=0;
197
-		}
198
-		elseif ($action == 'ORDER_CLOSE')
215
+		} elseif ($action == 'ORDER_CLOSE')
199 216
         {
200 217
             // Load translation files required by the page
201 218
             $langs->loadLangs(array("agenda","other","orders"));
202 219
 
203
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderDeliveredInDolibarr",$object->ref);
220
+            if (empty($object->actionmsg2)) {
221
+                $object->actionmsg2=$langs->transnoentities("OrderDeliveredInDolibarr",$object->ref);
222
+            }
204 223
             $object->actionmsg=$langs->transnoentities("OrderDeliveredInDolibarr",$object->ref);
205 224
 
206 225
 			$object->sendtoid=0;
207
-		}
208
-		elseif ($action == 'ORDER_CLASSIFY_BILLED')
226
+		} elseif ($action == 'ORDER_CLASSIFY_BILLED')
209 227
         {
210 228
             // Load translation files required by the page
211 229
             $langs->loadLangs(array("agenda","other","orders"));
212 230
 
213
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderBilledInDolibarr",$object->ref);
231
+            if (empty($object->actionmsg2)) {
232
+                $object->actionmsg2=$langs->transnoentities("OrderBilledInDolibarr",$object->ref);
233
+            }
214 234
             $object->actionmsg=$langs->transnoentities("OrderBilledInDolibarr",$object->ref);
215 235
 
216 236
 			$object->sendtoid=0;
217
-		}
218
-		elseif ($action == 'ORDER_CANCEL')
237
+		} elseif ($action == 'ORDER_CANCEL')
219 238
         {
220 239
             // Load translation files required by the page
221 240
             $langs->loadLangs(array("agenda","other","orders"));
222 241
 
223
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderCanceledInDolibarr",$object->ref);
242
+            if (empty($object->actionmsg2)) {
243
+                $object->actionmsg2=$langs->transnoentities("OrderCanceledInDolibarr",$object->ref);
244
+            }
224 245
             $object->actionmsg=$langs->transnoentities("OrderCanceledInDolibarr",$object->ref);
225 246
 
226 247
 			$object->sendtoid=0;
227
-		}
228
-		elseif ($action == 'ORDER_SENTBYMAIL')
248
+		} elseif ($action == 'ORDER_SENTBYMAIL')
229 249
         {
230 250
             // Load translation files required by the page
231 251
             $langs->loadLangs(array("agenda","other","orders"));
232 252
 
233
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderSentByEMail",$object->ref);
253
+            if (empty($object->actionmsg2)) {
254
+                $object->actionmsg2=$langs->transnoentities("OrderSentByEMail",$object->ref);
255
+            }
234 256
             if (empty($object->actionmsg))
235 257
             {
236 258
                 $object->actionmsg=$langs->transnoentities("OrderSentByEMail",$object->ref);
@@ -238,33 +260,36 @@  discard block
 block discarded – undo
238 260
 
239 261
             // Parameters $object->sendtoid defined by caller
240 262
             //$object->sendtoid=0;
241
-		}
242
-		elseif ($action == 'BILL_VALIDATE')
263
+		} elseif ($action == 'BILL_VALIDATE')
243 264
         {
244 265
             // Load translation files required by the page
245 266
             $langs->loadLangs(array("agenda","other","bills"));
246 267
 
247
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
268
+            if (empty($object->actionmsg2)) {
269
+                $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
270
+            }
248 271
             $object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
249 272
 
250 273
 			$object->sendtoid=0;
251
-		}
252
-		elseif ($action == 'BILL_UNVALIDATE')
274
+		} elseif ($action == 'BILL_UNVALIDATE')
253 275
         {
254 276
            // Load translation files required by the page
255 277
             $langs->loadLangs(array("agenda","other","bills"));
256 278
 
257
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
279
+            if (empty($object->actionmsg2)) {
280
+                $object->actionmsg2=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
281
+            }
258 282
             $object->actionmsg=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
259 283
 
260 284
 			$object->sendtoid=0;
261
-		}
262
-        elseif ($action == 'BILL_SENTBYMAIL')
285
+		} elseif ($action == 'BILL_SENTBYMAIL')
263 286
         {
264 287
             // Load translation files required by the page
265 288
             $langs->loadLangs(array("agenda","other","bills"));
266 289
 
267
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceSentByEMail",$object->ref);
290
+            if (empty($object->actionmsg2)) {
291
+                $object->actionmsg2=$langs->transnoentities("InvoiceSentByEMail",$object->ref);
292
+            }
268 293
             if (empty($object->actionmsg))
269 294
             {
270 295
                 $object->actionmsg=$langs->transnoentities("InvoiceSentByEMail",$object->ref);
@@ -272,8 +297,7 @@  discard block
 block discarded – undo
272 297
 
273 298
             // Parameters $object->sendtoid defined by caller
274 299
             //$object->sendtoid=0;
275
-		}
276
-		elseif ($action == 'BILL_PAYED')
300
+		} elseif ($action == 'BILL_PAYED')
277 301
         {
278 302
             // Load translation files required by the page
279 303
             $langs->loadLangs(array("agenda","other","bills"));
@@ -283,59 +307,64 @@  discard block
 block discarded – undo
283 307
             $object->actionmsg=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
284 308
 
285 309
             $object->sendtoid=0;
286
-		}
287
-		elseif ($action == 'BILL_CANCEL')
310
+		} elseif ($action == 'BILL_CANCEL')
288 311
         {
289 312
             // Load translation files required by the page
290 313
             $langs->loadLangs(array("agenda","other","bills"));
291 314
 
292
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
315
+            if (empty($object->actionmsg2)) {
316
+                $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
317
+            }
293 318
             $object->actionmsg=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
294 319
 
295 320
             $object->sendtoid=0;
296
-		}
297
-		elseif ($action == 'FICHINTER_CREATE')
321
+		} elseif ($action == 'FICHINTER_CREATE')
298 322
         {
299 323
             // Load translation files required by the page
300 324
             $langs->loadLangs(array("agenda","other","interventions"));
301 325
 
302
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionCreatedInDolibarr",$object->ref);
326
+            if (empty($object->actionmsg2)) {
327
+                $object->actionmsg2=$langs->transnoentities("InterventionCreatedInDolibarr",$object->ref);
328
+            }
303 329
             $object->actionmsg=$langs->transnoentities("InterventionCreatedInDolibarr",$object->ref);
304 330
 
305 331
             $object->sendtoid=0;
306 332
 			$object->fk_element=0;
307 333
 			$object->elementtype='';
308
-		}
309
-		elseif ($action == 'FICHINTER_VALIDATE')
334
+		} elseif ($action == 'FICHINTER_VALIDATE')
310 335
         {
311 336
             // Load translation files required by the page
312 337
             $langs->loadLangs(array("agenda","other","interventions"));
313 338
 
314
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
339
+            if (empty($object->actionmsg2)) {
340
+                $object->actionmsg2=$langs->transnoentities("InterventionValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
341
+            }
315 342
             $object->actionmsg=$langs->transnoentities("InterventionValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
316 343
 
317 344
             $object->sendtoid=0;
318 345
 			$object->fk_element=0;
319 346
 			$object->elementtype='';
320
-		}
321
-		elseif ($action == 'FICHINTER_MODIFY')
347
+		} elseif ($action == 'FICHINTER_MODIFY')
322 348
         {
323 349
             // Load translation files required by the page
324 350
             $langs->loadLangs(array("agenda","other","interventions"));
325 351
 
326
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionModifiedInDolibarr",$object->ref);
352
+            if (empty($object->actionmsg2)) {
353
+                $object->actionmsg2=$langs->transnoentities("InterventionModifiedInDolibarr",$object->ref);
354
+            }
327 355
             $object->actionmsg=$langs->transnoentities("InterventionModifiedInDolibarr",$object->ref);
328 356
 
329 357
             $object->sendtoid=0;
330 358
 			$object->fk_element=0;
331 359
 			$object->elementtype='';
332
-		}
333
-		elseif ($action == 'FICHINTER_SENTBYMAIL')
360
+		} elseif ($action == 'FICHINTER_SENTBYMAIL')
334 361
         {
335 362
             // Load translation files required by the page
336 363
             $langs->loadLangs(array("agenda","other","interventions"));
337 364
 
338
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref);
365
+            if (empty($object->actionmsg2)) {
366
+                $object->actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref);
367
+            }
339 368
             if (empty($object->actionmsg))
340 369
             {
341 370
             	$object->actionmsg=$langs->transnoentities("InterventionSentByEMail",$object->ref);
@@ -343,45 +372,49 @@  discard block
 block discarded – undo
343 372
 
344 373
             // Parameters $object->sendtoid defined by caller
345 374
             //$object->sendtoid=0;
346
-        }
347
-        elseif ($action == 'FICHINTER_CLASSIFY_BILLED')
375
+        } elseif ($action == 'FICHINTER_CLASSIFY_BILLED')
348 376
         {
349 377
             // Load translation files required by the page
350 378
             $langs->loadLangs(array("agenda","other","interventions"));
351 379
 
352
-           	if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionClassifiedBilledInDolibarr",$object->ref);
380
+           	if (empty($object->actionmsg2)) {
381
+           	    $object->actionmsg2=$langs->transnoentities("InterventionClassifiedBilledInDolibarr",$object->ref);
382
+           	}
353 383
            	$object->actionmsg=$langs->transnoentities("InterventionClassifiedBilledInDolibarr",$object->ref);
354 384
 
355 385
             $object->sendtoid=0;
356
-        }
357
-	    elseif ($action == 'FICHINTER_CLASSIFY_UNBILLED')
386
+        } elseif ($action == 'FICHINTER_CLASSIFY_UNBILLED')
358 387
         {
359 388
             // Load translation files required by the page
360 389
             $langs->loadLangs(array("agenda","other","interventions"));
361 390
 
362
-           	if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionClassifiedUnbilledInDolibarr",$object->ref);
391
+           	if (empty($object->actionmsg2)) {
392
+           	    $object->actionmsg2=$langs->transnoentities("InterventionClassifiedUnbilledInDolibarr",$object->ref);
393
+           	}
363 394
            	$object->actionmsg=$langs->transnoentities("InterventionClassifiedUnbilledInDolibarr",$object->ref);
364 395
 
365 396
             $object->sendtoid=0;
366
-        }
367
-        elseif ($action == 'FICHINTER_DELETE')
397
+        } elseif ($action == 'FICHINTER_DELETE')
368 398
         {
369 399
             // Load translation files required by the page
370 400
             $langs->loadLangs(array("agenda","other","interventions"));
371 401
 
372
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionDeletedInDolibarr",$object->ref);
402
+            if (empty($object->actionmsg2)) {
403
+                $object->actionmsg2=$langs->transnoentities("InterventionDeletedInDolibarr",$object->ref);
404
+            }
373 405
             $object->actionmsg=$langs->transnoentities("InterventionDeletedInDolibarr",$object->ref);
374 406
 
375 407
             $object->sendtoid=0;
376 408
 			$object->fk_element=0;
377 409
 			$object->elementtype='';
378
-		}
379
-        elseif ($action == 'SHIPPING_VALIDATE')
410
+		} elseif ($action == 'SHIPPING_VALIDATE')
380 411
         {
381 412
             // Load translation files required by the page
382 413
             $langs->loadLangs(array("agenda","other","sendings"));
383 414
 
384
-        	if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ShippingValidated",($object->newref?$object->newref:$object->ref));
415
+        	if (empty($object->actionmsg2)) {
416
+        	    $object->actionmsg2=$langs->transnoentities("ShippingValidated",($object->newref?$object->newref:$object->ref));
417
+        	}
385 418
         	if (empty($object->actionmsg))
386 419
         	{
387 420
         		$object->actionmsg=$langs->transnoentities("ShippingValidated",($object->newref?$object->newref:$object->ref));
@@ -389,13 +422,14 @@  discard block
 block discarded – undo
389 422
 
390 423
         	// Parameters $object->sendtoid defined by caller
391 424
         	//$object->sendtoid=0;
392
-        }
393
-		elseif ($action == 'SHIPPING_SENTBYMAIL')
425
+        } elseif ($action == 'SHIPPING_SENTBYMAIL')
394 426
         {
395 427
             // Load translation files required by the page
396 428
             $langs->loadLangs(array("agenda","other","sendings"));
397 429
 
398
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ShippingSentByEMail",$object->ref);
430
+            if (empty($object->actionmsg2)) {
431
+                $object->actionmsg2=$langs->transnoentities("ShippingSentByEMail",$object->ref);
432
+            }
399 433
             if (empty($object->actionmsg))
400 434
             {
401 435
                 $object->actionmsg=$langs->transnoentities("ShippingSentByEMail",$object->ref);
@@ -409,7 +443,9 @@  discard block
 block discarded – undo
409 443
             $langs->load("other");
410 444
         	$langs->load("receptions");
411 445
 
412
-        	if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ReceptionValidated",($object->newref?$object->newref:$object->ref));
446
+        	if (empty($object->actionmsg2)) {
447
+        	    $object->actionmsg2=$langs->transnoentities("ReceptionValidated",($object->newref?$object->newref:$object->ref));
448
+        	}
413 449
         	if (empty($object->actionmsg))
414 450
         	{
415 451
         		$object->actionmsg=$langs->transnoentities("ReceptionValidated",($object->newref?$object->newref:$object->ref));
@@ -417,14 +453,15 @@  discard block
 block discarded – undo
417 453
 
418 454
         	// Parameters $object->sendtoid defined by caller
419 455
         	//$object->sendtoid=0;
420
-        }
421
-		elseif ($action == 'RECEPTION_SENTBYMAIL')
456
+        } elseif ($action == 'RECEPTION_SENTBYMAIL')
422 457
         {
423 458
             $langs->load("agenda");
424 459
             $langs->load("other");
425 460
             $langs->load("receptions");
426 461
 
427
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ReceptionSentByEMail",$object->ref);
462
+            if (empty($object->actionmsg2)) {
463
+                $object->actionmsg2=$langs->transnoentities("ReceptionSentByEMail",$object->ref);
464
+            }
428 465
             if (empty($object->actionmsg))
429 466
             {
430 467
                 $object->actionmsg=$langs->transnoentities("ReceptionSentByEMail",$object->ref);
@@ -432,23 +469,25 @@  discard block
 block discarded – undo
432 469
 
433 470
             // Parameters $object->sendtoid defined by caller
434 471
             //$object->sendtoid=0;
435
-		}
436
-		elseif ($action == 'PROPOSAL_SUPPLIER_VALIDATE')
472
+		} elseif ($action == 'PROPOSAL_SUPPLIER_VALIDATE')
437 473
 		{
438 474
 			// Load translation files required by the page
439 475
             $langs->loadLangs(array("agenda","other","propal"));
440 476
 
441
-			if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
477
+			if (empty($object->actionmsg2)) {
478
+			    $object->actionmsg2=$langs->transnoentities("PropalValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
479
+			}
442 480
 			$object->actionmsg=$langs->transnoentities("PropalValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
443 481
 
444 482
 			$object->sendtoid=0;
445
-		}
446
-		elseif ($action == 'PROPOSAL_SUPPLIER_SENTBYMAIL')
483
+		} elseif ($action == 'PROPOSAL_SUPPLIER_SENTBYMAIL')
447 484
 		{
448 485
 			// Load translation files required by the page
449 486
             $langs->loadLangs(array("agenda","other","propal"));
450 487
 
451
-			if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProposalSentByEMail",$object->ref);
488
+			if (empty($object->actionmsg2)) {
489
+			    $object->actionmsg2=$langs->transnoentities("ProposalSentByEMail",$object->ref);
490
+			}
452 491
 			if (empty($object->actionmsg))
453 492
 			{
454 493
 				$object->actionmsg=$langs->transnoentities("ProposalSentByEMail",$object->ref);
@@ -456,93 +495,102 @@  discard block
 block discarded – undo
456 495
 
457 496
 			// Parameters $object->sendtoid defined by caller
458 497
 			//$object->sendtoid=0;
459
-		}
460
-		elseif ($action == 'PROPOSAL_SUPPLIER_CLOSE_SIGNED')
498
+		} elseif ($action == 'PROPOSAL_SUPPLIER_CLOSE_SIGNED')
461 499
 		{
462 500
 			// Load translation files required by the page
463 501
             $langs->loadLangs(array("agenda","other","propal"));
464 502
 
465
-			if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
503
+			if (empty($object->actionmsg2)) {
504
+			    $object->actionmsg2=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
505
+			}
466 506
 			$object->actionmsg=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
467 507
 
468 508
 			$object->sendtoid=0;
469
-		}
470
-		elseif ($action == 'PROPOSAL_SUPPLIER_CLOSE_REFUSED')
509
+		} elseif ($action == 'PROPOSAL_SUPPLIER_CLOSE_REFUSED')
471 510
 		{
472 511
 			// Load translation files required by the page
473 512
             $langs->loadLangs(array("agenda","other","propal"));
474 513
 
475
-			if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
514
+			if (empty($object->actionmsg2)) {
515
+			    $object->actionmsg2=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
516
+			}
476 517
 			$object->actionmsg=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
477 518
 
478 519
 			$object->sendtoid=0;
479
-		}
480
-		elseif ($action == 'ORDER_SUPPLIER_CREATE')
520
+		} elseif ($action == 'ORDER_SUPPLIER_CREATE')
481 521
         {
482 522
             // Load translation files required by the page
483 523
             $langs->loadLangs(array("agenda","other","orders"));
484 524
 
485
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderCreatedInDolibarr",($object->newref?$object->newref:$object->ref));
525
+            if (empty($object->actionmsg2)) {
526
+                $object->actionmsg2=$langs->transnoentities("OrderCreatedInDolibarr",($object->newref?$object->newref:$object->ref));
527
+            }
486 528
             $object->actionmsg=$langs->transnoentities("OrderCreatedInDolibarr",($object->newref?$object->newref:$object->ref));
487 529
 
488 530
             $object->sendtoid=0;
489
-		}
490
-		elseif ($action == 'ORDER_SUPPLIER_VALIDATE')
531
+		} elseif ($action == 'ORDER_SUPPLIER_VALIDATE')
491 532
         {
492 533
             // Load translation files required by the page
493 534
             $langs->loadLangs(array("agenda","other","orders"));
494 535
 
495
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
536
+            if (empty($object->actionmsg2)) {
537
+                $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
538
+            }
496 539
             $object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
497 540
 
498 541
             $object->sendtoid=0;
499
-		}
500
-		elseif ($action == 'ORDER_SUPPLIER_APPROVE')
542
+		} elseif ($action == 'ORDER_SUPPLIER_APPROVE')
501 543
 		{
502 544
             // Load translation files required by the page
503 545
             $langs->loadLangs(array("agenda","other","orders"));
504 546
 
505
-			if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderApprovedInDolibarr",$object->ref);
547
+			if (empty($object->actionmsg2)) {
548
+			    $object->actionmsg2=$langs->transnoentities("OrderApprovedInDolibarr",$object->ref);
549
+			}
506 550
 			$object->actionmsg=$langs->transnoentities("OrderApprovedInDolibarr",$object->ref);
507 551
 
508 552
 			$object->sendtoid=0;
509
-		}
510
-		elseif ($action == 'ORDER_SUPPLIER_REFUSE')
553
+		} elseif ($action == 'ORDER_SUPPLIER_REFUSE')
511 554
 		{
512 555
             // Load translation files required by the page
513 556
             $langs->loadLangs(array("agenda","other","orders"));
514 557
 
515
-			if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderRefusedInDolibarr",$object->ref);
558
+			if (empty($object->actionmsg2)) {
559
+			    $object->actionmsg2=$langs->transnoentities("OrderRefusedInDolibarr",$object->ref);
560
+			}
516 561
 			$object->actionmsg=$langs->transnoentities("OrderRefusedInDolibarr",$object->ref);
517 562
 
518 563
 			$object->sendtoid=0;
519
-		}
520
-		elseif ($action == 'ORDER_SUPPLIER_SUBMIT')
564
+		} elseif ($action == 'ORDER_SUPPLIER_SUBMIT')
521 565
         {
522 566
             // Load translation files required by the page
523 567
             $langs->loadLangs(array("agenda","other","orders"));
524 568
 
525
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierOrderSubmitedInDolibarr",($object->newref?$object->newref:$object->ref));
569
+            if (empty($object->actionmsg2)) {
570
+                $object->actionmsg2=$langs->transnoentities("SupplierOrderSubmitedInDolibarr",($object->newref?$object->newref:$object->ref));
571
+            }
526 572
             $object->actionmsg=$langs->transnoentities("SupplierOrderSubmitedInDolibarr",($object->newref?$object->newref:$object->ref));
527 573
 
528 574
             $object->sendtoid=0;
529
-		}
530
-		elseif ($action == 'ORDER_SUPPLIER_RECEIVE')
575
+		} elseif ($action == 'ORDER_SUPPLIER_RECEIVE')
531 576
         {
532 577
             // Load translation files required by the page
533 578
             $langs->loadLangs(array("agenda","other","orders"));
534 579
 
535
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierOrderReceivedInDolibarr",($object->newref?$object->newref:$object->ref));
580
+            if (empty($object->actionmsg2)) {
581
+                $object->actionmsg2=$langs->transnoentities("SupplierOrderReceivedInDolibarr",($object->newref?$object->newref:$object->ref));
582
+            }
536 583
             $object->actionmsg=$langs->transnoentities("SupplierOrderReceivedInDolibarr",($object->newref?$object->newref:$object->ref));
537 584
 
538 585
             $object->sendtoid=0;
539
-		}
540
-		elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL')
586
+		} elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL')
541 587
         {
542 588
             // Load translation files required by the page
543 589
             $langs->loadLangs(array("agenda","other","bills","orders"));
544 590
 
545
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierOrderSentByEMail",$object->ref);
591
+            if (empty($object->actionmsg2)) {
592
+                $object->actionmsg2=$langs->transnoentities("SupplierOrderSentByEMail",$object->ref);
593
+            }
546 594
             if (empty($object->actionmsg))
547 595
             {
548 596
                 $object->actionmsg=$langs->transnoentities("SupplierOrderSentByEMail",$object->ref);
@@ -550,46 +598,50 @@  discard block
 block discarded – undo
550 598
 
551 599
             // Parameters $object->sendtoid defined by caller
552 600
             //$object->sendtoid=0;
553
-        }
554
-		elseif ($action == 'ORDER_SUPPLIER_CLASSIFY_BILLED')
601
+        } elseif ($action == 'ORDER_SUPPLIER_CLASSIFY_BILLED')
555 602
         {
556 603
             // Load translation files required by the page
557 604
             $langs->loadLangs(array("agenda","other","bills","orders"));
558 605
 
559
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierOrderClassifiedBilled",$object->ref);
606
+            if (empty($object->actionmsg2)) {
607
+                $object->actionmsg2=$langs->transnoentities("SupplierOrderClassifiedBilled",$object->ref);
608
+            }
560 609
             if (empty($object->actionmsg))
561 610
             {
562 611
                 $object->actionmsg=$langs->transnoentities("SupplierOrderClassifiedBilled",$object->ref);
563 612
             }
564 613
 
565 614
             $object->sendtoid=0;
566
-        }
567
-		elseif ($action == 'BILL_SUPPLIER_VALIDATE')
615
+        } elseif ($action == 'BILL_SUPPLIER_VALIDATE')
568 616
         {
569 617
             // Load translation files required by the page
570 618
             $langs->loadLangs(array("agenda","other","bills"));
571 619
 
572
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
620
+            if (empty($object->actionmsg2)) {
621
+                $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
622
+            }
573 623
             $object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
574 624
 
575 625
             $object->sendtoid=0;
576
-		}
577
-		elseif ($action == 'BILL_SUPPLIER_UNVALIDATE')
626
+		} elseif ($action == 'BILL_SUPPLIER_UNVALIDATE')
578 627
         {
579 628
             // Load translation files required by the page
580 629
             $langs->loadLangs(array("agenda","other","bills"));
581 630
 
582
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
631
+            if (empty($object->actionmsg2)) {
632
+                $object->actionmsg2=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
633
+            }
583 634
             $object->actionmsg=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
584 635
 
585 636
             $object->sendtoid=0;
586
-		}
587
-        elseif ($action == 'BILL_SUPPLIER_SENTBYMAIL')
637
+		} elseif ($action == 'BILL_SUPPLIER_SENTBYMAIL')
588 638
         {
589 639
             // Load translation files required by the page
590 640
             $langs->loadLangs(array("agenda","other","bills","orders"));
591 641
 
592
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierInvoiceSentByEMail",$object->ref);
642
+            if (empty($object->actionmsg2)) {
643
+                $object->actionmsg2=$langs->transnoentities("SupplierInvoiceSentByEMail",$object->ref);
644
+            }
593 645
             if (empty($object->actionmsg))
594 646
             {
595 647
                 $object->actionmsg=$langs->transnoentities("SupplierInvoiceSentByEMail",$object->ref);
@@ -597,23 +649,25 @@  discard block
 block discarded – undo
597 649
 
598 650
             // Parameters $object->sendtoid defined by caller
599 651
             //$object->sendtoid=0;
600
-        }
601
-		elseif ($action == 'BILL_SUPPLIER_PAYED')
652
+        } elseif ($action == 'BILL_SUPPLIER_PAYED')
602 653
         {
603 654
             // Load translation files required by the page
604 655
             $langs->loadLangs(array("agenda","other","bills"));
605 656
 
606
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
657
+            if (empty($object->actionmsg2)) {
658
+                $object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
659
+            }
607 660
             $object->actionmsg=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
608 661
 
609 662
 			$object->sendtoid=0;
610
-		}
611
-		elseif ($action == 'BILL_SUPPLIER_CANCELED')
663
+		} elseif ($action == 'BILL_SUPPLIER_CANCELED')
612 664
         {
613 665
             // Load translation files required by the page
614 666
             $langs->loadLangs(array("agenda","other","bills"));
615 667
 
616
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
668
+            if (empty($object->actionmsg2)) {
669
+                $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
670
+            }
617 671
             $object->actionmsg=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
618 672
 
619 673
 			$object->sendtoid=0;
@@ -625,31 +679,35 @@  discard block
 block discarded – undo
625 679
             // Load translation files required by the page
626 680
             $langs->loadLangs(array("agenda","other","members"));
627 681
 
628
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",$object->getFullName($langs));
682
+            if (empty($object->actionmsg2)) {
683
+                $object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",$object->getFullName($langs));
684
+            }
629 685
             $object->actionmsg=$langs->transnoentities("MemberValidatedInDolibarr",$object->getFullName($langs));
630 686
             $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
631 687
             $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type;
632 688
 
633 689
 			$object->sendtoid=0;
634
-        }
635
-		elseif ($action == 'MEMBER_MODIFY')
690
+        } elseif ($action == 'MEMBER_MODIFY')
636 691
         {
637 692
             // Load translation files required by the page
638 693
             $langs->loadLangs(array("agenda","other","members"));
639 694
 
640
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberModifiedInDolibarr",$object->getFullName($langs));
695
+            if (empty($object->actionmsg2)) {
696
+                $object->actionmsg2=$langs->transnoentities("MemberModifiedInDolibarr",$object->getFullName($langs));
697
+            }
641 698
             $object->actionmsg=$langs->transnoentities("MemberModifiedInDolibarr",$object->getFullName($langs));
642 699
             $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
643 700
             $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type;
644 701
 
645 702
             $object->sendtoid=0;
646
-		}
647
-        elseif ($action == 'MEMBER_SUBSCRIPTION_CREATE')
703
+		} elseif ($action == 'MEMBER_SUBSCRIPTION_CREATE')
648 704
         {
649 705
             // Load translation files required by the page
650 706
             $langs->loadLangs(array("agenda","other","members"));
651 707
 
652
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref,$object->getFullName($langs));
708
+            if (empty($object->actionmsg2)) {
709
+                $object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref,$object->getFullName($langs));
710
+            }
653 711
             $object->actionmsg=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref,$object->getFullName($langs));
654 712
             $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
655 713
             $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type;
@@ -657,14 +715,17 @@  discard block
 block discarded – undo
657 715
             $object->actionmsg.="\n".$langs->transnoentities("Period").': '.dol_print_date($object->last_subscription_date_start,'day').' - '.dol_print_date($object->last_subscription_date_end,'day');
658 716
 
659 717
 			$object->sendtoid=0;
660
-			if ($object->fk_soc > 0) $object->socid=$object->fk_soc;
661
-        }
662
-        elseif ($action == 'MEMBER_SUBSCRIPTION_MODIFY')
718
+			if ($object->fk_soc > 0) {
719
+			    $object->socid=$object->fk_soc;
720
+			}
721
+        } elseif ($action == 'MEMBER_SUBSCRIPTION_MODIFY')
663 722
         {
664 723
         	// Load translation files required by the page
665 724
             $langs->loadLangs(array("agenda","other","members"));
666 725
 
667
-        	if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionModifiedInDolibarr",$object->ref,$object->getFullName($langs));
726
+        	if (empty($object->actionmsg2)) {
727
+        	    $object->actionmsg2=$langs->transnoentities("MemberSubscriptionModifiedInDolibarr",$object->ref,$object->getFullName($langs));
728
+        	}
668 729
         	$object->actionmsg=$langs->transnoentities("MemberSubscriptionModifiedInDolibarr",$object->ref,$object->getFullName($langs));
669 730
         	$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
670 731
         	$object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type;
@@ -672,14 +733,17 @@  discard block
 block discarded – undo
672 733
         	$object->actionmsg.="\n".$langs->transnoentities("Period").': '.dol_print_date($object->last_subscription_date_start,'day').' - '.dol_print_date($object->last_subscription_date_end,'day');
673 734
 
674 735
         	$object->sendtoid=0;
675
-        	if ($object->fk_soc > 0) $object->socid=$object->fk_soc;
676
-        }
677
-        elseif ($action == 'MEMBER_SUBSCRIPTION_DELETE')
736
+        	if ($object->fk_soc > 0) {
737
+        	    $object->socid=$object->fk_soc;
738
+        	}
739
+        } elseif ($action == 'MEMBER_SUBSCRIPTION_DELETE')
678 740
         {
679 741
         	// Load translation files required by the page
680 742
             $langs->loadLangs(array("agenda","other","members"));
681 743
 
682
-        	if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionDeletedInDolibarr",$object->ref,$object->getFullName($langs));
744
+        	if (empty($object->actionmsg2)) {
745
+        	    $object->actionmsg2=$langs->transnoentities("MemberSubscriptionDeletedInDolibarr",$object->ref,$object->getFullName($langs));
746
+        	}
683 747
         	$object->actionmsg=$langs->transnoentities("MemberSubscriptionDeletedInDolibarr",$object->ref,$object->getFullName($langs));
684 748
         	$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
685 749
         	$object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type;
@@ -687,26 +751,30 @@  discard block
 block discarded – undo
687 751
         	$object->actionmsg.="\n".$langs->transnoentities("Period").': '.dol_print_date($object->last_subscription_date_start,'day').' - '.dol_print_date($object->last_subscription_date_end,'day');
688 752
 
689 753
         	$object->sendtoid=0;
690
-        	if ($object->fk_soc > 0) $object->socid=$object->fk_soc;
691
-        }
692
-        elseif ($action == 'MEMBER_RESILIATE')
754
+        	if ($object->fk_soc > 0) {
755
+        	    $object->socid=$object->fk_soc;
756
+        	}
757
+        } elseif ($action == 'MEMBER_RESILIATE')
693 758
         {
694 759
             // Load translation files required by the page
695 760
             $langs->loadLangs(array("agenda","other","members"));
696 761
 
697
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberResiliatedInDolibarr",$object->getFullName($langs));
762
+            if (empty($object->actionmsg2)) {
763
+                $object->actionmsg2=$langs->transnoentities("MemberResiliatedInDolibarr",$object->getFullName($langs));
764
+            }
698 765
             $object->actionmsg=$langs->transnoentities("MemberResiliatedInDolibarr",$object->getFullName($langs));
699 766
             $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
700 767
             $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type;
701 768
 
702 769
 			$object->sendtoid=0;
703
-        }
704
-        elseif ($action == 'MEMBER_DELETE')
770
+        } elseif ($action == 'MEMBER_DELETE')
705 771
         {
706 772
             // Load translation files required by the page
707 773
             $langs->loadLangs(array("agenda","other","members"));
708 774
 
709
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberDeletedInDolibarr",$object->getFullName($langs));
775
+            if (empty($object->actionmsg2)) {
776
+                $object->actionmsg2=$langs->transnoentities("MemberDeletedInDolibarr",$object->getFullName($langs));
777
+            }
710 778
             $object->actionmsg=$langs->transnoentities("MemberDeletedInDolibarr",$object->getFullName($langs));
711 779
             $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
712 780
             $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type;
@@ -720,29 +788,33 @@  discard block
 block discarded – undo
720 788
             // Load translation files required by the page
721 789
             $langs->loadLangs(array("agenda","other","projects"));
722 790
 
723
-        	if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProjectCreatedInDolibarr",$object->ref);
791
+        	if (empty($object->actionmsg2)) {
792
+        	    $object->actionmsg2=$langs->transnoentities("ProjectCreatedInDolibarr",$object->ref);
793
+        	}
724 794
         	$object->actionmsg=$langs->transnoentities("ProjectCreatedInDolibarr",$object->ref);
725 795
         	$object->actionmsg.="\n".$langs->transnoentities("Project").': '.$object->ref;
726 796
 
727 797
         	$object->sendtoid=0;
728
-        }
729
-        elseif($action == 'PROJECT_VALIDATE')
798
+        } elseif($action == 'PROJECT_VALIDATE')
730 799
         {
731 800
             // Load translation files required by the page
732 801
             $langs->loadLangs(array("agenda","other","projects"));
733 802
 
734
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProjectValidatedInDolibarr",$object->ref);
803
+            if (empty($object->actionmsg2)) {
804
+                $object->actionmsg2=$langs->transnoentities("ProjectValidatedInDolibarr",$object->ref);
805
+            }
735 806
             $object->actionmsg=$langs->transnoentities("ProjectValidatedInDolibarr",$object->ref);
736 807
             $object->actionmsg.="\n".$langs->transnoentities("Project").': '.$object->ref;
737 808
 
738 809
             $object->sendtoid=0;
739
-        }
740
-        elseif($action == 'PROJECT_MODIFY')
810
+        } elseif($action == 'PROJECT_MODIFY')
741 811
         {
742 812
             // Load translation files required by the page
743 813
             $langs->loadLangs(array("agenda","other","projects"));
744 814
 
745
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProjectModifiedInDolibarr",$object->ref);
815
+            if (empty($object->actionmsg2)) {
816
+                $object->actionmsg2=$langs->transnoentities("ProjectModifiedInDolibarr",$object->ref);
817
+            }
746 818
             $object->actionmsg=$langs->transnoentities("ProjectModifiedInDolibarr",$object->ref);
747 819
             $object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref;
748 820
 
@@ -755,31 +827,33 @@  discard block
 block discarded – undo
755 827
             // Load translation files required by the page
756 828
             $langs->loadLangs(array("agenda","other","projects"));
757 829
 
758
-			if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("TaskCreatedInDolibarr",$object->ref);
830
+			if (empty($object->actionmsg2)) {
831
+			    $object->actionmsg2=$langs->transnoentities("TaskCreatedInDolibarr",$object->ref);
832
+			}
759 833
 			$object->actionmsg=$langs->transnoentities("TaskCreatedInDolibarr",$object->ref);
760 834
 			$object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref;
761 835
 
762 836
 			$object->sendtoid=0;
763
-		}
764
-
765
-		elseif($action == 'TASK_MODIFY')
837
+		} elseif($action == 'TASK_MODIFY')
766 838
 		{
767 839
             // Load translation files required by the page
768 840
             $langs->loadLangs(array("agenda","other","projects"));
769 841
 
770
-			if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("TaskModifiedInDolibarr",$object->ref);
842
+			if (empty($object->actionmsg2)) {
843
+			    $object->actionmsg2=$langs->transnoentities("TaskModifiedInDolibarr",$object->ref);
844
+			}
771 845
 			$object->actionmsg=$langs->transnoentities("TaskModifieddInDolibarr",$object->ref);
772 846
 			$object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref;
773 847
 
774 848
 			$object->sendtoid=0;
775
-		}
776
-
777
-		elseif($action == 'TASK_DELETE')
849
+		} elseif($action == 'TASK_DELETE')
778 850
 		{
779 851
             // Load translation files required by the page
780 852
             $langs->loadLangs(array("agenda","other","projects"));
781 853
 
782
-			if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("TaskDeletedInDolibarr",$object->ref);
854
+			if (empty($object->actionmsg2)) {
855
+			    $object->actionmsg2=$langs->transnoentities("TaskDeletedInDolibarr",$object->ref);
856
+			}
783 857
 			$object->actionmsg=$langs->transnoentities("TaskDeletedInDolibarr",$object->ref);
784 858
 			$object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref;
785 859
 
@@ -792,8 +866,12 @@  discard block
 block discarded – undo
792 866
 		    // Load translation files required by the page
793 867
             $langs->loadLangs(array("agenda","other"));
794 868
 
795
-		    if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities($action."InDolibarr",$object->ref);
796
-		    if (empty($object->actionmsg))  $object->actionmsg=$langs->transnoentities($action."InDolibarr",$object->ref);
869
+		    if (empty($object->actionmsg2)) {
870
+		        $object->actionmsg2=$langs->transnoentities($action."InDolibarr",$object->ref);
871
+		    }
872
+		    if (empty($object->actionmsg)) {
873
+		        $object->actionmsg=$langs->transnoentities($action."InDolibarr",$object->ref);
874
+		    }
797 875
 
798 876
 		    $object->sendtoid=0;
799 877
 		}
@@ -821,18 +899,26 @@  discard block
 block discarded – undo
821 899
         // Set contactforaction if there is only 1 contact.
822 900
         if (is_array($object->sendtoid))
823 901
         {
824
-            if (count($object->sendtoid) == 1) $contactforaction->fetch(reset($object->sendtoid));
825
-        }
826
-        else
902
+            if (count($object->sendtoid) == 1) {
903
+                $contactforaction->fetch(reset($object->sendtoid));
904
+            }
905
+        } else
827 906
         {
828
-            if ($object->sendtoid > 0) $contactforaction->fetch($object->sendtoid);
907
+            if ($object->sendtoid > 0) {
908
+                $contactforaction->fetch($object->sendtoid);
909
+            }
829 910
         }
830 911
         // Set societeforaction.
831
-        if ($object->socid > 0)			$societeforaction->fetch($object->socid);
832
-        elseif ($object->fk_soc > 0)	$societeforaction->fetch($object->fk_soc);
912
+        if ($object->socid > 0) {
913
+            $societeforaction->fetch($object->socid);
914
+        } elseif ($object->fk_soc > 0) {
915
+            $societeforaction->fetch($object->fk_soc);
916
+        }
833 917
 
834 918
         $projectid = isset($object->fk_project)?$object->fk_project:0;
835
-        if ($object->element == 'project') $projectid = $object->id;
919
+        if ($object->element == 'project') {
920
+            $projectid = $object->id;
921
+        }
836 922
 
837 923
         $elementid = $object->id;
838 924
         $elementtype = $object->element;
@@ -910,8 +996,7 @@  discard block
 block discarded – undo
910 996
 		{
911 997
 			$_SESSION['LAST_ACTION_CREATED'] = $ret;
912 998
 			return 1;
913
-		}
914
-		else
999
+		} else
915 1000
 		{
916 1001
             $error ="Failed to insert event : ".$actioncomm->error." ".join(',',$actioncomm->errors);
917 1002
             $this->error=$error;
Please login to merge, or discard this patch.
core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php 1 patch
Braces   +20 added lines, -18 removed lines patch added patch discarded remove patch
@@ -56,7 +56,10 @@  discard block
 block discarded – undo
56 56
 	 */
57 57
 	public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
58 58
 	{
59
-        if (empty($conf->mailmanspip->enabled)) return 0;     // Module not active, we do nothing
59
+        if (empty($conf->mailmanspip->enabled)) {
60
+            return 0;
61
+        }
62
+        // Module not active, we do nothing
60 63
 
61 64
         require_once DOL_DOCUMENT_ROOT."/mailmanspip/class/mailmanspip.class.php";
62 65
         require_once DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php";
@@ -71,15 +74,13 @@  discard block
 block discarded – undo
71 74
     			$this->error=$object->context['linkto']->error;
72 75
     			$this->errors=$object->context['linkto']->errors;
73 76
     			$return=-1;
74
-    		}
75
-			else
77
+    		} else
76 78
 			{
77 79
 				$return=1;
78 80
 			}
79 81
 
80 82
         	return $return;
81
-        }
82
-        elseif ($action == 'CATEGORY_UNLINK')
83
+        } elseif ($action == 'CATEGORY_UNLINK')
83 84
         {
84 85
         	dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
85 86
 
@@ -89,8 +90,7 @@  discard block
 block discarded – undo
89 90
         		$this->error=$object->context['unlinkoff']->error;
90 91
         		$this->errors=$object->context['unlinkoff']->errors;
91 92
         		$return=-1;
92
-        	}
93
-        	else
93
+        	} else
94 94
         	{
95 95
         		$return=1;
96 96
         	}
@@ -105,17 +105,18 @@  discard block
 block discarded – undo
105 105
 
106 106
 			$return=0;
107 107
             // Add user into some linked tools (mailman, spip, etc...)
108
-			if (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid))	// TODO Do del/add also if type change
108
+			if (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid)) {
109
+			    // TODO Do del/add also if type change
109 110
 			{
110 111
 				if (is_object($object->oldcopy) && ($object->oldcopy->email != $object->email))    // If email has changed we delete mailman subscription for old email
111 112
 				{
112 113
 					if ($object->oldcopy->del_to_abo() < 0)
113 114
 					{
114 115
 						if (! empty($object->oldcopy->error)) $this->error=$object->oldcopy->error;
116
+			}
115 117
 						$this->errors=$object->oldcopy->errors;
116 118
 						$return=-1;
117
-					}
118
-					else
119
+					} else
119 120
 					{
120 121
 						$return=1;
121 122
 					}
@@ -123,19 +124,19 @@  discard block
 block discarded – undo
123 124
     			// We add subscription if new email or new type (new type may means more mailing-list to subscribe)
124 125
     			if ($object->add_to_abo() < 0)
125 126
     			{
126
-    				 if (! empty($object->error)) $this->error=$object->error;
127
+    				 if (! empty($object->error)) {
128
+    				     $this->error=$object->error;
129
+    				 }
127 130
     				 $this->errors=$object->errors;
128 131
     				 $return=-1;
129
-    			}
130
-				else
132
+    			} else
131 133
 				{
132 134
 					$return=1;
133 135
 				}
134 136
 			}
135 137
 
136 138
 			return $return;
137
-        }
138
-        elseif ($action == 'MEMBER_RESILIATE' || $action == 'MEMBER_DELETE')
139
+        } elseif ($action == 'MEMBER_RESILIATE' || $action == 'MEMBER_DELETE')
139 140
         {
140 141
             dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
141 142
 
@@ -143,11 +144,12 @@  discard block
 block discarded – undo
143 144
             // Remove from external tools (mailman, spip, etc...)
144 145
         	if ($object->del_to_abo() < 0)
145 146
 			{
146
-				if (! empty($object->error)) $this->error=$object->error;
147
+				if (! empty($object->error)) {
148
+				    $this->error=$object->error;
149
+				}
147 150
 				$this->errors=$object->errors;
148 151
 				$return=-1;
149
-			}
150
-			else
152
+			} else
151 153
 			{
152 154
 				$return=1;
153 155
 			}
Please login to merge, or discard this patch.
htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php 1 patch
Braces   +25 added lines, -8 removed lines patch added patch discarded remove patch
@@ -59,7 +59,10 @@  discard block
 block discarded – undo
59 59
 	 */
60 60
 	public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
61 61
     {
62
-        if (empty($conf->workflow->enabled)) return 0;     // Module not active, we do nothing
62
+        if (empty($conf->workflow->enabled)) {
63
+            return 0;
64
+        }
65
+        // Module not active, we do nothing
63 66
 
64 67
         // Proposals to order
65 68
         if ($action == 'PROPAL_CLOSE_SIGNED')
@@ -111,7 +114,9 @@  discard block
 block discarded – undo
111 114
 				    $totalonlinkedelements=0;
112 115
 					foreach($object->linkedObjects['propal'] as $element)
113 116
 					{
114
-					    if ($element->statut == Propal::STATUS_SIGNED || $element->statut == Propal::STATUS_BILLED) $totalonlinkedelements += $element->total_ht;
117
+					    if ($element->statut == Propal::STATUS_SIGNED || $element->statut == Propal::STATUS_BILLED) {
118
+					        $totalonlinkedelements += $element->total_ht;
119
+					    }
115 120
 					}
116 121
 					dol_syslog( "Amount of linked proposals = ".$totalonlinkedelements.", of order = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht) );
117 122
 					if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) )
@@ -140,7 +145,9 @@  discard block
 block discarded – undo
140 145
         		    $totalonlinkedelements=0;
141 146
         		    foreach($object->linkedObjects['commande'] as $element)
142 147
         		    {
143
-        		        if ($element->statut == Commande::STATUS_VALIDATED || $element->statut == Commande::STATUS_SHIPMENTONPROCESS || $element->statut == Commande::STATUS_CLOSED) $totalonlinkedelements += $element->total_ht;
148
+        		        if ($element->statut == Commande::STATUS_VALIDATED || $element->statut == Commande::STATUS_SHIPMENTONPROCESS || $element->statut == Commande::STATUS_CLOSED) {
149
+        		            $totalonlinkedelements += $element->total_ht;
150
+        		        }
144 151
         		    }
145 152
         		    dol_syslog( "Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht) );
146 153
         		    if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) )
@@ -163,7 +170,9 @@  discard block
 block discarded – undo
163 170
         		    $totalonlinkedelements=0;
164 171
         		    foreach($object->linkedObjects['propal'] as $element)
165 172
         		    {
166
-        		        if ($element->statut == Propal::STATUS_SIGNED || $element->statut == Propal::STATUS_BILLED) $totalonlinkedelements += $element->total_ht;
173
+        		        if ($element->statut == Propal::STATUS_SIGNED || $element->statut == Propal::STATUS_BILLED) {
174
+        		            $totalonlinkedelements += $element->total_ht;
175
+        		        }
167 176
         		    }
168 177
         		    dol_syslog( "Amount of linked proposals = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht) );
169 178
         		    if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) )
@@ -192,7 +201,9 @@  discard block
 block discarded – undo
192 201
         			$totalonlinkedelements=0;
193 202
         			foreach($object->linkedObjects['order_supplier'] as $element)
194 203
         			{
195
-        				if ($element->statut == CommandeFournisseur::STATUS_ACCEPTED || $element->statut == CommandeFournisseur::STATUS_ORDERSENT || $element->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY || $element->statut == CommandeFournisseur::STATUS_RECEIVED_COMPLETELY) $totalonlinkedelements += $element->total_ht;
204
+        				if ($element->statut == CommandeFournisseur::STATUS_ACCEPTED || $element->statut == CommandeFournisseur::STATUS_ORDERSENT || $element->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY || $element->statut == CommandeFournisseur::STATUS_RECEIVED_COMPLETELY) {
205
+        				    $totalonlinkedelements += $element->total_ht;
206
+        				}
196 207
         			}
197 208
         			dol_syslog( "Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht) );
198 209
         			if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) )
@@ -215,7 +226,9 @@  discard block
 block discarded – undo
215 226
         			$totalonlinkedelements=0;
216 227
         			foreach($object->linkedObjects['supplier_proposal'] as $element)
217 228
         			{
218
-        				if ($element->statut == SupplierProposal::STATUS_SIGNED || $element->statut == SupplierProposal::STATUS_BILLED) $totalonlinkedelements += $element->total_ht;
229
+        				if ($element->statut == SupplierProposal::STATUS_SIGNED || $element->statut == SupplierProposal::STATUS_BILLED) {
230
+        				    $totalonlinkedelements += $element->total_ht;
231
+        				}
219 232
         			}
220 233
         			dol_syslog( "Amount of linked supplier proposals = ".$totalonlinkedelements.", of supplier invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht) );
221 234
         			if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) )
@@ -243,7 +256,9 @@  discard block
 block discarded – undo
243 256
                     $totalonlinkedelements=0;
244 257
                     foreach($object->linkedObjects['commande'] as $element)
245 258
                     {
246
-                        if ($element->statut == Commande::STATUS_VALIDATED || $element->statut == Commande::STATUS_SHIPMENTONPROCESS || $element->statut == Commande::STATUS_CLOSED) $totalonlinkedelements += $element->total_ht;
259
+                        if ($element->statut == Commande::STATUS_VALIDATED || $element->statut == Commande::STATUS_SHIPMENTONPROCESS || $element->statut == Commande::STATUS_CLOSED) {
260
+                            $totalonlinkedelements += $element->total_ht;
261
+                        }
247 262
                     }
248 263
                     dol_syslog( "Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht) );
249 264
                     if ( ($totalonlinkedelements == $object->total_ht) || (! empty($conf->global->WORKFLOW_CLASSIFY_IF_AMOUNTS_ARE_DIFFERENTS)) )
@@ -328,7 +343,9 @@  discard block
 block discarded – undo
328 343
         		    $totalonlinkedelements=0;
329 344
         		    foreach($object->linkedObjects['reception'] as $element)
330 345
         		    {
331
-        		        if ($element->statut == Reception::STATUS_VALIDATED) $totalonlinkedelements += $element->total_ht;
346
+        		        if ($element->statut == Reception::STATUS_VALIDATED) {
347
+        		            $totalonlinkedelements += $element->total_ht;
348
+        		        }
332 349
         		    }
333 350
         		    dol_syslog("Amount of linked proposals = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG);
334 351
         		    if ($totalonlinkedelements == $object->total_ht)
Please login to merge, or discard this patch.
dolibarr/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -166,8 +166,7 @@  discard block
 block discarded – undo
166 166
 	                	}
167 167
 
168 168
                         $ok = 1;
169
-	                }
170
-	                else
169
+	                } else
171 170
 	                {
172 171
 	                	$this->error = $userstat->error;
173 172
 	                	$this->errors = $userstat->errors;
@@ -282,10 +281,16 @@  discard block
 block discarded – undo
282 281
 			            	}
283 282
 
284 283
 			            	$qualified = true;
285
-			            	if (empty($enabled)) $qualified = false;
286
-			            	if (empty($perms)) $qualified = false;
284
+			            	if (empty($enabled)) {
285
+			            	    $qualified = false;
286
+			            	}
287
+			            	if (empty($perms)) {
288
+			            	    $qualified = false;
289
+			            	}
287 290
 
288
-			            	if ($qualified) $message_customer.='<li>'.$langs->trans($key).' : '.$value.'</li>';
291
+			            	if ($qualified) {
292
+			            	    $message_customer.='<li>'.$langs->trans($key).' : '.$value.'</li>';
293
+			            	}
289 294
 			            }
290 295
 
291 296
 			            $message_customer.='</ul>';
Please login to merge, or discard this patch.
htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php 1 patch
Braces   +14 added lines, -9 removed lines patch added patch discarded remove patch
@@ -56,11 +56,16 @@  discard block
 block discarded – undo
56 56
 	 */
57 57
 	public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
58 58
 	{
59
-		if (empty($conf->blockedlog->enabled)) return 0;     // Module not active, we do nothing
59
+		if (empty($conf->blockedlog->enabled)) {
60
+		    return 0;
61
+		}
62
+		// Module not active, we do nothing
60 63
 
61 64
 		// Test if event/record is qualified
62 65
 		$listofqualifiedelement = array('facture', 'don', 'payment', 'payment_donation', 'subscription', 'payment_various', 'cashcontrol');
63
-		if (! in_array($object->element, $listofqualifiedelement)) return 1;
66
+		if (! in_array($object->element, $listofqualifiedelement)) {
67
+		    return 1;
68
+		}
64 69
 
65 70
 		dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
66 71
 
@@ -88,12 +93,14 @@  discard block
 block discarded – undo
88 93
 
89 94
 			if (in_array($action, array(
90 95
 				'MEMBER_SUBSCRIPTION_CREATE','MEMBER_SUBSCRIPTION_MODIFY','MEMBER_SUBSCRIPTION_DELETE',
91
-				'DON_VALIDATE','DON_MODIFY','DON_DELETE'))) $amounts = (double) $object->amount;
92
-			elseif ($action == 'CASHCONTROL_VALIDATE')
96
+				'DON_VALIDATE','DON_MODIFY','DON_DELETE'))) {
97
+			    $amounts = (double) $object->amount;
98
+			} elseif ($action == 'CASHCONTROL_VALIDATE')
93 99
 			{
94 100
 				$amounts = (double) $object->cash + (double) $object->cheque + (double) $object->card;
101
+			} else {
102
+			    $amounts = (double) $object->total_ttc;
95 103
 			}
96
-			else $amounts = (double) $object->total_ttc;
97 104
 		}
98 105
 		/*if ($action === 'BILL_PAYED' || $action==='BILL_UNPAYED'
99 106
 		 || $action === 'BILL_SUPPLIER_PAYED' || $action === 'BILL_SUPPLIER_UNPAYED')
@@ -111,8 +118,7 @@  discard block
 block discarded – undo
111 118
 					$amounts += price2num($amount);
112 119
 				}
113 120
 			}
114
-		}
115
-		elseif (strpos($action,'PAYMENT')!==false && ! in_array($action, array('PAYMENT_ADD_TO_BANK')))
121
+		} elseif (strpos($action,'PAYMENT')!==false && ! in_array($action, array('PAYMENT_ADD_TO_BANK')))
116 122
 		{
117 123
 			$qualified++;
118 124
 			$amounts = (double) $object->amount;
@@ -141,8 +147,7 @@  discard block
 block discarded – undo
141 147
 			$this->error = $b->error;
142 148
 			$this->errors = $b->errors;
143 149
 			return -1;
144
-		}
145
-		else
150
+		} else
146 151
 		{
147 152
 			return 1;
148 153
 		}
Please login to merge, or discard this patch.
dolibarr/htdocs/core/db/DoliDB.class.php 1 patch
Braces   +24 added lines, -17 removed lines patch added patch discarded remove patch
@@ -120,8 +120,7 @@  discard block
 block discarded – undo
120 120
 				dol_syslog('',0,1);
121 121
 			}
122 122
 			return $ret;
123
-		}
124
-		else
123
+		} else
125 124
 		{
126 125
 			$this->transaction_opened++;
127 126
 			dol_syslog('',0,1);
@@ -146,13 +145,11 @@  discard block
 block discarded – undo
146 145
 				$this->transaction_opened=0;
147 146
 				dol_syslog("COMMIT Transaction".($log?' '.$log:''),LOG_DEBUG);
148 147
 				return 1;
149
-			}
150
-			else
148
+			} else
151 149
 			{
152 150
 				return 0;
153 151
 			}
154
-		}
155
-		else
152
+		} else
156 153
 		{
157 154
 			$this->transaction_opened--;
158 155
 			return 1;
@@ -174,8 +171,7 @@  discard block
 block discarded – undo
174 171
 			$this->transaction_opened=0;
175 172
 			dol_syslog("ROLLBACK Transaction".($log?' '.$log:''),LOG_DEBUG);
176 173
 			return $ret;
177
-		}
178
-		else
174
+		} else
179 175
 		{
180 176
 			$this->transaction_opened--;
181 177
 			return 1;
@@ -192,10 +188,17 @@  discard block
 block discarded – undo
192 188
 	function plimit($limit=0,$offset=0)
193 189
 	{
194 190
 		global $conf;
195
-		if (empty($limit)) return "";
196
-		if ($limit < 0) $limit=$conf->liste_limit;
197
-		if ($offset > 0) return " LIMIT $offset,$limit ";
198
-		else return " LIMIT $limit ";
191
+		if (empty($limit)) {
192
+		    return "";
193
+		}
194
+		if ($limit < 0) {
195
+		    $limit=$conf->liste_limit;
196
+		}
197
+		if ($offset > 0) {
198
+		    return " LIMIT $offset,$limit ";
199
+		} else {
200
+		    return " LIMIT $limit ";
201
+		}
199 202
 	}
200 203
 
201 204
 	/**
@@ -235,8 +238,11 @@  discard block
 block discarded – undo
235 238
 			$i=0;
236 239
 			foreach($fields as $val)
237 240
 			{
238
-				if (! $return) $return.=' ORDER BY ';
239
-				else $return.=', ';
241
+				if (! $return) {
242
+				    $return.=' ORDER BY ';
243
+				} else {
244
+				    $return.=', ';
245
+				}
240 246
 
241 247
 				$return.=preg_replace('/[^0-9a-z_\.]/i','',$val);
242 248
 
@@ -252,8 +258,7 @@  discard block
 block discarded – undo
252 258
 				$i++;
253 259
 			}
254 260
 			return $return;
255
-		}
256
-		else
261
+		} else
257 262
 		{
258 263
 			return '';
259 264
 		}
@@ -281,7 +286,9 @@  discard block
 block discarded – undo
281 286
 	function jdate($string, $gm=false)
282 287
 	{
283 288
 		// TODO GMT must set param gm to true by default
284
-		if ($string==0 || $string=="0000-00-00 00:00:00") return '';
289
+		if ($string==0 || $string=="0000-00-00 00:00:00") {
290
+		    return '';
291
+		}
285 292
 		$string=preg_replace('/([^0-9])/i','',$string);
286 293
 		$tmp=$string.'000000';
287 294
 		$date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),$gm);
Please login to merge, or discard this patch.
dolibarr/htdocs/core/actions_builddoc.inc.php 1 patch
Braces   +33 added lines, -14 removed lines patch added patch discarded remove patch
@@ -37,8 +37,7 @@  discard block
 block discarded – undo
37 37
     if (is_numeric(GETPOST('model','alpha')))
38 38
     {
39 39
         $error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Model"));
40
-    }
41
-    else
40
+    } else
42 41
     {
43 42
    		// Reload to get all modified line records and be ready for hooks
44 43
         $ret = $object->fetch($id);
@@ -68,9 +67,17 @@  discard block
 block discarded – undo
68 67
         $outputlangs = $langs;
69 68
         $newlang='';
70 69
 
71
-        if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09');
72
-        if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->thirdparty->default_lang)) $newlang=$object->thirdparty->default_lang;  // for proposal, order, invoice, ...
73
-        if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->default_lang)) $newlang=$object->default_lang;                  // for thirdparty
70
+        if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) {
71
+            $newlang=GETPOST('lang_id','aZ09');
72
+        }
73
+        if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->thirdparty->default_lang)) {
74
+            $newlang=$object->thirdparty->default_lang;
75
+        }
76
+        // for proposal, order, invoice, ...
77
+        if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->default_lang)) {
78
+            $newlang=$object->default_lang;
79
+        }
80
+        // for thirdparty
74 81
         if (! empty($newlang))
75 82
         {
76 83
             $outputlangs = new Translate("",$conf);
@@ -78,22 +85,31 @@  discard block
 block discarded – undo
78 85
         }
79 86
 
80 87
         // To be sure vars is defined
81
-        if (empty($hidedetails)) $hidedetails=0;
82
-        if (empty($hidedesc)) $hidedesc=0;
83
-        if (empty($hideref)) $hideref=0;
84
-        if (empty($moreparams)) $moreparams=null;
88
+        if (empty($hidedetails)) {
89
+            $hidedetails=0;
90
+        }
91
+        if (empty($hidedesc)) {
92
+            $hidedesc=0;
93
+        }
94
+        if (empty($hideref)) {
95
+            $hideref=0;
96
+        }
97
+        if (empty($moreparams)) {
98
+            $moreparams=null;
99
+        }
85 100
 
86 101
         $result= $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
87 102
         if ($result <= 0)
88 103
         {
89 104
             setEventMessages($object->error, $object->errors, 'errors');
90 105
             $action='';
91
-        }
92
-        else
106
+        } else
93 107
         {
94
-        	if (empty($donotredirect))	// This is set when include is done by bulk action "Bill Orders"
108
+        	if (empty($donotredirect)) {
109
+        	    // This is set when include is done by bulk action "Bill Orders"
95 110
         	{
96 111
 	            setEventMessages($langs->trans("FileGenerated"), null);
112
+        	}
97 113
 
98 114
 	            $urltoredirect = $_SERVER['REQUEST_URI'];
99 115
 	            $urltoredirect = preg_replace('/#builddoc$/', '', $urltoredirect);
@@ -122,8 +138,11 @@  discard block
 block discarded – undo
122 138
     $filetodelete=GETPOST('file','alpha');
123 139
     $file =	$upload_dir	. '/' .	$filetodelete;
124 140
     $ret=dol_delete_file($file,0,0,0,$object);
125
-    if ($ret) setEventMessages($langs->trans("FileWasRemoved", $filetodelete), null, 'mesgs');
126
-    else setEventMessages($langs->trans("ErrorFailToDeleteFile", $filetodelete), null, 'errors');
141
+    if ($ret) {
142
+        setEventMessages($langs->trans("FileWasRemoved", $filetodelete), null, 'mesgs');
143
+    } else {
144
+        setEventMessages($langs->trans("ErrorFailToDeleteFile", $filetodelete), null, 'errors');
145
+    }
127 146
 
128 147
     // Make a redirect to avoid to keep the remove_file into the url that create side effects
129 148
     $urltoredirect = $_SERVER['REQUEST_URI'];
Please login to merge, or discard this patch.
dolibarr/htdocs/core/search_page.php 1 patch
Braces   +19 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,15 +27,24 @@  discard block
 block discarded – undo
27 27
 //if (! defined('NOREQUIREDB'))   define('NOREQUIREDB','1');		// Not disabled cause need to load personalized language
28 28
 //if (! defined('NOREQUIRESOC'))    define('NOREQUIRESOC','1');
29 29
 //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');		// Not disabled cause need to do translations
30
-if (! defined('NOCSRFCHECK'))     define('NOCSRFCHECK',1);
31
-if (! defined('NOTOKENRENEWAL'))  define('NOTOKENRENEWAL',1);
30
+if (! defined('NOCSRFCHECK')) {
31
+    define('NOCSRFCHECK',1);
32
+}
33
+if (! defined('NOTOKENRENEWAL')) {
34
+    define('NOTOKENRENEWAL',1);
35
+}
32 36
 //if (! defined('NOLOGIN')) define('NOLOGIN',1);					// Not disabled cause need to load personalized language
33
-if (! defined('NOREQUIREMENU'))  define('NOREQUIREMENU',1);
37
+if (! defined('NOREQUIREMENU')) {
38
+    define('NOREQUIREMENU',1);
39
+}
34 40
 //if (! defined('NOREQUIREHTML'))  define('NOREQUIREHTML',1);
35 41
 
36 42
 require_once '../main.inc.php';
37 43
 
38
-if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09'));	// If language was forced on URL by the main.inc.php
44
+if (GETPOST('lang', 'aZ09')) {
45
+    $langs->setDefaultLang(GETPOST('lang', 'aZ09'));
46
+}
47
+// If language was forced on URL by the main.inc.php
39 48
 
40 49
 $langs->load("main");
41 50
 
@@ -69,13 +78,14 @@  discard block
 block discarded – undo
69 78
 // Define $searchform
70 79
 $searchform = '';
71 80
 
72
-if ($conf->use_javascript_ajax && 1 == 2)   // select2 is ko with jmobile
81
+if ($conf->use_javascript_ajax && 1 == 2) {
82
+    // select2 is ko with jmobile
73 83
 {
74 84
     if (! is_object($form)) $form=new Form($db);
85
+}
75 86
     $selected=-1;
76 87
     $searchform.='<br><br>'.$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'minwidth300', 1, $langs->trans("Search"), 0);
77
-}
78
-else
88
+} else
79 89
 {
80 90
     $usedbyinclude = 1; // Used into next include
81 91
 	$showtitlebefore = GETPOST('showtitlebefore','int');
@@ -104,8 +114,9 @@  discard block
 block discarded – undo
104 114
 if (empty($reshook))
105 115
 {
106 116
 	$searchform.=$hookmanager->resPrint;
117
+} else {
118
+    $searchform=$hookmanager->resPrint;
107 119
 }
108
-else $searchform=$hookmanager->resPrint;
109 120
 
110 121
 
111 122
 print "\n";
Please login to merge, or discard this patch.