fix: 21139
This commit is contained in:
parent
661c414703
commit
d4bbc72b1b
@ -387,6 +387,7 @@ if (empty($reshook)) {
|
||||
// Si déjà un user assigné on le supprime des contacts
|
||||
if ($useroriginassign > 0) {
|
||||
$internal_contacts = $object->listeContact(-1, 'internal', 0, 'SUPPORTTEC');
|
||||
|
||||
foreach ($internal_contacts as $key => $contact) {
|
||||
if ($contact['id'] !== $usertoassign) {
|
||||
$result = $object->delete_contact($contact['rowid']);
|
||||
@ -1055,7 +1056,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '<input type="hidden" name="action" value="assign_user">';
|
||||
print '<input type="hidden" name="track_id" value="'.$object->track_id.'">';
|
||||
//print '<label for="fk_user_assign">'.$langs->trans("AssignUser").'</label> ';
|
||||
print $form->select_dolusers($user->id, 'fk_user_assign', 1);
|
||||
print $form->select_dolusers(empty($object->fk_user_assign)?$user->id:$object->fk_user_assign, 'fk_user_assign', 1);
|
||||
print ' <input type="submit" class="button small" name="btn_assign_user" value="'.$langs->trans("Validate").'" />';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
@ -496,6 +496,13 @@ class Ticket extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && $this->fk_user_assign > 0) {
|
||||
if ($this->add_contact($this->fk_user_assign, 'SUPPORTTEC', 'internal') < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Update extrafield
|
||||
if (!$error) {
|
||||
$result = $this->insertExtraFields();
|
||||
@ -2194,6 +2201,10 @@ class Ticket extends CommonObject
|
||||
$sql .= " AND tc.source = 'external'";
|
||||
}
|
||||
|
||||
if (!empty($code)) {
|
||||
$sql .= " AND tc.code = '".$this->db->escape($code)."'";
|
||||
}
|
||||
|
||||
$sql .= " AND tc.active=1";
|
||||
if ($status >= 0) {
|
||||
$sql .= " AND ec.statut = ".((int) $status);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user