Index: openacs-4/packages/acs-content-repository/www/doc/tutorial.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/tutorial.html,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-content-repository/www/doc/tutorial.html 9 Jun 2004 16:59:07 -0000 1.1 +++ openacs-4/packages/acs-content-repository/www/doc/tutorial.html 30 Mar 2013 20:02:44 -0000 1.2 @@ -359,36 +359,22 @@ select define_function_args('pm_task__new_task_item', 'task_id, project_id, title, description, end_date, percent_complete, estimated_hours_work, estimated_hours_work_min, estimated_hours_work_max, creation_date, creation_user, creation_ip, package_id'); create function pm_task__new_task_item ( - integer, -- task_id - integer, -- project_id - varchar, -- title - varchar, -- description - timestamptz, -- end_date - numeric, -- percent_complete - numeric, -- estimated_hours_work - numeric, -- estimated_hours_work_min - numeric, -- estimated_hours_work_max, - timestamptz, -- creation_date - integer, -- creation_user - varchar, -- creation_ip - integer -- package_id + p_task_id integer, + p_project_id integer, + p_title varchar, + p_description varchar, + p_end_date timestamptz, + p_percent_complete numeric, + p_estimated_hours_work numeric, + p_estimated_hours_work_min numeric, + p_estimated_hours_work_max numeric, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_package_id integer ) returns integer -as ' +as $$ declare - p_task_id alias for $1; - p_project_id alias for $2; - p_title alias for $3; - p_description alias for $4; - p_end_date alias for $5; - p_percent_complete alias for $6; - p_estimated_hours_work alias for $7; - p_estimated_hours_work_min alias for $8; - p_estimated_hours_work_max alias for $9; - p_creation_date alias for $10; - p_creation_user alias for $11; - p_creation_ip alias for $12; - p_package_id alias for $13; - v_item_id cr_items.item_id%TYPE; v_revision_id cr_revisions.revision_id%TYPE; v_id cr_items.item_id%TYPE; @@ -409,11 +395,11 @@ p_creation_user, -- creation_user p_package_id, -- context_id p_creation_ip, -- creation_ip - ''content_item'', -- item_subtype - ''pm_task'', -- content_type + 'content_item', -- item_subtype + 'pm_task', -- content_type p_title, -- title p_description, -- description - ''text/plain'', -- mime_type + 'text/plain', -- mime_type null, -- nls_language null -- data ); @@ -422,7 +408,7 @@ p_title, -- title p_description, -- description now(), -- publish_date - ''text/plain'', -- mime_type + 'text/plain', -- mime_type NULL, -- nls_language NULL, -- data v_item_id, -- item_id @@ -442,53 +428,39 @@ insert into pm_tasks_revisions ( task_revision_id, end_date, percent_complete, estimated_hours_work, estimated_hours_work_min, estimated_hours_work_max, actual_hours_worked) values ( - v_revision_id, p_end_date, p_percent_complete, p_estimated_hours_work, p_estimated_hours_work_min, p_estimated_hours_work_max, ''0''); + v_revision_id, p_end_date, p_percent_complete, p_estimated_hours_work, p_estimated_hours_work_min, p_estimated_hours_work_max, '0'); PERFORM acs_permission__grant_permission( v_revision_id, p_creation_user, - ''admin'' + 'admin' ); return v_revision_id; -end;' language 'plpgsql'; +end; +$$ language plpgsql; select define_function_args('pm_task__new_task_revision', 'task_id, project_id, title, description, end_date, percent_complete, estimated_hours_work, estimated_hours_work_min, estimated_hours_work_max, actual_hours_worked, creation_date, creation_user, creation_ip, package_id'); create function pm_task__new_task_revision ( - integer, -- task_id (the item_id) - integer, -- project_id - varchar, -- title - varchar, -- description - timestamptz, -- end_date - numeric, -- percent_complete - numeric, -- estimated_hours_work - numeric, -- estimated_hours_work_min - numeric, -- estimated_hours_work_max - numeric, -- actual_hours_worked - timestamptz, -- creation_date - integer, -- creation_user - varchar, -- creation_ip - integer -- package_id + p_task_id integer, -- the item_id + p_project_id integer, + p_title varchar, + p_description varchar, + p_end_date timestamptz, + p_percent_complete numeric, + p_estimated_hours_work numeric, + p_estimated_hours_work_min numeric, + p_estimated_hours_work_max numeric, + p_actual_hours_worked numeric, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_package_id integer ) returns integer -as ' +as $$ declare - p_task_id alias for $1; - p_project_id alias for $2; - p_title alias for $3; - p_description alias for $4; - p_end_date alias for $5; - p_percent_complete alias for $6; - p_estimated_hours_work alias for $7; - p_estimated_hours_work_min alias for $8; - p_estimated_hours_work_max alias for $9; - p_actual_hours_worked alias for $10; - p_creation_date alias for $11; - p_creation_user alias for $12; - p_creation_ip alias for $13; - p_package_id alias for $14; - v_revision_id cr_revisions.revision_id%TYPE; v_id cr_items.item_id%TYPE; begin @@ -500,7 +472,7 @@ p_title, -- title p_description, -- description now(), -- publish_date - ''text/plain'', -- mime_type + 'text/plain', -- mime_type NULL, -- nls_language NULL, -- data p_task_id, -- item_id @@ -520,33 +492,34 @@ PERFORM acs_permission__grant_permission( v_revision_id, p_creation_user, - ''admin'' + 'admin' ); return v_revision_id; -end;' language 'plpgsql'; +end; +$$ language plpgsql; -- The delete function deletes a record and all related overhead. select define_function_args('pm_task__delete_task_item', 'task_id'); -create or replace function pm_task__delete_task_item (integer) -returns integer as ' +create or replace function pm_task__delete_task_item (p_task_id integer) +returns integer as $$ declare - p_task_id alias for $1; begin delete from pm_tasks_revisions where task_revision_id in (select revision_id from pm_tasks_revisionsx where item_id = p_task_id); delete from pm_tasks where task_id = p_task_id; - raise NOTICE ''Deleting pm_task...''; + raise NOTICE 'Deleting pm_task...'; PERFORM content_item__delete(p_task_id); return 0; -end;' language 'plpgsql'; +end; +$$ language plpgsql;