Index: openacs-4/packages/curriculum-central/lib/grades-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/lib/grades-postgresql.xql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/lib/grades-postgresql.xql	16 Jun 2006 11:57:19 -0000	1.1
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+
+<queryset>
+   <rdbms><type>postgresql</type><version>7.4</version></rdbms>
+
+   <fullquery name="live_grades">
+     <querytext>
+       SELECT g.grade_set_id, g.live_revision_id
+           FROM cc_uos u, cc_uos_revisions r, cr_items i, cc_uos_grade_set g
+	   WHERE u.uos_id = :uos_id
+	   AND i.item_id = u.uos_id
+	   AND r.uos_revision_id = i.live_revision
+	   AND g.parent_uos_id = :uos_id
+     </querytext>
+   </fullquery>
+
+   <fullquery name="get_grades">
+     <querytext>
+       SELECT t.type_id, grade_rev.description
+       FROM cc_uos_grade_type t LEFT OUTER JOIN
+           (SELECT g.grade_type_id, g.description
+	       FROM cc_uos_grade_map map, cc_uos_grade g
+	       WHERE map.revision_id = :live_revision_id
+	       AND map.grade_id = g.grade_id) AS grade_rev
+       ON (t.type_id = grade_rev.grade_type_id)
+       ORDER BY t.upper_bound DESC
+     </querytext>
+   </fullquery>
+
+</queryset>
Index: openacs-4/packages/curriculum-central/lib/grades.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/lib/grades.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/lib/grades.adp	16 Jun 2006 11:57:19 -0000	1.1
@@ -0,0 +1,13 @@
+<tr>
+  <td class="label">#curriculum-central.grade_descriptors#</td>
+  <td class="value">
+    <table>
+      <multiple name="grades">
+      <tr>
+        <td class="label">@grades.label;noquote@</td>
+        <td class="value">@grades.description;noquote@</td>
+      </tr>
+      </multiple>
+    </table>
+  </td>
+</tr>
Index: openacs-4/packages/curriculum-central/lib/grades.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/lib/grades.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/lib/grades.tcl	16 Jun 2006 11:57:19 -0000	1.1
@@ -0,0 +1,22 @@
+ad_page_contract {
+
+    @author Nick Carroll (nick.c@rroll.net)
+    @creation-date 2006-06-01
+    @cvs-id $Id: grades.tcl,v 1.1 2006/06/16 11:57:19 ncarroll Exp $
+} {
+    uos_id:integer,notnull
+}
+
+set package_id [ad_conn package_id]
+
+# Get live Grade Descritors revision ID.
+set live_revision_id ""
+db_0or1row live_grades {}
+db_multirow -extend { label } grades get_grades {} {
+    set label [curriculum_central::uos::get_grade_descriptor_pretty_name -type_id $type_id]
+
+    set description [template::util::richtext::get_property \
+			 html_value $description]
+}
+
+ad_return_template
Index: openacs-4/packages/curriculum-central/lib/graduate-attributes-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/lib/graduate-attributes-postgresql.xql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/lib/graduate-attributes-postgresql.xql	16 Jun 2006 11:57:19 -0000	1.1
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+
+<queryset>
+   <rdbms><type>postgresql</type><version>7.4</version></rdbms>
+
+   <fullquery name="live_ga">
+     <querytext>
+       SELECT s.gradattr_set_id, s.live_revision_id
+           FROM cc_uos u, cc_uos_revisions r, cr_items i, cc_uos_gradattr_set s
+           WHERE u.uos_id = :uos_id
+           AND i.item_id = u.uos_id
+           AND r.uos_revision_id = i.live_revision
+           AND s.parent_uos_id = :uos_id
+     </querytext>
+   </fullquery>
+
+   <fullquery name="get_attributes">
+     <querytext>
+       SELECT g.gradattr_id, n.name, g.description, g.level
+       FROM cc_uos_gradattr g, acs_objects o, cc_uos_gradattr_map m,
+           cc_uos_gradattr_name n
+        WHERE o.package_id = :package_id
+	   AND g.gradattr_id = o.object_id
+	   AND m.revision_id = :live_revision_id
+	   AND g.gradattr_id = m.gradattr_id
+	   AND n.name_id = g.name_id
+	   ORDER BY n.name
+     </querytext>
+   </fullquery>
+
+</queryset>
Index: openacs-4/packages/curriculum-central/lib/graduate-attributes.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/lib/graduate-attributes.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/lib/graduate-attributes.adp	16 Jun 2006 11:57:19 -0000	1.1
@@ -0,0 +1,14 @@
+<tr>
+  <td class="label">#curriculum-central.graduate_attributes#</td>
+  <td class="value">
+    <table>
+      <multiple name="methods">
+      <tr>
+        <td class="label">@methods.name;noquote@</td>
+        <td class="value">@methods.level;noquote@</td>
+        <td class="value">@methods.description;noquote@</td>
+      </tr>
+      </multiple>
+    </table>
+  </td>
+</tr>
Index: openacs-4/packages/curriculum-central/lib/graduate-attributes.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/lib/graduate-attributes.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/lib/graduate-attributes.tcl	16 Jun 2006 11:57:19 -0000	1.1
@@ -0,0 +1,21 @@
+ad_page_contract {
+
+
+    @author Nick Carroll (nick.c@rroll.net)
+    @creation-date 2006-06-01
+    @cvs-id $Id: graduate-attributes.tcl,v 1.1 2006/06/16 11:57:19 ncarroll Exp $
+} {
+    uos_id:integer,notnull
+}
+
+set package_id [ad_conn package_id]
+
+# Get live GA revision ID.
+set live_revision_id ""
+db_0or1row live_ga {}
+db_multirow methods get_attributes {} {
+    set level \
+	[curriculum_central::uos::get_graduate_attribute_level_name $level]
+}
+
+ad_return_template
Index: openacs-4/packages/curriculum-central/lib/schedule-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/lib/schedule-postgresql.xql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/lib/schedule-postgresql.xql	16 Jun 2006 11:57:19 -0000	1.1
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+
+<queryset>
+   <rdbms><type>postgresql</type><version>7.4</version></rdbms>
+
+   <fullquery name="live_schedule">
+     <querytext>
+       SELECT s.schedule_set_id, s.live_revision_id
+           FROM cc_uos u, cc_uos_revisions r, cr_items i, cc_uos_schedule_set s
+	   WHERE u.uos_id = :uos_id
+	   AND i.item_id = u.uos_id
+	   AND r.uos_revision_id = i.live_revision
+	   AND s.parent_uos_id = :uos_id
+     </querytext>
+   </fullquery>
+
+   <fullquery name="get_schedule">
+     <querytext>
+       SELECT w.week_id, rev.course_content, rev.assessment_ids
+       FROM cc_uos_schedule_week w LEFT OUTER JOIN
+           (SELECT s.week_id, s.course_content, s.assessment_ids
+	       FROM cc_uos_schedule_map map, cc_uos_schedule s
+	       WHERE map.revision_id = :live_revision_id
+	       AND map.schedule_id = s.schedule_id) AS rev
+       ON (w.week_id = rev.week_id)
+       ORDER BY w.week_id ASC
+     </querytext>
+   </fullquery>
+
+   <fullquery name="assess_name">
+     <querytext>
+       SELECT name FROM cc_uos_assess_method WHERE method_id = :assess_id
+     </querytext>
+   </fullquery>
+
+</queryset>
Index: openacs-4/packages/curriculum-central/lib/schedule.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/lib/schedule.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/lib/schedule.adp	16 Jun 2006 11:57:19 -0000	1.1
@@ -0,0 +1,21 @@
+<tr>
+  <td class="label">#curriculum-central.schedule#</td>
+  <td class="value">
+    <table>
+      <multiple name="schedule">
+      <tr>
+        <td class="label">@schedule.content_label;noquote@</td>
+        <td class="value">@schedule.course_content;noquote@</td>
+      </tr>
+
+      <if @schedule.assessments@ ne "">
+      <tr>
+        <td class="label">@schedule.assess_label;noquote@</td>
+        <td class="value">@schedule.assessments;noquote@</td>
+      </tr>
+      </if>
+      <tr><td></td></tr>
+      </multiple>
+    </table>
+  </td>
+</tr>
Index: openacs-4/packages/curriculum-central/lib/schedule.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/lib/schedule.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/lib/schedule.tcl	16 Jun 2006 11:57:19 -0000	1.1
@@ -0,0 +1,32 @@
+ad_page_contract {
+
+    @author Nick Carroll (nick.c@rroll.net)
+    @creation-date 2006-06-01
+    @cvs-id $Id: schedule.tcl,v 1.1 2006/06/16 11:57:19 ncarroll Exp $
+} {
+    uos_id:integer,notnull
+}
+
+set package_id [ad_conn package_id]
+
+# Get live Schedule revision ID.
+set live_revision_id ""
+db_0or1row live_schedule {}
+db_multirow -extend { content_label assess_label assessments } schedule get_schedule {} {
+    set content_label "[curriculum_central::uos::get_schedule_pretty_name -week_id $week_id] [_ curriculum-central.course_content]"
+
+    set course_content [template::util::richtext::get_property \
+			    html_value $course_content]
+
+    set assess_label "[curriculum_central::uos::get_schedule_pretty_name -week_id $week_id] [_ curriculum-central.assessment]"
+
+    set assess_list [list]
+    if { $assessment_ids != 0} {
+	foreach assess_id $assessment_ids {
+	    lappend assess_list [db_string assess_name {} -default ""]
+	}
+    }
+    set assessments [join $assess_list ,]
+}
+
+ad_return_template
Index: openacs-4/packages/curriculum-central/lib/textbooks-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/lib/textbooks-postgresql.xql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/lib/textbooks-postgresql.xql	16 Jun 2006 11:57:19 -0000	1.1
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+
+<queryset>
+   <rdbms><type>postgresql</type><version>7.4</version></rdbms>
+
+   <fullquery name="live_textbooks">
+     <querytext>
+       SELECT s.textbook_set_id, s.live_revision_id
+           FROM cc_uos u, cc_uos_revisions r, cr_items i, cc_uos_textbook_set s
+           WHERE u.uos_id = :uos_id
+           AND i.item_id = u.uos_id
+           AND r.uos_revision_id = i.live_revision
+           AND s.parent_uos_id = :uos_id
+     </querytext>
+   </fullquery>
+
+   <fullquery name="get_textbooks">
+     <querytext>
+       SELECT t.textbook_id, t.title, t.author, t.publisher, t.isbn
+       FROM cc_uos_textbook t, acs_objects o, cc_uos_textbook_map m
+       WHERE o.package_id = :package_id
+	   AND t.textbook_id = o.object_id
+	   AND m.revision_id = :live_revision_id
+	   AND t.textbook_id = m.textbook_id
+	   ORDER BY t.title
+     </querytext>
+   </fullquery>
+
+</queryset>
Index: openacs-4/packages/curriculum-central/lib/textbooks.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/lib/textbooks.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/lib/textbooks.adp	16 Jun 2006 11:57:19 -0000	1.1
@@ -0,0 +1,15 @@
+<tr>
+  <td class="label">#curriculum-central.textbooks#</td>
+  <td class="value">
+    <table>
+      <multiple name="textbooks">
+      <tr>
+        <td class="label">@textbooks.title;noquote@</td>
+        <td class="value">#curriculum-central.by# @textbooks.author;noquote@</td>
+        <td class="value">@textbooks.publisher;noquote@</td>
+        <td class="value">#curriculum-central.isbn#: @textbooks.isbn;noquote@</td>
+      </tr>
+      </multiple>
+    </table>
+  </td>
+</tr>
Index: openacs-4/packages/curriculum-central/lib/textbooks.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/lib/textbooks.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/lib/textbooks.tcl	16 Jun 2006 11:57:19 -0000	1.1
@@ -0,0 +1,17 @@
+ad_page_contract {
+
+    @author Nick Carroll (nick.c@rroll.net)
+    @creation-date 2006-06-01
+    @cvs-id $Id: textbooks.tcl,v 1.1 2006/06/16 11:57:19 ncarroll Exp $
+} {
+    uos_id:integer,notnull
+}
+
+set package_id [ad_conn package_id]
+
+# Get live Textbooks revision ID.
+set live_revision_id ""
+db_0or1row live_textbooks {}
+db_multirow textbooks get_textbooks {}
+
+ad_return_template
Index: openacs-4/packages/curriculum-central/lib/tl-methods-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/lib/tl-methods-postgresql.xql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/lib/tl-methods-postgresql.xql	16 Jun 2006 11:57:19 -0000	1.1
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+
+<queryset>
+   <rdbms><type>postgresql</type><version>7.4</version></rdbms>
+
+   <fullquery name="live_tl">
+     <querytext>
+       SELECT t.tl_id, t.live_revision_id AS tl_live_rev_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.live_revision
+           AND t.parent_uos_id = :uos_id
+     </querytext>
+   </fullquery>
+
+   <fullquery name="get_methods">
+     <querytext>
+       SELECT m.method_id, n.name, m.description
+       FROM cc_uos_tl_method m, acs_objects o, cc_uos_tl_method_map t,
+           cc_uos_tl_name n
+        WHERE o.package_id = :package_id
+	   AND m.method_id = o.object_id
+	   AND t.tl_revision_id = :tl_live_rev_id
+	   AND m.method_id = t.method_id
+	   AND n.name_id = m.name_id
+	   ORDER BY n.name
+     </querytext>
+   </fullquery>
+
+</queryset>
Index: openacs-4/packages/curriculum-central/lib/tl-methods.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/lib/tl-methods.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/lib/tl-methods.adp	16 Jun 2006 11:57:19 -0000	1.1
@@ -0,0 +1,13 @@
+<tr>
+  <td class="label">#curriculum-central.teaching_and_learning_approach#</td>
+  <td class="value">
+    <table>
+      <multiple name="methods">
+      <tr>
+        <td class="label">@methods.name;noquote@</td>
+        <td class="value">@methods.description;noquote@</td>
+      </tr>
+      </multiple>
+    </table>
+  </td>
+</tr>
Index: openacs-4/packages/curriculum-central/lib/tl-methods.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/lib/tl-methods.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/lib/tl-methods.tcl	16 Jun 2006 11:57:19 -0000	1.1
@@ -0,0 +1,17 @@
+ad_page_contract {
+
+    @author Nick Carroll (nick.c@rroll.net)
+    @creation-date 2005-11-20
+    @cvs-id $Id: tl-methods.tcl,v 1.1 2006/06/16 11:57:19 ncarroll Exp $
+} {
+    uos_id:integer
+}
+
+set package_id [ad_conn package_id]
+
+# Get live TL revision ID.
+set latest_revision_id ""
+db_0or1row live_tl {}
+db_multirow methods get_methods {}
+
+ad_return_template