commit
604463c9a4
@ -1055,7 +1055,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);
|
||||
|
||||
@ -137,6 +137,16 @@ if ($action == 'swapstatut' && $user->rights->ticket->write) {
|
||||
// Efface un contact
|
||||
if ($action == 'deletecontact' && $user->rights->ticket->write) {
|
||||
if ($object->fetch($id, '', $track_id)) {
|
||||
$internal_contacts = $object->listeContact(-1, 'internal', 0, 'SUPPORTTEC');
|
||||
foreach ($internal_contacts as $key => $contact) {
|
||||
if ($contact['rowid'] == $lineid && $object->fk_user_assign==$contact['id']) {
|
||||
$ret = $object->assignUser($user, null);
|
||||
if ($ret < 0) {
|
||||
$error ++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
$result = $object->delete_contact($lineid);
|
||||
|
||||
if ($result >= 0) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user