Update create_ticket.php
This commit is contained in:
parent
634348d048
commit
414b183ead
@ -146,7 +146,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) {
|
||||
$contacts = $object->searchContactByEmail($origin_email);
|
||||
|
||||
// Ensure that contact is active and select first active contact
|
||||
$cid = 0;
|
||||
$cid = -1;
|
||||
foreach ($contacts as $key => $contact) {
|
||||
if ((int) $contact->statut == 1) {
|
||||
$cid = $key;
|
||||
@ -156,7 +156,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) {
|
||||
|
||||
|
||||
// Option to require email exists to create ticket
|
||||
if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && !$contacts[$cid]->socid) {
|
||||
if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && ($cid <= 0 || empty($contacts[$cid]->socid))) {
|
||||
$error++;
|
||||
array_push($object->errors, $langs->trans("ErrorEmailMustExistToCreateTicket"));
|
||||
$action = '';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user