Repository Access Links:

This URL has Read-Only access.
Statistics
| Branch: | Revision:

dolibarr-module-template / core / triggers / interface_99_modMyModule_MyTrigger.class.php @ ef37f43f

History | View | Annotate | Download (20.9 kB)

1
<?php
2
/* <one line to give the program's name and a brief idea of what it does.>
3
 * Copyright (C) <year>  <name of author>
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 */
18

    
19
/**
20
 * \file    core/triggers/interface_99_modMyModule_MyTrigger.class.php
21
 * \ingroup mymodule
22
 * \brief   Example trigger.
23
 *
24
 * Put detailed description here.
25
 *
26
 * \remarks You can create other triggers by copying this one.
27
 * - File name should be either:
28
 *      - interface_99_modMyModule_MyTrigger.class.php
29
 *      - interface_99_all_MyTrigger.class.php
30
 * - The file must stay in core/triggers
31
 * - The class name must be InterfaceMytrigger
32
 * - The constructor method must be named InterfaceMytrigger
33
 * - The name property name must be Mytrigger
34
 */
35

    
36
/** Includes */
37
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
38
require_once DOL_DOCUMENT_ROOT . dol_buildpath('/mymodule/class/MyTrigger.php', 1);
39

    
40
/**
41
 * Class InterfaceMytrigger
42
 */
43
class InterfaceMytrigger extends MyTrigger
44
{
45
        /**
46
         * @var DoliDB Database handler
47
         */
48
        protected $db;
49

    
50
        /**
51
         * Constructor
52
         *
53
         * @param DoliDB $db Database handler
54
         */
55
        public function __construct($db)
56
        {
57
                $this->db = $db;
58

    
59
                $this->name = preg_replace('/^Interface/i', '', get_class($this));
60
                $this->family = "demo";
61
                $this->description = "Triggers of this module are empty functions."
62
                        . "They have no effect."
63
                        . "They are provided for tutorial purpose only.";
64
                // 'development', 'experimental', 'dolibarr' or version
65
                $this->version = 'development';
66
                $this->picto = 'mymodule@mymodule';
67
        }
68

    
69
        /**
70
         * Trigger name
71
         *
72
         * @return string Name of trigger file
73
         */
74
        public function getName()
75
        {
76
                return $this->name;
77
        }
78

    
79
        /**
80
         * Trigger description
81
         *
82
         * @return string Description of trigger file
83
         */
84
        public function getDesc()
85
        {
86
                return $this->description;
87
        }
88

    
89
        /**
90
         * Trigger version
91
         *
92
         * @return string Version of trigger file
93
         */
94
        public function getVersion()
95
        {
96
                global $langs;
97
                $langs->load("admin");
98

    
99
                if ($this->version == 'development') {
100
                        return $langs->trans("Development");
101
                } elseif ($this->version == 'experimental') {
102
                        return $langs->trans("Experimental");
103
                } elseif ($this->version == 'dolibarr') {
104
                        return DOL_VERSION;
105
                } elseif ($this->version) {
106
                        return $this->version;
107
                } else {
108
                        return $langs->trans("Unknown");
109
                }
110
        }
111

    
112
    // @codingStandardsIgnoreStart
113
        /**
114
         * Compatibility trigger function for Dolibarr < 3.7
115
         *
116
         * @param int $action Trigger action
117
         * @param CommonObject $object Object trigged from
118
         * @param User $user User that trigged
119
         * @param Translate $langs Translations handler
120
         * @param Conf $conf Configuration
121
         * @return int                  <0 if KO, 0 if no triggered ran, >0 if OK
122
         * @deprecated Replaced by DolibarrTriggers::runTrigger()
123
         */
124
        public function run_trigger($action, $object, $user, $langs, $conf)
125
        {
126
                return $this->runTrigger($action, $object, $user, $langs, $conf);
127
        }
128
        // @codingStandardsIgnoreEnd
129

    
130
        /**
131
         * Function called when a Dolibarrr business event is done.
132
         * All functions "runTrigger" are triggered if file
133
         * is inside directory core/triggers
134
         *
135
         * @param string $action Event action code
136
         * @param Object $object Object
137
         * @param User $user Object user
138
         * @param Translate $langs Object langs
139
         * @param Conf $conf Object conf
140
         * @return int              <0 if KO, 0 if no triggered ran, >0 if OK
141
         */
142
        public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
143
        {
144
                // Put here code you want to execute when a Dolibarr business events occurs.
145
                // Data and type of action are stored into $object and $action
146

    
147
                /** Users */
148
                if ($action == 'USER_LOGIN') {
149
                        dol_syslog(
150
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
151
                        );
152
                } elseif ($action == 'USER_UPDATE_SESSION') {
153
                        // Warning: To increase performances, this action is triggered only if
154
                        // constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1.
155
                        dol_syslog(
156
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
157
                        );
158
                } elseif ($action == 'USER_CREATE') {
159
                        dol_syslog(
160
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
161
                        );
162
                } elseif ($action == 'USER_CREATE_FROM_CONTACT') {
163
                        dol_syslog(
164
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
165
                        );
166
                } elseif ($action == 'USER_MODIFY') {
167
                        dol_syslog(
168
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
169
                        );
170
                } elseif ($action == 'USER_NEW_PASSWORD') {
171
                        dol_syslog(
172
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
173
                        );
174
                } elseif ($action == 'USER_ENABLEDISABLE') {
175
                        dol_syslog(
176
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
177
                        );
178
                } elseif ($action == 'USER_DELETE') {
179
                        dol_syslog(
180
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
181
                        );
182
                } elseif ($action == 'USER_LOGOUT') {
183
                        dol_syslog(
184
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
185
                        );
186
                } elseif ($action == 'USER_SETINGROUP') {
187
                        dol_syslog(
188
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
189
                        );
190
                } elseif ($action == 'USER_REMOVEFROMGROUP') {
191
                        dol_syslog(
192
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
193
                        );
194

    
195
                        /** Groups */
196
                } elseif ($action == 'GROUP_CREATE') {
197
                        dol_syslog(
198
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
199
                        );
200
                } elseif ($action == 'GROUP_MODIFY') {
201
                        dol_syslog(
202
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
203
                        );
204
                } elseif ($action == 'GROUP_DELETE') {
205
                        dol_syslog(
206
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
207
                        );
208

    
209
                        /** Companies */
210
                } elseif ($action == 'COMPANY_CREATE') {
211
                        dol_syslog(
212
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
213
                        );
214
                } elseif ($action == 'COMPANY_MODIFY') {
215
                        dol_syslog(
216
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
217
                        );
218
                } elseif ($action == 'COMPANY_DELETE') {
219
                        dol_syslog(
220
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
221
                        );
222

    
223
                        /** Contacts */
224
                } elseif ($action == 'CONTACT_CREATE') {
225
                        dol_syslog(
226
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
227
                        );
228
                } elseif ($action == 'CONTACT_MODIFY') {
229
                        dol_syslog(
230
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
231
                        );
232
                } elseif ($action == 'CONTACT_DELETE') {
233
                        dol_syslog(
234
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
235
                        );
236
                        // Products
237
                } elseif ($action == 'PRODUCT_CREATE') {
238
                        dol_syslog(
239
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
240
                        );
241
                } elseif ($action == 'PRODUCT_MODIFY') {
242
                        dol_syslog(
243
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
244
                        );
245
                } elseif ($action == 'PRODUCT_DELETE') {
246
                        dol_syslog(
247
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
248
                        );
249

    
250
                        /** Customer orders */
251
                } elseif ($action == 'ORDER_CREATE') {
252
                        dol_syslog(
253
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
254
                        );
255
                } elseif ($action == 'ORDER_CLONE') {
256
                        dol_syslog(
257
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
258
                        );
259
                } elseif ($action == 'ORDER_VALIDATE') {
260
                        dol_syslog(
261
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
262
                        );
263
                } elseif ($action == 'ORDER_DELETE') {
264
                        dol_syslog(
265
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
266
                        );
267
                } elseif ($action == 'ORDER_BUILDDOC') {
268
                        dol_syslog(
269
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
270
                        );
271
                } elseif ($action == 'ORDER_SENTBYMAIL') {
272
                        dol_syslog(
273
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
274
                        );
275
                } elseif ($action == 'LINEORDER_INSERT') {
276
                        dol_syslog(
277
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
278
                        );
279
                } elseif ($action == 'LINEORDER_DELETE') {
280
                        dol_syslog(
281
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
282
                        );
283

    
284
                        /** Supplier orders */
285
                } elseif ($action == 'ORDER_SUPPLIER_CREATE') {
286
                        dol_syslog(
287
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
288
                        );
289
                } elseif ($action == 'ORDER_SUPPLIER_VALIDATE') {
290
                        dol_syslog(
291
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
292
                        );
293
                } elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL') {
294
                        dol_syslog(
295
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
296
                        );
297
                } elseif ($action == 'SUPPLIER_ORDER_BUILDDOC') {
298
                        dol_syslog(
299
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
300
                        );
301

    
302
                        /** Proposals */
303
                } elseif ($action == 'PROPAL_CREATE') {
304
                        dol_syslog(
305
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
306
                        );
307
                } elseif ($action == 'PROPAL_CLONE') {
308
                        dol_syslog(
309
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
310
                        );
311
                } elseif ($action == 'PROPAL_MODIFY') {
312
                        dol_syslog(
313
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
314
                        );
315
                } elseif ($action == 'PROPAL_VALIDATE') {
316
                        dol_syslog(
317
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
318
                        );
319
                } elseif ($action == 'PROPAL_BUILDDOC') {
320
                        dol_syslog(
321
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
322
                        );
323
                } elseif ($action == 'PROPAL_SENTBYMAIL') {
324
                        dol_syslog(
325
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
326
                        );
327
                } elseif ($action == 'PROPAL_CLOSE_SIGNED') {
328
                        dol_syslog(
329
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
330
                        );
331
                } elseif ($action == 'PROPAL_CLOSE_REFUSED') {
332
                        dol_syslog(
333
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
334
                        );
335
                } elseif ($action == 'PROPAL_DELETE') {
336
                        dol_syslog(
337
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
338
                        );
339
                } elseif ($action == 'LINEPROPAL_INSERT') {
340
                        dol_syslog(
341
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
342
                        );
343
                } elseif ($action == 'LINEPROPAL_MODIFY') {
344
                        dol_syslog(
345
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
346
                        );
347
                } elseif ($action == 'LINEPROPAL_DELETE') {
348
                        dol_syslog(
349
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
350
                        );
351

    
352
                        /** Contracts */
353
                } elseif ($action == 'CONTRACT_CREATE') {
354
                        dol_syslog(
355
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
356
                        );
357
                } elseif ($action == 'CONTRACT_MODIFY') {
358
                        dol_syslog(
359
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
360
                        );
361
                } elseif ($action == 'CONTRACT_ACTIVATE') {
362
                        dol_syslog(
363
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
364
                        );
365
                } elseif ($action == 'CONTRACT_CANCEL') {
366
                        dol_syslog(
367
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
368
                        );
369
                } elseif ($action == 'CONTRACT_CLOSE') {
370
                        dol_syslog(
371
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
372
                        );
373
                } elseif ($action == 'CONTRACT_DELETE') {
374
                        dol_syslog(
375
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
376
                        );
377

    
378
                        /** Bills */
379
                } elseif ($action == 'BILL_CREATE') {
380
                        dol_syslog(
381
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
382
                        );
383
                } elseif ($action == 'BILL_CLONE') {
384
                        dol_syslog(
385
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
386
                        );
387
                } elseif ($action == 'BILL_MODIFY') {
388
                        dol_syslog(
389
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
390
                        );
391
                } elseif ($action == 'BILL_VALIDATE') {
392
                        dol_syslog(
393
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
394
                        );
395
                } elseif ($action == 'BILL_BUILDDOC') {
396
                        dol_syslog(
397
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
398
                        );
399
                } elseif ($action == 'BILL_SENTBYMAIL') {
400
                        dol_syslog(
401
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
402
                        );
403
                } elseif ($action == 'BILL_CANCEL') {
404
                        dol_syslog(
405
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
406
                        );
407
                } elseif ($action == 'BILL_DELETE') {
408
                        dol_syslog(
409
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
410
                        );
411
                } elseif ($action == 'LINEBILL_INSERT') {
412
                        dol_syslog(
413
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
414
                        );
415
                } elseif ($action == 'LINEBILL_DELETE') {
416
                        dol_syslog(
417
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
418
                        );
419

    
420
                        /** Payments */
421
                } elseif ($action == 'PAYMENT_CUSTOMER_CREATE') {
422
                        dol_syslog(
423
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
424
                        );
425
                } elseif ($action == 'PAYMENT_SUPPLIER_CREATE') {
426
                        dol_syslog(
427
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
428
                        );
429
                } elseif ($action == 'PAYMENT_ADD_TO_BANK') {
430
                        dol_syslog(
431
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
432
                        );
433
                } elseif ($action == 'PAYMENT_DELETE') {
434
                        dol_syslog(
435
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
436
                        );
437

    
438
                        /** Interventions */
439
                } elseif ($action == 'FICHEINTER_CREATE') {
440
                        dol_syslog(
441
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
442
                        );
443
                } elseif ($action == 'FICHEINTER_MODIFY') {
444
                        dol_syslog(
445
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
446
                        );
447
                } elseif ($action == 'FICHEINTER_VALIDATE') {
448
                        dol_syslog(
449
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
450
                        );
451
                } elseif ($action == 'FICHEINTER_DELETE') {
452
                        dol_syslog(
453
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
454
                        );
455

    
456
                        /** Members */
457
                } elseif ($action == 'MEMBER_CREATE') {
458
                        dol_syslog(
459
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
460
                        );
461
                } elseif ($action == 'MEMBER_VALIDATE') {
462
                        dol_syslog(
463
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
464
                        );
465
                } elseif ($action == 'MEMBER_SUBSCRIPTION') {
466
                        dol_syslog(
467
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
468
                        );
469
                } elseif ($action == 'MEMBER_MODIFY') {
470
                        dol_syslog(
471
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
472
                        );
473
                } elseif ($action == 'MEMBER_NEW_PASSWORD') {
474
                        dol_syslog(
475
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
476
                        );
477
                } elseif ($action == 'MEMBER_RESILIATE') {
478
                        dol_syslog(
479
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
480
                        );
481
                } elseif ($action == 'MEMBER_DELETE') {
482
                        dol_syslog(
483
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
484
                        );
485

    
486
                        /** Categories */
487
                } elseif ($action == 'CATEGORY_CREATE') {
488
                        dol_syslog(
489
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
490
                        );
491
                } elseif ($action == 'CATEGORY_MODIFY') {
492
                        dol_syslog(
493
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
494
                        );
495
                } elseif ($action == 'CATEGORY_DELETE') {
496
                        dol_syslog(
497
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
498
                        );
499

    
500
                        /** Projects */
501
                } elseif ($action == 'PROJECT_CREATE') {
502
                        dol_syslog(
503
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
504
                        );
505
                } elseif ($action == 'PROJECT_MODIFY') {
506
                        dol_syslog(
507
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
508
                        );
509
                } elseif ($action == 'PROJECT_DELETE') {
510
                        dol_syslog(
511
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
512
                        );
513
                        /** Project tasks */
514
                } elseif ($action == 'TASK_CREATE') {
515
                        dol_syslog(
516
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
517
                        );
518
                } elseif ($action == 'TASK_MODIFY') {
519
                        dol_syslog(
520
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
521
                        );
522
                } elseif ($action == 'TASK_DELETE') {
523
                        dol_syslog(
524
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
525
                        );
526

    
527
                        /** Task time spent */
528
                } elseif ($action == 'TASK_TIMESPENT_CREATE') {
529
                        dol_syslog(
530
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
531
                        );
532
                } elseif ($action == 'TASK_TIMESPENT_MODIFY') {
533
                        dol_syslog(
534
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
535
                        );
536
                } elseif ($action == 'TASK_TIMESPENT_DELETE') {
537
                        dol_syslog(
538
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
539
                        );
540

    
541
                        /** Shipping */
542
                } elseif ($action == 'SHIPPING_CREATE') {
543
                        dol_syslog(
544
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
545
                        );
546
                } elseif ($action == 'SHIPPING_MODIFY') {
547
                        dol_syslog(
548
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
549
                        );
550
                } elseif ($action == 'SHIPPING_VALIDATE') {
551
                        dol_syslog(
552
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
553
                        );
554
                } elseif ($action == 'SHIPPING_SENTBYMAIL') {
555
                        dol_syslog(
556
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
557
                        );
558
                } elseif ($action == 'SHIPPING_DELETE') {
559
                        dol_syslog(
560
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
561
                        );
562
                } elseif ($action == 'SHIPPING_BUILDDOC') {
563
                        dol_syslog(
564
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
565
                        );
566

    
567
                        /** File */
568
                } elseif ($action == 'FILE_UPLOAD') {
569
                        dol_syslog(
570
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
571
                        );
572
                } elseif ($action == 'FILE_DELETE') {
573
                        dol_syslog(
574
                                "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
575
                        );
576
                }
577

    
578
                return 0;
579
        }
580
}