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 -r1.1 -r1.2
--- openacs-4/packages/curriculum-central/catalog/curriculum-central.en_US.ISO-8859-1.xml 20 Nov 2005 23:51:10 -0000 1.1
+++ openacs-4/packages/curriculum-central/catalog/curriculum-central.en_US.ISO-8859-1.xml 21 Nov 2005 01:10:53 -0000 1.2
@@ -61,6 +61,7 @@
%faculty_name% Departments
Faculty Departments
Add Department
+ Edit Department
No departments have been created.
Head of Department
Department Name
Index: openacs-4/packages/curriculum-central/sql/postgresql/department-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/sql/postgresql/department-create.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/curriculum-central/sql/postgresql/department-create.sql 20 Nov 2005 23:51:10 -0000 1.1
+++ openacs-4/packages/curriculum-central/sql/postgresql/department-create.sql 21 Nov 2005 01:10:54 -0000 1.2
@@ -101,20 +101,21 @@
drop function inline_1 ();
-select define_function_args('cc_department__new', 'department_id,department_name,hod_id,object_type,creation_user,creation_ip,package_id');
+select define_function_args('cc_department__new', 'department_id,department_name,hod_id,faculty_id,object_type,creation_user,creation_ip,package_id');
-create function cc_department__new(integer, varchar, integer, varchar, integer, varchar, integer)
+create function cc_department__new(integer, varchar, integer, integer, varchar, integer, varchar, integer)
returns integer as'
declare
p_department_id alias for $1;
- p_department_name alias for $2;
+ p_department_name alias for $2;
p_hod_id alias for $3;
- p_object_type alias for $4;
- p_creation_user alias for $5;
- p_creation_ip alias for $6;
- p_package_id alias for $7;
+ p_faculty_id alias for $4;
+ p_object_type alias for $5;
+ p_creation_user alias for $6;
+ p_creation_ip alias for $7;
+ p_package_id alias for $8;
v_department_id cc_department.department_id%TYPE;
begin
@@ -128,7 +129,7 @@
p_package_id
);
- insert into cc_department values(v_department_id, p_hod_id, p_department_name, p_package_id);
+ insert into cc_department values(v_department_id, p_hod_id, p_department_name, p_faculty_id, p_package_id);
return v_department_id;
Index: openacs-4/packages/curriculum-central/www/admin/dept-ae-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/admin/dept-ae-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/www/admin/dept-ae-postgresql.xql 21 Nov 2005 01:10:54 -0000 1.1
@@ -0,0 +1,24 @@
+
+
+
+ postgresql7.4
+
+
+
+ UPDATE cc_department
+ SET hod_id = :hod_id,
+ department_name = :department_name
+ WHERE department_id = :department_id
+
+
+
+
+
+ UPDATE acs_objects
+ SET modifying_user = :modifying_user,
+ modifying_ip = :modifying_ip
+ WHERE object_id = :department_id
+
+
+
+
Index: openacs-4/packages/curriculum-central/www/admin/dept-ae.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/admin/dept-ae.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/www/admin/dept-ae.adp 21 Nov 2005 01:10:54 -0000 1.1
@@ -0,0 +1,6 @@
+
+@page_title;noquote@
+@context;noquote@
+dept.department_name
+
+
\ No newline at end of file
Index: openacs-4/packages/curriculum-central/www/admin/dept-ae.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/admin/dept-ae.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/www/admin/dept-ae.tcl 21 Nov 2005 01:10:54 -0000 1.1
@@ -0,0 +1,57 @@
+ad_page_contract {
+ Add/Edit a department.
+
+ @author Nick Carroll (nick.c@rroll.net)
+ @creation-date 2005-11-20
+ @cvs-id $Id: dept-ae.tcl,v 1.1 2005/11/21 01:10:54 ncarroll Exp $
+} {
+ faculty_id:integer
+ department_id:integer,optional
+ return_url:optional
+}
+
+if { [info exists department_id] } {
+ set page_title [_ curriculum-central.edit_dept]
+} else {
+ set page_title [_ curriculum-central.add_dept]
+}
+
+if { ![info exists return_url] } {
+ set return_url [export_vars -base faculty-depts {faculty_id}]
+}
+
+set context [list $page_title]
+set package_id [ad_conn package_id]
+
+ad_form -name dept -cancel_url $return_url -form {
+ {department_id:key(acs_object_id_seq)}
+ {return_url:text(hidden) {value $return_url}}
+ {faculty_id:integer(hidden) {value $faculty_id}}
+ {department_name:text
+ {html {size 50}}
+ {label "#curriculum-central.dept_name#" }
+ }
+ {hod_id:integer(select)
+ {label "#curriculum-central.hod#" }
+ {options [curriculum_central::users_get_options] }
+ }
+} -select_query {
+ SELECT hod_id, department_name
+ FROM cc_department WHERE department_id = :department_id
+} -new_data {
+ package_instantiate_object \
+ -var_list [list [list package_id $package_id] \
+ [list object_type cc_department] \
+ [list hod_id $hod_id] \
+ [list faculty_id $faculty_id]] \
+ -form_id dept cc_department
+} -edit_data {
+ set modifying_user [ad_conn user_id]
+ set modifying_ip [ad_conn peeraddr]
+
+ db_dml dept_update {}
+ db_dml object_update {}
+} -after_submit {
+ ad_returnredirect $return_url
+ ad_script_abort
+}
Index: openacs-4/packages/curriculum-central/www/admin/faculty-depts.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/admin/faculty-depts.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/curriculum-central/www/admin/faculty-depts.tcl 20 Nov 2005 23:51:11 -0000 1.1
+++ openacs-4/packages/curriculum-central/www/admin/faculty-depts.tcl 21 Nov 2005 01:10:54 -0000 1.2
@@ -6,6 +6,7 @@
@cvs-id $Id$
} {
faculty_id:integer,notnull
+ {orderby "department_name,asc"}
}
if { [db_0or1row get_faculty_name {}] } {
@@ -17,15 +18,16 @@
set page_title [_ curriculum-central.faculty_depts]
}
-set context [list $page_title]
+set context [list [list faculties [_ curriculum-central.faculties]] \
+ $page_title]
set elements {
edit {
sub_class narrow
display_template {
}
- link_url_eval {[export_vars -base dept-ae { department_id }]}
+ link_url_eval {[export_vars -base dept-ae { faculty_id department_id }]}
link_html {title "#curriculum-central.edit_dept_info#"}
}
department_name {
@@ -49,13 +51,14 @@
-no_data "#curriculum-central.no_depts_created#" \
-elements $elements \
-actions [list "#curriculum-central.add_dept#" \
- [export_vars -base dept-ae {}] \
+ [export_vars -base dept-ae { faculty_id }] \
"#curriculum-central.add_dept_to_list#"] \
-orderby {
department_name {orderby {lower(department_name)}}
hod {orderby {lower(hod)}}
- }
+ } \
+ -pass_properties {faculty_id}
-db_multirow depts get_depts {}
+db_multirow depts get_depts {}
ad_return_template