Track action close for ticket
This commit is contained in:
parent
ed00391428
commit
1f6f6f6edb
@ -786,7 +786,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
// TODO Merge all previous cases into this generic one
|
||||
else // $action = TICKET_CREATE, TICKET_MODIFY, TICKET_DELETE, ...
|
||||
{
|
||||
// Note: We are here only if $conf->global->MAIN_AGENDA_ACTIONAUTO_action is on (tested at begining of this function)
|
||||
// Note: We are here only if $conf->global->MAIN_AGENDA_ACTIONAUTO_action is on (tested at begining of this function). Key can be set in agenda setup if defined into c_action_trigger
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("agenda","other"));
|
||||
|
||||
|
||||
@ -109,7 +109,8 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_DELETE','Project deleted','Executed when a project is deleted','project',143);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_CREATE','Ticket created','Executed when a ticket is created','ticket',161);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_MODIFY','Ticket modified','Executed when a ticket is modified','ticket',163);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_DELETE','Ticket deleted','Executed when a ticket is deleted','ticket',164);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_CLOSE','Ticket closed','Executed when a ticket is closed','ticket',164);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_DELETE','Ticket deleted','Executed when a ticket is deleted','ticket',165);
|
||||
-- actions not enabled by default (no constant created for that) when we enable module agenda
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',41);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_MODIFY','Member modified','Executed when a member is modified','member',23);
|
||||
|
||||
@ -280,3 +280,6 @@ ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN datelastok datetime;
|
||||
|
||||
DELETE FROM llx_const WHERE name = 'THEME_ELDY_USE_HOVER' AND value = '0';
|
||||
DELETE FROM llx_const WHERE name = 'THEME_ELDY_USE_CHECKED' AND value = '0';
|
||||
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_CLOSE','Ticket closed','Executed when a ticket is closed','ticket',164);
|
||||
|
||||
|
||||
@ -95,6 +95,7 @@ PROJECT_MODIFYInDolibarr=Project %s modified
|
||||
PROJECT_DELETEInDolibarr=Project %s deleted
|
||||
TICKET_CREATEInDolibarr=Ticket %s created
|
||||
TICKET_MODIFYInDolibarr=Ticket %s modified
|
||||
TICKET_CLOSEInDolibarr=Ticket %s closed
|
||||
TICKET_DELETEInDolibarr=Ticket %s deleted
|
||||
##### End agenda events #####
|
||||
AgendaModelModule=Document templates for event
|
||||
|
||||
@ -152,7 +152,7 @@ TicketCategory=Analytic code
|
||||
SeeTicket=See ticket
|
||||
TicketMarkedAsRead=Ticket has been marked as read
|
||||
TicketReadOn=Read on
|
||||
TicketCloseOn=Clotured on
|
||||
TicketCloseOn=Closing date
|
||||
MarkAsRead=Mark ticket as read
|
||||
TicketHistory=Ticket history
|
||||
AssignUser=Assign to user
|
||||
@ -253,7 +253,7 @@ TicketEmailPleaseDoNotReplyToThisEmail=Please do not reply directly to this emai
|
||||
TicketPublicInfoCreateTicket=This form allows you to record a support ticket in our management system.
|
||||
TicketPublicPleaseBeAccuratelyDescribe=Please accurately describe the problem. Provide the most information possible to allow us to correctly identify your request.
|
||||
TicketPublicMsgViewLogIn=Please enter ticket tracking ID
|
||||
TicketTrackId=Tracking ID
|
||||
TicketTrackId=Public Tracking ID
|
||||
OneOfTicketTrackId=One of yours tracking ID
|
||||
ErrorTicketNotFound=Ticket with tracking ID %s not found!
|
||||
Subject=Subject
|
||||
|
||||
@ -390,9 +390,11 @@ if ($action == "new_public_message" && GETPOST('btn_add_message')) {
|
||||
$object->newMessagePublic($user, $action);
|
||||
}
|
||||
|
||||
if ($action == "confirm_close" && GETPOST('confirm', 'alpha') == 'yes' && $user->rights->ticket->write) {
|
||||
if ($action == "confirm_close" && GETPOST('confirm', 'alpha') == 'yes' && $user->rights->ticket->write)
|
||||
{
|
||||
$object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha'));
|
||||
if ($object->close()) {
|
||||
|
||||
if ($object->close($user)) {
|
||||
// Log action in ticket logs table
|
||||
$log_action = $langs->trans('TicketLogClosedBy', $user->getFullName($langs));
|
||||
|
||||
@ -1213,7 +1215,8 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
|
||||
$action = 'presend';
|
||||
}
|
||||
|
||||
if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'delete' || $action == 'edit_message_init')
|
||||
//if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'delete' || $action == 'edit_message_init')
|
||||
if ($action != 'add_message')
|
||||
{
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
@ -1751,11 +1751,12 @@ class Ticket extends CommonObject
|
||||
/**
|
||||
* Close a ticket
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user User that close
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function close()
|
||||
public function close(User $user)
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
global $conf, $langs;
|
||||
|
||||
if ($this->fk_statut != 9) { // not closed
|
||||
$this->db->begin();
|
||||
@ -1776,7 +1777,7 @@ class Ticket extends CommonObject
|
||||
foreach ($this->linkedObjectsIds['fichinter'] as $fichinter_id) {
|
||||
$fichinter = new Fichinter($this->db);
|
||||
$fichinter->fetch($fichinter_id);
|
||||
if($fichinter->statut == 0) {
|
||||
if ($fichinter->statut == 0) {
|
||||
$result = $fichinter->setValid($user);
|
||||
if (!$result) {
|
||||
$this->errors[] = $fichinter->error;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user