You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2013-04-08 13:58:51

ArriMa
Member
Registered: 2013-01-25
Posts: 7

Followup Writer after Update message

Hi!

If I want to edit a followup (for example I want to clean up some parts of email such as signature of the user), the writer of the followup change from the owner of the message to who edit the message.

In this way I can't understand who originally wrote the message.

It's not better leave the name of the user that had wrote the message and not change it to who have update it?

Thanks.

Offline

#2 2013-09-12 11:49:11

ArriMa
Member
Registered: 2013-01-25
Posts: 7

Re: Followup Writer after Update message

Some update/opinion about this?

Thanks!

Offline

#3 2013-09-12 16:19:28

MEI-IT
Member
From: Evansville, Indiana, USA
Registered: 2013-08-08
Posts: 104

Re: Followup Writer after Update message

I noticed the same thing. If only that option was available to Super-Admins...

The way it's currently set up prevents users from making other users look bad.


GLPI v0.84.6 - Ubuntu 12.04 - PHP 5.3.10-1 - Apache 2.2.22 - MySQL 5.5.37
~100 users - ~120 PCs - ~80 servers

Offline

#4 2013-09-12 18:24:19

ArriMa
Member
Registered: 2013-01-25
Posts: 7

Re: Followup Writer after Update message

To exclude that case... it could specify in the same column of Writer "(modified by <USER>)".
It's not the best way but i think it could be the right give-and-take...

In future: adding a button to view the original followup...
I don't know, it's only a suggestion...

Offline

#5 2013-09-16 23:44:34

FabFara
Member
From: Italy - Bergamo
Registered: 2011-09-15
Posts: 36

Re: Followup Writer after Update message

Try with this trigger on glpi_ticketfollowups table

DELIMITER $$

USE `glpi`$$

CREATE
DEFINER=`root`@`%`
TRIGGER `glpi`.`glpi_ticketfollowups_PreserveWriter`
BEFORE UPDATE ON `glpi`.`glpi_ticketfollowups`
FOR EACH ROW
BEGIN
    IF NEW.users_id != OLD.users_id THEN
        SET NEW.users_id = OLD.users_id;
    END IF;
END$$

You can modify the trigger to append a note in the orignal followup (Modified by NEW.users_id  ecc.......)

At your own risk!

Last edited by FabFara (2013-09-17 00:00:16)


GLPI 0.83.7 - MySQL 5.1.69 - PHP 5.3.3 - CentOS 6.4 64 bit

Offline

#6 2013-09-16 23:54:15

FabFara
Member
From: Italy - Bergamo
Registered: 2011-09-15
Posts: 36

Re: Followup Writer after Update message

To automatically cleanup mail from signatures you can try with procmail and some regex
http://www.procmail.org/
http://www.netikka.net/tsneti/info/proctips.php#delsig


GLPI 0.83.7 - MySQL 5.1.69 - PHP 5.3.3 - CentOS 6.4 64 bit

Offline

#7 2013-10-03 21:28:04

ArriMa
Member
Registered: 2013-01-25
Posts: 7

Re: Followup Writer after Update message

I'm sorry for the late answer.

The trigger do what i would like.
I had modify the trigger to append at the end of the followup who have modified + date and time.

-- Full Trigger DDL Statements
-- Note: Only CREATE TRIGGER statements are allowed
DELIMITER $$

USE `glpi`$$

CREATE
DEFINER=`root`@`%`
TRIGGER `glpi`.`glpi_ticketfollowups_PreserveWriter`
BEFORE UPDATE ON `glpi`.`glpi_ticketfollowups`
FOR EACH ROW
BEGIN
    IF NEW.users_id != OLD.users_id THEN
        SET NEW.content = CONCAT(NEW.content,'\r\n [Modified by ', (SELECT CONCAT(realname, ' ',firstname) FROM glpi_users WHERE id=NEW.users_id), ' - ', DATE_FORMAT(NOW(), '%d-%m-%Y %T'),']');
        SET NEW.users_id = OLD.users_id;
    END IF;
END$$

Bye!

Offline

#8 2013-10-10 21:28:17

MEI-IT
Member
From: Evansville, Indiana, USA
Registered: 2013-08-08
Posts: 104

Re: Followup Writer after Update message

FabFara and ArriMa, Thanks for the code!

I actually had to change \r\n to CHAR(13), CHAR(10) for my system to recognize the proper characters.


GLPI v0.84.6 - Ubuntu 12.04 - PHP 5.3.10-1 - Apache 2.2.22 - MySQL 5.5.37
~100 users - ~120 PCs - ~80 servers

Offline

Board footer

Powered by FluxBB