Index: openacs-4/contrib/obsolete-packages/ticket-tracker/sql/postgresql/ticket-tracker-packages.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/ticket-tracker/sql/postgresql/ticket-tracker-packages.sql,v
diff -u -N -r1.10 -r1.11
--- openacs-4/contrib/obsolete-packages/ticket-tracker/sql/postgresql/ticket-tracker-packages.sql	11 Feb 2002 07:45:52 -0000	1.10
+++ openacs-4/contrib/obsolete-packages/ticket-tracker/sql/postgresql/ticket-tracker-packages.sql	12 Feb 2002 01:35:16 -0000	1.11
@@ -583,7 +583,7 @@
 begin
 	select journal_entry__new (
 		null,							-- journal_id
-		case_id,						-- object_id
+		p_case_id,						-- object_id
 		''modify'',						-- action
 		''Attribute Change'',			-- action_pretty
 		now(),							-- creation_date
@@ -660,10 +660,14 @@
 
 	select ttracker_util__notification_sender(v_package_id) into v_party_from;
 
+	-- get the package url to use as return_url in the email
+	select site_node__url(node_id) into v_url
+	from site_nodes where object_id = v_package_id;
+
 	v_subject := ''Ticket #'' || v_ticket_id || '' -- '' || p_custom_arg;
 	v_body := ''Subject: '' || v_subject || ''
 '' || ''To do: '' || p_custom_arg || ''
-'' || ''Manage via: '' || ttracker_util__workflow_url(''t'') || ''task?task_id='' || p_task_id;
+'' || ''Manage via: '' || ttracker_util__workflow_url(''t'') || ''task?task_id='' || p_task_id || ''&return_url='' || v_url;
 
    -- acs-workflow has been changed. actual notification
    -- should be sent from callback now, thus it is called now
@@ -680,7 +684,7 @@
 
 	return 0;
 end;' language 'plpgsql';
-                    
+
 create function ttracker_callback__notify_admin (integer,varchar)
 returns integer as '
 declare
@@ -690,6 +694,7 @@
 	v_subject			ttracker_tickets.subject%TYPE;
 	v_package_id		ttracker_categories.package_id%TYPE;
 	v_request_id		integer;
+	v_url				varchar(1000);
 	admin_rec			record;
 begin
     -- uses 2 separate queries to find out who has ''admin'' privilege 
@@ -707,6 +712,10 @@
         and wc.object_id = tt.ticket_id
         and tt.category_id = tc.category_id;
 
+	-- get the package url to use as return_url in the email
+	select site_node__url(node_id) into v_url
+	from site_nodes where object_id = v_package_id;
+
 	for admin_rec in select u.user_id
                      from users u, acs_object_party_privilege_map m
                      where m.object_id = v_package_id
@@ -718,7 +727,7 @@
 			''Ticket #'' || v_ticket_id || '' -- '' || ''Assign Ticket'', -- subject
 			''Subject: '' || v_subject || ''
 '' || ''To do: '' || ''Assign Ticket'' || ''
-'' || ''Manage via: '' || ttracker_util__workflow_url( ''t'') || ''task?task_id='' || p_task_id						                            -- message
+'' || ''Manage via: '' || ttracker_util__workflow_url( ''t'') || ''task?task_id='' || p_task_id || ''&return_url='' || v_url                        -- message
 		) into v_request_id;
 	end loop;
 
