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.34 -r1.35 --- openacs-4/packages/curriculum-central/catalog/curriculum-central.en_US.ISO-8859-1.xml 25 Jan 2006 03:20:27 -0000 1.34 +++ openacs-4/packages/curriculum-central/catalog/curriculum-central.en_US.ISO-8859-1.xml 25 Jan 2006 12:25:51 -0000 1.35 @@ -2,6 +2,12 @@ UoS + Stream mapping has been deleted. + Core + Recommended + Elective + Select the relationship that this Unit of Study has with the Degree Stream. Choose from either Core, Recommended or Elective. + Core, Recommended or Elective UoS Units of Study Not Offered in any Years Status: Modified Status: Published Index: openacs-4/packages/curriculum-central/sql/postgresql/stream-uos-map-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/sql/postgresql/stream-uos-map-create.sql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/curriculum-central/sql/postgresql/stream-uos-map-create.sql 23 Jan 2006 10:38:47 -0000 1.2 +++ openacs-4/packages/curriculum-central/sql/postgresql/stream-uos-map-create.sql 25 Jan 2006 12:25:52 -0000 1.3 @@ -56,6 +56,7 @@ on delete cascade, year_id integer, semester_ids varchar(256), + core_id integer, -- core, elective, or recommended prerequisite_ids varchar(256), assumed_knowledge_ids varchar(256), corequisite_ids varchar(256), @@ -75,14 +76,15 @@ ); -select define_function_args('cc_stream_uos_map__new', 'map_id,stream_id,uos_id,year_id,semester_ids,prerequisite_ids,assumed_knowledge_ids,corequisite_ids,prohibition_ids,no_longer_offered_ids,creation_user,creation_ip,context_id,item_subtype;cc_stream_uos_map,content_type;cc_stream_uos_map_rev,object_type,package_id'); +select define_function_args('cc_stream_uos_map__new', 'map_id,stream_id,uos_id,year_id,semester_ids,core_id,prerequisite_ids,assumed_knowledge_ids,corequisite_ids,prohibition_ids,no_longer_offered_ids,creation_user,creation_ip,context_id,item_subtype;cc_stream_uos_map,content_type;cc_stream_uos_map_rev,object_type,package_id'); create function cc_stream_uos_map__new( integer, -- map_id integer, -- stream_id integer, -- uos_id integer, -- year_id varchar, -- semester_ids + integer, -- core_id varchar, -- prerequisite_ids varchar, -- assumed_knowledge_ids varchar, -- corequisite_ids @@ -103,18 +105,19 @@ p_uos_id alias for $3; p_year_id alias for $4; p_semester_ids alias for $5; - p_prerequisite_ids alias for $6; - p_assumed_knowledge_ids alias for $7; - p_corequisite_ids alias for $8; - p_prohibition_ids alias for $9; - p_no_longer_offered_ids alias for $10; - p_creation_user alias for $11; - p_creation_ip alias for $12; - p_context_id alias for $13; - p_item_subtype alias for $14; - p_content_type alias for $15; - p_object_type alias for $16; - p_package_id alias for $17; + p_core_id alias for $6; + p_prerequisite_ids alias for $7; + p_assumed_knowledge_ids alias for $8; + p_corequisite_ids alias for $9; + p_prohibition_ids alias for $10; + p_no_longer_offered_ids alias for $11; + p_creation_user alias for $12; + p_creation_ip alias for $13; + p_context_id alias for $14; + p_item_subtype alias for $15; + p_content_type alias for $16; + p_object_type alias for $17; + p_package_id alias for $18; v_map_id cc_stream_uos_map.map_id%TYPE; v_folder_id integer; @@ -162,6 +165,7 @@ v_map_id, -- map_id p_year_id, -- year_id p_semester_ids, -- semester_ids + p_core_id, -- core_id p_prerequisite_ids, -- requisite_ids p_assumed_knowledge_ids, -- assumed_knowledge_ids p_corequisite_ids, -- corequisite_ids @@ -193,6 +197,8 @@ perform content_item__delete(p_map_id); + delete from cc_stream_uos_map where map_id = p_map_id; + return 0; end; @@ -204,6 +210,7 @@ integer, -- map_id integer, -- year_id varchar, -- semester_ids + integer, -- core_id varchar, -- prerequisite_ids varchar, -- assumed_knowledge_ids varchar, -- corequisite_ids @@ -219,14 +226,15 @@ p_map_id alias for $2; p_year_id alias for $3; p_semester_ids alias for $4; - p_prerequisite_ids alias for $5; - p_assumed_knowledge_ids alias for $6; - p_corequisite_ids alias for $7; - p_prohibition_ids alias for $8; - p_no_longer_offered_ids alias for $9; - p_creation_date alias for $10; - p_creation_user alias for $11; - p_creation_ip alias for $12; + p_core_id alias for $5; + p_prerequisite_ids alias for $6; + p_assumed_knowledge_ids alias for $7; + p_corequisite_ids alias for $8; + p_prohibition_ids alias for $9; + p_no_longer_offered_ids alias for $10; + p_creation_date alias for $11; + p_creation_user alias for $12; + p_creation_ip alias for $13; v_revision_id integer; begin @@ -251,6 +259,7 @@ map_rev_id, year_id, semester_ids, + core_id, prerequisite_ids, assumed_knowledge_ids, corequisite_ids, @@ -260,6 +269,7 @@ v_revision_id, p_year_id, p_semester_ids, + p_core_id, p_prerequisite_ids, p_assumed_knowledge_ids, p_corequisite_ids, Index: openacs-4/packages/curriculum-central/tcl/stream-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/tcl/stream-procs.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/curriculum-central/tcl/stream-procs.tcl 23 Jan 2006 10:38:47 -0000 1.4 +++ openacs-4/packages/curriculum-central/tcl/stream-procs.tcl 25 Jan 2006 12:25:52 -0000 1.5 @@ -186,3 +186,39 @@ return [db_list_of_lists all_stream_uos {}] } + + +ad_proc curriculum_central::stream::stream_uos_relation_get_options {} { + Returns a two-column list of UoS to Stream relations. The list + contains hard coded values for Core, Recommended and Elective, with + values of 0, 1, and 2 respectively. + + @return Returns a two-column list of UoS to Stream relations. +} { + set relations [list] + lappend relations "[_ curriculum-central.core] 0" + lappend relations "[_ curriculum-central.recommended] 1" + lappend relations "[_ curriculum-central.elective] 2" + + return $relations +} + + +ad_proc curriculum_central::stream::stream_uos_relation_name { + {-id:required} +} { + Returns the pretty name for the given relation_id. + + @param id The ID that corresponds to either "Core", "Recommended", + or "Elective". + + @see curriculum_central::stream::stream_uos_relation_get_options +} { + if { $id eq 0 } { + return [_ curriculum-central.core] + } elseif { $id eq 1} { + return [_ curriculum-central.recommended] + } else { + return [_ curriculum-central.elective] + } +} \ No newline at end of file Index: openacs-4/packages/curriculum-central/www/coordinate/stream-map-ae-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/stream-map-ae-postgresql.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/curriculum-central/www/coordinate/stream-map-ae-postgresql.xql 24 Jan 2006 06:31:14 -0000 1.3 +++ openacs-4/packages/curriculum-central/www/coordinate/stream-map-ae-postgresql.xql 25 Jan 2006 12:25:52 -0000 1.4 @@ -11,7 +11,7 @@ - SELECT map.uos_id, rev.year_id, rev.semester_ids, + SELECT map.uos_id, rev.year_id, rev.semester_ids, rev.core_id, rev.prerequisite_ids, rev.assumed_knowledge_ids, rev.corequisite_ids, rev.prohibition_ids, rev.no_longer_offered_ids FROM cc_stream_uos_map map, cc_stream_uos_map_rev rev @@ -27,6 +27,7 @@ :map_id, :year_id, :semester_ids, + :core_id, :prerequisite_ids, :assumed_knowledge_ids, :corequisite_ids, Index: openacs-4/packages/curriculum-central/www/coordinate/stream-map-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/stream-map-ae.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/curriculum-central/www/coordinate/stream-map-ae.tcl 24 Jan 2006 06:31:14 -0000 1.3 +++ openacs-4/packages/curriculum-central/www/coordinate/stream-map-ae.tcl 25 Jan 2006 12:25:52 -0000 1.4 @@ -54,6 +54,11 @@ {html {size 5}} {help_text "[_ curriculum-central.help_select_semesters_that_uos_is_offered]"} } + {core_id:integer(select) + {label "[_ curriculum-central.core_recommended_or_elective]"} + {options "[curriculum_central::stream::stream_uos_relation_get_options]"} + {help_text "[_ curriculum-central.help_select_core_recommended_or_elective]"} + } {prerequisite_ids:text(multiselect),multiple {label "[_ curriculum-central.prerequisites]"} {options $requisite_uos_options} @@ -93,6 +98,7 @@ [list uos_id $uos_id] \ [list year_id $year_id] \ [list semester_ids $semester_ids] \ + [list core_id $core_id] \ [list prerequisite_ids $prerequisite_ids] \ [list assumed_knowledge_ids $assumed_knowledge_ids] \ [list corequisite_ids $corequisite_ids] \ Index: openacs-4/packages/curriculum-central/www/coordinate/stream-map-del-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/stream-map-del-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-central/www/coordinate/stream-map-del-postgresql.xql 25 Jan 2006 12:25:52 -0000 1.1 @@ -0,0 +1,12 @@ + + + + postgresql7.4 + + + + select cc_stream_uos_map__delete(:map_id) + + + + Index: openacs-4/packages/curriculum-central/www/coordinate/stream-map-del.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/stream-map-del.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-central/www/coordinate/stream-map-del.tcl 25 Jan 2006 12:25:52 -0000 1.1 @@ -0,0 +1,24 @@ +ad_page_contract { + This page deletes a stream to uos map. + + @author Nick Carroll (nick.c@rroll.net) + @creation-date 2005-11-15 + @cvs-id $Id: stream-map-del.tcl,v 1.1 2006/01/25 12:25:52 ncarroll Exp $ +} { + stream_id:integer + return_url + map_id:integer +} + +set package_id [ad_conn package_id] +set user_id [ad_conn user_id] + +# Only stream coordinators can develop a stream. +if { ![curriculum_central::staff::stream_coordinator_p $user_id] } { + ad_returnredirect -message [_ curriculum-central.only_stream_coordinators_can_develop_a_stream] index +} + +# Delete map_id. +db_exec_plsql delete_map {} + +ad_returnredirect -message [_ curriculum-central.stream_mapping_has_been_deleted] [export_vars -base stream-view {stream_id}] Index: openacs-4/packages/curriculum-central/www/coordinate/stream-view-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/stream-view-postgresql.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/curriculum-central/www/coordinate/stream-view-postgresql.xql 25 Jan 2006 03:20:28 -0000 1.3 +++ openacs-4/packages/curriculum-central/www/coordinate/stream-view-postgresql.xql 25 Jan 2006 12:25:52 -0000 1.4 @@ -6,8 +6,8 @@ SELECT map.map_id, uos.uos_code, uos.uos_name, uos.uos_id, - rev.year_id, y.name, rev.semester_ids, map.live_revision_id, - map.latest_revision_id + rev.year_id, y.name, rev.semester_ids, rev.core_id, + map.live_revision_id, map.latest_revision_id FROM cc_uos uos, cc_stream_uos_map map, cc_stream_uos_map_rev rev, cc_year y WHERE uos.uos_id = map.uos_id Index: openacs-4/packages/curriculum-central/www/coordinate/stream-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/stream-view.adp,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/curriculum-central/www/coordinate/stream-view.adp 25 Jan 2006 03:20:28 -0000 1.5 +++ openacs-4/packages/curriculum-central/www/coordinate/stream-view.adp 25 Jan 2006 12:25:52 -0000 1.6 @@ -30,7 +30,7 @@
  • @stream.semester_name@
    • -
    • #curriculum-central.edit#@stream.uos_code@ @stream.uos_name@
    • +
    • | @stream.uos_code@ @stream.uos_name@ (@stream.core_or_not@)
    Index: openacs-4/packages/curriculum-central/www/coordinate/stream-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/coordinate/stream-view.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/curriculum-central/www/coordinate/stream-view.tcl 25 Jan 2006 03:20:28 -0000 1.4 +++ openacs-4/packages/curriculum-central/www/coordinate/stream-view.tcl 25 Jan 2006 12:25:52 -0000 1.5 @@ -22,14 +22,11 @@ ad_returnredirect -message [_ curriculum-central.only_stream_coordinators_can_develop_a_stream] index } -# Get stream years. -# Get semesters in a year. -# Get mapped revisions - set units_of_study [db_list_of_lists units_of_study {}] template::multirow create stream map_id year_id year_name \ - semester_id semester_name uos_id uos_code uos_name group edit_url + semester_id semester_name core_or_not uos_id uos_code uos_name \ + group edit_url delete_url # Set the modified state to 0 by default. This means the stream # overview has been published. The state will be toggled below when @@ -45,9 +42,13 @@ set year_id [lindex $uos 4] set year_name [lindex $uos 5] set semester_ids [lindex $uos 6] - set live_revision_id [lindex $uos 7] - set latest_revision_id [lindex $uos 8] + set core_id [lindex $uos 7] + set live_revision_id [lindex $uos 8] + set latest_revision_id [lindex $uos 9] + set core_or_not [curriculum_central::stream::stream_uos_relation_name \ + -id $core_id] + # If there is no live revision or that the live revision and # latest revision IDs are different, then set modified flag to 1. if { $live_revision_id eq "" || \ @@ -69,10 +70,12 @@ set return_url [export_vars -base stream-view {stream_id}] set edit_url [export_vars -base stream-map-ae \ {stream_id uos_id map_id return_url}] + set delete_url [export_vars -base stream-map-del \ + {stream_id map_id return_url}] template::multirow append stream $map_id $year_id $year_name \ - $semester_id $semester_name $uos_id $uos_code $uos_name \ - $group $edit_url + $semester_id $semester_name $core_or_not $uos_id $uos_code \ + $uos_name $group $edit_url $delete_url } } Index: openacs-4/packages/curriculum-central/www/resources/curriculum-central.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/resources/curriculum-central.css,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/curriculum-central/www/resources/curriculum-central.css 25 Jan 2006 03:20:28 -0000 1.5 +++ openacs-4/packages/curriculum-central/www/resources/curriculum-central.css 25 Jan 2006 12:25:52 -0000 1.6 @@ -164,13 +164,17 @@ margin-bottom: 5px; } -#cc-stream-container ul ul ul li a { +#cc-stream-container ul ul ul li img { vertical-align: bottom; border: 0; text-decoration: none; - margin-right: 4em; + margin-right: 3px; + margin-left: 3px; } +#cc-stream-container ul ul ul li span { + margin-left: 3em; +} /* UoS no longer offered. Used in stream-view. */ #cc-stream-container h2 {