Index: openacs-4/packages/curriculum-central/curriculum-central.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/curriculum-central.info,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/curriculum-central/curriculum-central.info 24 Dec 2005 08:33:27 -0000 1.3 +++ openacs-4/packages/curriculum-central/curriculum-central.info 3 Jan 2006 03:23:27 -0000 1.4 @@ -7,14 +7,14 @@ f f - + Nick Carroll An application for managing the subjects comprising a course of study in a School or University. WEG Curriculum Central is an application for managing subjects comprising a course of study in a School or University. The application will allow academic staff to collaborate on course syllabus and rubrics, which can then be conveyed to students using course maps. 0 - + Index: openacs-4/packages/curriculum-central/catalog/curriculum-central.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/catalog/curriculum-central.en_US.ISO-8859-1.xml,v diff -u -N -r1.16 -r1.17 --- openacs-4/packages/curriculum-central/catalog/curriculum-central.en_US.ISO-8859-1.xml 21 Dec 2005 05:20:14 -0000 1.16 +++ openacs-4/packages/curriculum-central/catalog/curriculum-central.en_US.ISO-8859-1.xml 3 Jan 2006 03:23:27 -0000 1.17 @@ -2,7 +2,36 @@ UoS + View Details + Add T&L Approach + Edit T&L Approach + Add T&L approach to list + Add T&L Approaches + No T&L approaches have been created. + View list of T&L approaches + Enter the type of Teaching & Learning approach. Eg. Lecture, Seminar, Tutorial, Online Discussions, etc. + Identifier + Enter an identifier (such as the UoS code, eg. ELEC1000 or something more generic such as GENERAL) to distinguish this Teaching & Learning approach from others. This must be entered to allow for multiple types of lectures or online activities that have the same name but have different descriptions. + History + Description + Enter a description of the T&L approach, and describe the objectives of the approach. + Add T&L Method + Edit T&L Method + Edit T&L + Edited T&L + T&L Arrangements and Requirements + Teaching and Learning Approach + UoS Teaching and Learning + UoS Teaching and Learning Revision + UoS Teaching and Learning Revisions + UoS Detail + UoS Details + UoS Detail Revision + UoS Detail Revisions + Edit Details + Edited Details pending + Relevance Only stream coordinators may create Units of Study. All Pending Units of Study Your Pending Units of Study Index: openacs-4/packages/curriculum-central/sql/postgresql/uos-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/sql/postgresql/uos-create.sql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/curriculum-central/sql/postgresql/uos-create.sql 15 Dec 2005 11:15:05 -0000 1.5 +++ openacs-4/packages/curriculum-central/sql/postgresql/uos-create.sql 3 Jan 2006 03:23:27 -0000 1.6 @@ -72,19 +72,11 @@ constraint cc_uos_rev_uos_name_nn not null, credit_value integer, semester varchar(32), - online_course_content varchar(256), unit_coordinator_id integer constraint cc_uos_rev_coordinator_id_fk references users(user_id) constraint cc_uos_rev_coordinator_id_nn not null, - contact_hours varchar(256), - assessments varchar(512), - core_uos_for varchar(512), - recommended_uos_for varchar(512), - prerequisites varchar(256), - objectives text, - outcomes text, activity_log text, activity_log_format varchar(256) ); @@ -101,7 +93,7 @@ ); -select define_function_args('cc_uos__new', 'uos_id,uos_code,uos_name,unit_coordinator_id,credit_value,semester,online_course_content,contact_hours,assessments,core_uos_for,recommended_uos_for,prerequisites,objectives,outcomes,activity_log,activity_log_format,creation_user,creation_ip,context_id,item_subtype;cc_uos,content_type;cc_uos_revision,object_type,package_id'); +select define_function_args('cc_uos__new', 'uos_id,uos_code,uos_name,unit_coordinator_id,credit_value,semester,activity_log,activity_log_format,creation_user,creation_ip,context_id,item_subtype;cc_uos,content_type;cc_uos_revision,object_type,package_id'); create function cc_uos__new( integer, -- uos_id @@ -110,14 +102,6 @@ integer, -- unit_coordinator_id integer, -- credit_value varchar, -- semester - varchar, -- online_course_content - varchar, -- contact_hours - varchar, -- assessments - varchar, -- core_uos_for - varchar, -- recommended_uos_for - varchar, -- prerequisites - text, -- objectives - text, -- outcomes text, -- activity_log varchar, -- activity_log_format integer, -- creation_user @@ -136,23 +120,15 @@ p_unit_coordinator_id alias for $4; p_credit_value alias for $5; p_semester alias for $6; - p_online_course_content alias for $7; - p_contact_hours alias for $8; - p_assessments alias for $9; - p_core_uos_for alias for $10; - p_recommended_uos_for alias for $11; - p_prerequisites alias for $12; - p_objectives alias for $13; - p_outcomes alias for $14; - p_activity_log alias for $15; - p_activity_log_format alias for $16; - p_creation_user alias for $17; - p_creation_ip alias for $18; - p_context_id alias for $19; - p_item_subtype alias for $20; - p_content_type alias for $21; - p_object_type alias for $22; - p_package_id alias for $23; + p_activity_log alias for $7; + p_activity_log_format alias for $8; + p_creation_user alias for $9; + p_creation_ip alias for $10; + p_context_id alias for $11; + p_item_subtype alias for $12; + p_content_type alias for $13; + p_object_type alias for $14; + p_package_id alias for $15; v_uos_id cc_uos.uos_id%TYPE; v_folder_id integer; @@ -197,15 +173,7 @@ p_uos_name, -- uos_name p_credit_value, -- credit_value p_semester, -- semester - p_online_course_content, -- online_course_content p_unit_coordinator_id, -- unit_coordinator_id - p_contact_hours, -- contact_hours - p_assessments, -- assessments - p_core_uos_for, -- core_uos_for - p_recommended_uos_for, -- recommended_uos_for - p_prerequisites, -- prerequisites - p_objectives, -- objectives - p_outcomes, -- outcomes p_activity_log, -- activity_log p_activity_log_format, -- activity_log_format now(), -- creation_date @@ -278,15 +246,7 @@ varchar, -- uos_name integer, -- credit_value varchar, -- semester - varchar, -- online_course_content integer, -- unit_coordinator_id - varchar, -- contact_hours - varchar, -- assessments - varchar, -- core_uos_for - varchar, -- recommended_uos_for - varchar, -- prerequisites - text, -- objectives - text, -- outcomes text, -- activity_log varchar, -- activity_log_format timestamptz, -- creation_date @@ -301,20 +261,12 @@ p_uos_name alias for $4; p_credit_value alias for $5; p_semester alias for $6; - p_online_course_content alias for $7; - p_unit_coordinator_id alias for $8; - p_contact_hours alias for $9; - p_assessments alias for $10; - p_core_uos_for alias for $11; - p_recommended_uos_for alias for $12; - p_prerequisites alias for $13; - p_objectives alias for $14; - p_outcomes alias for $15; - p_activity_log alias for $16; - p_activity_log_format alias for $17; - p_creation_date alias for $18; - p_creation_user alias for $19; - p_creation_ip alias for $20; + p_unit_coordinator_id alias for $7; + p_activity_log alias for $8; + p_activity_log_format alias for $9; + p_creation_date alias for $10; + p_creation_user alias for $11; + p_creation_ip alias for $12; v_revision_id integer; begin @@ -336,16 +288,26 @@ -- insert into the uos-specific revision table insert into cc_uos_revisions (uos_revision_id, uos_code, uos_name, credit_value, - semester, online_course_content, unit_coordinator_id, - contact_hours, assessments, core_uos_for, recommended_uos_for, - prerequisites, objectives, outcomes, activity_log, activity_log_format) + semester, unit_coordinator_id, activity_log, + activity_log_format) values (v_revision_id, p_uos_code, p_uos_name, p_credit_value, - p_semester, p_online_course_content, p_unit_coordinator_id, - p_contact_hours, p_assessments, p_core_uos_for, - p_recommended_uos_for, p_prerequisites, p_objectives, - p_outcomes, p_activity_log, p_activity_log_format); + p_semester, p_unit_coordinator_id, p_activity_log, + p_activity_log_format); return v_revision_id; end; ' language 'plpgsql'; + + +-- +-- +-- Create other UoS related tables. +-- +-- + +-- UoS Details +\i uos-detail-create.sql + +-- UoS Teaching and Learning +\i uos-tl-create.sql Index: openacs-4/packages/curriculum-central/sql/postgresql/uos-detail-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/sql/postgresql/uos-detail-create.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-central/sql/postgresql/uos-detail-create.sql 3 Jan 2006 03:23:27 -0000 1.1 @@ -0,0 +1,287 @@ +-- +-- packages/curriculum-central/sql/postgresql/uos-detail-create.sql +-- +-- @author Nick Carroll (nick.c@rroll.net) +-- @creation-date 2005-11-16 +-- @cvs-id $Id: uos-detail-create.sql,v 1.1 2006/01/03 03:23:27 ncarroll Exp $ +-- +-- + + +create function inline_0 () +returns integer as' +begin + PERFORM acs_object_type__create_type ( + ''cc_uos_detail'', -- object_type + ''#curriculum-central.uos_detail#'', -- pretty_name + ''#curriculum-central.uos_details#'', -- pretty_plural + ''acs_object'', -- supertype + ''cc_uos_detail'', -- table_name + ''detail_id'', -- id_column + null, -- package_name + ''f'', -- abstract_p + null, -- type_extension_table + null -- name_method + ); + + return 0; +end;' language 'plpgsql'; + +select inline_0 (); +drop function inline_0 (); + + +-- Register UoS detail as a child type of Uos. +select content_type__register_child_type ( + 'cc_uos', -- parent_type + 'cc_uos_detail', -- child_type + 'generic', -- relation_tag + 0, -- min_n + null -- max_n +); + + +-- content_item subtype +create table cc_uos_detail ( + detail_id integer + constraint cc_uos_detail_detail_id_fk + references cr_items(item_id) + on delete cascade + constraint cc_uos_detail_detail_id_pk + primary key, + parent_uos_id integer, + live_revision_id integer, + latest_revision_id integer +); + + +-- Create the UoS Detail content_revision +create table cc_uos_detail_revisions ( + detail_revision_id integer + constraint cc_uos_detail_rev_pk + primary key + constraint cc_uos_detail_rev_detail_rev_id_fk + references cr_revisions(revision_id) + on delete cascade, + lecturer_id integer + constraint cc_uos_detail_rev_lecturer_id_fk + references users(user_id), + objectives text, + learning_outcomes text, + syllabus text, + relevance text, + online_course_content varchar(256) +); + +-- Create the UoS revision content type. +select content_type__create_type ( + 'cc_uos_detail_revision', + 'content_revision', + '#curriculum-central.uos_detail_revision#', + '#curriculum-central.uos_detail_revisions#', + 'cc_uos_detail_revisions', + 'detail_revision_id', + 'content_revision.revision_name' +); + +-- Register UoS detail revision as a child type of uos_revision. +select content_type__register_child_type ( + 'cc_uos_revision', -- parent_type + 'cc_uos_detail_revision', -- child_type + 'generic', -- relation_tag + 0, -- min_n + null -- max_n +); + +select define_function_args('cc_uos_detail__new', 'detail_id,parent_uos_id,lecturer_id,objectives,learning_outcomes,syllabus,relevance,online_course_content,creation_user,creation_ip,context_id,item_subtype;cc_uos_detail,content_type;cc_uos_detail_revision,object_type,package_id'); + +create function cc_uos_detail__new( + integer, -- detail_id + integer, -- parent_uos_id + integer, -- lecturer_id + text, -- objectives + text, -- learning_outcomes + text, -- syllabus + text, -- relevance + varchar, -- online_course_content + integer, -- creation_user + varchar, -- creation_ip + integer, -- context_id + varchar, -- item_subtype + varchar, -- content_type + varchar, -- object_type + integer -- package_id +) returns integer as' +declare + + p_detail_id alias for $1; + p_parent_uos_id alias for $2; + p_lecturer_id alias for $3; + p_objectives alias for $4; + p_learning_outcomes alias for $5; + p_syllabus alias for $6; + p_relevance alias for $7; + p_online_course_content alias for $8; + p_creation_user alias for $9; + p_creation_ip alias for $10; + p_context_id alias for $11; + p_item_subtype alias for $12; + p_content_type alias for $13; + p_object_type alias for $14; + p_package_id alias for $15; + + v_detail_id cc_uos_detail.detail_id%TYPE; + v_folder_id integer; + v_revision_id integer; + v_name varchar; + v_rel_id integer; +begin + -- get the content folder for this instance + select folder_id into v_folder_id + from cc_curriculum + where curriculum_id = p_package_id; + + -- Create a unique name + v_name := ''uos_detail_for_'' || p_parent_uos_id; + + -- create the content item + v_detail_id := content_item__new ( + v_name, -- name + v_folder_Id, -- parent_id + p_detail_id, -- item_id + null, -- locale + now(), -- creation_date + p_creation_user, -- creation_user + v_folder_id, -- context_id + p_creation_ip, -- creation_ip + p_item_subtype, -- item_subtype + p_content_type, -- content_type + null, -- title + null, -- description + null, -- mime_type + null, -- nls_language + null, -- data + p_package_id + ); + + -- create the initial revision + v_revision_id := cc_uos_detail_revision__new ( + null, -- detail_revision_id + v_detail_id, -- detail_id + p_lecturer_id, -- lecturer_id + p_objectives, -- objectives + p_learning_outcomes, -- learning_outcomes + p_syllabus, -- syllabus + p_relevance, -- relevance + p_online_course_content, -- online_course_content + now(), -- creation_date + p_creation_user, -- creation_user + p_creation_ip -- creation_ip + ); + + -- create the item type row + insert into cc_uos_detail (detail_id, parent_uos_id, + latest_revision_id) + VALUES (v_detail_id, p_parent_uos_id, v_revision_id); + + + -- associate the UoS detail with the parent UoS + v_rel_id := acs_object__new( + NULL, + ''cr_item_child_rel'', + current_timestamp, + p_creation_user, + p_creation_ip, + p_package_id + ); + + insert into cr_child_rels ( + rel_id, parent_id, child_id, relation_tag + ) values ( + v_rel_id, p_parent_uos_id, v_detail_id, ''cc_uos_detail'' + ); + + return v_detail_id; + +end; +' language plpgsql; + + +select define_function_args('cc_uos_detail__delete', 'detail_id'); + +create function cc_uos_detail__delete (integer) +returns integer as ' +declare + p_detail_id alias for $1; +begin + + perform content_item__delete(p_detail_id); + + return 0; + +end; +' language 'plpgsql'; + + +create or replace function cc_uos_detail_revision__new ( + integer, -- detail_revision_id + integer, -- detail_id + integer, -- lecturer_id + text, -- objectives + text, -- learning_outcomes + text, -- syllabus + text, -- relevance + varchar, -- online_course_content + timestamptz, -- creation_date + integer, -- creation_user + varchar -- creation_ip +) returns int +as ' +declare + p_detail_revision_id alias for $1; + p_detail_id alias for $2; + p_lecturer_id alias for $3; + p_objectives alias for $4; + p_learning_outcomes alias for $5; + p_syllabus alias for $6; + p_relevance alias for $7; + p_online_course_content alias for $8; + p_creation_date alias for $9; + p_creation_user alias for $10; + p_creation_ip alias for $11; + + v_revision_id integer; + v_title varchar; +begin + + -- create the initial revision + v_revision_id := content_revision__new ( + ''#curriculum-central.uos_detail#'', -- title + null, -- description + current_timestamp, -- publish_date + null, -- mime_type + null, -- nls_language + null, -- new_data + p_detail_id, -- item_id + p_detail_revision_id, -- revision_id + p_creation_date, -- creation_date + p_creation_user, -- creation_user + p_creation_ip -- creation_ip + ); + + -- Insert into the uos-specific revision table + INSERT into cc_uos_detail_revisions + (detail_revision_id, lecturer_id, objectives, + learning_outcomes, syllabus, relevance, online_course_content) + VALUES + (v_revision_id, p_lecturer_id, p_objectives, + p_learning_outcomes, p_syllabus, p_relevance, + p_online_course_content); + + -- Update the latest revision id in cc_uos_detail + UPDATE cc_uos_detail SET latest_revision_id = v_revision_id + WHERE detail_id = p_detail_id; + + return v_revision_id; +end; +' language 'plpgsql'; Index: openacs-4/packages/curriculum-central/sql/postgresql/uos-tl-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/sql/postgresql/uos-tl-create.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-central/sql/postgresql/uos-tl-create.sql 3 Jan 2006 03:23:27 -0000 1.1 @@ -0,0 +1,447 @@ +-- +-- packages/curriculum-central/sql/postgresql/uos-tl-create.sql +-- +-- @author Nick Carroll (nick.c@rroll.net) +-- @creation-date 2005-12-28 +-- @cvs-id $Id: uos-tl-create.sql,v 1.1 2006/01/03 03:23:27 ncarroll Exp $ +-- +-- + + +create function inline_0 () +returns integer as' +begin + PERFORM acs_object_type__create_type ( + ''cc_uos_tl'', -- object_type + ''#curriculum-central.uos_teaching_and_learning#'', -- pretty_name + ''#curriculum-central.uos_teaching_and_learning#'', -- pretty_plural + ''acs_object'', -- supertype + ''cc_uos_tl'', -- table_name + ''tl_id'', -- id_column + null, -- package_name + ''f'', -- abstract_p + null, -- type_extension_table + null -- name_method + ); + + return 0; +end;' language 'plpgsql'; + +select inline_0 (); +drop function inline_0 (); + + +-- Register UoS teaching and learning as a child type of Uos. +select content_type__register_child_type ( + 'cc_uos', -- parent_type + 'cc_uos_tl', -- child_type + 'generic', -- relation_tag + 0, -- min_n + null -- max_n +); + + +-- content_item subtype +create table cc_uos_tl ( + tl_id integer + constraint cc_uos_tl_tl_id_fk + references cr_items(item_id) + on delete cascade + constraint cc_uos_tl_id_pk + primary key, + parent_uos_id integer, + live_revision_id integer, + latest_revision_id integer +); + + +-- Create the UoS Teaching and Learning content_revision +-- A revision may point to many Teaching and Learning methods in the mapping +-- table below. +create table cc_uos_tl_revisions ( + tl_revision_id integer + constraint cc_uos_tl_rev_pk + primary key + constraint cc_uos_tl_rev_tl_id_fk + references cr_revisions(revision_id) + on delete cascade +); + +-- Create the UoS revision content type. +select content_type__create_type ( + 'cc_uos_tl_revision', + 'content_revision', + '#curriculum-central.uos_teaching_and_learning_revision#', + '#curriculum-central.uos_teaching_and_learning_revisions#', + 'cc_uos_tl_revisions', + 'tl_revision_id', + 'content_revision.revision_name' +); + +-- Register uos_tl_revision as a child type of uos_revision. +select content_type__register_child_type ( + 'cc_uos_revision', -- parent_type + 'cc_uos_tl_revision', -- child_type + 'generic', -- relation_tag + 0, -- min_n + null -- max_n +); + +-- Create Teaching and Learning Method object +create function inline_0 () +returns integer as ' +begin + PERFORM acs_object_type__create_type ( + ''cc_uos_tl_method'', -- object_type + ''#curriculum-central.teaching_and_learning_method#'', -- pretty_name + ''#curriculum-central.teaching_and_learning_method#s'', -- pretty_plural + ''acs_object'', -- supertype + ''cc_uos_tl_method'', -- table_name + ''method_id'', -- id_column + null, -- package_name + ''f'', -- abstract_p + null, -- type_extension_table + ''cc_uos_tl_method__name'' -- name_method + ); + + return 0; +end;' language 'plpgsql'; + +select inline_0 (); +drop function inline_0 (); + +-- Create the table that will be used to store information about a teaching +-- and learning method. Types of methods include Lectures, Tutorials, +-- Online, Lab work, etc. +-- The pretty names will be used for presentation. +-- The short names will be used for select lists in forms. Make sure +-- that short names do not contain any white space. +create table cc_uos_tl_method ( + method_id integer + constraint cc_uos_tl_method_id_fk + references acs_objects(object_id) + constraint cc_uos_tl_method_id_pk + primary key, + name varchar(256), -- eg. Lecture, Tutorial. + identifier varchar(256), -- for form multiselect. + description text -- method description +); + +-- Create Mapping table between revision and teaching and learning method. +-- A revision can refer to many teaching and learning methods, since a +-- Unit of Study can have lectures, tutorials, and online components to +-- the course. +create table cc_uos_tl_method_map ( + tl_revision_id integer + constraint cc_uos_tl_method_map_tl_rev_id_fk + references cc_uos_tl_revisions(tl_revision_id), + method_id integer + constraint cc_uos_tl_method_map_method_id_fk + references cc_uos_tl_method(method_id) +); + + +-- +-- +-- Create the functions for the tl content item and revisions. +-- +-- + +select define_function_args('cc_uos_tl__new', 'tl_id,parent_uos_id,creation_user,creation_ip,context_id,item_subtype;cc_uos_tl,content_type;cc_uos_tl_revision,object_type,package_id'); + +create function cc_uos_tl__new( + integer, -- tl_id + integer, -- parent_uos_id + integer, -- creation_user + varchar, -- creation_ip + integer, -- context_id + varchar, -- item_subtype + varchar, -- content_type + varchar, -- object_type + integer -- package_id +) returns integer as' +declare + + p_tl_id alias for $1; + p_parent_uos_id alias for $2; + p_creation_user alias for $3; + p_creation_ip alias for $4; + p_context_id alias for $5; + p_item_subtype alias for $6; + p_content_type alias for $7; + p_object_type alias for $8; + p_package_id alias for $9; + + v_tl_id cc_uos_tl.tl_id%TYPE; + v_folder_id integer; + v_revision_id integer; + v_name varchar; + v_rel_id integer; +begin + -- get the content folder for this instance + select folder_id into v_folder_id + from cc_curriculum + where curriculum_id = p_package_id; + + -- Create a unique name + -- Can only have one tl per Unit of Study, so append uos_id + -- to "uos_tl_for_". + v_name := ''uos_tl_for_'' || p_parent_uos_id; + + -- create the content item + v_tl_id := content_item__new ( + v_name, -- name + v_folder_Id, -- parent_id + p_tl_id, -- item_id + null, -- locale + now(), -- creation_date + p_creation_user, -- creation_user + v_folder_id, -- context_id + p_creation_ip, -- creation_ip + p_item_subtype, -- item_subtype + p_content_type, -- content_type + null, -- title + null, -- description + null, -- mime_type + null, -- nls_language + null, -- data + p_package_id + ); + + -- create the initial revision + v_revision_id := cc_uos_tl_revision__new ( + null, -- tl_revision_id + v_tl_id, -- tl_id + now(), -- creation_date + p_creation_user, -- creation_user + p_creation_ip -- creation_ip + ); + + -- create the item type row + INSERT INTO cc_uos_tl (tl_id, parent_uos_id, latest_revision_id) + VALUES (v_tl_id, p_parent_uos_id, v_revision_id); + + + -- associate the UoS tl with the parent UoS + v_rel_id := acs_object__new( + NULL, + ''cr_item_child_rel'', + current_timestamp, + p_creation_user, + p_creation_ip, + p_package_id + ); + + INSERT INTO cr_child_rels ( + rel_id, parent_id, child_id, relation_tag + ) VALUES ( + v_rel_id, p_parent_uos_id, v_tl_id, ''cc_uos_tl'' + ); + + return v_tl_id; + +end; +' language plpgsql; + + +select define_function_args('cc_uos_tl__delete', 'tl_id'); + +create function cc_uos_tl__delete (integer) +returns integer as ' +declare + p_tl_id alias for $1; +begin + + perform content_item__delete(p_tl_id); + + return 0; + +end; +' language 'plpgsql'; + + +create or replace function cc_uos_tl_revision__new ( + integer, -- tl_revision_id + integer, -- tl_id + timestamptz, -- creation_date + integer, -- creation_user + varchar -- creation_ip +) returns int +as ' +declare + p_tl_revision_id alias for $1; + p_tl_id alias for $2; + p_creation_date alias for $3; + p_creation_user alias for $4; + p_creation_ip alias for $5; + + v_revision_id integer; + v_title varchar; +begin + + -- create the initial revision + v_revision_id := content_revision__new ( + ''#curriculum-central.uos_teaching_and_learning#'', -- title + null, -- description + current_timestamp, -- publish_date + null, -- mime_type + null, -- nls_language + null, -- new_data + p_tl_id, -- item_id + p_tl_revision_id, -- revision_id + p_creation_date, -- creation_date + p_creation_user, -- creation_user + p_creation_ip -- creation_ip + ); + + -- insert into the uos-specific revision table + INSERT INTO cc_uos_tl_revisions (tl_revision_id) + VALUES (v_revision_id); + + -- Update the latest revision id in cc_uos_tl + UPDATE cc_uos_tl SET latest_revision_id = v_revision_id + WHERE tl_id = p_tl_id; + + return v_revision_id; +end; +' language 'plpgsql'; + + +-- +-- +-- Create the functions for the tl method object. +-- +-- + +select define_function_args('cc_uos_tl_method__new','method_id,name,identifier,description,creation_date;now,creation_user,creation_ip,package_id,context_id'); + +create function cc_uos_tl_method__new ( + integer, -- method_id + varchar, -- name + varchar, -- identifier + text, -- description + timestamptz, -- creation_date + integer, -- creation_user + varchar, -- creation_ip + integer, -- package_id + integer -- context_id +) returns integer as ' +declare + p_method_id alias for $1; -- default null + p_name alias for $2; + p_identifier alias for $3; + p_description alias for $4; + p_creation_date alias for $5; -- default now() + p_creation_user alias for $6; -- default null + p_creation_ip alias for $7; -- default null + p_package_id alias for $8; + p_context_id alias for $9; -- default null + + v_method_id cc_uos_tl_method.method_id%TYPE; + v_title varchar; +begin + v_title := p_name || '' ('' || p_identifier || '')''; + + v_method_id := acs_object__new ( + p_method_id, + ''cc_uos_tl_method'', + p_creation_date, + p_creation_user, + p_creation_ip, + p_context_id, + v_title, + p_package_id + ); + + INSERT INTO cc_uos_tl_method ( + method_id, name, identifier, description + ) + VALUES ( + v_method_id, p_name, p_identifier, p_description + ); + + return v_method_id; + +end;' language 'plpgsql'; + + +select define_function_args('cc_uos_tl_method__del','method_id'); + +create function cc_uos_tl_method__del (integer) +returns integer as ' +declare + p_method_id alias for $1; +begin + DELETE FROM acs_permissions WHERE object_id = p_method_id; + + DELETE FROM cc_uos_tl_method WHERE method_id = p_method_id; + + RAISE NOTICE ''Deleting teaching and learning method...''; + PERFORM acs_object__delete(p_method_id); + + return 0; + +end;' language 'plpgsql'; + + +select define_function_args('cc_uos_tl_method__name','method_id'); + +create function cc_uos_tl_method__name (integer) +returns varchar as ' +declare + p_method_id alias for $1; + + v_method_name cc_uos_tl_method.name%TYPE; +begin + SELECT name INTO v_method_name + FROM cc_uos_tl_method + WHERE method_id = p_method_id; + + return v_method_name; +end; +' language 'plpgsql'; + + +-- +-- Maps a method to a teaching and learning (tl) revision. +-- +create function cc_uos_tl_method__map ( + integer, -- tl_revision_id + integer -- method_id +) returns integer as ' +declare + p_tl_revision_id alias for $1; + p_method_id alias for $2; +begin + + RAISE NOTICE ''Mapping method to a teaching and learning revision...''; + + INSERT INTO cc_uos_tl_method_map (tl_revision_id, method_id) + VALUES (p_tl_revision_id, p_method_id); + + return 0; +end; +' language 'plpgsql'; + + +-- +-- Unmaps a method to a teaching and learning (tl) revision. +-- +create function cc_uos_tl_method__unmap ( + integer, -- tl_revision_id + integer -- method_id +) returns integer as ' +declare + p_tl_revision_id alias for $1; + p_method_id alias for $2; +begin + + RAISE NOTICE ''Deleting mapping between method and tl revision...''; + + DELETE FROM cc_uos_tl_method_map + WHERE tl_revision_id = p_tl_revision_id + AND method_id = p_method_id; + + return 0; +end; +' language 'plpgsql'; Index: openacs-4/packages/curriculum-central/tcl/curriculum-central-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/tcl/curriculum-central-procs.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/curriculum-central/tcl/curriculum-central-procs.tcl 18 Dec 2005 06:23:30 -0000 1.4 +++ openacs-4/packages/curriculum-central/tcl/curriculum-central-procs.tcl 3 Jan 2006 03:23:27 -0000 1.5 @@ -35,6 +35,16 @@ -content_type "cc_uos_revision" \ -include_subtypes "t" + content::folder::register_content_type \ + -folder_id $folder_id \ + -content_type "cc_uos_tl_revision" \ + -include_subtypes "t" + + content::folder::register_content_type \ + -folder_id $folder_id \ + -content_type "cc_uos_detail_revision" \ + -include_subtypes "t" + set keyword_id [content::keyword::new -heading "$instance_name"] # Inserts into cc_curriculum Index: openacs-4/packages/curriculum-central/tcl/uos-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/tcl/uos-procs-postgresql.xql,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/curriculum-central/tcl/uos-procs-postgresql.xql 21 Dec 2005 05:20:15 -0000 1.7 +++ openacs-4/packages/curriculum-central/tcl/uos-procs-postgresql.xql 3 Jan 2006 03:23:27 -0000 1.8 @@ -13,6 +13,39 @@ + + + SELECT d.detail_id, dr.lecturer_id, dr.objectives, + dr.learning_outcomes, dr.syllabus, dr.relevance, + dr.online_course_content + FROM cc_uos u, cc_uos_revisions r, cr_items i, + cc_uos_detail_revisions dr, cc_uos_detail d + WHERE u.uos_id = :uos_id + AND i.item_id = u.uos_id + AND r.uos_revision_id = i.latest_revision + AND d.parent_uos_id = :uos_id + AND dr.detail_revision_id = d.latest_revision_id + + + + + + SELECT t.tl_id, t.latest_revision_id + FROM cc_uos u, cc_uos_revisions r, cr_items i, cc_uos_tl t + WHERE u.uos_id = :uos_id + AND i.item_id = u.uos_id + AND r.uos_revision_id = i.latest_revision + AND t.parent_uos_id = :uos_id + + + + + + SELECT method_id FROM cc_uos_tl_method_map + WHERE tl_revision_id = :latest_revision_id + + + SELECT count(*) @@ -72,15 +105,7 @@ :uos_name, :credit_value, :semester, - :online_course_content, :unit_coordinator_id, - :contact_hours, - :assessments, - :core_uos_for, - :recommended_uos_for, - :prerequisites, - :objectives, - :outcomes, :activity_log, :activity_log_format, now(), @@ -97,19 +122,102 @@ + + + SELECT cc_uos_detail_revision__new ( + null, + :detail_id, + :lecturer_id, + :objectives, + :learning_outcomes, + :syllabus, + :relevance, + :online_course_content, + now(), + :user_id, + :creation_ip + ); + + + + + + SELECT cc_uos_tl_revision__new ( + null, + :tl_id, + now(), + :user_id, + :creation_ip + ); + + + + + + SELECT cc_uos_tl_method__map ( + :revision_id, + :tl_approach_id + ); + + + + + + SELECT m.name || ' (' || m.identifier || ')' AS method_name, + m.method_id + FROM cc_uos_tl_method m, acs_objects o + WHERE o.object_id = m.method_id + AND o.package_id = :package_id + + + SELECT latest_revision FROM cr_items WHERE item_id = :object_id + + + SELECT i.latest_revision AS latest_detail_revision + FROM cr_items i, cr_child_rels c + WHERE c.relation_tag = 'cc_uos_detail' + AND c.parent_id = :object_id + AND i.item_id = c.child_id + + + + + + SELECT i.latest_revision AS latest_tl_revision + FROM cr_items i, cr_child_rels c + WHERE c.relation_tag = 'cc_uos_tl' + AND c.parent_id = :object_id + AND i.item_id = c.child_id + + + UPDATE cc_uos SET live_revision_id = :latest_revision WHERE uos_id = :object_id + + + UPDATE cc_uos_detail SET live_revision_id = :latest_detail_revision + WHERE parent_uos_id = :object_id + + + + + + UPDATE cc_uos_tl SET live_revision_id = :latest_tl_revision + WHERE parent_uos_id = :object_id + + + (select * from cc_users u, cc_staff s where u.user_id = s.staff_id) Index: openacs-4/packages/curriculum-central/tcl/uos-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/tcl/uos-procs.tcl,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/curriculum-central/tcl/uos-procs.tcl 24 Dec 2005 08:33:27 -0000 1.11 +++ openacs-4/packages/curriculum-central/tcl/uos-procs.tcl 3 Jan 2006 03:23:27 -0000 1.12 @@ -97,41 +97,55 @@ privileges { read write } always_enabled_p t } - edit { - pretty_name "#curriculum-central.edit#" - pretty_past_tense "#curriculum-central.edited#" + reassign { + pretty_name "#curriculum-central.reassign#" + pretty_past_tense "#curriculum-central.reassigned#" allowed_roles { stream_coordinator + } + privileges { write } + assigned_states { open } + edit_fields { role_unit_coordinator } + } + edit_details { + pretty_name "#curriculum-central.edit_details#" + pretty_past_tense "#curriculum-central.edited_details#" + allowed_roles { + stream_coordinator unit_coordinator lecturer } privileges { write } assigned_states { open } edit_fields { - contact_hours - assessments - online_course_content + lecturer_id objectives - outcomes + learning_outcomes + syllabus + relevance + online_course_content } } - reassign { - pretty_name "#curriculum-central.reassign#" - pretty_past_tense "#curriculum-central.reassigned#" + edit_tl { + pretty_name "#curriculum-central.edit_tl#" + pretty_past_tense "#curriculum-central.edited_tl#" allowed_roles { stream_coordinator + unit_coordinator + lecturer } privileges { write } - enabled_states { submitted } - assigned_states { open } - edit_fields { role_unit_coordinator } + edit_fields { + tl_approach_ids + } + assigned_states { open } } submit { pretty_name "#curriculum-central.submit#" pretty_past_tense "#curriculum-central.submitted#" assigned_role { unit_coordinator } assigned_states { open } - new_state submitted + new_state { submitted } privileges { write } } close { @@ -265,9 +279,6 @@ -credit_value:required -semester:required -unit_coordinator_id:required - -core_uos_for - -recommended_uos_for - -prerequisites:required -activity_log:required -activity_log_format:required {-user_id ""} @@ -298,9 +309,6 @@ -credit_value $credit_value \ -semester $semester \ -unit_coordinator_id $unit_coordinator_id \ - -core_uos_for $core_uos_for \ - -recommended_uos_for $recommended_uos_for \ - -prerequisites $prerequisites \ -activity_log $activity_log \ -activity_log_format $activity_log_format ] @@ -346,9 +354,6 @@ -credit_value:required -semester:required -unit_coordinator_id:required - -core_uos_for - -recommended_uos_for - -prerequisites:required -activity_log:required -activity_log_format:required {-user_id ""} @@ -368,14 +373,27 @@ [list credit_value $credit_value] \ [list semester $semester] \ [list unit_coordinator_id $unit_coordinator_id] \ - [list core_uos_for $core_uos_for] \ - [list recommended_uos_for $recommended_uos_for] \ - [list prerequisites $prerequisites] \ [list activity_log $activity_log] \ [list activity_log_format $activity_log_format] \ [list object_type "cc_uos"]] \ -package_name "cc_uos" \ "cc_uos"] + + # Initiate cc_uos_detail + set detail_id [package_instantiate_object \ + -var_list [list [list parent_uos_id $uos_id] \ + [list package_id $package_id] \ + [list object_type "cc_uos_detail"]] \ + "cc_uos_detail"] + + # Initiate cc_uos_tl + set tl_id [package_instantiate_object \ + -var_list [list [list parent_uos_id $uos_id] \ + [list package_id $package_id] \ + [list object_type "cc_uos_tl"]] \ + "cc_uos_tl"] + + return $uos_id } @@ -393,12 +411,20 @@ side-effects. @return uos_id The same uos_id passed in, for convenience. + @see curriculum_central::uos::update } { upvar $array row array set assignments [list] + if { $user_id eq "" } { + set user_id [ad_conn user_id] + } + if { $creation_ip eq "" } { + set creation_ip [ad_conn peeraddr] + } + set role_prefix "role_" foreach name [array names row "${role_prefix}*"] { set assignments([string range $name \ @@ -413,6 +439,7 @@ } db_transaction { + # Update the UoS info. curriculum_central::uos::update -uos_id $uos_id \ -user_id $user_id \ @@ -493,6 +520,170 @@ } +ad_proc -public curriculum_central::uos::update_details { + -detail_id:required + {-lecturer_id ""} + {-objectives ""} + {-learning_outcomes ""} + {-syllabus ""} + {-relevance ""} + {-online_course_content ""} + {-user_id ""} + {-creation_ip ""} +} { + Updates the details for a Unit of Study. This update proc creates + a new details revision of the given Unit of Study. + + @param uos_id The ID of the Unit of Study to update. + @param lecturer_id The ID of the selected lecturer. + @param objectives Unit of Study objectives. + @param learning_outcomes Unit of Study learning outcomes. + @param syllabus Unit of Study syllabus. + @param relevance Unit of Study relevance. + @param online_course_content URL of the online course content for the + associated Unit of Study. + @param user_id The ID of the user that updated the Unit of Study. + @param creation_ip The IP of the user that made the update. + + @return revision_id Returns the ID of the newly created revision for + convenience, otherwise the empty string if unsuccessful. +} { + if { $user_id eq "" } { + set user_id [ad_conn user_id] + } + if { $creation_ip eq "" } { + set creation_ip [ad_conn peeraddr] + } + + # Set the default value for revision_id. + set revision_id "" + db_transaction { + set revision_id [db_exec_plsql update_details {}] + } + + return $revision_id +} + + +ad_proc -public curriculum_central::uos::update_tl { + -tl_id:required + -tl_approach_ids + {-user_id ""} + {-creation_ip ""} +} { + Updates the teaching and learning component for a Unit of Study. + This update proc creates a new teaching and learning revision.. + + @param tl_id The ID of the teaching and learning object to update. + @param user_id The ID of the user that updated the Unit of Study. + @param creation_ip The IP of the user that made the update. + + @return revision_id Returns the ID of the newly created revision for + convenience, otherwise the empty string if unsuccessful. +} { + if { $user_id eq "" } { + set user_id [ad_conn user_id] + } + if { $creation_ip eq "" } { + set creation_ip [ad_conn peeraddr] + } + + # Set the default value for revision_id. + set revision_id "" + db_transaction { + set revision_id [db_exec_plsql update_tl {}] + + # Foreach tl_approach_id map to the newly created revision_id + # retrieved above. + foreach tl_approach_id $tl_approach_ids { + ns_log Warning "Map revision_id <$revision_id> to tl_approach_id <$tl_approach_id>" + db_exec_plsql map_tl_to_revision {} + } + } + + return $revision_id +} + + +ad_proc -public curriculum_central::uos::get_details { + {-uos_id:required} + {-array:required} +} { + Get the details fields for a Unit of Study. + + @param uos_id The ID of the Unit of Study for which we return + detail fields for. + @param array A predefined array for returning fields in. Values include + detail_id, lecturer_id, objectives, learning_outcomes, syllabus, + relevance, online_course_content. + + @return Array containing all valid fields for the cc_uos_detail table. +} { + # Select the info into the upvar'ed Tcl array + upvar $array row + + if { ![db_0or1row latest_details {} -column_array row] } { + # Set default values + set row(detail_id) "" + set row(lecturer_id) "" + set row(objectives) "" + set row(learning_outcomes) "" + set row(syllabus) "" + set row(relevance) "" + set row(online_course_content) "" + } +} + + +ad_proc -public curriculum_central::uos::get_tl { + {-uos_id:required} + {-array:required} +} { + Get the teaching and learning fields for a Unit of Study. + + @param uos_id The ID of the Unit of Study for which we return + teaching and learning info for. + @param array A predefined array for returning fields in. Values include + tl_id, tl_approach_ids, latest_revision_id. + + @return Array containing all valid fields for the cc_uos_tl table. +} { + # Select the info into the upvar'ed Tcl array + upvar $array row + + if { ![db_0or1row latest_tl {} -column_array row] } { + # Set default values + set row(tl_id) "" + set row(latest_revision_id) "" + } + + if { $row(latest_revision_id) ne "" } { + set latest_revision_id $row(latest_revision_id) + set row(tl_approach_ids) [db_list latest_tl_method_ids {}] + } else { + set row(tl_approach_ids) "" + } +} + + +ad_proc curriculum_central::uos::tl_method_get_options { + {-package_id ""} +} { + Returns a two-column list of registered teaching and learning methods. + + @return Returns a two-column list of registered teaching and + learning methods. +} { + if { $package_id eq ""} { + set package_id [ad_conn package_id] + } + + set method_list [db_list_of_lists tl_methods {}] + + return $method_list +} + + ##### # # UoS Pending @@ -679,4 +870,14 @@ # Also set the latest revision to the live revision in cc_uos. db_dml set_live_revision {} + + # Do the same for cc_uos_detail + db_1row get_latest_detail_revision {} + content::item::set_live_revision -revision_id $latest_detail_revision + db_dml set_live_detail_revision {} + + # Do the same for cc_uos_tl + db_1row get_latest_tl_revision {} + content::item::set_live_revision -revision_id $latest_tl_revision + db_dml set_live_tl_revision {} } Index: openacs-4/packages/curriculum-central/www/coordinate/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/index.adp,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/curriculum-central/www/coordinate/index.adp 21 Dec 2005 02:54:13 -0000 1.4 +++ openacs-4/packages/curriculum-central/www/coordinate/index.adp 3 Jan 2006 03:23:28 -0000 1.5 @@ -8,6 +8,7 @@
  • #curriculum-central.your_pending_units_of_study# (@num_users_pending@ #curriculum-central.pending#)
  • #curriculum-central.all_pending_units_of_study# (@num_all_pending@ #curriculum-central.pending#)
  • +
  • #curriculum-central.view_list_of_tl_approaches#

    Things To Do

    Index: openacs-4/packages/curriculum-central/www/coordinate/tl-method-ae-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/tl-method-ae-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-central/www/coordinate/tl-method-ae-postgresql.xql 3 Jan 2006 03:23:28 -0000 1.1 @@ -0,0 +1,26 @@ + + + + postgresql7.4 + + + + UPDATE cc_uos_tl_method + SET name = :name, + identifier = :identifier, + description = :description + WHERE method_id = :method_id + + + + + + UPDATE acs_objects + SET modifying_user = :modifying_user, + modifying_ip = :modifying_ip, + package_id = :package_id + WHERE object_id = :method_id + + + + Index: openacs-4/packages/curriculum-central/www/coordinate/tl-method-ae.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/tl-method-ae.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-central/www/coordinate/tl-method-ae.adp 3 Jan 2006 03:23:28 -0000 1.1 @@ -0,0 +1,6 @@ + +@page_title;noquote@ +@context;noquote@ +tl_method.pretty_name + + \ No newline at end of file Index: openacs-4/packages/curriculum-central/www/coordinate/tl-method-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/tl-method-ae.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-central/www/coordinate/tl-method-ae.tcl 3 Jan 2006 03:23:28 -0000 1.1 @@ -0,0 +1,62 @@ +ad_page_contract { + Add/Edit a teaching and learning method. + + @author Nick Carroll (nick.c@rroll.net) + @creation-date 2005-11-20 + @cvs-id $Id: tl-method-ae.tcl,v 1.1 2006/01/03 03:23:28 ncarroll Exp $ +} { + method_id:integer,optional + {return_url "tl-methods"} +} + +auth::require_login + +if { [info exists method_id] } { + set page_title [_ curriculum-central.edit_tl_method] +} else { + set page_title [_ curriculum-central.add_tl_method] +} + +set context [list $page_title] +set package_id [ad_conn package_id] + +ad_form -name tl_method -cancel_url $return_url -form { + {method_id:key(acs_object_id_seq)} + {return_url:text(hidden) {value $return_url}} + {name:text + {html {size 25}} + {label "[_ curriculum-central.name]" } + {help_text "[_ curriculum-central.help_enter_type_of_tl_method]"} + } + {identifier:text + {html {size 25}} + {label "[_ curriculum-central.identifier]" } + {help_text "[_ curriculum-central.help_enter_identifier]"} + } + {description:text(textarea) + {html {cols 40 rows 10}} + {label "[_ curriculum-central.description]" } + {help_text "[_ curriculum-central.help_enter_description]"} + } +} -select_query { + SELECT name, identifier, description + FROM cc_uos_tl_method WHERE method_id = :method_id +} -new_data { + package_instantiate_object \ + -var_list [list [list package_id $package_id] \ + [list object_type cc_uos_tl_method] \ + [list name $name] \ + [list identifier $identifier] \ + [list description $description]] \ + -form_id tl_method cc_uos_tl_method + +} -edit_data { + set modifying_user [ad_conn user_id] + set modifying_ip [ad_conn peeraddr] + + db_dml tl_method_update {} + db_dml object_update {} +} -after_submit { + ad_returnredirect $return_url + ad_script_abort +} Index: openacs-4/packages/curriculum-central/www/coordinate/tl-methods-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/tl-methods-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-central/www/coordinate/tl-methods-postgresql.xql 3 Jan 2006 03:23:28 -0000 1.1 @@ -0,0 +1,16 @@ + + + + postgresql7.4 + + + + SELECT m.method_id, m.name, m.identifier, m.description + FROM cc_uos_tl_method m, acs_objects o + WHERE package_id = :package_id + AND m.method_id = o.object_id + [template::list::orderby_clause -orderby -name "methods"] + + + + Index: openacs-4/packages/curriculum-central/www/coordinate/tl-methods.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/tl-methods.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-central/www/coordinate/tl-methods.adp 3 Jan 2006 03:23:28 -0000 1.1 @@ -0,0 +1,5 @@ + +@page_title;noquote@ +@context;noquote@ + + Index: openacs-4/packages/curriculum-central/www/coordinate/tl-methods.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/tl-methods.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-central/www/coordinate/tl-methods.tcl 3 Jan 2006 03:23:28 -0000 1.1 @@ -0,0 +1,54 @@ +ad_page_contract { + Page for listing Teaching and Learning Approachess. + + @author Nick Carroll (nick.c@rroll.net) + @creation-date 2005-11-15 + @cvs-id $Id: tl-methods.tcl,v 1.1 2006/01/03 03:23:28 ncarroll Exp $ +} { + {orderby "name,asc"} +} + +set page_title "[_ curriculum-central.tl_approaches]" +set context [list [list . [_ curriculum-central.coordinate]] $page_title] +set package_id [ad_conn package_id] + +set elements { + edit { + sub_class narrow + display_template { + + } + link_url_eval {[export_vars -base tl-method-ae { method_id }]} + link_html {title "#curriculum-central.edit_tl_approach#"} + } + name { + label "#curriculum-central.name#" + } + identifier { + label "#curriculum-central.identifier#" + } + description { + label "#curriculum-central.description#" + } + delete { + sub_class narrow + display_template { + + } + } +} + +template::list::create \ + -name methods \ + -actions [list "#curriculum-central.add_tl_approach#" [export_vars -base tl-method-ae {}] "#curriculum-central.add_tl_approach_to_list#"] \ + -multirow methods \ + -no_data "#curriculum-central.no_tl_approaches_created#" \ + -elements $elements \ + -orderby { + name {orderby {lower(name)}} + identifier {orderby {lower(identifier)}} + } + +db_multirow methods get_methods {} + +ad_return_template Index: openacs-4/packages/curriculum-central/www/coordinate/uos-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/uos-add.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/curriculum-central/www/coordinate/uos-add.tcl 19 Dec 2005 11:55:25 -0000 1.5 +++ openacs-4/packages/curriculum-central/www/coordinate/uos-add.tcl 3 Jan 2006 03:23:28 -0000 1.6 @@ -61,18 +61,6 @@ {options [curriculum_central::staff_get_options] } {help_text "[_ curriculum-central.help_select_unit_coordinator]"} } - {core_uos_for:text,optional - {label "#curriculum-central.core_uos_for#"} - {html {size 50}} - } - {recommended_uos_for:text,optional - {label "#curriculum-central.recommended_uos_for#"} - {html {size 50}} - } - {prerequisites:text,optional - {label "#curriculum-central.prerequisites#"} - {html {size 50}} - } {activity_log:richtext(richtext) {label "#curriculum-central.activity_log#"} {html {cols 50 rows 13}} @@ -92,9 +80,6 @@ -credit_value $credit_value \ -semester $semester \ -unit_coordinator_id $unit_coordinator_id \ - -core_uos_for $core_uos_for \ - -recommended_uos_for $recommended_uos_for \ - -prerequisites $prerequisites \ -activity_log [template::util::richtext::get_property contents $activity_log] \ -activity_log_format [template::util::richtext::get_property format $activity_log] Index: openacs-4/packages/curriculum-central/www/coordinate/uos-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/uos-edit.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/curriculum-central/www/coordinate/uos-edit.tcl 24 Dec 2005 08:33:28 -0000 1.4 +++ openacs-4/packages/curriculum-central/www/coordinate/uos-edit.tcl 3 Jan 2006 03:23:28 -0000 1.5 @@ -31,8 +31,7 @@ # Registration required for all actions set action_id "" -if { ![empty_string_p $enabled_action_id] } { - auth::require_login +if { $enabled_action_id ne "" } { workflow::case::enabled_action_get -enabled_action_id $enabled_action_id -array enabled_action set action_id $enabled_action(action_id) } @@ -47,7 +46,8 @@ } } -# Retrieve infor for Unit of Study. + +# Retrieve info for Unit of Study. curriculum_central::uos::get \ -uos_id $uos_id \ -array uos \ @@ -60,7 +60,13 @@ # Create widgets for displaying UoS information that should already # have been entered by the Stream Coordinator when the UoS was # initially created. -ad_form -name uos -cancel_url $return_url -mode display -has_edit 1 -actions $actions -form { +ad_form -name uos -cancel_url $return_url \ + -mode display -has_edit 1 -actions $actions + +# Add UoS Section +template::form::section uos [_ curriculum-central.uos] + +ad_form -extend -name uos -form { {uos_code:text(inform) {label "[_ curriculum-central.uos_code]"} {value $uos(uos_code)} @@ -91,55 +97,86 @@ {value $uos(semester)} {mode display} } - {core_uos_for:text(inform) - {label "[_ curriculum-central.core_uos_for]"} - {value $uos(core_uos_for)} +} + +# Add UoS Details Section +template::form::section uos [_ curriculum-central.uos_details] + +# Retrieve Details info for Unit of Study. +curriculum_central::uos::get_details \ + -uos_id $uos_id \ + -array uos_details + +ad_form -extend -name uos -form { + {detail_id:integer(hidden),optional + {value $uos_details(detail_id)} + } + {lecturer_id:integer(select),optional + {label "[_ curriculum-central.lecturer]"} + {options [curriculum_central::staff_get_options] } + {value $uos_details(lecturer_id)} {mode display} } - {recommended_uos_for:text(inform) - {label "[_ curriculum-central.recommended_uos_for]"} - {value $uos(recommended_uos_for)} + {objectives:text,optional + {label "[_ curriculum-central.aims_and_objectives]"} + {html {size 50}} + {value $uos_details(objectives)} {mode display} } - {prerequisites:text(inform) - {label "[_ curriculum-central.prerequisites]"} - {value $uos(prerequisites)} + {learning_outcomes:text,optional + {label "[_ curriculum-central.learning_outcomes]"} + {html {size 50}} + {value $uos_details(learning_outcomes)} {mode display} } -} - -# Add widgets for fields that the Unit Coordinator must enter data into. -ad_form -extend -name uos -form { - {contact_hours:text - {label "[_ curriculum-central.contact_hours]"} + {syllabus:text,optional + {label "[_ curriculum-central.syllabus]"} {html {size 50}} - {value $uos(contact_hours)} + {value $uos_details(syllabus)} {mode display} } - {assessments:text - {label "[_ curriculum-central.assessments]"} + {relevance:text,optional + {label "[_ curriculum-central.relevance]"} {html {size 50}} - {value $uos(assessments)} + {value $uos_details(relevance)} {mode display} } {online_course_content:text,optional {label "[_ curriculum-central.online_course_content]"} {html {size 50}} - {value $uos(online_course_content)} + {value $uos_details(online_course_content)} {mode display} } - {objectives:text - {label "[_ curriculum-central.aims_and_objectives]"} - {html {size 50}} - {value $uos(objectives)} - {mode display} +} + +# Add teaching and learning section. +template::form::section uos [_ curriculum-central.tl_arrangements_and_requirements] + +# Retrieve teaching and learning info for Unit of Study. +curriculum_central::uos::get_tl \ + -uos_id $uos_id \ + -array uos_tl + +# Add widgets for Teaching and Learning. +ad_form -extend -name uos -form { + {tl_id:integer(hidden),optional + {value $uos_tl(tl_id)} } - {outcomes:text - {label "[_ curriculum-central.learning_outcomes]"} - {html {size 50}} - {value $uos(outcomes)} + {tl_approach_ids:text(multiselect),multiple,optional + {label "[_ curriculum-central.teaching_and_learning_approach]"} + {options [curriculum_central::uos::tl_method_get_options]} + {html {size 5}} + {values $uos_tl(tl_approach_ids)} {mode display} + {after_html "[_ curriculum-central.view_details]"} } +} + +# Add history section +template::form::section uos [_ curriculum-central.history] + +# Add widgets for fields that the Unit Coordinator must enter data into. +ad_form -extend -name uos -form { {activity_log:richtext(richtext) {label "#curriculum-central.activity_log#"} {html {cols 50 rows 13}} @@ -173,7 +210,7 @@ ad_form -extend -name uos -on_submit { array set row [list] - if { ![empty_string_p $enabled_action_id] } { + if { $enabled_action_id ne "" } { foreach field [workflow::action::get_element \ -action_id $action_id -element edit_fields] { set row($field) [element get_value uos $field] @@ -182,6 +219,37 @@ set activity_log [element get_value uos activity_log] + # Retrieve some workflow information + workflow::case::enabled_action_get \ + -enabled_action_id $enabled_action_id \ + -array enabled_action_info + + workflow::action::get \ + -action_id $enabled_action_info(action_id) \ + -array action_info + + # Do edits specific to a workflow action. + # If action is edit_details, then update edit_details. + if { $action_info(short_name) eq "edit_details" } { + + curriculum_central::uos::update_details \ + -detail_id $detail_id \ + -lecturer_id $lecturer_id \ + -objectives $objectives \ + -learning_outcomes $learning_outcomes \ + -syllabus $syllabus \ + -relevance $relevance \ + -online_course_content $online_course_content + + } elseif { $action_info(short_name) eq "edit_tl"} { + ns_log Warning "NC: Update TL..." + + curriculum_central::uos::update_tl \ + -tl_id $tl_id \ + -tl_approach_ids $tl_approach_ids + } + + # Do a general edit update. curriculum_central::uos::edit \ -uos_id $uos(uos_id) \ -enabled_action_id $enabled_action_id \ @@ -209,7 +277,7 @@ -array uos \ -enabled_action_id $enabled_action_id - # Hide elements that should be hidden depending on the bug status + # Hide elements that should be hidden depending on the workflow status foreach element $uos(hide_fields) { element set_properties uos $element -widget hidden }