diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index 030ee52a013..859c1cbe202 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -843,7 +843,7 @@ class Facture $action_notify = 2; // ne pas modifier cette valeur if ($force_number) { - $numfa=$force_number; + $numfa = $force_number; } else { @@ -941,6 +941,8 @@ class Facture { $this->use_webcal=($conf->global->PHPWEBCALENDAR_BILLSTATUS=='always'?1:0); + $this->ref = $numfa; + // Appel des triggers include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php"); $interface=new Interfaces($this->db); diff --git a/htdocs/includes/triggers/interface_webcal.class.php b/htdocs/includes/triggers/interface_webcal.class.php index 5788b4c21a5..db49e2a4099 100644 --- a/htdocs/includes/triggers/interface_webcal.class.php +++ b/htdocs/includes/triggers/interface_webcal.class.php @@ -151,7 +151,7 @@ class InterfaceWebCal $this->duree=0; $this->texte=$langs->trans("NewCompanyToDolibarr",$object->nom); $this->desc=$langs->trans("NewCompanyToDolibarr",$object->nom); - $this->desc.="\n".$langs->trans("Prefix").': '.$object->prefix; + if ($object->prefix) $this->desc.=" (".$object->prefix.")"; //$this->desc.="\n".$langs->trans("Customer").': '.yn($object->client); //$this->desc.="\n".$langs->trans("Supplier").': '.yn($object->fournisseur); $this->desc.="\n".$langs->trans("Author").': '.$user->code; @@ -192,6 +192,56 @@ class InterfaceWebCal $this->desc.="\n".$langs->trans("Author").': '.$user->code; } + if ($action == 'PROPAL_CREATE') + { + // Pas interessant + } + if ($action == 'PROPAL_MODIFY') + { + // Etat brouillon pas interessant + } + if ($action == 'PROPAL_VALIDATE') + { + dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched. id=".$object->id); + $langs->load("other"); + + $this->date=time(); + $this->duree=0; + $this->texte=$langs->trans("PropalValidatedInDolibarr",$object->ref); + $this->desc=$langs->trans("PropalValidatedInDolibarr",$object->ref); + $this->desc.="\n".$langs->trans("Author").': '.$user->code; + } + if ($action == 'PROPAL_CLOSE_SIGNED') + { + dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched. id=".$object->id); + $langs->load("other"); + + $this->date=time(); + $this->duree=0; + $this->texte=$langs->trans("PropalClosedSignedInDolibarr",$object->ref); + $this->desc=$langs->trans("PropalClosedSignedInDolibarr",$object->ref); + $this->desc.="\n".$langs->trans("Author").': '.$user->code; + } + if ($action == 'PROPAL_CLOSE_REFUSED') + { + dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched. id=".$object->id); + $langs->load("other"); + + $this->date=time(); + $this->duree=0; + $this->texte=$langs->trans("PropalClosedRefusedInDolibarr",$object->ref); + $this->desc=$langs->trans("PropalClosedRefusedInDolibarr",$object->ref); + $this->desc.="\n".$langs->trans("Author").': '.$user->code; + } + + if ($action == 'BILL_CREATE') + { + // Etat brouillon pas interessant + } + if ($action == 'BILL_MODIFY') + { + // Pas interessant + } if ($action == 'BILL_VALIDATE') { dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched. id=".$object->id);