@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#
|
@@ -87,18 +82,18 @@
-
+
- #curriculum.Revisit#
+ #curriculum.Revisit#
#curriculum.Unvisited#
|
-
+
- #curriculum.Visit#
+ #curriculum.Visit#
|
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#