+@title@
+@context@
+
+
+
+ Administer Curriculum
+
+
+
+
Index: openacs-4/packages/curriculum/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/www/index.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum/www/index.tcl 3 Jun 2003 10:40:53 -0000 1.1
@@ -0,0 +1,22 @@
+ad_page_contract {
+
+ Curriculum index page.
+
+ @author Ola Hansson (ola@polyxena.net)
+ @creation-date 2003-05-31
+ @cvs-id $Id: index.tcl,v 1.1 2003/06/03 10:40:53 olah Exp $
+
+} {
+} -properties {
+ title:onevalue
+ context:onevalue
+ admin_p:onevalue
+}
+
+set title "Curriculum"
+set context {}
+
+# We let admins see the link to the admin page.
+set admin_p [permission::permission_p -object_id [curriculum::conn package_id] -privilege admin]
+
+ad_return_template
Index: openacs-4/packages/curriculum/www/remove-from-bar-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/www/remove-from-bar-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum/www/remove-from-bar-oracle.xql 3 Jun 2003 10:40:53 -0000 1.1
@@ -0,0 +1,20 @@
+
+
+ oracle8.1.6
+
+
+
+ insert into cu_user_curriculum_map
+ (user_id, curriculum_id, package_id)
+ select :user_id,
+ :curriculum_id,
+ :package_id
+ from dual
+ where not exists (select 1
+ from cu_user_curriculum_map
+ where user_id = :user_id
+ and curriculum_id = :curriculum_id)
+
+
+
+
Index: openacs-4/packages/curriculum/www/remove-from-bar-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/www/remove-from-bar-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum/www/remove-from-bar-postgresql.xql 3 Jun 2003 10:40:53 -0000 1.1
@@ -0,0 +1,19 @@
+
+
+ postgresql7.1
+
+
+
+ insert into cu_user_curriculum_map
+ (user_id, curriculum_id, package_id)
+ select :user_id,
+ :curriculum_id,
+ :package_id
+ where not exists (select 1
+ from cu_user_curriculum_map
+ where user_id = :user_id
+ and curriculum_id = :curriculum_id)
+
+
+
+
Index: openacs-4/packages/curriculum/www/remove-from-bar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/www/remove-from-bar.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum/www/remove-from-bar.tcl 3 Jun 2003 10:40:53 -0000 1.1
@@ -0,0 +1,30 @@
+ad_page_contract {
+
+ Curriculum remove-published-curriculums-from-bar page
+
+ @author Ola Hansson (ola@polyxena.net)
+ @creation-date 2003-06-01
+ @cvs-id $Id: remove-from-bar.tcl,v 1.1 2003/06/03 10:40:53 olah Exp $
+
+} {
+ curriculum_id
+ {return_url "."}
+}
+
+set package_id [curriculum::conn package_id]
+
+# Removing is actually obtained by inserting a row into the table
+# "cu_user_curriculum_map", which holds the row(s) the user DOESN'T want.
+
+if [set user_id [ad_conn user_id]] {
+
+ db_transaction {
+ db_dml user_curriculum_map_insert {*SQL*}
+
+ # Force the bat to update.
+ curriculum::elements_flush
+ }
+
+}
+
+ns_returnredirect $return_url
Index: openacs-4/packages/curriculum/www/start-over.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/www/start-over.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum/www/start-over.tcl 3 Jun 2003 10:40:53 -0000 1.1
@@ -0,0 +1,35 @@
+ad_page_contract {
+
+ Curriculum reset page
+
+ @author Ola Hansson (ola@polyxena.net)
+ @creation-date 2003-06-03
+ @cvs-id $Id: start-over.tcl,v 1.1 2003/06/03 10:40:53 olah Exp $
+
+} {
+ curriculum_id:optional
+ {return_url "."}
+}
+
+set package_id [curriculum::conn package_id]
+
+if { [info exists curriculum_id] } {
+ set new_cookie [curriculum::curriculum_progress_cookie_value \
+ -package_id $package_id reset_one_curriculum $curriculum_id]
+ set extra_where_clause { and curriculum_id = :curriculum_id }
+} else {
+ set new_cookie [curriculum::curriculum_progress_cookie_value \
+ -package_id $package_id]
+ set extra_where_clause {}
+}
+
+if [set user_id [ad_conn user_id]] {
+ db_dml start_over {*SQL*}
+}
+
+# Write the new cookie.
+ad_set_cookie -replace t \
+ [curriculum::get_cookie_name] $new_cookie
+
+
+ns_returnredirect $return_url
Index: openacs-4/packages/curriculum/www/start-over.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/www/start-over.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum/www/start-over.xql 3 Jun 2003 10:40:53 -0000 1.1
@@ -0,0 +1,13 @@
+
+
+
+
+
+ delete from cu_user_element_map
+ where user_id = :user_id
+ and package_id = :package_id
+ $extra_where_clause
+
+
+
+