phpgroupware-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-users] Trouble Ticket System is not multiuser safe.


From: Carwyn T. Edwards
Subject: [Phpgroupware-users] Trouble Ticket System is not multiuser safe.
Date: Mon, 17 Dec 2001 13:31:08 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120

Try this:

1)Log in to phpGroupWare with user1 and create a ticket.
2)View the ticket.
3)Log into phpGroupWare with user2 and view the same ticket.
4)Add a ticket detail using user1.
5)Add a ticket detail using user2.

Result = user1's detail will have vanished.

Why? The table for the tickets is as such:

t_id | integer | not null default nextval('ticket_t_id_seq'::text)
t_category         | varchar(40)  | not null
t_detail           | text         |
t_priority         | smallint     |
t_user             | varchar(10)  | not null
t_assignedto       | varchar(10)  | not null
t_timestamp_opened | integer      |
t_timestamp_closed | integer      |
t_subject          | varchar(255) |
t_department       | varchar(25)  |
t_watchers         | text         |
Index: ticket_t_id_key

where t_detail is a text field listing all the details seperated my the string:

"--------+-------"

User1 and user 2 both re-insert the string with an added --------+-------- and their detail, user2 however overwrites user1's modification as user2 doesn't have user1's added -----+----- with detail.

Solution:

A ticket -> detail relation is a one to many relation in this form so the tables should be something like:

create table ticket (
 t_id          serial primary key,
 t_category    varchar(40) not null,
 t_priority    smallint,
 t_user        varchar(10) not null,
 t_assignedto  varchar(10) not null,
 t_timestamp_opened    int,
 t_timestamp_closed    int,
 t_subject     varchar(255),
 t_department  varchar(25),
 t_watchers    text
);

create table tts_detail (
detail_id serial primary key, -- Handy if you want to be able to delete the detail.
   t_id int4 references ticket on delete cascade on update cascade,
   t_added_by_user varchar(10) not null,
t_added_time int -- Are you not using SQL timestamps for compatability reasons?
);

(Note: above works in PostgreSQL).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]