@@ -25,25 +25,25 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | function subtotalAdminPrepareHead() |
| 27 | 27 | { |
| 28 | - global $langs, $conf; |
|
| 28 | + global $langs, $conf; |
|
| 29 | 29 | |
| 30 | - $langs->load("subtotal@subtotal"); |
|
| 30 | + $langs->load("subtotal@subtotal"); |
|
| 31 | 31 | |
| 32 | - $h = 0; |
|
| 33 | - $head = array(); |
|
| 32 | + $h = 0; |
|
| 33 | + $head = array(); |
|
| 34 | 34 | |
| 35 | - $head[$h][0] = dol_buildpath("/subtotal/admin/subtotal_setup.php", 1); |
|
| 36 | - $head[$h][1] = $langs->trans("Parameters"); |
|
| 37 | - $head[$h][2] = 'settings'; |
|
| 38 | - $h++; |
|
| 39 | - $head[$h][0] = dol_buildpath("/subtotal/admin/subtotal_about.php", 1); |
|
| 40 | - $head[$h][1] = $langs->trans("About"); |
|
| 41 | - $head[$h][2] = 'about'; |
|
| 42 | - $h++; |
|
| 35 | + $head[$h][0] = dol_buildpath("/subtotal/admin/subtotal_setup.php", 1); |
|
| 36 | + $head[$h][1] = $langs->trans("Parameters"); |
|
| 37 | + $head[$h][2] = 'settings'; |
|
| 38 | + $h++; |
|
| 39 | + $head[$h][0] = dol_buildpath("/subtotal/admin/subtotal_about.php", 1); |
|
| 40 | + $head[$h][1] = $langs->trans("About"); |
|
| 41 | + $head[$h][2] = 'about'; |
|
| 42 | + $h++; |
|
| 43 | 43 | |
| 44 | - complete_head_from_modules($conf, $langs, $object, $head, $h, 'subtotal', $showLabel=false); |
|
| 44 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'subtotal', $showLabel=false); |
|
| 45 | 45 | |
| 46 | - return $head; |
|
| 46 | + return $head; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | function getHtmlSelectTitle(&$object, $showLabel=false) |
@@ -242,17 +242,17 @@ discard block |
||
| 242 | 242 | $classname = ucfirst($element); |
| 243 | 243 | |
| 244 | 244 | switch ($element) { |
| 245 | - case 'supplier_proposal': |
|
| 246 | - $classname = 'SupplierProposal'; |
|
| 247 | - break; |
|
| 245 | + case 'supplier_proposal': |
|
| 246 | + $classname = 'SupplierProposal'; |
|
| 247 | + break; |
|
| 248 | 248 | |
| 249 | - case 'order_supplier': |
|
| 250 | - $classname = 'CommandeFournisseur'; |
|
| 251 | - break; |
|
| 249 | + case 'order_supplier': |
|
| 250 | + $classname = 'CommandeFournisseur'; |
|
| 251 | + break; |
|
| 252 | 252 | |
| 253 | - case 'invoice_supplier': |
|
| 254 | - $classname = 'FactureFournisseur'; |
|
| 255 | - break; |
|
| 253 | + case 'invoice_supplier': |
|
| 254 | + $classname = 'FactureFournisseur'; |
|
| 255 | + break; |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | $object = new $classname($db); // Propal | Commande | Facture |
@@ -325,14 +325,14 @@ discard block |
||
| 325 | 325 | else $res = $line->update($user, $notrigger); |
| 326 | 326 | } |
| 327 | 327 | else { |
| 328 | - if(in_array($object->element, array('invoice_supplier', 'order_supplier', 'supplier_proposal'))) { |
|
| 329 | - if(empty($line->label)) $line->label = $line->description; // supplier lines don't have the field label |
|
| 328 | + if(in_array($object->element, array('invoice_supplier', 'order_supplier', 'supplier_proposal'))) { |
|
| 329 | + if(empty($line->label)) $line->label = $line->description; // supplier lines don't have the field label |
|
| 330 | 330 | |
| 331 | - require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); |
|
| 332 | - $extrafields=new ExtraFields($object->db); |
|
| 333 | - $extralabels=$extrafields->fetch_name_optionals_label($object->table_element_line,true); |
|
| 334 | - $line->fetch_optionals($line->id,$extralabels); |
|
| 335 | - } |
|
| 331 | + require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); |
|
| 332 | + $extrafields=new ExtraFields($object->db); |
|
| 333 | + $extralabels=$extrafields->fetch_name_optionals_label($object->table_element_line,true); |
|
| 334 | + $line->fetch_optionals($line->id,$extralabels); |
|
| 335 | + } |
|
| 336 | 336 | $line->array_options['options_subtotal_nc'] = 0; |
| 337 | 337 | if($object->element == 'order_supplier') $line->update($user); |
| 338 | 338 | $res = TSubtotal::doUpdateLine($object, $line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->product_type, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->fk_parent_line, $line->skip_update_total, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit, $notrigger); |
@@ -39,10 +39,10 @@ discard block |
||
| 39 | 39 | * @var $object Facture fournisseur |
| 40 | 40 | */ |
| 41 | 41 | else if($object->element=='invoice_supplier') { |
| 42 | - $object->special_code = TSubtotal::$module_number; |
|
| 43 | - $rang = $object->line_max() + 1; |
|
| 44 | - if($qty==50) $res = $object->addline($desc,0,0,0,0,$qty,0,0,'','',0,0,'HT',9,$rang); |
|
| 45 | - else $res = $object->addline($label,0,0,0,0,$qty,0,0,'','',0,0,'HT',9,$rang); |
|
| 42 | + $object->special_code = TSubtotal::$module_number; |
|
| 43 | + $rang = $object->line_max() + 1; |
|
| 44 | + if($qty==50) $res = $object->addline($desc,0,0,0,0,$qty,0,0,'','',0,0,'HT',9,$rang); |
|
| 45 | + else $res = $object->addline($label,0,0,0,0,$qty,0,0,'','',0,0,'HT',9,$rang); |
|
| 46 | 46 | } |
| 47 | 47 | /** |
| 48 | 48 | * @var $object Propal |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | * @var $object Commande fournisseur |
| 62 | 62 | */ |
| 63 | 63 | else if($object->element=='order_supplier') { |
| 64 | - $object->special_code = TSubtotal::$module_number; |
|
| 65 | - $res = $object->addline($label, 0,$qty,0,0,0,0,0,'',0,'HT', 0, 9); |
|
| 64 | + $object->special_code = TSubtotal::$module_number; |
|
| 65 | + $res = $object->addline($label, 0,$qty,0,0,0,0,0,'',0,'HT', 0, 9); |
|
| 66 | 66 | } |
| 67 | 67 | /** |
| 68 | 68 | * @var $object Facturerec |
@@ -404,16 +404,16 @@ discard block |
||
| 404 | 404 | $createRight = $user->rights->{$object->element}->creer; |
| 405 | 405 | if($object->element == 'facturerec' ) |
| 406 | 406 | { |
| 407 | - $object->statut = 0; // hack for facture rec |
|
| 408 | - $createRight = $user->rights->facture->creer; |
|
| 407 | + $object->statut = 0; // hack for facture rec |
|
| 408 | + $createRight = $user->rights->facture->creer; |
|
| 409 | 409 | } |
| 410 | 410 | elseif($object->element == 'order_supplier' ) |
| 411 | 411 | { |
| 412 | - $createRight = $user->rights->fournisseur->commande->creer; |
|
| 412 | + $createRight = $user->rights->fournisseur->commande->creer; |
|
| 413 | 413 | } |
| 414 | 414 | elseif($object->element == 'invoice_supplier' ) |
| 415 | 415 | { |
| 416 | - $createRight = $user->rights->fournisseur->facture->creer; |
|
| 416 | + $createRight = $user->rights->fournisseur->facture->creer; |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | if ($object->statut == 0 && $createRight && !empty($conf->global->SUBTOTAL_ALLOW_DUPLICATE_BLOCK)) |
@@ -438,8 +438,8 @@ discard block |
||
| 438 | 438 | break; |
| 439 | 439 | |
| 440 | 440 | case 'supplier_proposal': |
| 441 | - $res = $object->addline($line->desc, $line->subprice, $line->qty, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->fk_product, $line->remise_percent, 'HT', 0, $line->info_bits, $line->product_type, -1, $line->special_code, 0, 0, $line->pa_ht, $line->label, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->origin, $line->origin_id); |
|
| 442 | - break; |
|
| 441 | + $res = $object->addline($line->desc, $line->subprice, $line->qty, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->fk_product, $line->remise_percent, 'HT', 0, $line->info_bits, $line->product_type, -1, $line->special_code, 0, 0, $line->pa_ht, $line->label, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->origin, $line->origin_id); |
|
| 442 | + break; |
|
| 443 | 443 | |
| 444 | 444 | case 'commande': |
| 445 | 445 | //$desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0, $date_start='', $date_end='', $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$array_options=0, $fk_unit=null, $origin='', $origin_id=0) |
@@ -447,10 +447,10 @@ discard block |
||
| 447 | 447 | break; |
| 448 | 448 | |
| 449 | 449 | case 'order_supplier': |
| 450 | - $object->line = $line; |
|
| 451 | - $object->line->fk_commande = $object->id; |
|
| 452 | - $object->line->rang = $object->line_max() +1; |
|
| 453 | - $res = $object->line->insert(1); |
|
| 450 | + $object->line = $line; |
|
| 451 | + $object->line->fk_commande = $object->id; |
|
| 452 | + $object->line->rang = $object->line_max() +1; |
|
| 453 | + $res = $object->line->insert(1); |
|
| 454 | 454 | break; |
| 455 | 455 | |
| 456 | 456 | case 'facture': |
@@ -503,8 +503,8 @@ discard block |
||
| 503 | 503 | $object->db->commit(); |
| 504 | 504 | foreach ($TLineAdded as &$line) |
| 505 | 505 | { |
| 506 | - // ça peut paraitre non optimisé de déclancher la fonction sur toutes les lignes mais ceci est nécessaire pour réappliquer l'état exact de chaque ligne |
|
| 507 | - _updateLineNC($object->element, $object->id, $line->id, $line->array_options['options_subtotal_nc']); |
|
| 506 | + // ça peut paraitre non optimisé de déclancher la fonction sur toutes les lignes mais ceci est nécessaire pour réappliquer l'état exact de chaque ligne |
|
| 507 | + _updateLineNC($object->element, $object->id, $line->id, $line->array_options['options_subtotal_nc']); |
|
| 508 | 508 | } |
| 509 | 509 | return count($TLineAdded); |
| 510 | 510 | } |
@@ -578,33 +578,33 @@ discard block |
||
| 578 | 578 | |
| 579 | 579 | switch ($object->element) |
| 580 | 580 | { |
| 581 | - case 'propal': |
|
| 582 | - $res = $object->updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $desc, $price_base_type, $info_bits, $special_code, $fk_parent_line, $skip_update_total, $fk_fournprice, $pa_ht, $label, $type, $date_start, $date_end, $array_options, $fk_unit, 0, $notrigger); |
|
| 583 | - break; |
|
| 581 | + case 'propal': |
|
| 582 | + $res = $object->updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $desc, $price_base_type, $info_bits, $special_code, $fk_parent_line, $skip_update_total, $fk_fournprice, $pa_ht, $label, $type, $date_start, $date_end, $array_options, $fk_unit, 0, $notrigger); |
|
| 583 | + break; |
|
| 584 | 584 | |
| 585 | - case 'supplier_proposal': |
|
| 586 | - $res = $object->updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $desc, $price_base_type, $info_bits, $special_code, $fk_parent_line, $skip_update_total, $fk_fournprice, $pa_ht, $label, $type, $array_options,'', $fk_unit); |
|
| 587 | - break; |
|
| 585 | + case 'supplier_proposal': |
|
| 586 | + $res = $object->updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $desc, $price_base_type, $info_bits, $special_code, $fk_parent_line, $skip_update_total, $fk_fournprice, $pa_ht, $label, $type, $array_options,'', $fk_unit); |
|
| 587 | + break; |
|
| 588 | 588 | |
| 589 | 589 | case 'commande': |
| 590 | 590 | $res = $object->updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $date_start, $date_end, $type, $fk_parent_line, $skip_update_total, $fk_fournprice, $pa_ht, $label, $special_code, $array_options, $fk_unit, 0, $notrigger); |
| 591 | 591 | break; |
| 592 | 592 | |
| 593 | 593 | case 'order_supplier': |
| 594 | - $object->special_code = SELF::$module_number; |
|
| 595 | - if (empty($desc)) $desc = $label; |
|
| 596 | - $res = $object->updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $type, 0, $date_start, $date_end, $array_options, $fk_unit); |
|
| 597 | - break; |
|
| 594 | + $object->special_code = SELF::$module_number; |
|
| 595 | + if (empty($desc)) $desc = $label; |
|
| 596 | + $res = $object->updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $type, 0, $date_start, $date_end, $array_options, $fk_unit); |
|
| 597 | + break; |
|
| 598 | 598 | |
| 599 | 599 | case 'facture': |
| 600 | 600 | $res = $object->updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $type, $fk_parent_line, $skip_update_total, $fk_fournprice, $pa_ht, $label, $special_code, $array_options, $situation_percent, $fk_unit, 0, $notrigger); |
| 601 | 601 | break; |
| 602 | 602 | |
| 603 | 603 | case 'invoice_supplier': |
| 604 | - $object->special_code = SELF::$module_number; |
|
| 605 | - if (empty($desc)) $desc = $label; |
|
| 606 | - $res = $object->updateline($rowid, $desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, 0, $price_base_type, $info_bits, $type, $remise_percent, 0, $date_start, $date_end, $array_options, $fk_unit); |
|
| 607 | - break; |
|
| 604 | + $object->special_code = SELF::$module_number; |
|
| 605 | + if (empty($desc)) $desc = $label; |
|
| 606 | + $res = $object->updateline($rowid, $desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, 0, $price_base_type, $info_bits, $type, $remise_percent, 0, $date_start, $date_end, $array_options, $fk_unit); |
|
| 607 | + break; |
|
| 608 | 608 | |
| 609 | 609 | case 'facturerec': |
| 610 | 610 | // Add extrafields and get rang |
@@ -995,8 +995,8 @@ discard block |
||
| 995 | 995 | { |
| 996 | 996 | if (is_readable($logo)) |
| 997 | 997 | { |
| 998 | - $height=pdf_getHeightForLogo($logo); |
|
| 999 | - $pdf->Image($logo, $objmarge->marge_gauche, $posy, 0, $height); // width=0 (auto) |
|
| 998 | + $height=pdf_getHeightForLogo($logo); |
|
| 999 | + $pdf->Image($logo, $objmarge->marge_gauche, $posy, 0, $height); // width=0 (auto) |
|
| 1000 | 1000 | } |
| 1001 | 1001 | else |
| 1002 | 1002 | { |
@@ -1187,13 +1187,13 @@ discard block |
||
| 1187 | 1187 | * @param int $hidebottom Hide bottom |
| 1188 | 1188 | * @return void |
| 1189 | 1189 | */ |
| 1190 | - private static function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0) |
|
| 1191 | - { |
|
| 1192 | - if (empty($hidetop) || $hidetop==-1) $pdf->line($x, $y, $x+$l, $y); |
|
| 1193 | - $pdf->line($x+$l, $y, $x+$l, $y+$h); |
|
| 1194 | - if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h); |
|
| 1195 | - $pdf->line($x, $y+$h, $x, $y); |
|
| 1196 | - } |
|
| 1190 | + private static function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0) |
|
| 1191 | + { |
|
| 1192 | + if (empty($hidetop) || $hidetop==-1) $pdf->line($x, $y, $x+$l, $y); |
|
| 1193 | + $pdf->line($x+$l, $y, $x+$l, $y+$h); |
|
| 1194 | + if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h); |
|
| 1195 | + $pdf->line($x, $y+$h, $x, $y); |
|
| 1196 | + } |
|
| 1197 | 1197 | |
| 1198 | 1198 | |
| 1199 | 1199 | public static function concat(&$outputlangs, $files, $fileoutput='') |
@@ -1203,14 +1203,14 @@ discard block |
||
| 1203 | 1203 | if (empty($fileoutput)) $fileoutput = $file[0]; |
| 1204 | 1204 | |
| 1205 | 1205 | $pdf=pdf_getInstance(); |
| 1206 | - if (class_exists('TCPDF')) |
|
| 1207 | - { |
|
| 1208 | - $pdf->setPrintHeader(false); |
|
| 1209 | - $pdf->setPrintFooter(false); |
|
| 1210 | - } |
|
| 1211 | - $pdf->SetFont(pdf_getPDFFont($outputlangs)); |
|
| 1206 | + if (class_exists('TCPDF')) |
|
| 1207 | + { |
|
| 1208 | + $pdf->setPrintHeader(false); |
|
| 1209 | + $pdf->setPrintFooter(false); |
|
| 1210 | + } |
|
| 1211 | + $pdf->SetFont(pdf_getPDFFont($outputlangs)); |
|
| 1212 | 1212 | |
| 1213 | - if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); |
|
| 1213 | + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); |
|
| 1214 | 1214 | |
| 1215 | 1215 | |
| 1216 | 1216 | foreach($files as $file) |
@@ -31,170 +31,170 @@ discard block |
||
| 31 | 31 | class modSubtotal extends DolibarrModules |
| 32 | 32 | { |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Constructor. Define names, constants, directories, boxes, permissions |
|
| 36 | - * |
|
| 37 | - * @param DoliDB $db Database handler |
|
| 38 | - */ |
|
| 34 | + /** |
|
| 35 | + * Constructor. Define names, constants, directories, boxes, permissions |
|
| 36 | + * |
|
| 37 | + * @param DoliDB $db Database handler |
|
| 38 | + */ |
|
| 39 | 39 | |
| 40 | - public function __construct($db) |
|
| 41 | - { |
|
| 42 | - global $langs, $conf; |
|
| 40 | + public function __construct($db) |
|
| 41 | + { |
|
| 42 | + global $langs, $conf; |
|
| 43 | 43 | |
| 44 | - $this->db = $db; |
|
| 44 | + $this->db = $db; |
|
| 45 | 45 | |
| 46 | 46 | $this->editor_name = 'ATM-Consulting'; |
| 47 | - // Id for module (must be unique). |
|
| 48 | - // Use a free id here |
|
| 49 | - // (See in Home -> System information -> Dolibarr for list of used modules id). |
|
| 50 | - $this->numero = 104777; // 104000 to 104999 for ATM CONSULTING |
|
| 51 | - // Key text used to identify module (for permissions, menus, etc...) |
|
| 52 | - $this->rights_class = 'subtotal'; |
|
| 47 | + // Id for module (must be unique). |
|
| 48 | + // Use a free id here |
|
| 49 | + // (See in Home -> System information -> Dolibarr for list of used modules id). |
|
| 50 | + $this->numero = 104777; // 104000 to 104999 for ATM CONSULTING |
|
| 51 | + // Key text used to identify module (for permissions, menus, etc...) |
|
| 52 | + $this->rights_class = 'subtotal'; |
|
| 53 | 53 | |
| 54 | - // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' |
|
| 55 | - // It is used to group modules in module setup page |
|
| 56 | - $this->family = "technic"; |
|
| 57 | - // Module label (no space allowed) |
|
| 58 | - // used if translation string 'ModuleXXXName' not found |
|
| 59 | - // (where XXX is value of numeric property 'numero' of module) |
|
| 60 | - $this->name = preg_replace('/^mod/i', '', get_class($this)); |
|
| 61 | - // Module description |
|
| 62 | - // used if translation string 'ModuleXXXDesc' not found |
|
| 63 | - // (where XXX is value of numeric property 'numero' of module) |
|
| 64 | - $this->description = "Module permettant l'ajout de sous-totaux et sous-totaux intermédiaires et le déplacement d'une ligne aisée de l'un dans l'autre"; |
|
| 65 | - // Possible values for version are: 'development', 'experimental' or version |
|
| 66 | - $this->version = '3.1.1'; |
|
| 67 | - // Key used in llx_const table to save module status enabled/disabled |
|
| 68 | - // (where MYMODULE is value of property name of module in uppercase) |
|
| 69 | - $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); |
|
| 70 | - // Where to store the module in setup page |
|
| 71 | - // (0=common,1=interface,2=others,3=very specific) |
|
| 72 | - $this->special = 2; |
|
| 73 | - // Name of image file used for this module. |
|
| 74 | - // If file is in theme/yourtheme/img directory under name object_pictovalue.png |
|
| 75 | - // use this->picto='pictovalue' |
|
| 76 | - // If file is in module/img directory under name object_pictovalue.png |
|
| 77 | - // use this->picto='pictovalue@module' |
|
| 78 | - $this->picto = 'subtotal@subtotal'; // mypicto@titre |
|
| 79 | - // Defined all module parts (triggers, login, substitutions, menus, css, etc...) |
|
| 80 | - // for default path (eg: /titre/core/xxxxx) (0=disable, 1=enable) |
|
| 81 | - // for specific path of parts (eg: /titre/core/modules/barcode) |
|
| 82 | - // for specific css file (eg: /titre/css/titre.css.php) |
|
| 83 | - $this->module_parts = array( |
|
| 84 | - // Set this to 1 if module has its own trigger directory |
|
| 85 | - 'triggers' => 1, |
|
| 86 | - // Set this to 1 if module has its own login method directory |
|
| 87 | - //'login' => 0, |
|
| 88 | - // Set this to 1 if module has its own substitution function file |
|
| 89 | - //'substitutions' => 0, |
|
| 90 | - // Set this to 1 if module has its own menus handler directory |
|
| 91 | - //'menus' => 0, |
|
| 92 | - // Set this to 1 if module has its own barcode directory |
|
| 93 | - //'barcode' => 0, |
|
| 94 | - // Set this to 1 if module has its own models directory |
|
| 95 | - 'models' => 1, |
|
| 96 | - // Set this to relative path of css if module has its own css file |
|
| 97 | - //'css' => '/titre/css/mycss.css.php', |
|
| 98 | - // Set here all hooks context managed by module |
|
| 99 | - 'hooks' => array('invoicecard', 'invoicesuppliercard','propalcard', 'supplier_proposalcard', 'ordercard', 'ordersuppliercard','odtgeneration','orderstoinvoice','admin','invoicereccard','consumptionthirdparty') |
|
| 100 | - // Set here all workflow context managed by module |
|
| 101 | - //'workflow' => array('order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE')) |
|
| 102 | - ); |
|
| 54 | + // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' |
|
| 55 | + // It is used to group modules in module setup page |
|
| 56 | + $this->family = "technic"; |
|
| 57 | + // Module label (no space allowed) |
|
| 58 | + // used if translation string 'ModuleXXXName' not found |
|
| 59 | + // (where XXX is value of numeric property 'numero' of module) |
|
| 60 | + $this->name = preg_replace('/^mod/i', '', get_class($this)); |
|
| 61 | + // Module description |
|
| 62 | + // used if translation string 'ModuleXXXDesc' not found |
|
| 63 | + // (where XXX is value of numeric property 'numero' of module) |
|
| 64 | + $this->description = "Module permettant l'ajout de sous-totaux et sous-totaux intermédiaires et le déplacement d'une ligne aisée de l'un dans l'autre"; |
|
| 65 | + // Possible values for version are: 'development', 'experimental' or version |
|
| 66 | + $this->version = '3.1.1'; |
|
| 67 | + // Key used in llx_const table to save module status enabled/disabled |
|
| 68 | + // (where MYMODULE is value of property name of module in uppercase) |
|
| 69 | + $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); |
|
| 70 | + // Where to store the module in setup page |
|
| 71 | + // (0=common,1=interface,2=others,3=very specific) |
|
| 72 | + $this->special = 2; |
|
| 73 | + // Name of image file used for this module. |
|
| 74 | + // If file is in theme/yourtheme/img directory under name object_pictovalue.png |
|
| 75 | + // use this->picto='pictovalue' |
|
| 76 | + // If file is in module/img directory under name object_pictovalue.png |
|
| 77 | + // use this->picto='pictovalue@module' |
|
| 78 | + $this->picto = 'subtotal@subtotal'; // mypicto@titre |
|
| 79 | + // Defined all module parts (triggers, login, substitutions, menus, css, etc...) |
|
| 80 | + // for default path (eg: /titre/core/xxxxx) (0=disable, 1=enable) |
|
| 81 | + // for specific path of parts (eg: /titre/core/modules/barcode) |
|
| 82 | + // for specific css file (eg: /titre/css/titre.css.php) |
|
| 83 | + $this->module_parts = array( |
|
| 84 | + // Set this to 1 if module has its own trigger directory |
|
| 85 | + 'triggers' => 1, |
|
| 86 | + // Set this to 1 if module has its own login method directory |
|
| 87 | + //'login' => 0, |
|
| 88 | + // Set this to 1 if module has its own substitution function file |
|
| 89 | + //'substitutions' => 0, |
|
| 90 | + // Set this to 1 if module has its own menus handler directory |
|
| 91 | + //'menus' => 0, |
|
| 92 | + // Set this to 1 if module has its own barcode directory |
|
| 93 | + //'barcode' => 0, |
|
| 94 | + // Set this to 1 if module has its own models directory |
|
| 95 | + 'models' => 1, |
|
| 96 | + // Set this to relative path of css if module has its own css file |
|
| 97 | + //'css' => '/titre/css/mycss.css.php', |
|
| 98 | + // Set here all hooks context managed by module |
|
| 99 | + 'hooks' => array('invoicecard', 'invoicesuppliercard','propalcard', 'supplier_proposalcard', 'ordercard', 'ordersuppliercard','odtgeneration','orderstoinvoice','admin','invoicereccard','consumptionthirdparty') |
|
| 100 | + // Set here all workflow context managed by module |
|
| 101 | + //'workflow' => array('order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE')) |
|
| 102 | + ); |
|
| 103 | 103 | |
| 104 | - // Data directories to create when module is enabled. |
|
| 105 | - // Example: this->dirs = array("/titre/temp"); |
|
| 106 | - $this->dirs = array(); |
|
| 104 | + // Data directories to create when module is enabled. |
|
| 105 | + // Example: this->dirs = array("/titre/temp"); |
|
| 106 | + $this->dirs = array(); |
|
| 107 | 107 | |
| 108 | - // Config pages. Put here list of php pages |
|
| 109 | - // stored into titre/admin directory, used to setup module. |
|
| 110 | - $this->config_page_url = array("subtotal_setup.php@subtotal"); |
|
| 108 | + // Config pages. Put here list of php pages |
|
| 109 | + // stored into titre/admin directory, used to setup module. |
|
| 110 | + $this->config_page_url = array("subtotal_setup.php@subtotal"); |
|
| 111 | 111 | |
| 112 | - // Dependencies |
|
| 113 | - // List of modules id that must be enabled if this module is enabled |
|
| 114 | - $this->depends = array(); |
|
| 112 | + // Dependencies |
|
| 113 | + // List of modules id that must be enabled if this module is enabled |
|
| 114 | + $this->depends = array(); |
|
| 115 | 115 | |
| 116 | 116 | $this->conflictwith=array('modMilestone'); |
| 117 | - // List of modules id to disable if this one is disabled |
|
| 118 | - $this->requiredby = array(); |
|
| 119 | - // Minimum version of PHP required by module |
|
| 120 | - $this->phpmin = array(5, 3); |
|
| 121 | - // Minimum version of Dolibarr required by module |
|
| 122 | - $this->need_dolibarr_version = array(3, 2); |
|
| 123 | - $this->langfiles = array("subtotal@subtotal"); // langfiles@titre |
|
| 124 | - // Constants |
|
| 125 | - // List of particular constants to add when module is enabled |
|
| 126 | - // (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) |
|
| 127 | - // Example: |
|
| 128 | - $this->const = array( |
|
| 129 | - 0=>array( |
|
| 130 | - 'SUBTOTAL_STYLE_TITRES_SI_LIGNES_CACHEES', |
|
| 131 | - 'chaine', |
|
| 132 | - 'I', |
|
| 133 | - 'Définit le style (B : gras, I : Italique, U : Souligné) des sous titres lorsque le détail des lignes et des ensembles est caché', |
|
| 134 | - 1 |
|
| 135 | - ) |
|
| 117 | + // List of modules id to disable if this one is disabled |
|
| 118 | + $this->requiredby = array(); |
|
| 119 | + // Minimum version of PHP required by module |
|
| 120 | + $this->phpmin = array(5, 3); |
|
| 121 | + // Minimum version of Dolibarr required by module |
|
| 122 | + $this->need_dolibarr_version = array(3, 2); |
|
| 123 | + $this->langfiles = array("subtotal@subtotal"); // langfiles@titre |
|
| 124 | + // Constants |
|
| 125 | + // List of particular constants to add when module is enabled |
|
| 126 | + // (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) |
|
| 127 | + // Example: |
|
| 128 | + $this->const = array( |
|
| 129 | + 0=>array( |
|
| 130 | + 'SUBTOTAL_STYLE_TITRES_SI_LIGNES_CACHEES', |
|
| 131 | + 'chaine', |
|
| 132 | + 'I', |
|
| 133 | + 'Définit le style (B : gras, I : Italique, U : Souligné) des sous titres lorsque le détail des lignes et des ensembles est caché', |
|
| 134 | + 1 |
|
| 135 | + ) |
|
| 136 | 136 | ,1=>array('SUBTOTAL_ALLOW_ADD_BLOCK', 'chaine', '1', 'Permet l\'ajout de titres et sous-totaux') |
| 137 | 137 | ,2=>array('SUBTOTAL_ALLOW_EDIT_BLOCK', 'chaine', '1', 'Permet de modifier titres et sous-totaux') |
| 138 | 138 | ,3=>array('SUBTOTAL_ALLOW_REMOVE_BLOCK', 'chaine', '1', 'Permet de supprimer les titres et sous-totaux') |
| 139 | 139 | ,4=>array('SUBTOTAL_TITLE_STYLE', 'chaine', 'BU') |
| 140 | 140 | ,5=>array('SUBTOTAL_SUBTOTAL_STYLE', 'chaine', 'B') |
| 141 | - // 1=>array( |
|
| 142 | - // 'MYMODULE_MYNEWCONST2', |
|
| 143 | - // 'chaine', |
|
| 144 | - // 'myvalue', |
|
| 145 | - // 'This is another constant to add', |
|
| 146 | - // 0 |
|
| 147 | - // ) |
|
| 148 | - ); |
|
| 141 | + // 1=>array( |
|
| 142 | + // 'MYMODULE_MYNEWCONST2', |
|
| 143 | + // 'chaine', |
|
| 144 | + // 'myvalue', |
|
| 145 | + // 'This is another constant to add', |
|
| 146 | + // 0 |
|
| 147 | + // ) |
|
| 148 | + ); |
|
| 149 | 149 | |
| 150 | 150 | |
| 151 | 151 | |
| 152 | 152 | |
| 153 | - // Array to add new pages in new tabs |
|
| 154 | - // Example: |
|
| 155 | - $this->tabs = array( |
|
| 156 | - // // To add a new tab identified by code tabname1 |
|
| 157 | - // 'objecttype:+tabname1:Title1:langfile@titre:$user->rights->titre->read:/titre/mynewtab1.php?id=__ID__', |
|
| 158 | - // // To add another new tab identified by code tabname2 |
|
| 159 | - // 'objecttype:+tabname2:Title2:langfile@titre:$user->rights->othermodule->read:/titre/mynewtab2.php?id=__ID__', |
|
| 160 | - // // To remove an existing tab identified by code tabname |
|
| 161 | - // 'objecttype:-tabname' |
|
| 162 | - ); |
|
| 163 | - // where objecttype can be |
|
| 164 | - // 'thirdparty' to add a tab in third party view |
|
| 165 | - // 'intervention' to add a tab in intervention view |
|
| 166 | - // 'order_supplier' to add a tab in supplier order view |
|
| 167 | - // 'invoice_supplier' to add a tab in supplier invoice view |
|
| 168 | - // 'invoice' to add a tab in customer invoice view |
|
| 169 | - // 'order' to add a tab in customer order view |
|
| 170 | - // 'product' to add a tab in product view |
|
| 171 | - // 'stock' to add a tab in stock view |
|
| 172 | - // 'propal' to add a tab in propal view |
|
| 173 | - // 'member' to add a tab in fundation member view |
|
| 174 | - // 'contract' to add a tab in contract view |
|
| 175 | - // 'user' to add a tab in user view |
|
| 176 | - // 'group' to add a tab in group view |
|
| 177 | - // 'contact' to add a tab in contact view |
|
| 178 | - // 'categories_x' to add a tab in category view |
|
| 179 | - // (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) |
|
| 180 | - // Dictionnaries |
|
| 181 | - if (! isset($conf->subtotal->enabled)) { |
|
| 182 | - $conf->subtotal=new stdClass(); |
|
| 183 | - $conf->subtotal->enabled = 0; |
|
| 184 | - } |
|
| 185 | - $this->dictionaries = array( |
|
| 153 | + // Array to add new pages in new tabs |
|
| 154 | + // Example: |
|
| 155 | + $this->tabs = array( |
|
| 156 | + // // To add a new tab identified by code tabname1 |
|
| 157 | + // 'objecttype:+tabname1:Title1:langfile@titre:$user->rights->titre->read:/titre/mynewtab1.php?id=__ID__', |
|
| 158 | + // // To add another new tab identified by code tabname2 |
|
| 159 | + // 'objecttype:+tabname2:Title2:langfile@titre:$user->rights->othermodule->read:/titre/mynewtab2.php?id=__ID__', |
|
| 160 | + // // To remove an existing tab identified by code tabname |
|
| 161 | + // 'objecttype:-tabname' |
|
| 162 | + ); |
|
| 163 | + // where objecttype can be |
|
| 164 | + // 'thirdparty' to add a tab in third party view |
|
| 165 | + // 'intervention' to add a tab in intervention view |
|
| 166 | + // 'order_supplier' to add a tab in supplier order view |
|
| 167 | + // 'invoice_supplier' to add a tab in supplier invoice view |
|
| 168 | + // 'invoice' to add a tab in customer invoice view |
|
| 169 | + // 'order' to add a tab in customer order view |
|
| 170 | + // 'product' to add a tab in product view |
|
| 171 | + // 'stock' to add a tab in stock view |
|
| 172 | + // 'propal' to add a tab in propal view |
|
| 173 | + // 'member' to add a tab in fundation member view |
|
| 174 | + // 'contract' to add a tab in contract view |
|
| 175 | + // 'user' to add a tab in user view |
|
| 176 | + // 'group' to add a tab in group view |
|
| 177 | + // 'contact' to add a tab in contact view |
|
| 178 | + // 'categories_x' to add a tab in category view |
|
| 179 | + // (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) |
|
| 180 | + // Dictionnaries |
|
| 181 | + if (! isset($conf->subtotal->enabled)) { |
|
| 182 | + $conf->subtotal=new stdClass(); |
|
| 183 | + $conf->subtotal->enabled = 0; |
|
| 184 | + } |
|
| 185 | + $this->dictionaries = array( |
|
| 186 | 186 | 'langs'=>'subtotal@subtotal', |
| 187 | - 'tabname'=>array(MAIN_DB_PREFIX.'c_subtotal_free_text'), // List of tables we want to see into dictonnary editor |
|
| 188 | - 'tablib'=>array($langs->trans('subtotalFreeLineDictionary')), // Label of tables |
|
| 189 | - 'tabsql'=>array('SELECT f.rowid as rowid, f.label, f.content, f.entity, f.active FROM '.MAIN_DB_PREFIX.'c_subtotal_free_text as f WHERE f.entity='.$conf->entity), // Request to select fields |
|
| 190 | - 'tabsqlsort'=>array('label ASC'), // Sort order |
|
| 191 | - 'tabfield'=>array('label,content'), // List of fields (result of select to show dictionary) |
|
| 192 | - 'tabfieldvalue'=>array('label,content'), // List of fields (list of fields to edit a record) |
|
| 193 | - 'tabfieldinsert'=>array('label,content,entity'), // List of fields (list of fields for insert) |
|
| 194 | - 'tabrowid'=>array('rowid'), // Name of columns with primary key (try to always name it 'rowid') |
|
| 195 | - 'tabcond'=>array($conf->subtotal->enabled) |
|
| 187 | + 'tabname'=>array(MAIN_DB_PREFIX.'c_subtotal_free_text'), // List of tables we want to see into dictonnary editor |
|
| 188 | + 'tablib'=>array($langs->trans('subtotalFreeLineDictionary')), // Label of tables |
|
| 189 | + 'tabsql'=>array('SELECT f.rowid as rowid, f.label, f.content, f.entity, f.active FROM '.MAIN_DB_PREFIX.'c_subtotal_free_text as f WHERE f.entity='.$conf->entity), // Request to select fields |
|
| 190 | + 'tabsqlsort'=>array('label ASC'), // Sort order |
|
| 191 | + 'tabfield'=>array('label,content'), // List of fields (result of select to show dictionary) |
|
| 192 | + 'tabfieldvalue'=>array('label,content'), // List of fields (list of fields to edit a record) |
|
| 193 | + 'tabfieldinsert'=>array('label,content,entity'), // List of fields (list of fields for insert) |
|
| 194 | + 'tabrowid'=>array('rowid'), // Name of columns with primary key (try to always name it 'rowid') |
|
| 195 | + 'tabcond'=>array($conf->subtotal->enabled) |
|
| 196 | 196 | ); |
| 197 | - /* Example: |
|
| 197 | + /* Example: |
|
| 198 | 198 | // This is to avoid warnings |
| 199 | 199 | if (! isset($conf->titre->enabled)) $conf->titre->enabled=0; |
| 200 | 200 | $this->dictionnaries=array( |
@@ -235,223 +235,223 @@ discard block |
||
| 235 | 235 | ); |
| 236 | 236 | */ |
| 237 | 237 | |
| 238 | - // Boxes |
|
| 239 | - // Add here list of php file(s) stored in core/boxes that contains class to show a box. |
|
| 240 | - $this->boxes = array(); // Boxes list |
|
| 238 | + // Boxes |
|
| 239 | + // Add here list of php file(s) stored in core/boxes that contains class to show a box. |
|
| 240 | + $this->boxes = array(); // Boxes list |
|
| 241 | 241 | |
| 242 | - /* |
|
| 242 | + /* |
|
| 243 | 243 | $this->boxes[$r][1] = "myboxb.php"; |
| 244 | 244 | $r++; |
| 245 | 245 | */ |
| 246 | 246 | |
| 247 | - // Permissions |
|
| 248 | - $this->rights = array(); // Permission array used by this module |
|
| 249 | - $r = 0; |
|
| 247 | + // Permissions |
|
| 248 | + $this->rights = array(); // Permission array used by this module |
|
| 249 | + $r = 0; |
|
| 250 | 250 | |
| 251 | - // Add here list of permission defined by |
|
| 252 | - // an id, a label, a boolean and two constant strings. |
|
| 253 | - // Example: |
|
| 254 | - //// Permission id (must not be already used) |
|
| 255 | - //$this->rights[$r][0] = 2000; |
|
| 256 | - //// Permission label |
|
| 257 | - //$this->rights[$r][1] = 'Permision label'; |
|
| 258 | - //// Permission by default for new user (0/1) |
|
| 259 | - //$this->rights[$r][3] = 1; |
|
| 260 | - //// In php code, permission will be checked by test |
|
| 261 | - //// if ($user->rights->permkey->level1->level2) |
|
| 262 | - //$this->rights[$r][4] = 'level1'; |
|
| 263 | - //// In php code, permission will be checked by test |
|
| 264 | - //// if ($user->rights->permkey->level1->level2) |
|
| 265 | - //$this->rights[$r][5] = 'level2'; |
|
| 266 | - //$r++; |
|
| 267 | - // Main menu entries |
|
| 268 | - $this->menus = array(); // List of menus to add |
|
| 269 | - $r = 0; |
|
| 251 | + // Add here list of permission defined by |
|
| 252 | + // an id, a label, a boolean and two constant strings. |
|
| 253 | + // Example: |
|
| 254 | + //// Permission id (must not be already used) |
|
| 255 | + //$this->rights[$r][0] = 2000; |
|
| 256 | + //// Permission label |
|
| 257 | + //$this->rights[$r][1] = 'Permision label'; |
|
| 258 | + //// Permission by default for new user (0/1) |
|
| 259 | + //$this->rights[$r][3] = 1; |
|
| 260 | + //// In php code, permission will be checked by test |
|
| 261 | + //// if ($user->rights->permkey->level1->level2) |
|
| 262 | + //$this->rights[$r][4] = 'level1'; |
|
| 263 | + //// In php code, permission will be checked by test |
|
| 264 | + //// if ($user->rights->permkey->level1->level2) |
|
| 265 | + //$this->rights[$r][5] = 'level2'; |
|
| 266 | + //$r++; |
|
| 267 | + // Main menu entries |
|
| 268 | + $this->menus = array(); // List of menus to add |
|
| 269 | + $r = 0; |
|
| 270 | 270 | |
| 271 | - // Add here entries to declare new menus |
|
| 272 | - // |
|
| 273 | - // Example to declare a new Top Menu entry and its Left menu entry: |
|
| 274 | - //$this->menu[$r]=array( |
|
| 275 | - // // Put 0 if this is a top menu |
|
| 276 | - // 'fk_menu'=>0, |
|
| 277 | - // // This is a Top menu entry |
|
| 278 | - // 'type'=>'top', |
|
| 279 | - // 'titre'=>'titre top menu', |
|
| 280 | - // 'mainmenu'=>'titre', |
|
| 281 | - // 'leftmenu'=>'titre', |
|
| 282 | - // 'url'=>'/titre/pagetop.php', |
|
| 283 | - // // Lang file to use (without .lang) by module. |
|
| 284 | - // // File must be in langs/code_CODE/ directory. |
|
| 285 | - // 'langs'=>'mylangfile', |
|
| 286 | - // 'position'=>100, |
|
| 287 | - // // Define condition to show or hide menu entry. |
|
| 288 | - // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 289 | - // 'enabled'=>'$conf->titre->enabled', |
|
| 290 | - // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 291 | - // // if you want your menu with a permission rules |
|
| 292 | - // 'perms'=>'1', |
|
| 293 | - // 'target'=>'', |
|
| 294 | - // // 0=Menu for internal users, 1=external users, 2=both |
|
| 295 | - // 'user'=>2 |
|
| 296 | - //); |
|
| 297 | - //$r++; |
|
| 298 | - //$this->menu[$r]=array( |
|
| 299 | - // // Use r=value where r is index key used for the parent menu entry |
|
| 300 | - // // (higher parent must be a top menu entry) |
|
| 301 | - // 'fk_menu'=>'r=0', |
|
| 302 | - // // This is a Left menu entry |
|
| 303 | - // 'type'=>'left', |
|
| 304 | - // 'titre'=>'titre left menu', |
|
| 305 | - // 'mainmenu'=>'titre', |
|
| 306 | - // 'leftmenu'=>'titre', |
|
| 307 | - // 'url'=>'/titre/pagelevel1.php', |
|
| 308 | - // // Lang file to use (without .lang) by module. |
|
| 309 | - // // File must be in langs/code_CODE/ directory. |
|
| 310 | - // 'langs'=>'mylangfile', |
|
| 311 | - // 'position'=>100, |
|
| 312 | - // // Define condition to show or hide menu entry. |
|
| 313 | - // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 314 | - // 'enabled'=>'$conf->titre->enabled', |
|
| 315 | - // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 316 | - // // if you want your menu with a permission rules |
|
| 317 | - // 'perms'=>'1', |
|
| 318 | - // 'target'=>'', |
|
| 319 | - // // 0=Menu for internal users, 1=external users, 2=both |
|
| 320 | - // 'user'=>2 |
|
| 321 | - //); |
|
| 322 | - //$r++; |
|
| 323 | - // |
|
| 324 | - // Example to declare a Left Menu entry into an existing Top menu entry: |
|
| 325 | - //$this->menu[$r]=array( |
|
| 326 | - // // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' |
|
| 327 | - // 'fk_menu'=>'fk_mainmenu=mainmenucode', |
|
| 328 | - // // This is a Left menu entry |
|
| 329 | - // 'type'=>'left', |
|
| 330 | - // 'titre'=>'titre left menu', |
|
| 331 | - // 'mainmenu'=>'mainmenucode', |
|
| 332 | - // 'leftmenu'=>'titre', |
|
| 333 | - // 'url'=>'/titre/pagelevel2.php', |
|
| 334 | - // // Lang file to use (without .lang) by module. |
|
| 335 | - // // File must be in langs/code_CODE/ directory. |
|
| 336 | - // 'langs'=>'mylangfile', |
|
| 337 | - // 'position'=>100, |
|
| 338 | - // // Define condition to show or hide menu entry. |
|
| 339 | - // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 340 | - // // Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 341 | - // 'enabled'=>'$conf->titre->enabled', |
|
| 342 | - // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 343 | - // // if you want your menu with a permission rules |
|
| 344 | - // 'perms'=>'1', |
|
| 345 | - // 'target'=>'', |
|
| 346 | - // // 0=Menu for internal users, 1=external users, 2=both |
|
| 347 | - // 'user'=>2 |
|
| 348 | - //); |
|
| 349 | - //$r++; |
|
| 350 | - // Exports |
|
| 351 | - $r = 1; |
|
| 271 | + // Add here entries to declare new menus |
|
| 272 | + // |
|
| 273 | + // Example to declare a new Top Menu entry and its Left menu entry: |
|
| 274 | + //$this->menu[$r]=array( |
|
| 275 | + // // Put 0 if this is a top menu |
|
| 276 | + // 'fk_menu'=>0, |
|
| 277 | + // // This is a Top menu entry |
|
| 278 | + // 'type'=>'top', |
|
| 279 | + // 'titre'=>'titre top menu', |
|
| 280 | + // 'mainmenu'=>'titre', |
|
| 281 | + // 'leftmenu'=>'titre', |
|
| 282 | + // 'url'=>'/titre/pagetop.php', |
|
| 283 | + // // Lang file to use (without .lang) by module. |
|
| 284 | + // // File must be in langs/code_CODE/ directory. |
|
| 285 | + // 'langs'=>'mylangfile', |
|
| 286 | + // 'position'=>100, |
|
| 287 | + // // Define condition to show or hide menu entry. |
|
| 288 | + // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 289 | + // 'enabled'=>'$conf->titre->enabled', |
|
| 290 | + // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 291 | + // // if you want your menu with a permission rules |
|
| 292 | + // 'perms'=>'1', |
|
| 293 | + // 'target'=>'', |
|
| 294 | + // // 0=Menu for internal users, 1=external users, 2=both |
|
| 295 | + // 'user'=>2 |
|
| 296 | + //); |
|
| 297 | + //$r++; |
|
| 298 | + //$this->menu[$r]=array( |
|
| 299 | + // // Use r=value where r is index key used for the parent menu entry |
|
| 300 | + // // (higher parent must be a top menu entry) |
|
| 301 | + // 'fk_menu'=>'r=0', |
|
| 302 | + // // This is a Left menu entry |
|
| 303 | + // 'type'=>'left', |
|
| 304 | + // 'titre'=>'titre left menu', |
|
| 305 | + // 'mainmenu'=>'titre', |
|
| 306 | + // 'leftmenu'=>'titre', |
|
| 307 | + // 'url'=>'/titre/pagelevel1.php', |
|
| 308 | + // // Lang file to use (without .lang) by module. |
|
| 309 | + // // File must be in langs/code_CODE/ directory. |
|
| 310 | + // 'langs'=>'mylangfile', |
|
| 311 | + // 'position'=>100, |
|
| 312 | + // // Define condition to show or hide menu entry. |
|
| 313 | + // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 314 | + // 'enabled'=>'$conf->titre->enabled', |
|
| 315 | + // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 316 | + // // if you want your menu with a permission rules |
|
| 317 | + // 'perms'=>'1', |
|
| 318 | + // 'target'=>'', |
|
| 319 | + // // 0=Menu for internal users, 1=external users, 2=both |
|
| 320 | + // 'user'=>2 |
|
| 321 | + //); |
|
| 322 | + //$r++; |
|
| 323 | + // |
|
| 324 | + // Example to declare a Left Menu entry into an existing Top menu entry: |
|
| 325 | + //$this->menu[$r]=array( |
|
| 326 | + // // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' |
|
| 327 | + // 'fk_menu'=>'fk_mainmenu=mainmenucode', |
|
| 328 | + // // This is a Left menu entry |
|
| 329 | + // 'type'=>'left', |
|
| 330 | + // 'titre'=>'titre left menu', |
|
| 331 | + // 'mainmenu'=>'mainmenucode', |
|
| 332 | + // 'leftmenu'=>'titre', |
|
| 333 | + // 'url'=>'/titre/pagelevel2.php', |
|
| 334 | + // // Lang file to use (without .lang) by module. |
|
| 335 | + // // File must be in langs/code_CODE/ directory. |
|
| 336 | + // 'langs'=>'mylangfile', |
|
| 337 | + // 'position'=>100, |
|
| 338 | + // // Define condition to show or hide menu entry. |
|
| 339 | + // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 340 | + // // Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 341 | + // 'enabled'=>'$conf->titre->enabled', |
|
| 342 | + // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 343 | + // // if you want your menu with a permission rules |
|
| 344 | + // 'perms'=>'1', |
|
| 345 | + // 'target'=>'', |
|
| 346 | + // // 0=Menu for internal users, 1=external users, 2=both |
|
| 347 | + // 'user'=>2 |
|
| 348 | + //); |
|
| 349 | + //$r++; |
|
| 350 | + // Exports |
|
| 351 | + $r = 1; |
|
| 352 | 352 | |
| 353 | - // Example: |
|
| 354 | - //$this->export_code[$r]=$this->rights_class.'_'.$r; |
|
| 355 | - //// Translation key (used only if key ExportDataset_xxx_z not found) |
|
| 356 | - //$this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; |
|
| 357 | - //// Condition to show export in list (ie: '$user->id==3'). |
|
| 358 | - //// Set to 1 to always show when module is enabled. |
|
| 359 | - //$this->export_enabled[$r]='1'; |
|
| 360 | - //$this->export_permission[$r]=array(array("facture","facture","export")); |
|
| 361 | - //$this->export_fields_array[$r]=array( |
|
| 362 | - // 's.rowid'=>"IdCompany", |
|
| 363 | - // 's.nom'=>'CompanyName', |
|
| 364 | - // 's.address'=>'Address', |
|
| 365 | - // 's.cp'=>'Zip', |
|
| 366 | - // 's.ville'=>'Town', |
|
| 367 | - // 's.fk_pays'=>'Country', |
|
| 368 | - // 's.tel'=>'Phone', |
|
| 369 | - // 's.siren'=>'ProfId1', |
|
| 370 | - // 's.siret'=>'ProfId2', |
|
| 371 | - // 's.ape'=>'ProfId3', |
|
| 372 | - // 's.idprof4'=>'ProfId4', |
|
| 373 | - // 's.code_compta'=>'CustomerAccountancyCode', |
|
| 374 | - // 's.code_compta_fournisseur'=>'SupplierAccountancyCode', |
|
| 375 | - // 'f.rowid'=>"InvoiceId", |
|
| 376 | - // 'f.facnumber'=>"InvoiceRef", |
|
| 377 | - // 'f.datec'=>"InvoiceDateCreation", |
|
| 378 | - // 'f.datef'=>"DateInvoice", |
|
| 379 | - // 'f.total'=>"TotalHT", |
|
| 380 | - // 'f.total_ttc'=>"TotalTTC", |
|
| 381 | - // 'f.tva'=>"TotalVAT", |
|
| 382 | - // 'f.paye'=>"InvoicePaid", |
|
| 383 | - // 'f.fk_statut'=>'InvoiceStatus', |
|
| 384 | - // 'f.note'=>"InvoiceNote", |
|
| 385 | - // 'fd.rowid'=>'LineId', |
|
| 386 | - // 'fd.description'=>"LineDescription", |
|
| 387 | - // 'fd.price'=>"LineUnitPrice", |
|
| 388 | - // 'fd.tva_tx'=>"LineVATRate", |
|
| 389 | - // 'fd.qty'=>"LineQty", |
|
| 390 | - // 'fd.total_ht'=>"LineTotalHT", |
|
| 391 | - // 'fd.total_tva'=>"LineTotalTVA", |
|
| 392 | - // 'fd.total_ttc'=>"LineTotalTTC", |
|
| 393 | - // 'fd.date_start'=>"DateStart", |
|
| 394 | - // 'fd.date_end'=>"DateEnd", |
|
| 395 | - // 'fd.fk_product'=>'ProductId', |
|
| 396 | - // 'p.ref'=>'ProductRef' |
|
| 397 | - //); |
|
| 398 | - //$this->export_entities_array[$r]=array('s.rowid'=>"company", |
|
| 399 | - // 's.nom'=>'company', |
|
| 400 | - // 's.address'=>'company', |
|
| 401 | - // 's.cp'=>'company', |
|
| 402 | - // 's.ville'=>'company', |
|
| 403 | - // 's.fk_pays'=>'company', |
|
| 404 | - // 's.tel'=>'company', |
|
| 405 | - // 's.siren'=>'company', |
|
| 406 | - // 's.siret'=>'company', |
|
| 407 | - // 's.ape'=>'company', |
|
| 408 | - // 's.idprof4'=>'company', |
|
| 409 | - // 's.code_compta'=>'company', |
|
| 410 | - // 's.code_compta_fournisseur'=>'company', |
|
| 411 | - // 'f.rowid'=>"invoice", |
|
| 412 | - // 'f.facnumber'=>"invoice", |
|
| 413 | - // 'f.datec'=>"invoice", |
|
| 414 | - // 'f.datef'=>"invoice", |
|
| 415 | - // 'f.total'=>"invoice", |
|
| 416 | - // 'f.total_ttc'=>"invoice", |
|
| 417 | - // 'f.tva'=>"invoice", |
|
| 418 | - // 'f.paye'=>"invoice", |
|
| 419 | - // 'f.fk_statut'=>'invoice', |
|
| 420 | - // 'f.note'=>"invoice", |
|
| 421 | - // 'fd.rowid'=>'invoice_line', |
|
| 422 | - // 'fd.description'=>"invoice_line", |
|
| 423 | - // 'fd.price'=>"invoice_line", |
|
| 424 | - // 'fd.total_ht'=>"invoice_line", |
|
| 425 | - // 'fd.total_tva'=>"invoice_line", |
|
| 426 | - // 'fd.total_ttc'=>"invoice_line", |
|
| 427 | - // 'fd.tva_tx'=>"invoice_line", |
|
| 428 | - // 'fd.qty'=>"invoice_line", |
|
| 429 | - // 'fd.date_start'=>"invoice_line", |
|
| 430 | - // 'fd.date_end'=>"invoice_line", |
|
| 431 | - // 'fd.fk_product'=>'product', |
|
| 432 | - // 'p.ref'=>'product' |
|
| 433 | - //); |
|
| 434 | - //$this->export_sql_start[$r] = 'SELECT DISTINCT '; |
|
| 435 | - //$this->export_sql_end[$r] = ' FROM (' . MAIN_DB_PREFIX . 'facture as f, ' |
|
| 436 | - // . MAIN_DB_PREFIX . 'facturedet as fd, ' . MAIN_DB_PREFIX . 'societe as s)'; |
|
| 437 | - //$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX |
|
| 438 | - // . 'product as p on (fd.fk_product = p.rowid)'; |
|
| 439 | - //$this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid ' |
|
| 440 | - // . 'AND f.rowid = fd.fk_facture'; |
|
| 441 | - //$r++; |
|
| 442 | - } |
|
| 353 | + // Example: |
|
| 354 | + //$this->export_code[$r]=$this->rights_class.'_'.$r; |
|
| 355 | + //// Translation key (used only if key ExportDataset_xxx_z not found) |
|
| 356 | + //$this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; |
|
| 357 | + //// Condition to show export in list (ie: '$user->id==3'). |
|
| 358 | + //// Set to 1 to always show when module is enabled. |
|
| 359 | + //$this->export_enabled[$r]='1'; |
|
| 360 | + //$this->export_permission[$r]=array(array("facture","facture","export")); |
|
| 361 | + //$this->export_fields_array[$r]=array( |
|
| 362 | + // 's.rowid'=>"IdCompany", |
|
| 363 | + // 's.nom'=>'CompanyName', |
|
| 364 | + // 's.address'=>'Address', |
|
| 365 | + // 's.cp'=>'Zip', |
|
| 366 | + // 's.ville'=>'Town', |
|
| 367 | + // 's.fk_pays'=>'Country', |
|
| 368 | + // 's.tel'=>'Phone', |
|
| 369 | + // 's.siren'=>'ProfId1', |
|
| 370 | + // 's.siret'=>'ProfId2', |
|
| 371 | + // 's.ape'=>'ProfId3', |
|
| 372 | + // 's.idprof4'=>'ProfId4', |
|
| 373 | + // 's.code_compta'=>'CustomerAccountancyCode', |
|
| 374 | + // 's.code_compta_fournisseur'=>'SupplierAccountancyCode', |
|
| 375 | + // 'f.rowid'=>"InvoiceId", |
|
| 376 | + // 'f.facnumber'=>"InvoiceRef", |
|
| 377 | + // 'f.datec'=>"InvoiceDateCreation", |
|
| 378 | + // 'f.datef'=>"DateInvoice", |
|
| 379 | + // 'f.total'=>"TotalHT", |
|
| 380 | + // 'f.total_ttc'=>"TotalTTC", |
|
| 381 | + // 'f.tva'=>"TotalVAT", |
|
| 382 | + // 'f.paye'=>"InvoicePaid", |
|
| 383 | + // 'f.fk_statut'=>'InvoiceStatus', |
|
| 384 | + // 'f.note'=>"InvoiceNote", |
|
| 385 | + // 'fd.rowid'=>'LineId', |
|
| 386 | + // 'fd.description'=>"LineDescription", |
|
| 387 | + // 'fd.price'=>"LineUnitPrice", |
|
| 388 | + // 'fd.tva_tx'=>"LineVATRate", |
|
| 389 | + // 'fd.qty'=>"LineQty", |
|
| 390 | + // 'fd.total_ht'=>"LineTotalHT", |
|
| 391 | + // 'fd.total_tva'=>"LineTotalTVA", |
|
| 392 | + // 'fd.total_ttc'=>"LineTotalTTC", |
|
| 393 | + // 'fd.date_start'=>"DateStart", |
|
| 394 | + // 'fd.date_end'=>"DateEnd", |
|
| 395 | + // 'fd.fk_product'=>'ProductId', |
|
| 396 | + // 'p.ref'=>'ProductRef' |
|
| 397 | + //); |
|
| 398 | + //$this->export_entities_array[$r]=array('s.rowid'=>"company", |
|
| 399 | + // 's.nom'=>'company', |
|
| 400 | + // 's.address'=>'company', |
|
| 401 | + // 's.cp'=>'company', |
|
| 402 | + // 's.ville'=>'company', |
|
| 403 | + // 's.fk_pays'=>'company', |
|
| 404 | + // 's.tel'=>'company', |
|
| 405 | + // 's.siren'=>'company', |
|
| 406 | + // 's.siret'=>'company', |
|
| 407 | + // 's.ape'=>'company', |
|
| 408 | + // 's.idprof4'=>'company', |
|
| 409 | + // 's.code_compta'=>'company', |
|
| 410 | + // 's.code_compta_fournisseur'=>'company', |
|
| 411 | + // 'f.rowid'=>"invoice", |
|
| 412 | + // 'f.facnumber'=>"invoice", |
|
| 413 | + // 'f.datec'=>"invoice", |
|
| 414 | + // 'f.datef'=>"invoice", |
|
| 415 | + // 'f.total'=>"invoice", |
|
| 416 | + // 'f.total_ttc'=>"invoice", |
|
| 417 | + // 'f.tva'=>"invoice", |
|
| 418 | + // 'f.paye'=>"invoice", |
|
| 419 | + // 'f.fk_statut'=>'invoice', |
|
| 420 | + // 'f.note'=>"invoice", |
|
| 421 | + // 'fd.rowid'=>'invoice_line', |
|
| 422 | + // 'fd.description'=>"invoice_line", |
|
| 423 | + // 'fd.price'=>"invoice_line", |
|
| 424 | + // 'fd.total_ht'=>"invoice_line", |
|
| 425 | + // 'fd.total_tva'=>"invoice_line", |
|
| 426 | + // 'fd.total_ttc'=>"invoice_line", |
|
| 427 | + // 'fd.tva_tx'=>"invoice_line", |
|
| 428 | + // 'fd.qty'=>"invoice_line", |
|
| 429 | + // 'fd.date_start'=>"invoice_line", |
|
| 430 | + // 'fd.date_end'=>"invoice_line", |
|
| 431 | + // 'fd.fk_product'=>'product', |
|
| 432 | + // 'p.ref'=>'product' |
|
| 433 | + //); |
|
| 434 | + //$this->export_sql_start[$r] = 'SELECT DISTINCT '; |
|
| 435 | + //$this->export_sql_end[$r] = ' FROM (' . MAIN_DB_PREFIX . 'facture as f, ' |
|
| 436 | + // . MAIN_DB_PREFIX . 'facturedet as fd, ' . MAIN_DB_PREFIX . 'societe as s)'; |
|
| 437 | + //$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX |
|
| 438 | + // . 'product as p on (fd.fk_product = p.rowid)'; |
|
| 439 | + //$this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid ' |
|
| 440 | + // . 'AND f.rowid = fd.fk_facture'; |
|
| 441 | + //$r++; |
|
| 442 | + } |
|
| 443 | 443 | |
| 444 | - /** |
|
| 445 | - * Function called when module is enabled. |
|
| 446 | - * The init function add constants, boxes, permissions and menus |
|
| 447 | - * (defined in constructor) into Dolibarr database. |
|
| 448 | - * It also creates data directories |
|
| 449 | - * |
|
| 450 | - * @param string $options Options when enabling module ('', 'noboxes') |
|
| 451 | - * @return int 1 if OK, 0 if KO |
|
| 452 | - */ |
|
| 453 | - public function init($options = '') |
|
| 454 | - { |
|
| 444 | + /** |
|
| 445 | + * Function called when module is enabled. |
|
| 446 | + * The init function add constants, boxes, permissions and menus |
|
| 447 | + * (defined in constructor) into Dolibarr database. |
|
| 448 | + * It also creates data directories |
|
| 449 | + * |
|
| 450 | + * @param string $options Options when enabling module ('', 'noboxes') |
|
| 451 | + * @return int 1 if OK, 0 if KO |
|
| 452 | + */ |
|
| 453 | + public function init($options = '') |
|
| 454 | + { |
|
| 455 | 455 | global $conf; |
| 456 | 456 | |
| 457 | 457 | |
@@ -459,39 +459,39 @@ discard block |
||
| 459 | 459 | exit("Attention, ce module rentre ne conflit avec le module Jalon/Milestones. Merci de le désactiver auparavant."); |
| 460 | 460 | } |
| 461 | 461 | */ |
| 462 | - $sql = array(); |
|
| 462 | + $sql = array(); |
|
| 463 | 463 | |
| 464 | - $result = $this->loadTables(); |
|
| 464 | + $result = $this->loadTables(); |
|
| 465 | 465 | |
| 466 | 466 | |
| 467 | - return $this->_init($sql, $options); |
|
| 468 | - } |
|
| 467 | + return $this->_init($sql, $options); |
|
| 468 | + } |
|
| 469 | 469 | |
| 470 | - /** |
|
| 471 | - * Function called when module is disabled. |
|
| 472 | - * Remove from database constants, boxes and permissions from Dolibarr database. |
|
| 473 | - * Data directories are not deleted |
|
| 474 | - * |
|
| 475 | - * @param string $options Options when enabling module ('', 'noboxes') |
|
| 476 | - * @return int 1 if OK, 0 if KO |
|
| 477 | - */ |
|
| 478 | - public function remove($options = '') |
|
| 479 | - { |
|
| 480 | - $sql = array(); |
|
| 470 | + /** |
|
| 471 | + * Function called when module is disabled. |
|
| 472 | + * Remove from database constants, boxes and permissions from Dolibarr database. |
|
| 473 | + * Data directories are not deleted |
|
| 474 | + * |
|
| 475 | + * @param string $options Options when enabling module ('', 'noboxes') |
|
| 476 | + * @return int 1 if OK, 0 if KO |
|
| 477 | + */ |
|
| 478 | + public function remove($options = '') |
|
| 479 | + { |
|
| 480 | + $sql = array(); |
|
| 481 | 481 | |
| 482 | - return $this->_remove($sql, $options); |
|
| 483 | - } |
|
| 482 | + return $this->_remove($sql, $options); |
|
| 483 | + } |
|
| 484 | 484 | |
| 485 | - /** |
|
| 486 | - * Create tables, keys and data required by module |
|
| 487 | - * Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys |
|
| 488 | - * and create data commands must be stored in directory /titre/sql/ |
|
| 489 | - * This function is called by this->init |
|
| 490 | - * |
|
| 491 | - * @return int <=0 if KO, >0 if OK |
|
| 492 | - */ |
|
| 493 | - private function loadTables() |
|
| 494 | - { |
|
| 495 | - return $this->_load_tables('/subtotal/sql/'); |
|
| 496 | - } |
|
| 485 | + /** |
|
| 486 | + * Create tables, keys and data required by module |
|
| 487 | + * Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys |
|
| 488 | + * and create data commands must be stored in directory /titre/sql/ |
|
| 489 | + * This function is called by this->init |
|
| 490 | + * |
|
| 491 | + * @return int <=0 if KO, >0 if OK |
|
| 492 | + */ |
|
| 493 | + private function loadTables() |
|
| 494 | + { |
|
| 495 | + return $this->_load_tables('/subtotal/sql/'); |
|
| 496 | + } |
|
| 497 | 497 | } |
@@ -36,68 +36,68 @@ discard block |
||
| 36 | 36 | class Interfacesubtotaltrigger |
| 37 | 37 | { |
| 38 | 38 | |
| 39 | - private $db; |
|
| 40 | - |
|
| 41 | - /** |
|
| 42 | - * Constructor |
|
| 43 | - * |
|
| 44 | - * @param DoliDB $db Database handler |
|
| 45 | - */ |
|
| 46 | - public function __construct($db) |
|
| 47 | - { |
|
| 48 | - $this->db = $db; |
|
| 49 | - |
|
| 50 | - $this->name = preg_replace('/^Interface/i', '', get_class($this)); |
|
| 51 | - $this->family = "demo"; |
|
| 52 | - $this->description = "Triggers of this module are empty functions." |
|
| 53 | - . "They have no effect." |
|
| 54 | - . "They are provided for tutorial purpose only."; |
|
| 55 | - // 'development', 'experimental', 'dolibarr' or version |
|
| 56 | - $this->version = 'development'; |
|
| 57 | - $this->picto = 'titre@titre'; |
|
| 58 | - } |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * Trigger name |
|
| 62 | - * |
|
| 63 | - * @return string Name of trigger file |
|
| 64 | - */ |
|
| 65 | - public function getName() |
|
| 66 | - { |
|
| 67 | - return $this->name; |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - /** |
|
| 71 | - * Trigger description |
|
| 72 | - * |
|
| 73 | - * @return string Description of trigger file |
|
| 74 | - */ |
|
| 75 | - public function getDesc() |
|
| 76 | - { |
|
| 77 | - return $this->description; |
|
| 78 | - } |
|
| 79 | - |
|
| 80 | - /** |
|
| 81 | - * Trigger version |
|
| 82 | - * |
|
| 83 | - * @return string Version of trigger file |
|
| 84 | - */ |
|
| 85 | - public function getVersion() |
|
| 86 | - { |
|
| 87 | - global $langs; |
|
| 88 | - $langs->load("admin"); |
|
| 89 | - |
|
| 90 | - if ($this->version == 'development') { |
|
| 91 | - return $langs->trans("Development"); |
|
| 92 | - } elseif ($this->version == 'experimental') |
|
| 93 | - |
|
| 94 | - return $langs->trans("Experimental"); |
|
| 95 | - elseif ($this->version == 'dolibarr') return DOL_VERSION; |
|
| 96 | - elseif ($this->version) return $this->version; |
|
| 97 | - else { |
|
| 98 | - return $langs->trans("Unknown"); |
|
| 99 | - } |
|
| 100 | - } |
|
| 39 | + private $db; |
|
| 40 | + |
|
| 41 | + /** |
|
| 42 | + * Constructor |
|
| 43 | + * |
|
| 44 | + * @param DoliDB $db Database handler |
|
| 45 | + */ |
|
| 46 | + public function __construct($db) |
|
| 47 | + { |
|
| 48 | + $this->db = $db; |
|
| 49 | + |
|
| 50 | + $this->name = preg_replace('/^Interface/i', '', get_class($this)); |
|
| 51 | + $this->family = "demo"; |
|
| 52 | + $this->description = "Triggers of this module are empty functions." |
|
| 53 | + . "They have no effect." |
|
| 54 | + . "They are provided for tutorial purpose only."; |
|
| 55 | + // 'development', 'experimental', 'dolibarr' or version |
|
| 56 | + $this->version = 'development'; |
|
| 57 | + $this->picto = 'titre@titre'; |
|
| 58 | + } |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * Trigger name |
|
| 62 | + * |
|
| 63 | + * @return string Name of trigger file |
|
| 64 | + */ |
|
| 65 | + public function getName() |
|
| 66 | + { |
|
| 67 | + return $this->name; |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + /** |
|
| 71 | + * Trigger description |
|
| 72 | + * |
|
| 73 | + * @return string Description of trigger file |
|
| 74 | + */ |
|
| 75 | + public function getDesc() |
|
| 76 | + { |
|
| 77 | + return $this->description; |
|
| 78 | + } |
|
| 79 | + |
|
| 80 | + /** |
|
| 81 | + * Trigger version |
|
| 82 | + * |
|
| 83 | + * @return string Version of trigger file |
|
| 84 | + */ |
|
| 85 | + public function getVersion() |
|
| 86 | + { |
|
| 87 | + global $langs; |
|
| 88 | + $langs->load("admin"); |
|
| 89 | + |
|
| 90 | + if ($this->version == 'development') { |
|
| 91 | + return $langs->trans("Development"); |
|
| 92 | + } elseif ($this->version == 'experimental') |
|
| 93 | + |
|
| 94 | + return $langs->trans("Experimental"); |
|
| 95 | + elseif ($this->version == 'dolibarr') return DOL_VERSION; |
|
| 96 | + elseif ($this->version) return $this->version; |
|
| 97 | + else { |
|
| 98 | + return $langs->trans("Unknown"); |
|
| 99 | + } |
|
| 100 | + } |
|
| 101 | 101 | |
| 102 | 102 | public function addToBegin(&$parent, &$object, $rang) |
| 103 | 103 | { |
@@ -147,28 +147,28 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - /** |
|
| 151 | - * Function called when a Dolibarrr business event is done. |
|
| 152 | - * All functions "run_trigger" are triggered if file |
|
| 153 | - * is inside directory core/triggers |
|
| 154 | - * |
|
| 155 | - * @param string $action Event action code |
|
| 156 | - * @param Object $object Object |
|
| 157 | - * @param User $user Object user |
|
| 158 | - * @param Translate $langs Object langs |
|
| 159 | - * @param conf $conf Object conf |
|
| 160 | - * @return int <0 if KO, 0 if no triggered ran, >0 if OK |
|
| 161 | - */ |
|
| 162 | - public function run_trigger($action, $object, $user, $langs, $conf) |
|
| 163 | - { |
|
| 164 | - // Put here code you want to execute when a Dolibarr business events occurs. |
|
| 165 | - // Data and type of action are stored into $object and $action |
|
| 166 | - // Users |
|
| 167 | - dol_include_once('/subtotal/class/subtotal.class.php'); |
|
| 168 | - dol_include_once('/subtotal/lib/subtotal.lib.php'); |
|
| 169 | - $langs->load('subtotal@subtotal'); |
|
| 150 | + /** |
|
| 151 | + * Function called when a Dolibarrr business event is done. |
|
| 152 | + * All functions "run_trigger" are triggered if file |
|
| 153 | + * is inside directory core/triggers |
|
| 154 | + * |
|
| 155 | + * @param string $action Event action code |
|
| 156 | + * @param Object $object Object |
|
| 157 | + * @param User $user Object user |
|
| 158 | + * @param Translate $langs Object langs |
|
| 159 | + * @param conf $conf Object conf |
|
| 160 | + * @return int <0 if KO, 0 if no triggered ran, >0 if OK |
|
| 161 | + */ |
|
| 162 | + public function run_trigger($action, $object, $user, $langs, $conf) |
|
| 163 | + { |
|
| 164 | + // Put here code you want to execute when a Dolibarr business events occurs. |
|
| 165 | + // Data and type of action are stored into $object and $action |
|
| 166 | + // Users |
|
| 167 | + dol_include_once('/subtotal/class/subtotal.class.php'); |
|
| 168 | + dol_include_once('/subtotal/lib/subtotal.lib.php'); |
|
| 169 | + $langs->load('subtotal@subtotal'); |
|
| 170 | 170 | |
| 171 | - if (!empty($conf->global->SUBTOTAL_ALLOW_ADD_LINE_UNDER_TITLE) && in_array($action, array('LINEPROPAL_INSERT', 'LINEORDER_INSERT', 'LINEBILL_INSERT'))) |
|
| 171 | + if (!empty($conf->global->SUBTOTAL_ALLOW_ADD_LINE_UNDER_TITLE) && in_array($action, array('LINEPROPAL_INSERT', 'LINEORDER_INSERT', 'LINEBILL_INSERT'))) |
|
| 172 | 172 | { |
| 173 | 173 | |
| 174 | 174 | $rang = GETPOST('under_title', 'int'); // Rang du titre |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | |
| 203 | - if ($action == 'LINEBILL_INSERT' && $object->special_code != TSubtotal::$module_number) |
|
| 203 | + if ($action == 'LINEBILL_INSERT' && $object->special_code != TSubtotal::$module_number) |
|
| 204 | 204 | { |
| 205 | 205 | $subtotal_add_title_bloc_from_orderstoinvoice = GETPOST('subtotal_add_title_bloc_from_orderstoinvoice'); |
| 206 | 206 | if (!empty($subtotal_add_title_bloc_from_orderstoinvoice)) |
@@ -320,173 +320,173 @@ discard block |
||
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | |
| 323 | - if ($action == 'USER_LOGIN') { |
|
| 324 | - dol_syslog( |
|
| 325 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 326 | - ); |
|
| 327 | - } elseif ($action == 'USER_UPDATE_SESSION') { |
|
| 328 | - // Warning: To increase performances, this action is triggered only if |
|
| 329 | - // constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1. |
|
| 330 | - dol_syslog( |
|
| 331 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 332 | - ); |
|
| 333 | - } elseif ($action == 'USER_CREATE') { |
|
| 334 | - dol_syslog( |
|
| 335 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 336 | - ); |
|
| 337 | - } elseif ($action == 'USER_CREATE_FROM_CONTACT') { |
|
| 338 | - dol_syslog( |
|
| 339 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 340 | - ); |
|
| 341 | - } elseif ($action == 'USER_MODIFY') { |
|
| 342 | - dol_syslog( |
|
| 343 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 344 | - ); |
|
| 345 | - } elseif ($action == 'USER_NEW_PASSWORD') { |
|
| 346 | - dol_syslog( |
|
| 347 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 348 | - ); |
|
| 349 | - } elseif ($action == 'USER_ENABLEDISABLE') { |
|
| 350 | - dol_syslog( |
|
| 351 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 352 | - ); |
|
| 353 | - } elseif ($action == 'USER_DELETE') { |
|
| 354 | - dol_syslog( |
|
| 355 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 356 | - ); |
|
| 357 | - } elseif ($action == 'USER_LOGOUT') { |
|
| 358 | - dol_syslog( |
|
| 359 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 360 | - ); |
|
| 361 | - } elseif ($action == 'USER_SETINGROUP') { |
|
| 362 | - dol_syslog( |
|
| 363 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 364 | - ); |
|
| 365 | - } elseif ($action == 'USER_REMOVEFROMGROUP') { |
|
| 366 | - dol_syslog( |
|
| 367 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 368 | - ); |
|
| 369 | - } |
|
| 370 | - |
|
| 371 | - // Groups |
|
| 372 | - elseif ($action == 'GROUP_CREATE') { |
|
| 373 | - dol_syslog( |
|
| 374 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 375 | - ); |
|
| 376 | - } elseif ($action == 'GROUP_MODIFY') { |
|
| 377 | - dol_syslog( |
|
| 378 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 379 | - ); |
|
| 380 | - } elseif ($action == 'GROUP_DELETE') { |
|
| 381 | - dol_syslog( |
|
| 382 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 383 | - ); |
|
| 384 | - } |
|
| 385 | - |
|
| 386 | - // Companies |
|
| 387 | - elseif ($action == 'COMPANY_CREATE') { |
|
| 388 | - dol_syslog( |
|
| 389 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 390 | - ); |
|
| 391 | - } elseif ($action == 'COMPANY_MODIFY') { |
|
| 392 | - dol_syslog( |
|
| 393 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 394 | - ); |
|
| 395 | - } elseif ($action == 'COMPANY_DELETE') { |
|
| 396 | - dol_syslog( |
|
| 397 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 398 | - ); |
|
| 399 | - } |
|
| 400 | - |
|
| 401 | - // Contacts |
|
| 402 | - elseif ($action == 'CONTACT_CREATE') { |
|
| 403 | - dol_syslog( |
|
| 404 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 405 | - ); |
|
| 406 | - } elseif ($action == 'CONTACT_MODIFY') { |
|
| 407 | - dol_syslog( |
|
| 408 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 409 | - ); |
|
| 410 | - } elseif ($action == 'CONTACT_DELETE') { |
|
| 411 | - dol_syslog( |
|
| 412 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 413 | - ); |
|
| 414 | - } |
|
| 415 | - |
|
| 416 | - // Products |
|
| 417 | - elseif ($action == 'PRODUCT_CREATE') { |
|
| 418 | - dol_syslog( |
|
| 419 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 420 | - ); |
|
| 421 | - } elseif ($action == 'PRODUCT_MODIFY') { |
|
| 422 | - dol_syslog( |
|
| 423 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 424 | - ); |
|
| 425 | - } elseif ($action == 'PRODUCT_DELETE') { |
|
| 426 | - dol_syslog( |
|
| 427 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 428 | - ); |
|
| 429 | - } |
|
| 430 | - |
|
| 431 | - // Customer orders |
|
| 432 | - elseif ($action == 'ORDER_CREATE') { |
|
| 433 | - dol_syslog( |
|
| 434 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 435 | - ); |
|
| 436 | - } elseif ($action == 'ORDER_VALIDATE') { |
|
| 437 | - dol_syslog( |
|
| 438 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 439 | - ); |
|
| 440 | - } elseif ($action == 'ORDER_DELETE') { |
|
| 441 | - dol_syslog( |
|
| 442 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 443 | - ); |
|
| 444 | - } elseif ($action == 'ORDER_BUILDDOC') { |
|
| 445 | - dol_syslog( |
|
| 446 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 447 | - ); |
|
| 448 | - } elseif ($action == 'ORDER_SENTBYMAIL') { |
|
| 449 | - dol_syslog( |
|
| 450 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 451 | - ); |
|
| 452 | - } elseif ($action == 'LINEORDER_INSERT') { |
|
| 453 | - dol_syslog( |
|
| 454 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 455 | - ); |
|
| 456 | - } elseif ($action == 'LINEORDER_DELETE') { |
|
| 457 | - dol_syslog( |
|
| 458 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 459 | - ); |
|
| 460 | - } |
|
| 461 | - |
|
| 462 | - // Supplier orders |
|
| 463 | - elseif ($action == 'ORDER_SUPPLIER_CREATE') { |
|
| 464 | - dol_syslog( |
|
| 465 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 466 | - ); |
|
| 467 | - } elseif ($action == 'ORDER_SUPPLIER_VALIDATE') { |
|
| 468 | - dol_syslog( |
|
| 469 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 470 | - ); |
|
| 471 | - } elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL') { |
|
| 472 | - dol_syslog( |
|
| 473 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 474 | - ); |
|
| 475 | - } elseif ($action == 'SUPPLIER_ORDER_BUILDDOC') { |
|
| 476 | - dol_syslog( |
|
| 477 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 478 | - ); |
|
| 479 | - } |
|
| 480 | - |
|
| 481 | - // Proposals |
|
| 482 | - elseif ($action == 'PROPAL_CREATE') { |
|
| 483 | - dol_syslog( |
|
| 484 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 485 | - ); |
|
| 486 | - } elseif (in_array($action, array('PROPAL_CLONE', 'ORDER_CLONE', 'BILL_CLONE'))) { |
|
| 487 | - dol_syslog( |
|
| 488 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 489 | - ); |
|
| 323 | + if ($action == 'USER_LOGIN') { |
|
| 324 | + dol_syslog( |
|
| 325 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 326 | + ); |
|
| 327 | + } elseif ($action == 'USER_UPDATE_SESSION') { |
|
| 328 | + // Warning: To increase performances, this action is triggered only if |
|
| 329 | + // constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1. |
|
| 330 | + dol_syslog( |
|
| 331 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 332 | + ); |
|
| 333 | + } elseif ($action == 'USER_CREATE') { |
|
| 334 | + dol_syslog( |
|
| 335 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 336 | + ); |
|
| 337 | + } elseif ($action == 'USER_CREATE_FROM_CONTACT') { |
|
| 338 | + dol_syslog( |
|
| 339 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 340 | + ); |
|
| 341 | + } elseif ($action == 'USER_MODIFY') { |
|
| 342 | + dol_syslog( |
|
| 343 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 344 | + ); |
|
| 345 | + } elseif ($action == 'USER_NEW_PASSWORD') { |
|
| 346 | + dol_syslog( |
|
| 347 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 348 | + ); |
|
| 349 | + } elseif ($action == 'USER_ENABLEDISABLE') { |
|
| 350 | + dol_syslog( |
|
| 351 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 352 | + ); |
|
| 353 | + } elseif ($action == 'USER_DELETE') { |
|
| 354 | + dol_syslog( |
|
| 355 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 356 | + ); |
|
| 357 | + } elseif ($action == 'USER_LOGOUT') { |
|
| 358 | + dol_syslog( |
|
| 359 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 360 | + ); |
|
| 361 | + } elseif ($action == 'USER_SETINGROUP') { |
|
| 362 | + dol_syslog( |
|
| 363 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 364 | + ); |
|
| 365 | + } elseif ($action == 'USER_REMOVEFROMGROUP') { |
|
| 366 | + dol_syslog( |
|
| 367 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 368 | + ); |
|
| 369 | + } |
|
| 370 | + |
|
| 371 | + // Groups |
|
| 372 | + elseif ($action == 'GROUP_CREATE') { |
|
| 373 | + dol_syslog( |
|
| 374 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 375 | + ); |
|
| 376 | + } elseif ($action == 'GROUP_MODIFY') { |
|
| 377 | + dol_syslog( |
|
| 378 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 379 | + ); |
|
| 380 | + } elseif ($action == 'GROUP_DELETE') { |
|
| 381 | + dol_syslog( |
|
| 382 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 383 | + ); |
|
| 384 | + } |
|
| 385 | + |
|
| 386 | + // Companies |
|
| 387 | + elseif ($action == 'COMPANY_CREATE') { |
|
| 388 | + dol_syslog( |
|
| 389 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 390 | + ); |
|
| 391 | + } elseif ($action == 'COMPANY_MODIFY') { |
|
| 392 | + dol_syslog( |
|
| 393 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 394 | + ); |
|
| 395 | + } elseif ($action == 'COMPANY_DELETE') { |
|
| 396 | + dol_syslog( |
|
| 397 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 398 | + ); |
|
| 399 | + } |
|
| 400 | + |
|
| 401 | + // Contacts |
|
| 402 | + elseif ($action == 'CONTACT_CREATE') { |
|
| 403 | + dol_syslog( |
|
| 404 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 405 | + ); |
|
| 406 | + } elseif ($action == 'CONTACT_MODIFY') { |
|
| 407 | + dol_syslog( |
|
| 408 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 409 | + ); |
|
| 410 | + } elseif ($action == 'CONTACT_DELETE') { |
|
| 411 | + dol_syslog( |
|
| 412 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 413 | + ); |
|
| 414 | + } |
|
| 415 | + |
|
| 416 | + // Products |
|
| 417 | + elseif ($action == 'PRODUCT_CREATE') { |
|
| 418 | + dol_syslog( |
|
| 419 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 420 | + ); |
|
| 421 | + } elseif ($action == 'PRODUCT_MODIFY') { |
|
| 422 | + dol_syslog( |
|
| 423 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 424 | + ); |
|
| 425 | + } elseif ($action == 'PRODUCT_DELETE') { |
|
| 426 | + dol_syslog( |
|
| 427 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 428 | + ); |
|
| 429 | + } |
|
| 430 | + |
|
| 431 | + // Customer orders |
|
| 432 | + elseif ($action == 'ORDER_CREATE') { |
|
| 433 | + dol_syslog( |
|
| 434 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 435 | + ); |
|
| 436 | + } elseif ($action == 'ORDER_VALIDATE') { |
|
| 437 | + dol_syslog( |
|
| 438 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 439 | + ); |
|
| 440 | + } elseif ($action == 'ORDER_DELETE') { |
|
| 441 | + dol_syslog( |
|
| 442 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 443 | + ); |
|
| 444 | + } elseif ($action == 'ORDER_BUILDDOC') { |
|
| 445 | + dol_syslog( |
|
| 446 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 447 | + ); |
|
| 448 | + } elseif ($action == 'ORDER_SENTBYMAIL') { |
|
| 449 | + dol_syslog( |
|
| 450 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 451 | + ); |
|
| 452 | + } elseif ($action == 'LINEORDER_INSERT') { |
|
| 453 | + dol_syslog( |
|
| 454 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 455 | + ); |
|
| 456 | + } elseif ($action == 'LINEORDER_DELETE') { |
|
| 457 | + dol_syslog( |
|
| 458 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 459 | + ); |
|
| 460 | + } |
|
| 461 | + |
|
| 462 | + // Supplier orders |
|
| 463 | + elseif ($action == 'ORDER_SUPPLIER_CREATE') { |
|
| 464 | + dol_syslog( |
|
| 465 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 466 | + ); |
|
| 467 | + } elseif ($action == 'ORDER_SUPPLIER_VALIDATE') { |
|
| 468 | + dol_syslog( |
|
| 469 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 470 | + ); |
|
| 471 | + } elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL') { |
|
| 472 | + dol_syslog( |
|
| 473 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 474 | + ); |
|
| 475 | + } elseif ($action == 'SUPPLIER_ORDER_BUILDDOC') { |
|
| 476 | + dol_syslog( |
|
| 477 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 478 | + ); |
|
| 479 | + } |
|
| 480 | + |
|
| 481 | + // Proposals |
|
| 482 | + elseif ($action == 'PROPAL_CREATE') { |
|
| 483 | + dol_syslog( |
|
| 484 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 485 | + ); |
|
| 486 | + } elseif (in_array($action, array('PROPAL_CLONE', 'ORDER_CLONE', 'BILL_CLONE'))) { |
|
| 487 | + dol_syslog( |
|
| 488 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 489 | + ); |
|
| 490 | 490 | |
| 491 | 491 | $doli_action = GETPOST('action'); |
| 492 | 492 | |
@@ -519,277 +519,277 @@ discard block |
||
| 519 | 519 | if (!empty($line)) $object->update_price(1); |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | - } elseif ($action == 'PROPAL_MODIFY') { |
|
| 523 | - dol_syslog( |
|
| 524 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 525 | - ); |
|
| 526 | - } elseif ($action == 'PROPAL_VALIDATE') { |
|
| 527 | - dol_syslog( |
|
| 528 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 529 | - ); |
|
| 530 | - } elseif ($action == 'PROPAL_BUILDDOC') { |
|
| 531 | - dol_syslog( |
|
| 532 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 533 | - ); |
|
| 534 | - } elseif ($action == 'PROPAL_SENTBYMAIL') { |
|
| 535 | - dol_syslog( |
|
| 536 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 537 | - ); |
|
| 538 | - } elseif ($action == 'PROPAL_CLOSE_SIGNED') { |
|
| 539 | - dol_syslog( |
|
| 540 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 541 | - ); |
|
| 542 | - } elseif ($action == 'PROPAL_CLOSE_REFUSED') { |
|
| 543 | - dol_syslog( |
|
| 544 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 545 | - ); |
|
| 546 | - } elseif ($action == 'PROPAL_DELETE') { |
|
| 547 | - dol_syslog( |
|
| 548 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 549 | - ); |
|
| 550 | - } elseif ($action == 'LINEPROPAL_INSERT') { |
|
| 551 | - dol_syslog( |
|
| 552 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 553 | - ); |
|
| 554 | - } elseif ($action == 'LINEPROPAL_MODIFY') { |
|
| 555 | - dol_syslog( |
|
| 556 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 557 | - ); |
|
| 558 | - } elseif ($action == 'LINEPROPAL_DELETE') { |
|
| 559 | - dol_syslog( |
|
| 560 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 561 | - ); |
|
| 562 | - } |
|
| 563 | - |
|
| 564 | - // Contracts |
|
| 565 | - elseif ($action == 'CONTRACT_CREATE') { |
|
| 566 | - dol_syslog( |
|
| 567 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 568 | - ); |
|
| 569 | - } elseif ($action == 'CONTRACT_MODIFY') { |
|
| 570 | - dol_syslog( |
|
| 571 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 572 | - ); |
|
| 573 | - } elseif ($action == 'CONTRACT_ACTIVATE') { |
|
| 574 | - dol_syslog( |
|
| 575 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 576 | - ); |
|
| 577 | - } elseif ($action == 'CONTRACT_CANCEL') { |
|
| 578 | - dol_syslog( |
|
| 579 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 580 | - ); |
|
| 581 | - } elseif ($action == 'CONTRACT_CLOSE') { |
|
| 582 | - dol_syslog( |
|
| 583 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 584 | - ); |
|
| 585 | - } elseif ($action == 'CONTRACT_DELETE') { |
|
| 586 | - dol_syslog( |
|
| 587 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 588 | - ); |
|
| 589 | - } |
|
| 522 | + } elseif ($action == 'PROPAL_MODIFY') { |
|
| 523 | + dol_syslog( |
|
| 524 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 525 | + ); |
|
| 526 | + } elseif ($action == 'PROPAL_VALIDATE') { |
|
| 527 | + dol_syslog( |
|
| 528 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 529 | + ); |
|
| 530 | + } elseif ($action == 'PROPAL_BUILDDOC') { |
|
| 531 | + dol_syslog( |
|
| 532 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 533 | + ); |
|
| 534 | + } elseif ($action == 'PROPAL_SENTBYMAIL') { |
|
| 535 | + dol_syslog( |
|
| 536 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 537 | + ); |
|
| 538 | + } elseif ($action == 'PROPAL_CLOSE_SIGNED') { |
|
| 539 | + dol_syslog( |
|
| 540 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 541 | + ); |
|
| 542 | + } elseif ($action == 'PROPAL_CLOSE_REFUSED') { |
|
| 543 | + dol_syslog( |
|
| 544 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 545 | + ); |
|
| 546 | + } elseif ($action == 'PROPAL_DELETE') { |
|
| 547 | + dol_syslog( |
|
| 548 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 549 | + ); |
|
| 550 | + } elseif ($action == 'LINEPROPAL_INSERT') { |
|
| 551 | + dol_syslog( |
|
| 552 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 553 | + ); |
|
| 554 | + } elseif ($action == 'LINEPROPAL_MODIFY') { |
|
| 555 | + dol_syslog( |
|
| 556 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 557 | + ); |
|
| 558 | + } elseif ($action == 'LINEPROPAL_DELETE') { |
|
| 559 | + dol_syslog( |
|
| 560 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 561 | + ); |
|
| 562 | + } |
|
| 563 | + |
|
| 564 | + // Contracts |
|
| 565 | + elseif ($action == 'CONTRACT_CREATE') { |
|
| 566 | + dol_syslog( |
|
| 567 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 568 | + ); |
|
| 569 | + } elseif ($action == 'CONTRACT_MODIFY') { |
|
| 570 | + dol_syslog( |
|
| 571 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 572 | + ); |
|
| 573 | + } elseif ($action == 'CONTRACT_ACTIVATE') { |
|
| 574 | + dol_syslog( |
|
| 575 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 576 | + ); |
|
| 577 | + } elseif ($action == 'CONTRACT_CANCEL') { |
|
| 578 | + dol_syslog( |
|
| 579 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 580 | + ); |
|
| 581 | + } elseif ($action == 'CONTRACT_CLOSE') { |
|
| 582 | + dol_syslog( |
|
| 583 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 584 | + ); |
|
| 585 | + } elseif ($action == 'CONTRACT_DELETE') { |
|
| 586 | + dol_syslog( |
|
| 587 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 588 | + ); |
|
| 589 | + } |
|
| 590 | 590 | |
| 591 | 591 | elseif ($action == 'BILL_MODIFY') { |
| 592 | - dol_syslog( |
|
| 593 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 594 | - ); |
|
| 595 | - } elseif ($action == 'BILL_VALIDATE') { |
|
| 596 | - dol_syslog( |
|
| 597 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 598 | - ); |
|
| 599 | - } elseif ($action == 'BILL_BUILDDOC') { |
|
| 600 | - dol_syslog( |
|
| 601 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 602 | - ); |
|
| 603 | - } elseif ($action == 'BILL_SENTBYMAIL') { |
|
| 604 | - dol_syslog( |
|
| 605 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 606 | - ); |
|
| 607 | - } elseif ($action == 'BILL_CANCEL') { |
|
| 608 | - dol_syslog( |
|
| 609 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 610 | - ); |
|
| 611 | - } elseif ($action == 'BILL_DELETE') { |
|
| 612 | - dol_syslog( |
|
| 613 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 614 | - ); |
|
| 615 | - } elseif ($action == 'LINEBILL_INSERT') { |
|
| 592 | + dol_syslog( |
|
| 593 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 594 | + ); |
|
| 595 | + } elseif ($action == 'BILL_VALIDATE') { |
|
| 596 | + dol_syslog( |
|
| 597 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 598 | + ); |
|
| 599 | + } elseif ($action == 'BILL_BUILDDOC') { |
|
| 600 | + dol_syslog( |
|
| 601 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 602 | + ); |
|
| 603 | + } elseif ($action == 'BILL_SENTBYMAIL') { |
|
| 604 | + dol_syslog( |
|
| 605 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 606 | + ); |
|
| 607 | + } elseif ($action == 'BILL_CANCEL') { |
|
| 608 | + dol_syslog( |
|
| 609 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 610 | + ); |
|
| 611 | + } elseif ($action == 'BILL_DELETE') { |
|
| 612 | + dol_syslog( |
|
| 613 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 614 | + ); |
|
| 615 | + } elseif ($action == 'LINEBILL_INSERT') { |
|
| 616 | 616 | |
| 617 | - dol_syslog( |
|
| 618 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 619 | - ); |
|
| 620 | - } elseif ($action == 'LINEBILL_DELETE') { |
|
| 621 | - dol_syslog( |
|
| 622 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 623 | - ); |
|
| 624 | - } |
|
| 625 | - |
|
| 626 | - // Payments |
|
| 627 | - elseif ($action == 'PAYMENT_CUSTOMER_CREATE') { |
|
| 628 | - dol_syslog( |
|
| 629 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 630 | - ); |
|
| 631 | - } elseif ($action == 'PAYMENT_SUPPLIER_CREATE') { |
|
| 632 | - dol_syslog( |
|
| 633 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 634 | - ); |
|
| 635 | - } elseif ($action == 'PAYMENT_ADD_TO_BANK') { |
|
| 636 | - dol_syslog( |
|
| 637 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 638 | - ); |
|
| 639 | - } elseif ($action == 'PAYMENT_DELETE') { |
|
| 640 | - dol_syslog( |
|
| 641 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 642 | - ); |
|
| 643 | - } |
|
| 644 | - |
|
| 645 | - // Interventions |
|
| 646 | - elseif ($action == 'FICHEINTER_CREATE') { |
|
| 647 | - dol_syslog( |
|
| 648 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 649 | - ); |
|
| 650 | - } elseif ($action == 'FICHEINTER_MODIFY') { |
|
| 651 | - dol_syslog( |
|
| 652 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 653 | - ); |
|
| 654 | - } elseif ($action == 'FICHEINTER_VALIDATE') { |
|
| 655 | - dol_syslog( |
|
| 656 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 657 | - ); |
|
| 658 | - } elseif ($action == 'FICHEINTER_DELETE') { |
|
| 659 | - dol_syslog( |
|
| 660 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 661 | - ); |
|
| 662 | - } |
|
| 663 | - |
|
| 664 | - // Members |
|
| 665 | - elseif ($action == 'MEMBER_CREATE') { |
|
| 666 | - dol_syslog( |
|
| 667 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 668 | - ); |
|
| 669 | - } elseif ($action == 'MEMBER_VALIDATE') { |
|
| 670 | - dol_syslog( |
|
| 671 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 672 | - ); |
|
| 673 | - } elseif ($action == 'MEMBER_SUBSCRIPTION') { |
|
| 674 | - dol_syslog( |
|
| 675 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 676 | - ); |
|
| 677 | - } elseif ($action == 'MEMBER_MODIFY') { |
|
| 678 | - dol_syslog( |
|
| 679 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 680 | - ); |
|
| 681 | - } elseif ($action == 'MEMBER_NEW_PASSWORD') { |
|
| 682 | - dol_syslog( |
|
| 683 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 684 | - ); |
|
| 685 | - } elseif ($action == 'MEMBER_RESILIATE') { |
|
| 686 | - dol_syslog( |
|
| 687 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 688 | - ); |
|
| 689 | - } elseif ($action == 'MEMBER_DELETE') { |
|
| 690 | - dol_syslog( |
|
| 691 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 692 | - ); |
|
| 693 | - } |
|
| 694 | - |
|
| 695 | - // Categories |
|
| 696 | - elseif ($action == 'CATEGORY_CREATE') { |
|
| 697 | - dol_syslog( |
|
| 698 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 699 | - ); |
|
| 700 | - } elseif ($action == 'CATEGORY_MODIFY') { |
|
| 701 | - dol_syslog( |
|
| 702 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 703 | - ); |
|
| 704 | - } elseif ($action == 'CATEGORY_DELETE') { |
|
| 705 | - dol_syslog( |
|
| 706 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 707 | - ); |
|
| 708 | - } |
|
| 709 | - |
|
| 710 | - // Projects |
|
| 711 | - elseif ($action == 'PROJECT_CREATE') { |
|
| 712 | - dol_syslog( |
|
| 713 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 714 | - ); |
|
| 715 | - } elseif ($action == 'PROJECT_MODIFY') { |
|
| 716 | - dol_syslog( |
|
| 717 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 718 | - ); |
|
| 719 | - } elseif ($action == 'PROJECT_DELETE') { |
|
| 720 | - dol_syslog( |
|
| 721 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 722 | - ); |
|
| 723 | - } |
|
| 724 | - |
|
| 725 | - // Project tasks |
|
| 726 | - elseif ($action == 'TASK_CREATE') { |
|
| 727 | - dol_syslog( |
|
| 728 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 729 | - ); |
|
| 730 | - } elseif ($action == 'TASK_MODIFY') { |
|
| 731 | - dol_syslog( |
|
| 732 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 733 | - ); |
|
| 734 | - } elseif ($action == 'TASK_DELETE') { |
|
| 735 | - dol_syslog( |
|
| 736 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 737 | - ); |
|
| 738 | - } |
|
| 739 | - |
|
| 740 | - // Task time spent |
|
| 741 | - elseif ($action == 'TASK_TIMESPENT_CREATE') { |
|
| 742 | - dol_syslog( |
|
| 743 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 744 | - ); |
|
| 745 | - } elseif ($action == 'TASK_TIMESPENT_MODIFY') { |
|
| 746 | - dol_syslog( |
|
| 747 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 748 | - ); |
|
| 749 | - } elseif ($action == 'TASK_TIMESPENT_DELETE') { |
|
| 750 | - dol_syslog( |
|
| 751 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 752 | - ); |
|
| 753 | - } |
|
| 754 | - |
|
| 755 | - // Shipping |
|
| 756 | - elseif ($action == 'SHIPPING_CREATE') { |
|
| 757 | - dol_syslog( |
|
| 758 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 759 | - ); |
|
| 760 | - } elseif ($action == 'SHIPPING_MODIFY') { |
|
| 761 | - dol_syslog( |
|
| 762 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 763 | - ); |
|
| 764 | - } elseif ($action == 'SHIPPING_VALIDATE') { |
|
| 765 | - dol_syslog( |
|
| 766 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 767 | - ); |
|
| 768 | - } elseif ($action == 'SHIPPING_SENTBYMAIL') { |
|
| 769 | - dol_syslog( |
|
| 770 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 771 | - ); |
|
| 772 | - } elseif ($action == 'SHIPPING_DELETE') { |
|
| 773 | - dol_syslog( |
|
| 774 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 775 | - ); |
|
| 776 | - } elseif ($action == 'SHIPPING_BUILDDOC') { |
|
| 777 | - dol_syslog( |
|
| 778 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 779 | - ); |
|
| 780 | - } |
|
| 781 | - |
|
| 782 | - // File |
|
| 783 | - elseif ($action == 'FILE_UPLOAD') { |
|
| 784 | - dol_syslog( |
|
| 785 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 786 | - ); |
|
| 787 | - } elseif ($action == 'FILE_DELETE') { |
|
| 788 | - dol_syslog( |
|
| 789 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 790 | - ); |
|
| 791 | - } |
|
| 792 | - |
|
| 793 | - return 0; |
|
| 794 | - } |
|
| 617 | + dol_syslog( |
|
| 618 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 619 | + ); |
|
| 620 | + } elseif ($action == 'LINEBILL_DELETE') { |
|
| 621 | + dol_syslog( |
|
| 622 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 623 | + ); |
|
| 624 | + } |
|
| 625 | + |
|
| 626 | + // Payments |
|
| 627 | + elseif ($action == 'PAYMENT_CUSTOMER_CREATE') { |
|
| 628 | + dol_syslog( |
|
| 629 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 630 | + ); |
|
| 631 | + } elseif ($action == 'PAYMENT_SUPPLIER_CREATE') { |
|
| 632 | + dol_syslog( |
|
| 633 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 634 | + ); |
|
| 635 | + } elseif ($action == 'PAYMENT_ADD_TO_BANK') { |
|
| 636 | + dol_syslog( |
|
| 637 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 638 | + ); |
|
| 639 | + } elseif ($action == 'PAYMENT_DELETE') { |
|
| 640 | + dol_syslog( |
|
| 641 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 642 | + ); |
|
| 643 | + } |
|
| 644 | + |
|
| 645 | + // Interventions |
|
| 646 | + elseif ($action == 'FICHEINTER_CREATE') { |
|
| 647 | + dol_syslog( |
|
| 648 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 649 | + ); |
|
| 650 | + } elseif ($action == 'FICHEINTER_MODIFY') { |
|
| 651 | + dol_syslog( |
|
| 652 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 653 | + ); |
|
| 654 | + } elseif ($action == 'FICHEINTER_VALIDATE') { |
|
| 655 | + dol_syslog( |
|
| 656 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 657 | + ); |
|
| 658 | + } elseif ($action == 'FICHEINTER_DELETE') { |
|
| 659 | + dol_syslog( |
|
| 660 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 661 | + ); |
|
| 662 | + } |
|
| 663 | + |
|
| 664 | + // Members |
|
| 665 | + elseif ($action == 'MEMBER_CREATE') { |
|
| 666 | + dol_syslog( |
|
| 667 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 668 | + ); |
|
| 669 | + } elseif ($action == 'MEMBER_VALIDATE') { |
|
| 670 | + dol_syslog( |
|
| 671 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 672 | + ); |
|
| 673 | + } elseif ($action == 'MEMBER_SUBSCRIPTION') { |
|
| 674 | + dol_syslog( |
|
| 675 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 676 | + ); |
|
| 677 | + } elseif ($action == 'MEMBER_MODIFY') { |
|
| 678 | + dol_syslog( |
|
| 679 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 680 | + ); |
|
| 681 | + } elseif ($action == 'MEMBER_NEW_PASSWORD') { |
|
| 682 | + dol_syslog( |
|
| 683 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 684 | + ); |
|
| 685 | + } elseif ($action == 'MEMBER_RESILIATE') { |
|
| 686 | + dol_syslog( |
|
| 687 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 688 | + ); |
|
| 689 | + } elseif ($action == 'MEMBER_DELETE') { |
|
| 690 | + dol_syslog( |
|
| 691 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 692 | + ); |
|
| 693 | + } |
|
| 694 | + |
|
| 695 | + // Categories |
|
| 696 | + elseif ($action == 'CATEGORY_CREATE') { |
|
| 697 | + dol_syslog( |
|
| 698 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 699 | + ); |
|
| 700 | + } elseif ($action == 'CATEGORY_MODIFY') { |
|
| 701 | + dol_syslog( |
|
| 702 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 703 | + ); |
|
| 704 | + } elseif ($action == 'CATEGORY_DELETE') { |
|
| 705 | + dol_syslog( |
|
| 706 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 707 | + ); |
|
| 708 | + } |
|
| 709 | + |
|
| 710 | + // Projects |
|
| 711 | + elseif ($action == 'PROJECT_CREATE') { |
|
| 712 | + dol_syslog( |
|
| 713 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 714 | + ); |
|
| 715 | + } elseif ($action == 'PROJECT_MODIFY') { |
|
| 716 | + dol_syslog( |
|
| 717 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 718 | + ); |
|
| 719 | + } elseif ($action == 'PROJECT_DELETE') { |
|
| 720 | + dol_syslog( |
|
| 721 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 722 | + ); |
|
| 723 | + } |
|
| 724 | + |
|
| 725 | + // Project tasks |
|
| 726 | + elseif ($action == 'TASK_CREATE') { |
|
| 727 | + dol_syslog( |
|
| 728 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 729 | + ); |
|
| 730 | + } elseif ($action == 'TASK_MODIFY') { |
|
| 731 | + dol_syslog( |
|
| 732 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 733 | + ); |
|
| 734 | + } elseif ($action == 'TASK_DELETE') { |
|
| 735 | + dol_syslog( |
|
| 736 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 737 | + ); |
|
| 738 | + } |
|
| 739 | + |
|
| 740 | + // Task time spent |
|
| 741 | + elseif ($action == 'TASK_TIMESPENT_CREATE') { |
|
| 742 | + dol_syslog( |
|
| 743 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 744 | + ); |
|
| 745 | + } elseif ($action == 'TASK_TIMESPENT_MODIFY') { |
|
| 746 | + dol_syslog( |
|
| 747 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 748 | + ); |
|
| 749 | + } elseif ($action == 'TASK_TIMESPENT_DELETE') { |
|
| 750 | + dol_syslog( |
|
| 751 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 752 | + ); |
|
| 753 | + } |
|
| 754 | + |
|
| 755 | + // Shipping |
|
| 756 | + elseif ($action == 'SHIPPING_CREATE') { |
|
| 757 | + dol_syslog( |
|
| 758 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 759 | + ); |
|
| 760 | + } elseif ($action == 'SHIPPING_MODIFY') { |
|
| 761 | + dol_syslog( |
|
| 762 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 763 | + ); |
|
| 764 | + } elseif ($action == 'SHIPPING_VALIDATE') { |
|
| 765 | + dol_syslog( |
|
| 766 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 767 | + ); |
|
| 768 | + } elseif ($action == 'SHIPPING_SENTBYMAIL') { |
|
| 769 | + dol_syslog( |
|
| 770 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 771 | + ); |
|
| 772 | + } elseif ($action == 'SHIPPING_DELETE') { |
|
| 773 | + dol_syslog( |
|
| 774 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 775 | + ); |
|
| 776 | + } elseif ($action == 'SHIPPING_BUILDDOC') { |
|
| 777 | + dol_syslog( |
|
| 778 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 779 | + ); |
|
| 780 | + } |
|
| 781 | + |
|
| 782 | + // File |
|
| 783 | + elseif ($action == 'FILE_UPLOAD') { |
|
| 784 | + dol_syslog( |
|
| 785 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 786 | + ); |
|
| 787 | + } elseif ($action == 'FILE_DELETE') { |
|
| 788 | + dol_syslog( |
|
| 789 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 790 | + ); |
|
| 791 | + } |
|
| 792 | + |
|
| 793 | + return 0; |
|
| 794 | + } |
|
| 795 | 795 | } |
| 796 | 796 | \ No newline at end of file |