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.5 -r1.6
--- openacs-4/packages/curriculum-central/catalog/curriculum-central.en_US.ISO-8859-1.xml 4 Dec 2005 07:29:26 -0000 1.5
+++ openacs-4/packages/curriculum-central/catalog/curriculum-central.en_US.ISO-8859-1.xml 4 Dec 2005 13:08:26 -0000 1.6
@@ -13,6 +13,18 @@
Please visit the <a href="admin/streams">stream administration</a> pages to define a stream.
Please contact an administrator to get a stream set up.
NOTE: Need to <a href="faculties">create a faculty</a> and associated departments before proceeding.
+ Address Line 1
+ Address Line 2
+ Suburb
+ State
+ Postcode
+ Country
+ Enter the first line of the address. For example, office, room, unit number, etc.
+ Enter the second line of the address. For example, building, street, etc.
+ Enter the suburb/town/city.
+ Enter the state.
+ Enter the postcode.
+ Enter country component of address.
Stream Coordinator
Stream Coordinators
Unit Coordinator
@@ -35,9 +47,19 @@
Reopened
Close
Closed
+ Address
+ Phone
+ Fax
+ Homepage URL
+ Enter the staff member's office address.
+ Enter the staff member's contact number.
+ Enter the staff member's fax number.
+ Enter a URL for the staff member's personal homepage.
Admin
Assign roles to users.
Create streams.
+ Add a Stream
+ View Streams
Create faculties.
Faculties
Roles Admin
@@ -53,6 +75,7 @@
Add Staff Member
Add a member of staff to this list.
No staff
+ View Staff
Department
Faculty
Add Stream
@@ -73,6 +96,7 @@
Add a faculty to this list.
Add a stream to this list.
View faculty departments
+ View Faculties
%faculty_name% Departments
Faculty Departments
Add Department
Index: openacs-4/packages/curriculum-central/sql/postgresql/staff-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/sql/postgresql/staff-create.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/curriculum-central/sql/postgresql/staff-create.sql 4 Dec 2005 07:30:45 -0000 1.1
+++ openacs-4/packages/curriculum-central/sql/postgresql/staff-create.sql 4 Dec 2005 13:08:27 -0000 1.2
@@ -42,7 +42,16 @@
constraint cc_staff_position_nn not null,
department_id integer
constraint cc_staff_department_id_fk
- references cc_department(department_id)
+ references cc_department(department_id),
+ address_line_1 varchar(256),
+ address_line_2 varchar(256),
+ address_suburb varchar(256),
+ address_state varchar(256),
+ address_postcode varchar(256),
+ address_country varchar(256),
+ phone varchar(256),
+ fax varchar(256),
+ homepage_url varchar(256)
);
@@ -69,11 +78,11 @@
);
PERFORM acs_attribute__create_attribute (
- ''cc_staff'', -- object_type
- ''position'', -- attribute_name
- ''string'', -- datatype
- ''Position'', -- pretty_name
- ''Positions'', -- pretty_plural
+ ''cc_staff'', -- object_type
+ ''position'', -- attribute_name
+ ''string'', -- datatype
+ ''curriculum-central.position'', -- pretty_name
+ ''curriculum-central.positions'', -- pretty_plural
null, -- table_name
null, -- column_name
null, -- default_value
@@ -84,16 +93,160 @@
''f'' -- static_p
);
+ PERFORM acs_attribute__create_attribute (
+ ''cc_staff'', -- object_type
+ ''address_line_1'', -- attribute_name
+ ''string'', -- datatype
+ ''curriculum-central.address_line_1'', -- pretty_name
+ ''curriculum-central.address_line_1'', -- pretty_plural
+ null, -- table_name
+ null, -- column_name
+ null, -- default_value
+ 1, -- min_n_values
+ 1, -- max_n_values
+ null, -- sort_order
+ ''type_specific'', -- storage
+ ''f'' -- static_p
+ );
+
+ PERFORM acs_attribute__create_attribute (
+ ''cc_staff'', -- object_type
+ ''address_line_2'', -- attribute_name
+ ''string'', -- datatype
+ ''curriculum-central.address_line_2'', -- pretty_name
+ ''curriculum-central.address_line_2'', -- pretty_plural
+ null, -- table_name
+ null, -- column_name
+ null, -- default_value
+ 1, -- min_n_values
+ 1, -- max_n_values
+ null, -- sort_order
+ ''type_specific'', -- storage
+ ''f'' -- static_p
+ );
+
+ PERFORM acs_attribute__create_attribute (
+ ''cc_staff'', -- object_type
+ ''address_suburb'', -- attribute_name
+ ''string'', -- datatype
+ ''curriculum-central.address_suburb'', -- pretty_name
+ ''curriculum-central.address_suburbs'', -- pretty_plural
+ null, -- table_name
+ null, -- column_name
+ null, -- default_value
+ 1, -- min_n_values
+ 1, -- max_n_values
+ null, -- sort_order
+ ''type_specific'', -- storage
+ ''f'' -- static_p
+ );
+
+ PERFORM acs_attribute__create_attribute (
+ ''cc_staff'', -- object_type
+ ''address_state'', -- attribute_name
+ ''string'', -- datatype
+ ''curriculum-central.address_state'', -- pretty_name
+ ''curriculum-central.address_states'', -- pretty_plural
+ null, -- table_name
+ null, -- column_name
+ null, -- default_value
+ 1, -- min_n_values
+ 1, -- max_n_values
+ null, -- sort_order
+ ''type_specific'', -- storage
+ ''f'' -- static_p
+ );
+
+ PERFORM acs_attribute__create_attribute (
+ ''cc_staff'', -- object_type
+ ''address_postcode'', -- attribute_name
+ ''string'', -- datatype
+ ''curriculum-central.address_postcode'', -- pretty_name
+ ''curriculum-central.address_postcodes'', -- pretty_plural
+ null, -- table_name
+ null, -- column_name
+ null, -- default_value
+ 1, -- min_n_values
+ 1, -- max_n_values
+ null, -- sort_order
+ ''type_specific'', -- storage
+ ''f'' -- static_p
+ );
+
+ PERFORM acs_attribute__create_attribute (
+ ''cc_staff'', -- object_type
+ ''address_country'', -- attribute_name
+ ''string'', -- datatype
+ ''curriculum-central.address_country'', -- pretty_name
+ ''curriculum-central.address_countries'', -- pretty_plural
+ null, -- table_name
+ null, -- column_name
+ null, -- default_value
+ 1, -- min_n_values
+ 1, -- max_n_values
+ null, -- sort_order
+ ''type_specific'', -- storage
+ ''f'' -- static_p
+ );
+
+ PERFORM acs_attribute__create_attribute (
+ ''cc_staff'', -- object_type
+ ''phone'', -- attribute_name
+ ''string'', -- datatype
+ ''#curriculum-central.phone_number#'', -- pretty_name
+ ''#curriculum-central.phone_numbers#'', -- pretty_plural
+ null, -- table_name
+ null, -- column_name
+ null, -- default_value
+ 1, -- min_n_values
+ 1, -- max_n_values
+ null, -- sort_order
+ ''type_specific'', -- storage
+ ''f'' -- static_p
+ );
+
+ PERFORM acs_attribute__create_attribute (
+ ''cc_staff'', -- object_type
+ ''fax'', -- attribute_name
+ ''string'', -- datatype
+ ''#curriculum-central.fax_number#'', -- pretty_name
+ ''#curriculum-central.fax_numbers#'', -- pretty_plural
+ null, -- table_name
+ null, -- column_name
+ null, -- default_value
+ 1, -- min_n_values
+ 1, -- max_n_values
+ null, -- sort_order
+ ''type_specific'', -- storage
+ ''f'' -- static_p
+ );
+
+ PERFORM acs_attribute__create_attribute (
+ ''cc_staff'', -- object_type
+ ''homepage_url'', -- attribute_name
+ ''string'', -- datatype
+ ''#curriculum-central.homepage#'', -- pretty_name
+ ''#curriculum-central.homepages#'', -- pretty_plural
+ null, -- table_name
+ null, -- column_name
+ null, -- default_value
+ 1, -- min_n_values
+ 1, -- max_n_values
+ null, -- sort_order
+ ''type_specific'', -- storage
+ ''f'' -- static_p
+ );
+
return 0;
end;'
language 'plpgsql';
select inline_1 ();
drop function inline_1 ();
-select define_function_args('cc_staff__new', 'staff_id,title,position,department_id');
+select define_function_args('cc_staff__new', 'staff_id,title,position,department_id,address_line_1,address_line_2,address_suburb,address_state,address_postcode,address_country,phone,fax,homepage_url');
-create function cc_staff__new(integer, varchar, varchar, integer)
+create function cc_staff__new(integer, varchar, varchar, integer, varchar, varchar, varchar, varchar, varchar, varchar, varchar, varchar, varchar)
returns integer as'
declare
@@ -102,11 +255,20 @@
p_title alias for $2;
p_position alias for $3;
p_department_id alias for $4;
+ p_address_line_1 alias for $5;
+ p_address_line_2 alias for $6;
+ p_address_suburb alias for $7;
+ p_address_state alias for $8;
+ p_address_postcode alias for $9;
+ p_address_country alias for $10;
+ p_phone alias for $11;
+ p_fax alias for $12;
+ p_homepage_url alias for $13;
begin
-- The p_staff_id should already exist in acs_objects and users
-- tables. cc_staff is a "subtype" of the users table.
- insert into cc_staff values(p_staff_id, p_title, p_position, p_department_id);
+ insert into cc_staff values(p_staff_id, p_title, p_position, p_department_id, p_address_line_1, p_address_line_2, p_address_suburb, p_address_state, p_address_postcode, p_address_country, p_phone, p_fax, p_homepage_url);
return p_staff_id;
Index: openacs-4/packages/curriculum-central/www/staff-member-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/staff-member-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/www/staff-member-postgresql.xql 4 Dec 2005 13:08:27 -0000 1.1
@@ -0,0 +1,19 @@
+
+
+
+ postgresql7.4
+
+
+
+ SELECT s.title || ' ' || u.first_names || ' ' || u.last_name AS name,
+ s.position, s.department_id, d.department_name, s.staff_id,
+ u.email, u.url, s.address, s.phone, s.fax, s.homepage_url
+ FROM cc_users u, cc_staff s, cc_department d
+ WHERE s.staff_id = u.user_id
+ AND s.staff_id = :staff_id
+ AND d.department_id = s.department_id
+ ORDER BY department_id, u.last_name ASC
+
+
+
+
Index: openacs-4/packages/curriculum-central/www/staff-member.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/staff-member.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/www/staff-member.adp 4 Dec 2005 13:08:27 -0000 1.1
@@ -0,0 +1,17 @@
+
+@page_title;noquote@
+@context;noquote@
+
+
+Need to display the following:
+
+
+- portrait
+- name: @name@
+- position: @position@
+- address: @address@
+- email: @email@
+- phone number: @phone@
+- fax number: @fax@
+- personal home page: @homepage_url@
+
\ No newline at end of file
Index: openacs-4/packages/curriculum-central/www/staff-member.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/staff-member.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/www/staff-member.tcl 4 Dec 2005 13:08:27 -0000 1.1
@@ -0,0 +1,22 @@
+ad_page_contract {
+ Page for displaying details for a specific staff member.
+
+ @author Nick Carroll (nick.c@rroll.net)
+ @creation-date 2005-11-20
+ @cvs-id $Id: staff-member.tcl,v 1.1 2005/12/04 13:08:27 ncarroll Exp $
+} {
+ staff_id:integer
+}
+
+# Set optional fields to the empty string by default.
+set address {}
+set phone {}
+set fax {}
+set homepage_url {}
+
+db_1row staff_details {}
+
+set page_title $name
+set context [list [list staff [_ curriculum-central.staff]] $page_title]
+
+ad_return_template
\ No newline at end of file
Index: openacs-4/packages/curriculum-central/www/staff-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/staff-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/www/staff-postgresql.xql 4 Dec 2005 13:08:27 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+
+ postgresql7.4
+
+
+
+ SELECT s.title || ' ' || u.first_names || ' ' || u.last_name AS name,
+ s.position, s.department_id, d.department_name, s.staff_id
+ FROM cc_users u, cc_staff s, cc_department d
+ WHERE s.staff_id = u.user_id
+ AND d.department_id = s.department_id
+ ORDER BY department_id, u.last_name ASC
+
+
+
+
Index: openacs-4/packages/curriculum-central/www/staff.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/staff.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/www/staff.adp 4 Dec 2005 13:08:27 -0000 1.1
@@ -0,0 +1,21 @@
+
+@page_title;noquote@
+@context;noquote@
+
+
+
+
+
+
Index: openacs-4/packages/curriculum-central/www/staff.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/staff.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/curriculum-central/www/staff.tcl 4 Dec 2005 13:08:27 -0000 1.1
@@ -0,0 +1,21 @@
+ad_page_contract {
+ Page for displaying a list of staff members for each faculty.
+
+ @author Nick Carroll (nick.c@rroll.net)
+ @creation-date 2005-11-20
+ @cvs-id $Id: staff.tcl,v 1.1 2005/12/04 13:08:27 ncarroll Exp $
+}
+
+set page_title "[_ curriculum-central.staff]"
+set context [list [_ curriculum-central.staff]]
+
+# Check if any faculties have been created, otherwise redirect if there
+# are none.
+if { ![curriculum_central::faculty::faculties_exist_p] } {
+ ad_return_template "no-faculties"
+ return
+}
+
+db_multirow staff staff {}
+
+ad_return_template
Index: openacs-4/packages/curriculum-central/www/admin/staff-ae-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/admin/staff-ae-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/curriculum-central/www/admin/staff-ae-postgresql.xql 4 Dec 2005 06:50:31 -0000 1.1
+++ openacs-4/packages/curriculum-central/www/admin/staff-ae-postgresql.xql 4 Dec 2005 13:08:27 -0000 1.2
@@ -8,7 +8,16 @@
UPDATE cc_staff
SET title = :title,
position = :position,
- department_id = :department_id
+ department_id = :department_id,
+ address_line_1 = :address_line_1,
+ address_line_2 = :address_line_2,
+ address_suburb = :address_suburb,
+ address_state = :address_state,
+ address_postcode = :address_postcode,
+ address_country = :address_country,
+ phone = :phone,
+ fax = :fax,
+ homepage_url = :homepage_url
WHERE staff_id = :staff_id
Index: openacs-4/packages/curriculum-central/www/admin/staff-ae.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-central/www/admin/staff-ae.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/curriculum-central/www/admin/staff-ae.tcl 4 Dec 2005 07:34:26 -0000 1.2
+++ openacs-4/packages/curriculum-central/www/admin/staff-ae.tcl 4 Dec 2005 13:08:27 -0000 1.3
@@ -57,15 +57,71 @@
{options [curriculum_central::departments_get_options] }
{help_text "[_ curriculum-central.help_select_staff_member_department]"}
}
+ {address_line_1:text,optional
+ {html {size 50}}
+ {label "#curriculum-central.address_line_1#"}
+ {help_text "[_ curriculum-central.help_enter_address_line_1]"}
+ }
+ {address_line_2:text,optional
+ {html {size 50}}
+ {label "#curriculum-central.address_line_2#"}
+ {help_text "[_ curriculum-central.help_enter_address_line_2]"}
+ }
+ {address_suburb:text,optional
+ {html {size 50}}
+ {label "#curriculum-central.suburb#"}
+ {help_text "[_ curriculum-central.help_enter_suburb]"}
+ }
+ {address_state:text,optional
+ {html {size 50}}
+ {label "#curriculum-central.state#"}
+ {help_text "[_ curriculum-central.help_enter_state]"}
+ }
+ {address_postcode:text,optional
+ {html {size 50}}
+ {label "#curriculum-central.postcode#"}
+ {help_text "[_ curriculum-central.help_enter_postcode]"}
+ }
+ {address_country:text,optional
+ {html {size 50}}
+ {label "#curriculum-central.country#"}
+ {help_text "[_ curriculum-central.help_enter_country]"}
+ }
+ {phone:text,optional
+ {html {size 50}}
+ {label "#curriculum-central.phone#"}
+ {help_text "[_ curriculum-central.help_enter_phone]"}
+ }
+ {fax:text,optional
+ {html {size 50}}
+ {label "#curriculum-central.fax#"}
+ {help_text "[_ curriculum-central.help_enter_fax]"}
+ }
+ {homepage_url:text,optional
+ {html {size 50}}
+ {label "#curriculum-central.homepage_url#"}
+ {help_text "[_ curriculum-central.help_enter_homepage_url]"}
+ }
} -select_query {
- SELECT title, position, department_id
+ SELECT title, position, department_id, address_line_1,
+ address_line_2, address_suburb, address_state, address_postcode,
+ address_country, phone, fax, homepage_url
FROM cc_staff WHERE staff_id = :staff_id
} -new_data {
package_instantiate_object \
-var_list [list [list staff_id $staff_id] \
[list title $title] \
[list position $position] \
- [list department_id $department_id]] \
+ [list department_id $department_id] \
+ [list address_line_1 $address_line_1] \
+ [list address_line_2 $address_line_2] \
+ [list address_suburb $address_suburb] \
+ [list address_state $address_state] \
+ [list address_postcode $address_postcode] \
+ [list address_country $address_country] \
+ [list phone $phone] \
+ [list fax $fax] \
+ [list homepage_url $homepage_url]] \
-form_id staff cc_staff
} -edit_data {
db_dml staff_update {}