Passed
Push — master ( 49af33...3cffbe )
by Alxarafe
21:21
created
dolibarr/htdocs/core/tpl/extrafields_list_search_input.tpl.php 1 patch
Braces   +17 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,10 +7,13 @@  discard block
 block discarded – undo
7 7
 	exit;
8 8
 }
9 9
 
10
-if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element;
10
+if (empty($extrafieldsobjectkey) && is_object($object)) {
11
+    $extrafieldsobjectkey=$object->table_element;
12
+}
11 13
 
12 14
 // Loop to show all columns of extrafields for the search title line
13
-if (! empty($extrafieldsobjectkey))	// $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
15
+if (! empty($extrafieldsobjectkey)) {
16
+    // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
14 17
 {
15 18
 	if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']))
16 19
 	{
@@ -18,6 +21,7 @@  discard block
 block discarded – undo
18 21
 		{
19 22
 			if (! empty($arrayfields["ef.".$key]['checked'])) {
20 23
 				$align=$extrafields->getAlignFlag($key);
24
+}
21 25
 				$typeofextrafield=$extrafields->attributes[$extrafieldsobjectkey]['type'][$key];
22 26
 				print '<td class="liste_titre'.($align?' '.$align:'').'">';
23 27
 				if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]))
@@ -25,18 +29,22 @@  discard block
 block discarded – undo
25 29
 					$crit=$val;
26 30
 					$tmpkey=preg_replace('/search_options_/','',$key);
27 31
 					$searchclass='';
28
-					if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring';
29
-					if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum';
32
+					if (in_array($typeofextrafield, array('varchar', 'select'))) {
33
+					    $searchclass='searchstring';
34
+					}
35
+					if (in_array($typeofextrafield, array('int', 'double'))) {
36
+					    $searchclass='searchnum';
37
+					}
30 38
 					print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">';
31
-				}
32
-				elseif (! in_array($typeofextrafield, array('datetime','timestamp')))
39
+				} elseif (! in_array($typeofextrafield, array('datetime','timestamp')))
33 40
 				{
34 41
 					// for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid')
35 42
 					$morecss='';
36
-					if ($typeofextrafield == 'sellist') $morecss='maxwidth200';
43
+					if ($typeofextrafield == 'sellist') {
44
+					    $morecss='maxwidth200';
45
+					}
37 46
 					echo $extrafields->showInputField($key, $search_array_options['search_options_'.$key], '', '', 'search_', $morecss);
38
-				}
39
-				elseif (in_array($typeofextrafield, array('datetime','timestamp')))
47
+				} elseif (in_array($typeofextrafield, array('datetime','timestamp')))
40 48
 				{
41 49
 					// TODO
42 50
 					// Use showInputField in a particular manner to have input with a comparison operator, not input for a specific value date-hour-minutes
Please login to merge, or discard this patch.
dolibarr/htdocs/core/tpl/admin_extrafields_view.tpl.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -100,8 +100,7 @@
 block discarded – undo
100 100
 		print "&nbsp; <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
101 101
 		print "</tr>";
102 102
 	}
103
-}
104
-else
103
+} else
105 104
 {
106 105
 	$colspan=9;
107 106
 
Please login to merge, or discard this patch.
dolibarr/htdocs/core/commonfieldsinexport.inc.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@
 block discarded – undo
52 52
 			$this->export_entities_array[$r][$fieldname] = $keyforelement;
53 53
 		}
54 54
 	}
55
-}
56
-else
55
+} else
57 56
 {
58 57
 	dol_print_error($this->db, 'Failed to find class '.$keyforclass.', even after the include of '.$keyforclassfile);
59 58
 }
Please login to merge, or discard this patch.
dolibarr/htdocs/core/triggers/interface_20_all_Logevents.class.php 1 patch
Braces   +22 added lines, -18 removed lines patch added patch discarded remove patch
@@ -59,13 +59,22 @@  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->global->MAIN_LOGEVENTS_DISABLE_ALL)) return 0;	// Log events is disabled (hidden features)
62
+    	if (! empty($conf->global->MAIN_LOGEVENTS_DISABLE_ALL)) {
63
+    	    return 0;
64
+    	}
65
+    	// Log events is disabled (hidden features)
63 66
 
64 67
     	$key='MAIN_LOGEVENTS_'.$action;
65 68
     	//dol_syslog("xxxxxxxxxxx".$key);
66
-    	if (empty($conf->global->$key)) return 0;				// Log events not enabled for this action
69
+    	if (empty($conf->global->$key)) {
70
+    	    return 0;
71
+    	}
72
+    	// Log events not enabled for this action
67 73
 
68
-    	if (empty($conf->entity)) $conf->entity = $entity;  // forcing of the entity if it's not defined (ex: in login form)
74
+    	if (empty($conf->entity)) {
75
+    	    $conf->entity = $entity;
76
+    	}
77
+    	// forcing of the entity if it's not defined (ex: in login form)
69 78
 
70 79
         $date = dol_now();
71 80
 
@@ -106,8 +115,7 @@  discard block
 block discarded – undo
106 115
             // Initialisation donnees (date,duree,texte,desc)
107 116
             $text=$langs->transnoentities("NewUserCreated",$object->login);
108 117
             $desc=$langs->transnoentities("NewUserCreated",$object->login);
109
-		}
110
-        elseif ($action == 'USER_MODIFY')
118
+		} elseif ($action == 'USER_MODIFY')
111 119
         {
112 120
             dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
113 121
             $langs->load("users");
@@ -115,8 +123,7 @@  discard block
 block discarded – undo
115 123
             // Initialisation donnees (date,duree,texte,desc)
116 124
             $text=$langs->transnoentities("EventUserModified",$object->login);
117 125
             $desc=$langs->transnoentities("EventUserModified",$object->login);
118
-        }
119
-        elseif ($action == 'USER_NEW_PASSWORD')
126
+        } elseif ($action == 'USER_NEW_PASSWORD')
120 127
         {
121 128
             dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
122 129
             $langs->load("users");
@@ -124,8 +131,7 @@  discard block
 block discarded – undo
124 131
             // Initialisation donnees (date,duree,texte,desc)
125 132
             $text=$langs->transnoentities("NewUserPassword",$object->login);
126 133
             $desc=$langs->transnoentities("NewUserPassword",$object->login);
127
-        }
128
-        elseif ($action == 'USER_ENABLEDISABLE')
134
+        } elseif ($action == 'USER_ENABLEDISABLE')
129 135
         {
130 136
             dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
131 137
             $langs->load("users");
@@ -140,8 +146,7 @@  discard block
 block discarded – undo
140 146
 				$text=$langs->transnoentities("UserDisabled",$object->login);
141 147
 				$desc=$langs->transnoentities("UserDisabled",$object->login);
142 148
 			}
143
-        }
144
-        elseif ($action == 'USER_DELETE')
149
+        } elseif ($action == 'USER_DELETE')
145 150
         {
146 151
             dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
147 152
             $langs->load("users");
@@ -158,16 +163,14 @@  discard block
 block discarded – undo
158 163
             // Initialisation donnees (date,duree,texte,desc)
159 164
             $text=$langs->transnoentities("NewGroupCreated",$object->name);
160 165
             $desc=$langs->transnoentities("NewGroupCreated",$object->name);
161
-		}
162
-        elseif ($action == 'GROUP_MODIFY')
166
+		} elseif ($action == 'GROUP_MODIFY')
163 167
         {
164 168
             dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
165 169
             $langs->load("users");
166 170
             // Initialisation donnees (date,duree,texte,desc)
167 171
             $text=$langs->transnoentities("GroupModified",$object->name);
168 172
             $desc=$langs->transnoentities("GroupModified",$object->name);
169
-		}
170
-        elseif ($action == 'GROUP_DELETE')
173
+		} elseif ($action == 'GROUP_DELETE')
171 174
         {
172 175
             dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
173 176
             $langs->load("users");
@@ -186,7 +189,9 @@  discard block
 block discarded – undo
186 189
 */
187 190
 
188 191
 		// Add more information into desc from the context property
189
-		if (! empty($desc) && ! empty($object->context['audit'])) $desc.=' - '.$object->context['audit'];
192
+		if (! empty($desc) && ! empty($object->context['audit'])) {
193
+		    $desc.=' - '.$object->context['audit'];
194
+		}
190 195
 
191 196
         // Add entry in event table
192 197
 		include_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
@@ -202,8 +207,7 @@  discard block
 block discarded – undo
202 207
         if ($result > 0)
203 208
         {
204 209
             return 1;
205
-        }
206
-        else
210
+        } else
207 211
         {
208 212
             $error ="Failed to insert security event: ".$event->error;
209 213
             $this->error=$error;
Please login to merge, or discard this patch.
dolibarr/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php 1 patch
Braces   +34 added lines, -15 removed lines patch added patch discarded remove patch
@@ -124,7 +124,9 @@  discard block
 block discarded – undo
124 124
 		require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';
125 125
 		$stripe = new Stripe($db);
126 126
 
127
-		if (empty($conf->stripe->enabled)) return 0;
127
+		if (empty($conf->stripe->enabled)) {
128
+		    return 0;
129
+		}
128 130
 
129 131
 		$ok = 1;
130 132
 
@@ -155,25 +157,40 @@  discard block
 block discarded – undo
155 157
 						$taxinfo["tax_id"] = $vatcleaned;
156 158
 					}
157 159
 					// We force data to "null" if not defined as expected by Stripe
158
-					if (empty($vatcleaned)) $taxinfo=null;
160
+					if (empty($vatcleaned)) {
161
+					    $taxinfo=null;
162
+					}
159 163
 
160 164
 					// Detect if we change a Stripe info (email, description, vat id)
161 165
 					$changerequested = 0;
162
-					if (! empty($object->email) && $object->email != $customer->email) $changerequested++;
163
-					if ($namecleaned != $customer->description) $changerequested++;
164
-					if (! isset($customer->tax_info['tax_id']) && ! is_null($vatcleaned)) $changerequested++;
165
-					elseif (isset($customer->tax_info['tax_id']) && is_null($vatcleaned)) $changerequested++;
166
-					elseif (isset($customer->tax_info['tax_id']) && ! is_null($vatcleaned))
166
+					if (! empty($object->email) && $object->email != $customer->email) {
167
+					    $changerequested++;
168
+					}
169
+					if ($namecleaned != $customer->description) {
170
+					    $changerequested++;
171
+					}
172
+					if (! isset($customer->tax_info['tax_id']) && ! is_null($vatcleaned)) {
173
+					    $changerequested++;
174
+					} elseif (isset($customer->tax_info['tax_id']) && is_null($vatcleaned)) {
175
+					    $changerequested++;
176
+					} elseif (isset($customer->tax_info['tax_id']) && ! is_null($vatcleaned))
167 177
 					{
168
-						if ($vatcleaned != $customer->tax_info['tax_id']) $changerequested++;
178
+						if ($vatcleaned != $customer->tax_info['tax_id']) {
179
+						    $changerequested++;
180
+						}
169 181
 					}
170 182
 
171 183
 					if ($changerequested)
172 184
 					{
173
-						if (! empty($object->email)) $customer->email = $object->email;
185
+						if (! empty($object->email)) {
186
+						    $customer->email = $object->email;
187
+						}
174 188
 						$customer->description = $namecleaned;
175
-						if (empty($taxinfo)) $customer->tax_info = array('type'=>'vat', 'tax_id'=>null);
176
-						else $customer->tax_info = $taxinfo;
189
+						if (empty($taxinfo)) {
190
+						    $customer->tax_info = array('type'=>'vat', 'tax_id'=>null);
191
+						} else {
192
+						    $customer->tax_info = $taxinfo;
193
+						}
177 194
 
178 195
 						$customer->save();
179 196
 					}
@@ -225,8 +242,7 @@  discard block
 block discarded – undo
225 242
 							$card->metadata=array('dol_id'=>$object->id, 'dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>(empty($_SERVER['REMOTE_ADDR'])?'':$_SERVER['REMOTE_ADDR']));
226 243
 							try {
227 244
 								$card->save($dataforcard);
228
-							}
229
-							catch(Exception $e)
245
+							} catch(Exception $e)
230 246
 							{
231 247
 								$ok = -1;
232 248
 								$this->error = $e->getMessages();
@@ -257,8 +273,11 @@  discard block
 block discarded – undo
257 273
 					{
258 274
 						$card = $stripe->cardStripe($customer, $object, $stripeacc, $servicestatus);
259 275
 						if ($card) {
260
-							if (method_exists($card, 'detach')) $card->detach();
261
-							else $card->delete();
276
+							if (method_exists($card, 'detach')) {
277
+							    $card->detach();
278
+							} else {
279
+							    $card->delete();
280
+							}
262 281
 						}
263 282
 					}
264 283
 				}
Please login to merge, or discard this patch.
htdocs/core/triggers/interface_50_modNotification_Notification.class.php 1 patch
Braces   +25 added lines, -10 removed lines patch added patch discarded remove patch
@@ -76,12 +76,17 @@  discard block
 block discarded – undo
76 76
 	 */
77 77
 	public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
78 78
 	{
79
-		if (empty($conf->notification->enabled)) return 0;     // Module not active, we do nothing
79
+		if (empty($conf->notification->enabled)) {
80
+		    return 0;
81
+		}
82
+		// Module not active, we do nothing
80 83
 
81 84
 		require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
82 85
 		$notify = new Notify($this->db);
83 86
 
84
-		if (! in_array($action, $notify->arrayofnotifsupported)) return 0;
87
+		if (! in_array($action, $notify->arrayofnotifsupported)) {
88
+		    return 0;
89
+		}
85 90
 
86 91
 		dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
87 92
 
@@ -117,7 +122,9 @@  discard block
 block discarded – undo
117 122
 
118 123
 				$qualified=0;
119 124
 				// Check is this event is supported by notification module
120
-				if (in_array($obj->code, $this->listofmanagedevents)) $qualified=1;
125
+				if (in_array($obj->code, $this->listofmanagedevents)) {
126
+				    $qualified=1;
127
+				}
121 128
 				// Check if module for this event is active
122 129
 				if ($qualified)
123 130
 				{
@@ -125,12 +132,19 @@  discard block
 block discarded – undo
125 132
 					$element=$obj->elementtype;
126 133
 
127 134
 					// Exclude events if related module is disabled
128
-					if ($element == 'order_supplier' && empty($conf->fournisseur->enabled)) $qualified=0;
129
-					elseif ($element == 'invoice_supplier' && empty($conf->fournisseur->enabled)) $qualified=0;
130
-					elseif ($element == 'withdraw' && empty($conf->prelevement->enabled)) $qualified=0;
131
-					elseif ($element == 'shipping' && empty($conf->expedition->enabled)) $qualified=0;
132
-					elseif ($element == 'member' && empty($conf->adherent->enabled)) $qualified=0;
133
-					elseif (! in_array($element,array('order_supplier','invoice_supplier','withdraw','shipping','member','expensereport')) && empty($conf->$element->enabled)) $qualified=0;
135
+					if ($element == 'order_supplier' && empty($conf->fournisseur->enabled)) {
136
+					    $qualified=0;
137
+					} elseif ($element == 'invoice_supplier' && empty($conf->fournisseur->enabled)) {
138
+					    $qualified=0;
139
+					} elseif ($element == 'withdraw' && empty($conf->prelevement->enabled)) {
140
+					    $qualified=0;
141
+					} elseif ($element == 'shipping' && empty($conf->expedition->enabled)) {
142
+					    $qualified=0;
143
+					} elseif ($element == 'member' && empty($conf->adherent->enabled)) {
144
+					    $qualified=0;
145
+					} elseif (! in_array($element,array('order_supplier','invoice_supplier','withdraw','shipping','member','expensereport')) && empty($conf->$element->enabled)) {
146
+					    $qualified=0;
147
+					}
134 148
 				}
135 149
 
136 150
 				if ($qualified)
@@ -140,8 +154,9 @@  discard block
 block discarded – undo
140 154
 
141 155
 				$i++;
142 156
 			}
157
+		} else {
158
+		    dol_print_error($this->db);
143 159
 		}
144
-		else dol_print_error($this->db);
145 160
 
146 161
 		return $ret;
147 162
 	}
Please login to merge, or discard this patch.
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.