fix duplicate ticket information (#26199)
* FIX duplicate data on ticket creation: fk_user_create * Light code format on ticket/card.php
This commit is contained in:
parent
1e3e53ffb5
commit
af0bf77d0d
1 changed files with 22 additions and 18 deletions
|
|
@ -226,28 +226,32 @@ if (empty($reshook)) {
|
|||
$object->ref = $getRef;
|
||||
}
|
||||
|
||||
$object->fk_soc = $object->socid = GETPOST("socid", 'int') > 0 ? GETPOST("socid", 'int') : 0;
|
||||
$object->subject = GETPOST("subject", 'alphanohtml');
|
||||
$object->message = GETPOST("message", 'restricthtml');
|
||||
$object->fk_soc = $object->socid = GETPOST("socid", 'int') > 0 ? GETPOST("socid", 'int') : 0;
|
||||
$object->subject = GETPOST("subject", 'alphanohtml');
|
||||
$object->message = GETPOST("message", 'restricthtml');
|
||||
|
||||
$object->type_code = GETPOST("type_code", 'alpha');
|
||||
$object->type_label = $langs->trans($langs->getLabelFromKey($db, $object->type_code, 'c_ticket_type', 'code', 'label'));
|
||||
$object->category_code = GETPOST("category_code", 'alpha');
|
||||
$object->category_label = $langs->trans($langs->getLabelFromKey($db, $object->category_code, 'c_ticket_category', 'code', 'label'));
|
||||
$object->severity_code = GETPOST("severity_code", 'alpha');
|
||||
$object->severity_label = $langs->trans($langs->getLabelFromKey($db, $object->severity_code, 'c_ticket_severity', 'code', 'label'));
|
||||
$object->email_from = $user->email;
|
||||
$object->origin_email = null;
|
||||
$notifyTiers = GETPOST("notify_tiers_at_create", 'alpha');
|
||||
$object->notify_tiers_at_create = empty($notifyTiers) ? 0 : 1;
|
||||
$fk_user_assign = GETPOST("fk_user_assign", 'int');
|
||||
$object->type_code = GETPOST("type_code", 'alpha');
|
||||
$object->type_label = $langs->trans($langs->getLabelFromKey($db, $object->type_code, 'c_ticket_type', 'code', 'label'));
|
||||
$object->category_code = GETPOST("category_code", 'alpha');
|
||||
$object->category_label = $langs->trans($langs->getLabelFromKey($db, $object->category_code, 'c_ticket_category', 'code', 'label'));
|
||||
$object->severity_code = GETPOST("severity_code", 'alpha');
|
||||
$object->severity_label = $langs->trans($langs->getLabelFromKey($db, $object->severity_code, 'c_ticket_severity', 'code', 'label'));
|
||||
$object->fk_user_create = $user->id;
|
||||
$object->email_from = $user->email;
|
||||
$object->origin_email = null;
|
||||
|
||||
$notifyTiers = GETPOST("notify_tiers_at_create", 'alpha');
|
||||
$object->notify_tiers_at_create = empty($notifyTiers) ? 0 : 1;
|
||||
|
||||
$fk_user_assign = GETPOST("fk_user_assign", 'int');
|
||||
if ($fk_user_assign > 0) {
|
||||
$object->fk_user_assign = $fk_user_assign;
|
||||
$object->status = $object::STATUS_ASSIGNED;
|
||||
$object->fk_user_assign = $fk_user_assign;
|
||||
$object->status = $object::STATUS_ASSIGNED;
|
||||
}
|
||||
|
||||
$object->fk_project = $projectid;
|
||||
$object->fk_contract = GETPOST('fk_contract', 'int');
|
||||
$object->fk_project = $projectid;
|
||||
$object->fk_contract = GETPOST('fk_contract', 'int');
|
||||
|
||||
|
||||
$id = $object->create($user);
|
||||
if ($id <= 0) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue