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);
|
$contacts = $object->searchContactByEmail($origin_email);
|
||||||
|
|
||||||
// Ensure that contact is active and select first active contact
|
// Ensure that contact is active and select first active contact
|
||||||
$cid = 0;
|
$cid = -1;
|
||||||
foreach ($contacts as $key => $contact) {
|
foreach ($contacts as $key => $contact) {
|
||||||
if ((int) $contact->statut == 1) {
|
if ((int) $contact->statut == 1) {
|
||||||
$cid = $key;
|
$cid = $key;
|
||||||
@ -156,7 +156,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) {
|
|||||||
|
|
||||||
|
|
||||||
// Option to require email exists to create ticket
|
// 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++;
|
$error++;
|
||||||
array_push($object->errors, $langs->trans("ErrorEmailMustExistToCreateTicket"));
|
array_push($object->errors, $langs->trans("ErrorEmailMustExistToCreateTicket"));
|
||||||
$action = '';
|
$action = '';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user