When the ficheinter can't be created, display an error.
This commit is contained in:
parent
ac7f02e0d3
commit
2ec7818c75
@ -457,9 +457,9 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Automatically create intervention
|
// Automatically create intervention
|
||||||
if (!empty($conf->ficheinter->enabled) && !empty($conf->ticket->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_CREATE_INTERVENTION) && !empty($object->fk_soc)) {
|
if (!empty($conf->ficheinter->enabled) && !empty($conf->ticket->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_CREATE_INTERVENTION)) {
|
||||||
$fichinter = new Fichinter($this->db);
|
$fichinter = new Fichinter($this->db);
|
||||||
$fichinter->socid = $object->fk_soc;
|
$fichinter->socid = (int) $object->fk_soc;
|
||||||
$fichinter->fk_project = $projectid;
|
$fichinter->fk_project = $projectid;
|
||||||
$fichinter->fk_contrat = (int) $object->fk_contract;
|
$fichinter->fk_contrat = (int) $object->fk_contract;
|
||||||
$fichinter->author = $user->id;
|
$fichinter->author = $user->id;
|
||||||
|
|||||||
@ -255,7 +255,7 @@ class Fichinter extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->socid <= 0) {
|
if ($this->socid <= 0) {
|
||||||
$this->error = 'ErrorBadParameterForFunc';
|
$this->error = 'ErrorFicheinterCompanyDoesNotExist';
|
||||||
dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,3 +67,4 @@ ToCreateAPredefinedIntervention=To create a predefined or recurring intervention
|
|||||||
ConfirmReopenIntervention=Are you sure you want to open back the intervention <b>%s</b>?
|
ConfirmReopenIntervention=Are you sure you want to open back the intervention <b>%s</b>?
|
||||||
GenerateInter=Generate intervention
|
GenerateInter=Generate intervention
|
||||||
FichinterNoContractLinked=Intervention %s has been created without a linked contract.
|
FichinterNoContractLinked=Intervention %s has been created without a linked contract.
|
||||||
|
ErrorFicheinterCompanyDoesNotExist=Company does not exist. Intervention has not been created.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user