Index: openacs-4/packages/curriculum/curriculum.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/curriculum.info,v diff -u -r1.9 -r1.10 --- openacs-4/packages/curriculum/curriculum.info 11 Dec 2003 21:40:01 -0000 1.9 +++ openacs-4/packages/curriculum/curriculum.info 22 Feb 2004 22:01:52 -0000 1.10 @@ -7,15 +7,15 @@ f f - + Ola Hansson Polyxena Create and track user page sequence "curriculum" Provides a UI for creating a sequence of links as a "curriculum" which can be presented as a linkbar in the page footer (or elsewhere) and is tracked per user. - - + + Index: openacs-4/packages/curriculum/catalog/curriculum.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/catalog/curriculum.en_US.ISO-8859-1.xml,v diff -u -r1.8 -r1.9 --- openacs-4/packages/curriculum/catalog/curriculum.en_US.ISO-8859-1.xml 17 Oct 2003 13:43:29 -0000 1.8 +++ openacs-4/packages/curriculum/catalog/curriculum.en_US.ISO-8859-1.xml 22 Feb 2004 22:01:53 -0000 1.9 @@ -23,7 +23,12 @@ Curriculum: Curriculum Curriculum info - Curriculum owner + Default Assignees + <p><b>Help:</b></p> + +<p>Every authored curriculum is subject to a publishing workflow, and the users assigned to the editor and publisher roles are responsible for assuring its quality. The editor is supposed to review the curriculum, and then it is the job of the publisher to ultimately decide if the curriculum is ready to be published or not.</p> + +<p>It is possible at any time to assign these roles to different users in each individual curriculum. Still, it is a good idea to have default assignees for all curricula that are added to this Curriculum instance, so that no curriculum is left unattended. Initially, the user who mounted this instance is assigned as default editor and publisher.</p> Delete Description Detailed information @@ -54,6 +59,7 @@ Back to where you came from Create a new curriculum Deactivate this element + Default assignees for the editor and publisher role Delete this curriculum and all of its data Delete this element and all of its data deleting curriculum %curriculum_id% in package_id %package_id% @@ -91,7 +97,6 @@ No elements Ongoing Options - Owner Package parameters Package permissions Pending Index: openacs-4/packages/curriculum/catalog/curriculum.sv_SE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/catalog/curriculum.sv_SE.ISO-8859-1.xml,v diff -u -r1.7 -r1.8 --- openacs-4/packages/curriculum/catalog/curriculum.sv_SE.ISO-8859-1.xml 17 Oct 2003 13:43:30 -0000 1.7 +++ openacs-4/packages/curriculum/catalog/curriculum.sv_SE.ISO-8859-1.xml 22 Feb 2004 22:01:53 -0000 1.8 @@ -24,6 +24,8 @@ Kursplan Kursplansinformation Kursplanens �gare + Huvudansvariga + <p><b>Hj�lp:</b></p> <p>Varje kursplan som skapas �r underst�lld ett publicistiskt arbetsfl�de, och det �r anv�ndarna som tilldelats redigerar- och publicistrollerna som ansvarar f�r dess kvalitet. Redigeraren f�rv�ntas granska kursplanen och d�refter �r det publicistens uppgift att slutligen avg�ra ifall kursplanen �r f�rdig f�r publicering eller inte.</p> <p>Det �r n�r som helst m�jligt att tilldela olika anv�ndare dessa roller f�r varje enskild kurplan. Det kan �nd� vara en bra id� att ha anv�ndare som fr�n b�rjan �r tilldelade huvudansvar f�r alla kursplaner som l�ggs till denna Curriculum-instans, s� att ingen kursplan l�mnas o�vervakad. Initialt �r den anv�ndare som skapade denna instans tilldelad b�de rollen som redigerare och rollen som publicist.</p> Radera Beskrivning Detaljerad information @@ -54,6 +56,7 @@ Tillbaka dit du kom ifr�n L�gg upp en ny kursplan Avaktivera detta element + Huvudansvariga f�r redigering och publicering Radera denna kursplan och dess samtliga element Radera detta element och all dess data raderar kursplan %curriculum_id% i package_id %package_id% Index: openacs-4/packages/curriculum/lib/admin-curriculums-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/lib/admin-curriculums-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/curriculum/lib/admin-curriculums-oracle.xql 15 Jun 2003 15:33:02 -0000 1.3 +++ openacs-4/packages/curriculum/lib/admin-curriculums-oracle.xql 22 Feb 2004 22:01:54 -0000 1.4 @@ -46,7 +46,6 @@ workflow_fsm_states st where cc.curriculum_id = ce.curriculum_id(+) and cc.package_id = :package_id - and author.user_id = cc.owner_id and cfsm.case_id = cas.case_id and st.state_id = cfsm.current_state and cas.workflow_id = :workflow_id Index: openacs-4/packages/curriculum/lib/admin-curriculums-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/lib/admin-curriculums-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/curriculum/lib/admin-curriculums-postgresql.xql 15 Jun 2003 15:33:02 -0000 1.3 +++ openacs-4/packages/curriculum/lib/admin-curriculums-postgresql.xql 22 Feb 2004 22:01:54 -0000 1.4 @@ -45,7 +45,6 @@ workflow_case_fsm cfsm, workflow_fsm_states st where cc.package_id = :package_id - and author.user_id = cc.owner_id and cfsm.case_id = cas.case_id and st.state_id = cfsm.current_state and cas.workflow_id = :workflow_id Index: openacs-4/packages/curriculum/lib/admin-curriculums.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/lib/admin-curriculums.adp,v diff -u -r1.14 -r1.15 --- openacs-4/packages/curriculum/lib/admin-curriculums.adp 4 Oct 2003 13:10:52 -0000 1.14 +++ openacs-4/packages/curriculum/lib/admin-curriculums.adp 22 Feb 2004 22:01:54 -0000 1.15 @@ -1,15 +1,13 @@

- [ - #curriculum.Package_parameters# - | - #curriculum.Package_permissions# - | - #curriculum.Help# - ] + #curriculum.Default_Assignees# + #curriculum.Package_parameters# + #curriculum.Package_permissions# + #curriculum.Help#

+ - - +
+ @@ -42,11 +40,10 @@ @curriculums.pretty_state@ - + - + -
#curriculum.Name# #curriculum.Description# #curriculum.State# - @notification_label@ - | - #curriculum.Delete# + @notification_label@ + #curriculum.Delete# + @@ -65,7 +62,7 @@ -
  » @@ -83,18 +80,17 @@ #curriculum.Enabled# - #curriculum.Disable# + #curriculum.Disable# #curriculum.Disabled# - #curriculum.Enable# - | - #curriculum.Delete# + #curriculum.Enable# + #curriculum.Delete# + @@ -109,19 +105,15 @@ -
-
  • - #curriculum.No_elements# -
  • + #curriculum.No_elements#
    -
  • - #curriculum.Add_an_element# -
  • +
    + #curriculum.Add_an_element#
    @@ -131,14 +123,10 @@
    -
  • #curriculum.No_curriculums# -

  • -
  • - #curriculum.Add_a_curriculum# -
  • + #curriculum.Add_a_curriculum#
    Index: openacs-4/packages/curriculum/lib/admin-roles.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/lib/admin-roles.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum/lib/admin-roles.adp 22 Feb 2004 22:01:54 -0000 1.1 @@ -0,0 +1,7 @@ + +@title;noquote@ +@context;noquote@ + + + +#curriculum.Default_assignees_help# Index: openacs-4/packages/curriculum/lib/admin-roles.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/lib/admin-roles.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum/lib/admin-roles.tcl 22 Feb 2004 22:01:54 -0000 1.1 @@ -0,0 +1,56 @@ +ad_page_contract { + + Add/edit/view default assignees. + + @author Ola Hansson (ola@polyxena.net) + @creation-date 2004-02-06 + @cvs-id $Id: admin-roles.tcl,v 1.1 2004/02/22 22:01:54 olah Exp $ + +} { + {return_url "."} +} -properties { + title:onevalue + context:onevalue +} + +set title "[_ curriculum.Default_Assignees]" +set context [list $title] + +set user_list [curriculum::users_get_options] +set search_query [db_map dbqd.curriculum.lib.curriculum-ave.user_search] + +ad_form -name default_assignees \ + -cancel_url $return_url \ + -mode display \ + -form { + {default_editor:search,optional + {result_datatype integer} + {label "[_ curriculum.Editor]"} + {options $user_list} + {search_query $search_query} + } + {default_publisher:search,optional + {result_datatype integer} + {label "[_ curriculum.Publisher]"} + {options $user_list} + {search_query $search_query} + } + } -on_request { + + set default_editor [curriculum::default_editor::get_assignees {} {} {}] + set default_publisher [curriculum::default_publisher::get_assignees {} {} {}] + + } -on_submit { + + set package_id [curriculum::conn package_id] + + db_dml update_default_assignees {*SQL*} + + } -after_submit { + + #ad_returnredirect $return_url + #ad_script_abort + + } + +ad_return_template Index: openacs-4/packages/curriculum/lib/admin-roles.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/lib/admin-roles.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum/lib/admin-roles.xql 22 Feb 2004 22:01:54 -0000 1.1 @@ -0,0 +1,15 @@ + + + + + + + update cu_default_assignees set + default_editor = :default_editor, + default_publisher = :default_publisher + where package_id = :package_id + + + + + Index: openacs-4/packages/curriculum/lib/curriculum-ave.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/lib/curriculum-ave.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/curriculum/lib/curriculum-ave.tcl 11 Dec 2003 21:40:01 -0000 1.11 +++ openacs-4/packages/curriculum/lib/curriculum-ave.tcl 22 Feb 2004 22:01:54 -0000 1.12 @@ -16,7 +16,6 @@ set package_id [curriculum::conn package_id] set user_id [ad_conn user_id] -set owners_list [list] set actions [list] set element_mode {} set desc_help_text "[_ curriculum.lt_This_text_should_desc]" @@ -34,8 +33,6 @@ set title "[_ curriculum.Create_Curriculum]" - lappend owners_list [list [person::name -person_id $user_id] "$user_id"] - } else { #### @@ -112,16 +109,10 @@ } - lappend owners_list [list [person::name -person_id $curriculum_array(owner_id)] $curriculum_array(owner_id)] - } set context [list $title] -# Curriculum "owner" select box. -lappend owners_list [list "[_ curriculum.Search]" ":search:"] - - #### # # Build the form. @@ -201,19 +192,6 @@ } -# More fixed form elements -# FIXME. Datatype "search" does not appear to work with ad_form very well. -# Do we need an owner anyway when we're using workflow roles? -ad_form -extend -name curriculum -form { - {owner_id:search,optional - {mode $element_mode} - {result_datatype integer} - {label "[_ curriculum.Owner]"} - {options $owners_list} - {search_query {[db_map user_search]}} - } -} - #### # # Done defining the form elements. @@ -246,7 +224,6 @@ -desc_format [template::util::richtext::get_property format $description] \ -comment [template::util::richtext::get_property contents $comment] \ -comment_format [template::util::richtext::get_property format $comment] \ - -owner_id $owner_id \ -package_id $package_id } -edit_data { @@ -258,7 +235,6 @@ -desc_format [template::util::richtext::get_property format $description] \ -comment [template::util::richtext::get_property contents $comment] \ -comment_format [template::util::richtext::get_property format $comment] \ - -owner_id $owner_id \ -action_id $action_id \ -array curriculum_array Index: openacs-4/packages/curriculum/lib/user-curriculums.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/lib/user-curriculums.adp,v diff -u -r1.13 -r1.14 --- openacs-4/packages/curriculum/lib/user-curriculums.adp 11 Dec 2003 21:40:01 -0000 1.13 +++ openacs-4/packages/curriculum/lib/user-curriculums.adp 22 Feb 2004 22:01:54 -0000 1.14 @@ -1,17 +1,13 @@

    - [ - #curriculum.lt_Reset_all_curriculums# + #curriculum.lt_Reset_all_curriculums# - | - #curriculum.lt_Remove_all_curriculum# + #curriculum.lt_Remove_all_curriculum# - | - #curriculum.Help# - ] + #curriculum.Help#

    - - +
    + @@ -20,7 +16,7 @@
    #curriculum.Name# #curriculum.Description# #curriculum.Status#

    - +
    @@ -87,18 +82,18 @@ Index: openacs-4/packages/curriculum/sql/oracle/curriculum-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/sql/oracle/curriculum-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/curriculum/sql/oracle/curriculum-create.sql 3 Jun 2003 10:48:45 -0000 1.2 +++ openacs-4/packages/curriculum/sql/oracle/curriculum-create.sql 22 Feb 2004 22:01:55 -0000 1.3 @@ -86,3 +86,19 @@ comment on column cu_user_curriculum_map.package_id is ' We use this column mainly to be able to add all the curriculums in a package instance to the user''s personalized bar (delete from cu_user_curriculum_map where user_id = :user_id and package_id = :package_id). '; + + +create table cu_default_assignees ( + package_id integer + constraint cu_assignees_package_id_fk + references apm_packages (package_id) + on delete cascade + constraint cu_assignees_package_id_pk + primary key, + default_editor integer + constraint cu_assignees_editor_fk + references parties (party_id), + default_publisher integer + constraint cu_assignees_publisher_fk + references parties (party_id) +); Index: openacs-4/packages/curriculum/sql/oracle/curriculum-curriculum-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/sql/oracle/curriculum-curriculum-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/curriculum/sql/oracle/curriculum-curriculum-create.sql 26 May 2003 17:40:02 -0000 1.1 +++ openacs-4/packages/curriculum/sql/oracle/curriculum-curriculum-create.sql 22 Feb 2004 22:01:55 -0000 1.2 @@ -5,29 +5,23 @@ -- @cvs-id $Id$ create table cu_curriculums ( - curriculum_id integer + curriculum_id integer constraint cu_curriculums_curricul_id_fk references acs_objects (object_id) - on delete cascade + on delete cascade constraint cu_curriculums_curricul_id_pk primary key, name varchar(200) constraint cu_curriculums_name_nn not null, description clob, desc_format varchar(200), - owner_id integer - constraint cu_curriculums_owner_id_nn - not null - -- owner can be any party, e.g., a group - constraint cu_curriculums_owner_id_fk - references parties (party_id), package_id integer constraint cu_curriculums_package_id_nn not null - constraint cu_curriculums_package_id_fk - references apm_packages (package_id) - on delete cascade, + constraint cu_curriculums_package_id_fk + references apm_packages (package_id) + on delete cascade, sort_key integer constraint cu_curriculums_sort_key_nn not null Index: openacs-4/packages/curriculum/sql/oracle/curriculum-curriculum-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/sql/oracle/curriculum-curriculum-package-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/curriculum/sql/oracle/curriculum-curriculum-package-create.sql 30 Sep 2003 12:10:06 -0000 1.4 +++ openacs-4/packages/curriculum/sql/oracle/curriculum-curriculum-package-create.sql 22 Feb 2004 22:01:55 -0000 1.5 @@ -18,7 +18,6 @@ -- to 32K that is the explicit type we use here. description in varchar default null, desc_format in cu_curriculums.desc_format%TYPE, - owner_id in cu_curriculums.owner_id%TYPE, package_id in cu_curriculums.package_id%TYPE, sort_key in cu_curriculums.sort_key%TYPE default null, creation_date in acs_objects.creation_date%TYPE default sysdate, @@ -49,7 +48,6 @@ name in cu_curriculums.name%TYPE, description in varchar default null, desc_format in cu_curriculums.desc_format%TYPE, - owner_id in cu_curriculums.owner_id%TYPE, package_id in cu_curriculums.package_id%TYPE, sort_key in cu_curriculums.sort_key%TYPE default null, creation_date in acs_objects.creation_date%TYPE default sysdate, @@ -80,9 +78,9 @@ end if; insert into cu_curriculums - (curriculum_id, name, description, desc_format, owner_id, package_id, sort_key) + (curriculum_id, name, description, desc_format, package_id, sort_key) values - (v_curriculum_id, name, description, desc_format, owner_id, package_id, v_sort_key); + (v_curriculum_id, name, description, desc_format, package_id, v_sort_key); return v_curriculum_id; end new; Index: openacs-4/packages/curriculum/sql/oracle/curriculum-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/sql/oracle/curriculum-drop.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/curriculum/sql/oracle/curriculum-drop.sql 3 Jun 2003 10:48:45 -0000 1.2 +++ openacs-4/packages/curriculum/sql/oracle/curriculum-drop.sql 22 Feb 2004 22:01:55 -0000 1.3 @@ -4,6 +4,9 @@ -- @creation-date 2003-05-23 -- @cvs-id $Id$ +-- Drop default assignees table. +drop table cu_default_assignees; + -- Drop the mapping tables. drop table cu_user_curriculum_map; drop table cu_user_element_map; Index: openacs-4/packages/curriculum/sql/oracle/upgrade/upgrade-0.5d1-1.0.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/sql/oracle/upgrade/upgrade-0.5d1-1.0.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum/sql/oracle/upgrade/upgrade-0.5d1-1.0.sql 22 Feb 2004 22:01:55 -0000 1.1 @@ -0,0 +1,3 @@ +ALTER TABLE cu_curriculums DROP COLUMN ( owner_id ); + +@@ curriculum-curriculum-package-create.sql Index: openacs-4/packages/curriculum/sql/postgresql/curriculum-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/sql/postgresql/curriculum-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/curriculum/sql/postgresql/curriculum-create.sql 3 Jun 2003 10:45:44 -0000 1.2 +++ openacs-4/packages/curriculum/sql/postgresql/curriculum-create.sql 22 Feb 2004 22:01:56 -0000 1.3 @@ -86,3 +86,19 @@ comment on column cu_user_curriculum_map.package_id is ' We use this column mainly to be able to add all the curriculums in a package instance to the user''s personalized bar (delete from cu_user_curriculum_map where user_id = :user_id and package_id = :package_id). '; + + +create table cu_default_assignees ( + package_id integer + constraint cu_default_assignees_package_id_fk + references apm_packages (package_id) + on delete cascade + constraint cu_default_assignees_package_id_pk + primary key, + default_editor integer + constraint cu_default_assignees_default_editor_fk + references parties (party_id), + default_publisher integer + constraint cu_default_assignees_default_publisher_fk + references parties (party_id) + ); Index: openacs-4/packages/curriculum/sql/postgresql/curriculum-curriculum-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/sql/postgresql/curriculum-curriculum-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/curriculum/sql/postgresql/curriculum-curriculum-create.sql 26 May 2003 17:42:18 -0000 1.1 +++ openacs-4/packages/curriculum/sql/postgresql/curriculum-curriculum-create.sql 22 Feb 2004 22:01:56 -0000 1.2 @@ -6,29 +6,23 @@ create table cu_curriculums ( - curriculum_id integer + curriculum_id integer constraint cu_curriculums_curriculum_id_fk references acs_objects (object_id) - on delete cascade + on delete cascade constraint cu_curriculums_curriculum_id_pk primary key, name varchar(200) constraint cu_curriculums_name_nn not null, description text, desc_format varchar(200), - owner_id integer - constraint cu_curriculums_owner_id_nn - not null - -- owner can be any party, e.g., a group - constraint cu_curriculums_owner_id_fk - references parties (party_id), package_id integer constraint cu_curriculums_package_id_nn not null - constraint cu_curriculums_package_id_fk - references apm_packages (package_id) - on delete cascade, + constraint cu_curriculums_package_id_fk + references apm_packages (package_id) + on delete cascade, sort_key integer constraint cu_curriculums_sort_key_nn not null Index: openacs-4/packages/curriculum/sql/postgresql/curriculum-curriculum-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/sql/postgresql/curriculum-curriculum-package-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/curriculum/sql/postgresql/curriculum-curriculum-package-create.sql 10 Jun 2003 09:29:19 -0000 1.4 +++ openacs-4/packages/curriculum/sql/postgresql/curriculum-curriculum-package-create.sql 22 Feb 2004 22:01:56 -0000 1.5 @@ -4,14 +4,13 @@ -- @creation-date 2003-05-23 -- @cvs-id $Id$ -select define_function_args('cu_curriculum__new','curriculum_id,name,description,desc_format,owner_id,package_id,sort_key,object_type;cu_curriculum,creation_date,creation_user,creation_ip,context_id'); +select define_function_args('cu_curriculum__new','curriculum_id,name,description,desc_format,package_id,sort_key,object_type;cu_curriculum,creation_date,creation_user,creation_ip,context_id'); create or replace function cu_curriculum__new ( integer, -- curriculum_id varchar, -- name text, -- description varchar, -- desc_format - integer, -- owner_id integer, -- package_id integer, -- sort_key varchar, -- object_type @@ -25,7 +24,6 @@ p_name alias for $2; p_description alias for $3; -- default null p_desc_format alias for $4; - p_owner_id alias for $5; p_package_id alias for $6; p_sort_key alias for $7; -- default null p_object_type alias for $8; -- default ''cu_curriculum'' @@ -55,9 +53,9 @@ end if; insert into cu_curriculums - (curriculum_id, name, description, desc_format, owner_id, package_id, sort_key) + (curriculum_id, name, description, desc_format, package_id, sort_key) values - (v_curriculum_id, p_name, p_description, p_desc_format, p_owner_id, p_package_id, v_sort_key); + (v_curriculum_id, p_name, p_description, p_desc_format, p_package_id, v_sort_key); raise NOTICE ''Adding curriculum - %'',p_name; Index: openacs-4/packages/curriculum/sql/postgresql/curriculum-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/sql/postgresql/curriculum-drop.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/curriculum/sql/postgresql/curriculum-drop.sql 3 Jun 2003 10:45:44 -0000 1.2 +++ openacs-4/packages/curriculum/sql/postgresql/curriculum-drop.sql 22 Feb 2004 22:01:56 -0000 1.3 @@ -4,6 +4,9 @@ -- @creation-date 2003-05-23 -- @cvs-id $Id$ +-- Drop default assignees table. +drop table cu_default_assignees; + -- Drop the mapping tables. drop table cu_user_curriculum_map; drop table cu_user_element_map; Index: openacs-4/packages/curriculum/sql/postgresql/upgrade/upgrade-0.5d1-1.0.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/sql/postgresql/upgrade/upgrade-0.5d1-1.0.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum/sql/postgresql/upgrade/upgrade-0.5d1-1.0.sql 22 Feb 2004 22:01:56 -0000 1.1 @@ -0,0 +1,3 @@ +ALTER TABLE cu_curriculums DROP COLUMN owner_id; + +\i curriculum-curriculum-package-create.sql Index: openacs-4/packages/curriculum/tcl/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/tcl/apm-callback-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/curriculum/tcl/apm-callback-procs.tcl 4 Oct 2003 13:10:51 -0000 1.4 +++ openacs-4/packages/curriculum/tcl/apm-callback-procs.tcl 22 Feb 2004 22:01:56 -0000 1.5 @@ -44,6 +44,9 @@ Package instantiation callback proc. } { curriculum::instance_workflow_create -package_id $package_id + + set user_id [ad_conn user_id] + db_dml insert_default_assignees {*SQL*} } @@ -58,6 +61,8 @@ curriculum::delete_instance -package_id $package_id curriculum::instance_workflow_delete -package_id $package_id + + db_dml delete_default_assignees {*SQL*} } } @@ -71,7 +76,8 @@ ad_proc -private curriculum::apm::register_implementations {} { db_transaction { - curriculum::apm::register_curriculum_owner_impl + curriculum::apm::register_curriculum_default_editor_impl + curriculum::apm::register_curriculum_default_publisher_impl curriculum::apm::register_curriculum_notification_info_impl curriculum::apm::register_flush_elements_impl } @@ -83,9 +89,13 @@ acs_sc::impl::delete \ -contract_name [workflow::service_contract::role_default_assignees] \ - -impl_name "CurriculumOwner" + -impl_name "Role_DefaultAssignees_Editor" acs_sc::impl::delete \ + -contract_name [workflow::service_contract::role_default_assignees] \ + -impl_name "Role_DefaultAssignees_Publisher" + + acs_sc::impl::delete \ -contract_name [workflow::service_contract::notification_info] \ -impl_name "CurriculumNotificationInfo" @@ -97,14 +107,14 @@ } -ad_proc -private curriculum::apm::register_curriculum_owner_impl {} { +ad_proc -private curriculum::apm::register_curriculum_default_editor_impl {} { set spec { - name "CurriculumOwner" + name "Role_DefaultAssignees_Editor" aliases { GetObjectType curriculum::object_type - GetPrettyName curriculum::owner::pretty_name - GetAssignees curriculum::owner::get_assignees + GetPrettyName curriculum::default_editor::pretty_name + GetAssignees curriculum::default_editor::get_assignees } } @@ -115,6 +125,24 @@ } +ad_proc -private curriculum::apm::register_curriculum_default_publisher_impl {} { + + set spec { + name "Role_DefaultAssignees_Publisher" + aliases { + GetObjectType curriculum::object_type + GetPrettyName curriculum::default_publisher::pretty_name + GetAssignees curriculum::default_publisher::get_assignees + } + } + + lappend spec contract_name [workflow::service_contract::role_default_assignees] + lappend spec owner [curriculum::package_key] + + acs_sc::impl::new_from_spec -spec $spec +} + + ad_proc -private curriculum::apm::register_curriculum_notification_info_impl {} { set spec { Index: openacs-4/packages/curriculum/tcl/curriculum-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/tcl/curriculum-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/curriculum/tcl/curriculum-procs.tcl 17 Oct 2003 13:43:30 -0000 1.14 +++ openacs-4/packages/curriculum/tcl/curriculum-procs.tcl 22 Feb 2004 22:01:57 -0000 1.15 @@ -12,7 +12,8 @@ namespace eval curriculum {} # Service contract implementation alias namespaces (phew, that was long!). -namespace eval curriculum::owner {} +namespace eval curriculum::default_editor {} +namespace eval curriculum::default_publisher {} namespace eval curriculum::notification_info {} namespace eval curriculum::flush_elements {} @@ -29,7 +30,6 @@ {-desc_format "text/html"} {-comment ""} {-comment_format "text/html"} - {-owner_id ""} -package_id:required {-sort_key ""} } { @@ -42,7 +42,6 @@ @param desc_format The format of the description. Current formats are: text/enhanced text/plain text/html text/fixed-width @param comment Comment on the action taken on the curriculum. @param comment_format The format of the comment. Current formats are: text/enhanced text/plain text/html text/fixed-width - @param owner_id The party-id of the party - user or group - that is responsible for this curriculum. Defaults to the creating user. @param package_id Package-id makes the Curriculum package subsite-aware. Defaults to [ad_conn package_id]. @param sort_key The relative sort order of the curriculums in a package instance. @@ -51,14 +50,9 @@ @author Ola Hansson (ola@polyxena.net) } { - # If no owner_id is provided, we set it to the currently logged-in user. - if [empty_string_p $owner_id] { - set owner_id [ad_conn user_id] - } - # Prepare the variables for instantiation. set extra_vars [ns_set create] - oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {curriculum_id name description desc_format owner_id package_id sort_key} + oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {curriculum_id name description desc_format package_id sort_key} db_transaction { @@ -85,7 +79,6 @@ {-desc_format "text/html"} {-comment ""} {-comment_format "text/html"} - -owner_id:required -action_id:required -array:required {-entry_id {}} @@ -99,7 +92,6 @@ @param desc_format The format of the description. Current formats are: text/enhanced text/plain text/html text/fixed-width @param comment Comment on the action taken on the curriculum. @param comment_format The format of the comment. Current formats are: text/enhanced text/plain text/html text/fixed-width - @param owner_id The party-id of the party - user or group - that is responsible for this curriculum. @return curriculum_id (just for convenience). @@ -142,25 +134,6 @@ } -ad_proc -public curriculum::change_owner { - -curriculum_id:required - -owner_id:required -} { - - Change the owner of a curriculum. - - @param curriculum_id The object-id of the curriculum which should change owner. - @param owner_id Party-id of the new owner. - - @return Nothing. - - @author Ola Hansson (ola@polyxena.net) - -} { - db_dml update_curriculum_owner {*SQL*} -} - - ad_proc -public curriculum::get { -curriculum_id:required -array:required @@ -171,7 +144,7 @@ array (using upvar) in the callers scope. The array will contain the keys: -

    curriculum_id, name, description, desc_format, owner_id, package_id, sort_key

    +

    curriculum_id, name, description, desc_format, package_id, sort_key

    @param curriculum_id The id of the curriculum to retrieve information about. @param array The name of the array in the callers scope where the information will @@ -295,13 +268,15 @@ editor { pretty_name \#curriculum.Editor\# callbacks { + curriculum.Role_DefaultAssignees_Editor workflow.Role_PickList_CurrentAssignees workflow.Role_AssigneeSubquery_RegisteredUsers } } publisher { pretty_name \#curriculum.Publisher\# callbacks { + curriculum.Role_DefaultAssignees_Publisher workflow.Role_PickList_CurrentAssignees workflow.Role_AssigneeSubquery_RegisteredUsers } @@ -350,6 +325,7 @@ pretty_past_tense \#curriculum.Edited\# new_state edited allowed_roles { author editor publisher } + assigned_states { authored } privileges { write } always_enabled_p t edit_fields { @@ -376,7 +352,7 @@ pretty_name \#curriculum.Publish\# pretty_past_tense \#curriculum.Published\# assigned_role publisher - enabled_states { authored edited archived } + enabled_states { authored rejected archived } assigned_states { edited } new_state published privileges { admin } @@ -410,7 +386,6 @@ edit_fields { role_editor role_publisher - owner_id comment } } @@ -497,25 +472,65 @@ #### # -# Curriculum owner. +# Curriculum Default Editor. # #### +ad_proc -private curriculum::default_editor::pretty_name {} { + return "[_ curriculum.Editor]" +} -ad_proc -private curriculum::owner::pretty_name {} { - return "[_ curriculum.Curriculum_owner]" + +ad_proc -private curriculum::default_editor::get_assignees { + case_id + object_id + role_id +} { + set package_id [curriculum::conn package_id] + return [db_string select_default_editor {*SQL*} -default {}] } -ad_proc -private curriculum::owner::get_assignees { +#### +# +# Curriculum Default Publisher. +# +#### + +ad_proc -private curriculum::default_publisher::pretty_name {} { + return "[_ curriculum.Publisher]" +} + + +ad_proc -private curriculum::default_publisher::get_assignees { case_id object_id role_id } { - return [db_string select_curriculum_owner {*SQL*} -default {}] + set package_id [curriculum::conn package_id] + return [db_string select_default_publisher {*SQL*} -default {}] } +ad_proc -private curriculum::users_get_options { + -package_id +} { + if { ![info exists package_id] } { + set package_id [conn package_id] + } + + set user_id [ad_conn user_id] + + # This picks out users who are already assigned as editors or publishers in this curriculum instance. + set users_list [db_list_of_lists users {*SQL*}] + + set users_list [concat { { "Unassigned" "" } } $users_list] + lappend users_list { "Search..." ":search:" } + + return $users_list +} + + #### # # Flush element cache (action side-effect). @@ -555,31 +570,31 @@ case_id object_id } { - + curriculum::get -curriculum_id $object_id -array curriculum - + set url "[ad_url][apm_package_url_from_id $curriculum(package_id)]curriculum-ave?[export_vars { { curriculum_id $curriculum(curriculum_id) } }]" - + set notification_subject_tag "[_ curriculum.Curriculum_1]" - + set one_line "$curriculum(name)" # Build up data structures with the form labels and values # (Note, this is something that the metadata system should be able to do for us) - + array set label [list \ name "[_ curriculum.Name]" \ status "[_ curriculum.Status]"] - + array set value [list \ name "$curriculum(name)" \ status "$curriculum(pretty_state)"] - + set fields { name status } - + # Remove fields that should be hidden in this state foreach field $curriculum(hide_fields) { set index [lsearch -exact $fields $field] @@ -593,7 +608,7 @@ foreach field $fields { lappend details_list $label($field) $value($field) } - + return [list $url $one_line $details_list $notification_subject_tag] } @@ -610,15 +625,15 @@ # Get the type id set type "workflow_case" set type_id [notification::type::get_type_id -short_name $type] - + # Check if subscribed set request_id [notification::request::get_request_id \ -type_id $type_id \ -object_id $curriculum_id \ -user_id $user_id] - + set subscribed_p [expr ![empty_string_p $request_id]] - + if { !$subscribed_p } { set url [notification::display::subscribe_url \ -type $type \ @@ -644,8 +659,8 @@ } { ns_log Notice "[_ curriculum.lt_user_id_doesnt_have_p]" ad_return_forbidden \ - "[_ curriculum.Security_Violation]" \ - "
    + "[_ curriculum.Security_Violation]" \ + "
    [_ curriculum.lt_You_dont_have_permiss]
    " ad_script_abort Index: openacs-4/packages/curriculum/tcl/curriculum-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/tcl/curriculum-procs.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/curriculum/tcl/curriculum-procs.xql 4 Oct 2003 13:10:51 -0000 1.3 +++ openacs-4/packages/curriculum/tcl/curriculum-procs.xql 22 Feb 2004 22:01:57 -0000 1.4 @@ -6,34 +6,56 @@ update cu_curriculums set name = :name, description = :description, - desc_format = :desc_format, - owner_id = :owner_id + desc_format = :desc_format where curriculum_id = :curriculum_id - + - update cu_curriculums - set owner_id = :owner_id + select * + from cu_curriculums where curriculum_id = :curriculum_id - + - select * - from cu_curriculums - where curriculum_id = :curriculum_id + select default_editor + from cu_default_assignees + where package_id = :package_id - + - select owner_id - from cu_curriculums - where curriculum_id = :object_id + select default_publisher + from cu_default_assignees + where package_id = :package_id + + + + select first_names || ' ' || last_name || ' (' || email || ')' as name, + user_id + from cc_users + where user_id in ( + select default_editor + from cu_default_assignees + where package_id = :package_id + + union + + select default_publisher + from cu_default_assignees + where package_id = :package_id + ) + or user_id = :user_id + order by name + + + + Index: openacs-4/packages/curriculum/tcl/misc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/tcl/misc-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/curriculum/tcl/misc-procs.tcl 17 Oct 2003 13:43:30 -0000 1.12 +++ openacs-4/packages/curriculum/tcl/misc-procs.tcl 22 Feb 2004 22:01:57 -0000 1.13 @@ -685,24 +685,39 @@ array set info $list # Is the user visiting this curriculum element url? - if { [string equal $current_url [ns_urldecode $info(url)]] } { + set element_url [ns_urldecode $info(url)] - # See if this element isn't already in user's cookie. - set element_id $info(element_id) + if { ![string equal $current_url $element_url] } { - if { [lsearch -exact $cookie $element_id] == -1 } { - set cookie [curriculum_progress_cookie_value -package_id $package_id $cookie $element_id] - ad_set_cookie -replace t $cookie_name $cookie - - # If the user is logged in, we'll also want to record - # the additional element in the database. - - if { [set user_id [ad_conn user_id]] } { - # Insert, but only if there isn't a row already there. - set curriculum_id $info(curriculum_id) - db_dml map_insert {*SQL*} - } + # We're doing this since given a dir "/foo/", both "/foo/" and "/foo" will take + # us there, and both ways of getting there should result in a checked box. + + # Is the visited URL a "directory"? + if { ![string equal "/" [string range $current_url end end]] } { + continue } - } - } + + if { ![string equal $element_url [string range $current_url 0 end-1]] } { + continue + } + } + + + # See if this element isn't already in user's cookie. + set element_id $info(element_id) + + if { [lsearch -exact $cookie $element_id] == -1 } { + set cookie [curriculum_progress_cookie_value -package_id $package_id $cookie $element_id] + ad_set_cookie -replace t $cookie_name $cookie + + # If the user is logged in, we'll also want to record + # the additional element in the database. + + if { [set user_id [ad_conn user_id]] } { + # Insert, but only if there isn't a row already there. + set curriculum_id $info(curriculum_id) + db_dml map_insert {*SQL*} + } + } + } } Index: openacs-4/packages/curriculum/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/www/index.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/curriculum/www/index.adp 5 Sep 2003 09:32:15 -0000 1.2 +++ openacs-4/packages/curriculum/www/index.adp 22 Feb 2004 22:01:57 -0000 1.3 @@ -4,7 +4,7 @@

    - #curriculum.lt_Administer_Curriculum# + #curriculum.lt_Administer_Curriculum#

    @elements.curriculum_name;noquote@ @@ -38,19 +34,18 @@ - #curriculum.Retake# + #curriculum.Retake# - #curriculum.Resume# + #curriculum.Resume# #curriculum.Completed##curriculum.Ongoing# - #curriculum.Reset# - | - + #curriculum.Reset# + #curriculum.Remove##curriculum.Drop# @@ -59,7 +54,7 @@ #curriculum.Completed##curriculum.Ongoing# - #curriculum.Reset# + #curriculum.Reset#
    - + - #curriculum.Revisit# + #curriculum.Revisit# #curriculum.Unvisited# - + - #curriculum.Visit# + #curriculum.Visit#