Index: openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/sql/postgresql/Attic/project-manager-drop.sql,v
diff -u -r1.8 -r1.9
--- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql 29 Aug 2003 00:35:35 -0000 1.8
+++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql 12 Sep 2003 01:20:56 -0000 1.9
@@ -16,11 +16,19 @@
drop sequence pm_task_dependency_seq;
drop sequence pm_tasks_number_seq;
-drop table pm_task_default_roles;
-drop table pm_task_role_map;
-drop table pm_task_roles;
-drop sequence pm_task_role_seq;
+-- WORKGROUPS
+drop sequence pm_workgroup_seq;
+drop table pm_workgroup_parties;
+drop table pm_workgroup;
+
+drop table pm_default_roles;
+drop table pm_project_assignment;
+drop table pm_task_assignment;
+drop table pm_roles;
+drop sequence pm_role_seq;
+
+
create function inline_0 ()
returns integer as '
declare
@@ -112,13 +120,8 @@
select drop_package('pm_project');
--drop table
-drop table pm_project_default_roles;
-drop table pm_project_role_map;
-drop table pm_project_roles;
drop table pm_projects cascade;
-drop sequence pm_project_role_seq;
-
select content_type__drop_type('pm_task', 't', 'f');
drop table pm_tasks cascade;
Index: openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/sql/postgresql/Attic/project-manager-table-create.sql,v
diff -u -r1.10 -r1.11
--- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql 29 Aug 2003 00:35:35 -0000 1.10
+++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql 12 Sep 2003 01:20:56 -0000 1.11
@@ -1,18 +1,19 @@
-- TODO:
--
--- which items in this data model need to use the content repository?
-- need to add in workflow (for status among other things)
--- need to take into account acs-rels
-- add categories to projects
--
--- packages/test-project/sql/postgresql/test-project-table-create.sql
+-- packages/project-manager/sql/postgresql/project-manager-table-create.sql
--
--- @author jader@bread.com, ncarroll@ee.usyd.edu.au and everyone else involved in this thread: http://openacs.org/forums/message-view?message_id=90742
+-- @author jader@bread.com
+-- @author ncarroll@ee.usyd.edu.au was involved in creating the initial CR version
+-- @author everyone else involved in this thread: http://openacs.org/forums/message-view?message_id=90742
-- @creation-date 2003-05-15
--
--- Project repository datamodel.
+-- PROJECTS
+
create table pm_projects (
project_id integer
constraint project_manager_id_fk
@@ -53,65 +54,78 @@
-create table pm_project_roles (
+-- ROLES
+
+create sequence pm_role_seq start 3;
+
+create table pm_roles (
role_id integer
- constraint pm_project_role_id_pk
+ constraint pm_role_id_pk
primary key,
one_line varchar(100)
- constraint pm_project_role_one_line_uq
+ constraint pm_role_one_line_uq
unique,
description varchar(2000),
- sort_order integer
+ sort_order integer,
+ is_observer_p char(1) default 'f'
+ constraint pm_role_is_observer_ck
+ check (is_observer_p in ('t','f'))
);
-comment on table pm_project_roles is '
- Roles represent the way in which a party participates in a project. For example,
- they could be a manager, or client, or participant.. The sort order determines
- what order it is displayed in.
+comment on table pm_roles is '
+ Roles represent the way in which a party participates in a project
+ or task. For example, they could be a manager, or client, or
+ participant.. The sort order determines what order it is displayed
+ in. The is_observer_p specifies whether they are directly
+ responsible for the task. People not directly responsible will not
+ get email notifications reminding them that tasks are overdue, for
+ example.
';
-insert into pm_project_roles (role_id, one_line, description, sort_order) values ('1','Participant','Team members who are responsible for the completion of the project','10');
-insert into pm_project_roles (role_id, one_line, description, sort_order) values ('2','Manager','Manages the team to complete the project on time and on budget.','20');
+insert into pm_roles (role_id, one_line, description, sort_order) values ('1','Participant','Team members who are responsible for the completion of the project','10');
+insert into pm_roles (role_id, one_line, description, sort_order) values ('2','Manager','Manages the team to complete the project or task on time and on budget.','20');
-create sequence pm_project_role_seq start 3;
+create table pm_default_roles (
+ role_id integer
+ constraint pm_default_role_fk
+ references pm_roles
+ on delete cascade,
+ party_id integer
+ constraint pm_default_role_party_fk
+ references parties(party_id)
+ on delete cascade
+);
+comment on table pm_default_roles is '
+ Specifies what role a person is a part of by default
+';
-create table pm_project_role_map (
+-- PROJECT ASSIGNMENT
+
+create table pm_project_assignment (
project_id integer
constraint pm_project_role_map_project_fk
references pm_projects
on delete cascade,
role_id integer
constraint pm_project_role_map_role_fk
- references pm_project_roles,
+ references pm_roles,
party_id integer
constraint pm_project_role_map_user_id_fk
references parties(party_id)
on delete cascade
);
-comment on table pm_project_role_map is '
+
+comment on table pm_project_assignment is '
Maps who is a part of what project, and in what capacity
';
-create table pm_project_default_roles (
- role_id integer
- constraint pm_proj_default_role_fk
- references pm_project_roles
- on delete cascade,
- party_id integer
- constraint pm_proj_default_role_party_fk
- references parties(party_id)
- on delete cascade
-);
+-- TASKS
-comment on table pm_project_role_map is '
- Specifies what role a person is a part of by default, for projects
-';
-
-- we create two tables to store task information
-- the information that we keep revisions on is in the
-- pm_task_revisions table, the rest is in pm_task
@@ -286,6 +300,8 @@
);
+-- DEPENDENCIES
+
-- dependency types
-- such as:
-- cannot start until Task X finishes
@@ -326,72 +342,53 @@
);
--- assignments
+-- WORKGROUPS
+create sequence pm_workgroup_seq;
-create table pm_task_roles (
- role_id integer
- constraint pm_task_role_id_pk
+create table pm_workgroup (
+ workgroup_id integer
+ constraint pm_workgroup_id_pk
primary key,
one_line varchar(100)
- constraint pm_task_role_one_line_uq
+ constraint pm_workgroup_one_line_uq
unique,
description varchar(2000),
- is_observer_p char(1) default 'f'
- constraint pm_task_role_ck
- check (is_observer_p in ('t','f')),
sort_order integer
);
-comment on table pm_task_roles is '
- Roles represent the way in which a role participates in a task. For example,
- they could be an assignee, or a watcher. They can be divided up the same way
- the organization is broken up, by sales and R and D for example. These terms
- can be made up to fit the conditions of the local company. Defaults are set
- up by another table, pm_task_default_role
- The is_observer_p specifies
- whether they are directly responsible for the task. People not directly
- responsible will not get email notifications reminding them that tasks are
- overdue, for example.
-';
-
-insert into pm_task_roles (role_id, one_line, description, is_observer_p, sort_order) values ('1','Manager','This person oversees someone responsible for completion of the task','t','10');
-insert into pm_task_roles (role_id, one_line, description, is_observer_p, sort_order) values ('2','Assignee','This person is directly responsible for completion of the task','f','20');
-insert into pm_task_roles (role_id, one_line, description, is_observer_p, sort_order) values ('3','Watcher','This person is interested in developments of a ticket, but not directly responsible for it.','t','30');
-
-
-create sequence pm_task_role_seq start 4;
-
-
-create table pm_task_role_map (
- task_id integer
- constraint pm_task_role_map_task_fk
- references pm_tasks
+create table pm_workgroup_parties (
+ workgroup_id integer
+ constraint pm_workgroup_parties_wg_id_fk
+ references pm_workgroup(workgroup_id)
on delete cascade,
- role_id integer
- constraint pm_task_roles_fk
- references pm_task_roles,
party_id integer
- constraint pm_task_role_map_user_id_fk
+ constraint pm_workgroup_party_fk
references parties(party_id)
- on delete cascade
+ on delete cascade,
+ role_id integer
+ constraint pm_workgroup_role_id
+ references pm_roles
);
-comment on table pm_task_role_map is '
- Maps who is a part of what task, and in what capacity
-';
-create table pm_task_default_roles (
- role_id integer
- constraint pm_task_default_role_fk
- references pm_task_roles
+-- TASK ASSIGNMENTS
+
+create table pm_task_assignment (
+ task_id integer
+ constraint pm_task_assignment_task_fk
+ references pm_tasks(task_id)
on delete cascade,
+ role_id integer
+ constraint pm_task_assignment_role_fk
+ references pm_roles,
party_id integer
- constraint pm_task_default_role_party_fk
+ constraint pm_task_assignment_party_fk
references parties(party_id)
on delete cascade
);
-comment on table pm_task_role_map is '
- Specifies what role a person is a part of by default, for tasks
+
+comment on table pm_project_assignment is '
+ Maps who is a part of what project, and in what capacity
';
Index: openacs-4/contrib/packages/project-manager/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/index.adp,v
diff -u -r1.14 -r1.15
--- openacs-4/contrib/packages/project-manager/www/index.adp 5 Sep 2003 00:11:35 -0000 1.14
+++ openacs-4/contrib/packages/project-manager/www/index.adp 12 Sep 2003 01:20:57 -0000 1.15
@@ -5,11 +5,27 @@
@project_term@s
@context@
-My @project_term_lower@s All @project_term_lower@s My @task_term_lower@s All @task_term_lower@s Processes
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/index.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/contrib/packages/project-manager/www/index.tcl 5 Sep 2003 00:11:35 -0000 1.7
+++ openacs-4/contrib/packages/project-manager/www/index.tcl 12 Sep 2003 01:20:57 -0000 1.8
@@ -20,6 +20,7 @@
projects:multirow
write_p:onevalue
create_p:onevalue
+ admin_p:onevalue
task_term:onevalue
task_term_lower:onevalue
project_term:onevalue
@@ -46,6 +47,7 @@
set write_p [permission::permission_p -object_id $package_id -privilege write]
set create_p [permission::permission_p -object_id $package_id -privilege create]
+set admin_p [permission::permission_p -object_id $package_id -privilege admin]
# root CR folder
set root_folder [db_string get_root "select pm_project__get_root_folder (:package_id, 'f')"]
Index: openacs-4/contrib/packages/project-manager/www/one-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/one-postgresql.xql,v
diff -u -r1.14 -r1.15
--- openacs-4/contrib/packages/project-manager/www/one-postgresql.xql 5 Sep 2003 00:29:05 -0000 1.14
+++ openacs-4/contrib/packages/project-manager/www/one-postgresql.xql 12 Sep 2003 01:20:57 -0000 1.15
@@ -131,6 +131,17 @@
p.parent_id = :project_item_id
ORDER BY p.title
-
+
+
+
+ select
+ project_id,
+ role_id,
+ party_id
+ from pm_task_assignment
+ where project_id = :project_item_id
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/one.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/one.adp,v
diff -u -r1.20 -r1.21
--- openacs-4/contrib/packages/project-manager/www/one.adp 5 Sep 2003 23:43:24 -0000 1.20
+++ openacs-4/contrib/packages/project-manager/www/one.adp 12 Sep 2003 01:20:57 -0000 1.21
@@ -94,6 +94,10 @@
Subprojects:
+
+ People:
+
+
Index: openacs-4/contrib/packages/project-manager/www/one.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/one.tcl,v
diff -u -r1.17 -r1.18
--- openacs-4/contrib/packages/project-manager/www/one.tcl 5 Sep 2003 00:29:05 -0000 1.17
+++ openacs-4/contrib/packages/project-manager/www/one.tcl 12 Sep 2003 01:20:57 -0000 1.18
@@ -32,6 +32,7 @@
context_bar:onevalue
project:multirow
tasks:multirow
+ people:multirow
write_p:onevalue
create_p:onevalue
versions:multirow
@@ -148,6 +149,7 @@
project_item_id {}
orderby_subproject {}
orderby_versions {}
+ orderby_people {}
} \
-orderby {
title {orderby title}
@@ -193,6 +195,8 @@
project_item_id {}
orderby_versions {}
orderby_tasks {}
+ orderby_people {}
+ orderby_versions {}
} \
-orderby {
project_name {orderby project_name}
@@ -211,7 +215,46 @@
}
+# People, using list-builder ---------------------------------
+db_multirow people project_people_query { }
+
+template::list::create \
+ -name people \
+ -multirow people \
+ -key item_id \
+ -elements {
+ party_id {
+ label "Who"
+ }
+ role_id {
+ label "Role"
+ }
+ } \
+ -filters {
+ party_id {}
+ orderby_subproject {}
+ orderby_versions {}
+ orderby_tasks {}
+ } \
+ -orderby {
+ role_id {orderby role_id}
+ default_value role_id,desc
+ } \
+ -orderby_name orderby_subproject \
+ -html {
+ width 100%
+ }
+
+
+
+db_multirow -extend { item_url } subproject project_subproject_query {
+} {
+ set item_url [export_vars -base "one" -override {{project_item_id $item_id}} {project_item_id}]
+}
+
+
+
# Project versions, using list-builder ---------------------------------
db_multirow versions project_versions { }
@@ -233,6 +276,7 @@
-filters {
project_item_id {}
orderby_subproject {}
+ orderby_people {}
orderby_tasks {}
} \
-orderby {
Index: openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-add-edit.tcl,v
diff -u -r1.15 -r1.16
--- openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 4 Sep 2003 22:45:23 -0000 1.15
+++ openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 12 Sep 2003 01:20:57 -0000 1.16
@@ -24,7 +24,6 @@
project_item_id:integer,optional
project_id:integer,optional
{number:integer "1"}
- added_tasks:integer,multiple,optional
task_revision_id:integer,optional
task_id:multiple,integer,optional
task_title:array,optional
@@ -37,6 +36,7 @@
estimated_hours_work:array,optional
estimated_hours_work_min:array,optional
estimated_hours_work_max:array,optional
+
} -properties {
context_bar:onevalue
@@ -155,10 +155,13 @@
} -new_data {
- # we set up a list of task_revisions to pass on to the
- # add dependencies page. We only add in revision_ids when the
- # user has selected this task for dependencies
- set task_revisions [list]
+ # each task we add in returns a task_revision_id
+ # we set up two lists, one for tasks that will need dependencies
+ # another for tasks that don't
+
+ set revision_has_dependencies [list]
+ set revision_no_dependencies [list]
+
for {set i 1} {$i <= $number} {incr i} {
if {![exists_and_not_null estimated_hours_work($i)]} {
@@ -174,8 +177,11 @@
}
set this_revision_id [db_exec_plsql new_task_item { *SQL* }]
+
if {[info exists use_dependency_p($i)] && [string equal $use_dependency_p($i) "t"]} {
- lappend task_revisions $this_revision_id
+ lappend revision_has_dependencies $this_revision_id
+ } else {
+ lappend revision_no_dependencies $this_revision_id
}
}
@@ -187,13 +193,9 @@
# we add that to a list of ids that we pass to the dependency-add-edit
# page.
- if {[llength $task_revisions] <= 0} {
- ad_returnredirect "one?[export_vars -url {project_item_id}]"
- ad_script_abort
- } else {
- ad_returnredirect "dependency-add-edit?[export_vars -url {task_revisions:multiple project_item_id}]"
- ad_script_abort
- }
+ ad_returnredirect "task-assign-add-edit?[export_vars -url {revision_has_dependencies:multiple revision_no_dependencies:multiple project_item_id}]"
+ ad_script_abort
+
}
for {set i 1} {$i <= $number} {incr i} {
Index: openacs-4/contrib/packages/project-manager/www/task-assign-add-edit-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-assign-add-edit-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/task-assign-add-edit-postgresql.xql 12 Sep 2003 01:20:57 -0000 1.1
@@ -0,0 +1,80 @@
+
+
+
+
+ select
+ item_id
+ FROM
+ pm_tasks_revisionsx t
+ WHERE
+ revision_id in ([join $revisions ","])
+
+
+
+
+
+ select
+ first_names || ' ' || last_name || ' (' || email || ')' as who,
+ person_id
+ FROM
+ cc_users
+ ORDER BY
+ first_names, last_name
+
+
+
+
+
+ select
+ one_line,
+ role_id
+ FROM
+ pm_roles
+ ORDER BY
+ sort_order
+
+
+
+
+
+ delete from pm_task_assignment
+ where task_id in ([join $task_id ","])
+
+
+
+
+
+ insert into pm_task_assignment
+ (task_id,
+ role_id,
+ party_id)
+ values
+ (:t_id,
+ :r_id,
+ :p_id)
+
+
+
+
+
+ select
+ party_id
+ FROM
+ pm_task_assignment
+ WHERE
+ task_id in ([join $task_id ","])
+
+
+
+
+
+ select
+ role_id
+ FROM
+ pm_task_assignment a
+ WHERE
+ task_id in ([join $task_id ","])
+
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-assign-add-edit.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.adp 12 Sep 2003 01:20:57 -0000 1.1
@@ -0,0 +1,14 @@
+
+@context_bar@
+@title@
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-assign-add-edit.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl 12 Sep 2003 01:20:57 -0000 1.1
@@ -0,0 +1,245 @@
+ad_page_contract {
+
+ Form to add and edit assignments to a task
+
+ @author jader@bread.com
+ @creation-date 2003-09-10
+ @cvs-id $Id: task-assign-add-edit.tcl,v 1.1 2003/09/12 01:20:57 jader Exp $
+
+ @return context_bar Context bar.
+ @return title Page title.
+
+ @param task_id the list of tasks we want to assign people to
+ @param task_revisions the list of tasks that want dependencies assigned. Passed on to dependency-add-edit
+
+} {
+
+ revision_has_dependencies:multiple,optional
+ revision_no_dependencies:multiple,optional
+ task_id:multiple,optional
+ {project_item_id:integer ""}
+ role_id:array,optional
+ party_id:array,optional
+
+} -properties {
+
+ context_bar:onevalue
+ title:onevalue
+ task_term_lower:onevalue
+ project_item_id:onevalue
+
+}
+
+# --------------------------------------------------------------- #
+
+if {![exists_and_not_null revision_no_dependencies]} {
+ set revision_no_dependencies ""
+}
+
+if {![exists_and_not_null revision_has_dependencies]} {
+ set revision_has_dependencies ""
+}
+
+ns_log Notice "Before hack, revision_no_dependencies: $revision_no_dependencies revision_has_dependencies: $revision_has_dependencies"
+
+
+# hack to get around lack of multiple hidden support with ad_form
+
+set task_revision_dep_pass $revision_has_dependencies
+set task_revision_dep_pass [string map {"-" " "} $task_revision_dep_pass]
+set revision_has_dependencies $task_revision_dep_pass
+
+set task_revision_nodep_pass $revision_no_dependencies
+set task_revision_nodep_pass [string map {"-" " "} $task_revision_nodep_pass]
+set revision_no_dependencies $task_revision_nodep_pass
+
+ns_log Notice " After hack, revision_no_dependencies: $revision_no_dependencies revision_has_dependencies: $revision_has_dependencies"
+
+
+set revisions [concat $revision_has_dependencies $revision_no_dependencies]
+
+set task_id [db_list get_task_item_ids { }]
+
+
+# terminology
+set project_term [parameter::get -parameter "ProjectName" -default "Project"]
+set task_term [parameter::get -parameter "TaskName" -default "Task"]
+set task_term_lower [parameter::get -parameter "taskname" -default "task"]
+
+# the unique identifier for this package
+set package_id [ad_conn package_id]
+set user_id [ad_maybe_redirect_for_registration]
+
+# permissions
+
+set title "Add $task_term_lower assignments"
+set context_bar [ad_context_bar [list "one?project_item_id=$project_item_id" "One $project_term"] "New $task_term dependency"]
+permission::require_permission -party_id $user_id -object_id $package_id -privilege create
+
+
+set users_lofl "{{--Select Person--} {}} "
+append users_lofl [db_list_of_lists get_users { }]
+
+set users_values [db_list_of_lists get_current_users { }]
+
+set roles_lofl "{{--Select Role--} {}} "
+append roles_lofl [db_list_of_lists get_roles { }]
+
+set roles_values [db_list_of_lists get_current_roles { }]
+
+set task_revision_dep_pass $revision_has_dependencies
+set task_revision_dep_pass [string map {" " "-"} $task_revision_dep_pass]
+
+set task_revision_nodep_pass $revision_no_dependencies
+set task_revision_nodep_pass [string map {" " "-"} $task_revision_nodep_pass]
+
+ad_form -name add_edit -form {
+
+ acs_object_id_seq:key
+
+ {revision_has_dependencies:text(hidden)
+ {value $task_revision_dep_pass}}
+
+ {revision_no_dependencies:text(hidden)
+ {value $task_revision_nodep_pass}}
+
+ {project_item_id:text(hidden)
+ {value $project_item_id}}
+
+
+} -on_submit {
+
+ set user_id [ad_conn user_id]
+ set peeraddr [ad_conn peeraddr]
+
+} -new_data {
+
+ #role_id
+ #party_id
+
+ if {[info exists role_id]} {
+
+ set searchToken [array startsearch role_id]
+
+ while {[array anymore role_id $searchToken]} {
+
+ set keyname [array nextelement role_id $searchToken]
+ set keyvalu $role_id($keyname)
+
+ # keyname looks like 2308.1 - 2308.10
+ # first element is task_id, second is 1-10
+ # if keyvalu is not empty, then we pay attention to it.
+
+ if {[exists_and_not_null keyvalu]} {
+
+ regexp {(.*)\.(.*)} $keyname match task_id_val num_value
+
+ set assignment_role($task_id_val,$num_value) $keyvalu
+
+ }
+ }
+
+ }
+
+ set party_list [list]
+
+ if {[info exists party_id]} {
+
+ set searchToken [array startsearch party_id]
+
+ while {[array anymore party_id $searchToken]} {
+
+ set keyname [array nextelement party_id $searchToken]
+ set keyvalu $party_id($keyname)
+
+ # keyname looks like 2308.1 - 2308.10
+ # first element is task_id, second is 1-10
+ # if keyvalu is not empty, then we pay attention to it.
+
+ if {[exists_and_not_null keyvalu]} {
+
+ regexp {(.*)\.(.*)} $keyname match task_id_val num_value
+
+ set assignment_party($task_id_val,$num_value) $keyvalu
+
+ lappend party_list "$task_id_val,$num_value"
+
+ }
+ }
+
+ }
+
+ db_dml delete_assignments { }
+
+ foreach pl $party_list {
+
+ regexp {(.*),(.*)} $pl match task_id_v num_value
+
+ set t_id $task_id_v
+ set r_id $assignment_role($pl)
+ set p_id $assignment_party($pl)
+
+ ns_log Notice "tid: $t_id rid: $r_id pid: $p_id"
+
+ db_dml add_assignment { }
+
+ }
+
+} -edit_data {
+
+ # do something
+
+} -after_submit {
+
+ # for some reason this hack is necessary here
+
+ set task_revision_dep_pass $revision_has_dependencies
+ set task_revision_dep_pass [string map {"-" " "} $task_revision_dep_pass]
+ set revision_has_dependencies $task_revision_dep_pass
+
+ set task_revisions $revision_has_dependencies
+
+ ad_returnredirect "dependency-add-edit?[export_vars -url {task_revisions:multiple project_item_id}]"
+ ad_script_abort
+}
+
+
+# we create a terrible monster array
+
+foreach tiid $task_id {
+
+ set users_length [string length $users_values]
+ set roles_length [string length $roles_values]
+
+ for {set i 0} {$i <= 10} {incr i} {
+
+ if {$i < $users_length && $i < $roles_length} {
+ set uv [lindex $users_values $i]
+ set rv [lindex $roles_values $i]
+ } else {
+ set uv ""
+ set rv ""
+ }
+
+ ad_form -extend -name add_edit -form \
+ [list \
+ [list \
+ party_id.$tiid.$i:text(select) \
+ {label "Assignments \#$i $tiid"} \
+ {options {[set users_lofl]}} \
+ {values $uv} \
+ ] \
+ [list \
+ role_id.$tiid.$i:text(select) \
+ {label "Role \#$i $tiid"} \
+ {options {[set roles_lofl]}} \
+ {values $rv} \
+ ] \
+ ]
+
+ }
+}
+
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/task-one-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-one-postgresql.xql,v
diff -u -r1.13 -r1.14
--- openacs-4/contrib/packages/project-manager/www/task-one-postgresql.xql 5 Sep 2003 00:29:05 -0000 1.13
+++ openacs-4/contrib/packages/project-manager/www/task-one-postgresql.xql 12 Sep 2003 01:20:57 -0000 1.14
@@ -120,4 +120,21 @@
[template::list::orderby_clause -name dependency2 -orderby]
+
+
+
+ select
+ r.one_line,
+ u.first_names || ' ' || u.last_name || ' (' || u.email || ')' as user_info
+ from
+ pm_task_assignment a,
+ cc_users u,
+ pm_roles r
+ where
+ a.task_id = :task_id and
+ u.party_id = a.party_id and
+ a.role_id = r.role_id
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/task-one.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-one.adp,v
diff -u -r1.12 -r1.13
--- openacs-4/contrib/packages/project-manager/www/task-one.adp 5 Sep 2003 23:43:25 -0000 1.12
+++ openacs-4/contrib/packages/project-manager/www/task-one.adp 12 Sep 2003 01:20:57 -0000 1.13
@@ -85,26 +85,10 @@
@task_term@(s) relying on this @task_term@
-
-
+
+People
+
-
-People
-
-
-
-@assignee_term@(s):
-
-
-
-
-@watcher_term@(s):
-
-
-
-
-
-
Index: openacs-4/contrib/packages/project-manager/www/task-one.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-one.tcl,v
diff -u -r1.15 -r1.16
--- openacs-4/contrib/packages/project-manager/www/task-one.tcl 4 Sep 2003 22:45:23 -0000 1.15
+++ openacs-4/contrib/packages/project-manager/www/task-one.tcl 12 Sep 2003 01:20:57 -0000 1.16
@@ -36,6 +36,7 @@
revisions:multirow
dependency:multirow
dependency2:multirow
+ people:multirow
task_term:onevalue
task_term_lower:onevalue
assignee_term:onevalue
@@ -252,7 +253,48 @@
}
+# People, using list-builder ---------------------------------
+db_multirow people task_people_query { }
+
+template::list::create \
+ -name people \
+ -multirow people \
+ -key item_id \
+ -elements {
+ first_names {
+ label "Who"
+ display_template "@people.user_info@"
+ }
+ role_id {
+ label "Role"
+ display_template "@people.one_line@"
+ }
+ } \
+ -filters {
+ party_id {}
+ orderby_subproject {}
+ orderby_versions {}
+ orderby_tasks {}
+ } \
+ -orderby {
+ role_id {orderby role_id}
+ default_value role_id,desc
+ } \
+ -orderby_name orderby_people \
+ -html {
+ width 100%
+ }
+
+
+
+db_multirow -extend { item_url } subproject task_people_query {
+} {
+ set item_url [export_vars -base "one" -override {{project_item_id $item_id}} {project_item_id}]
+}
+
+
+
ad_return_template
# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/contrib/packages/project-manager/www/admin/default-project-roles-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/admin/Attic/default-project-roles-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/admin/default-project-roles-postgresql.xql 12 Sep 2003 01:20:57 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+postgresql 7.2
+
+
+
+ SELECT
+ role_id,
+ party_id
+ FROM
+ pm_project_default_roles
+
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/admin/default-project-roles.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/admin/Attic/default-project-roles.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/admin/default-project-roles.adp 12 Sep 2003 01:20:57 -0000 1.1
@@ -0,0 +1,10 @@
+
+
+
+
+@project_term@s
+@context_bar@
+
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/admin/default-project-roles.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/admin/Attic/default-project-roles.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/admin/default-project-roles.tcl 12 Sep 2003 01:20:57 -0000 1.1
@@ -0,0 +1,92 @@
+ad_page_contract {
+
+ page to view project roles
+
+ @author jader@bread.com
+ @creation-date 2003-09-10
+ @cvs-id $Id: default-project-roles.tcl,v 1.1 2003/09/12 01:20:57 jader Exp $
+
+ @return title Page title.
+ @return context Context bar.
+ @return roles Multirow data set of project roles
+ @return task_term Terminology for tasks
+ @return task_term_lower Terminology for tasks (lower case)
+ @return project_term Terminology for projects
+ @return project_term_lower Terminology for projects (lower case)
+} {
+ {orderby_r ""}
+} -properties {
+
+ context_bar:onevalue
+ projects:multirow
+ write_p:onevalue
+ create_p:onevalue
+ admin_p:onevalue
+ task_term:onevalue
+ task_term_lower:onevalue
+ project_term:onevalue
+ project_term_lower:onevalue
+}
+
+# --------------------------------------------------------------- #
+
+# terminology
+set task_term [parameter::get -parameter "TaskName" -default "Task"]
+set task_term_lower [parameter::get -parameter "taskname" -default "task"]
+set project_term [parameter::get -parameter "ProjectName" -default "Project"]
+set project_term_lower [parameter::get -parameter "projectname" -default "project"]
+
+# set up context bar
+set context_bar [ad_context_bar "View $project_term_lower roles"]
+
+# the unique identifier for this package
+set package_id [ad_conn package_id]
+set user_id [ad_maybe_redirect_for_registration]
+
+# permissions
+permission::require_permission -party_id $user_id -object_id $package_id -privilege read
+
+set write_p [permission::permission_p -object_id $package_id -privilege write]
+set create_p [permission::permission_p -object_id $package_id -privilege create]
+set admin_p [permission::permission_p -object_id $package_id -privilege admin]
+
+# root CR folder
+set root_folder [db_string get_root "select pm_project__get_root_folder (:package_id, 'f')"]
+
+# Project roles, using list-builder ---------------------------------
+
+template::list::create \
+ -name roles \
+ -multirow roles \
+ -key role_id \
+ -elements {
+ role_id {
+ label "Role ID"
+ link_url_col item_url
+ link_html { title "Edit this role" }
+ }
+ party_id {
+ label "Party ID"
+ }
+ } \
+ -filters {
+ orderby_r {}
+ } \
+ -orderby {
+ role_id {orderby role_id}
+ party_id {orderby party_id}
+ default_value role_id,asc
+ } \
+ -orderby_name orderby_r \
+ -html {
+ width 100%
+ }
+
+
+db_multirow -extend { item_url } roles default_project_roles_query {
+} {
+ set item_url [export_vars -base "default-project-role-add-edit" -override {{project_item_id}} {project_item_id}]
+}
+
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/contrib/packages/project-manager/www/admin/index-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/admin/Attic/index-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/admin/index-postgresql.xql 12 Sep 2003 01:20:57 -0000 1.1
@@ -0,0 +1,29 @@
+
+
+postgresql 7.2
+
+
+
+ SELECT
+ p.item_id,
+ p.project_id,
+ p.parent_id as folder_id,
+ p.object_type as content_type,
+ p.title as project_name,
+ p.project_code,
+ to_char(p.planned_start_date, 'Mon DD ''YY') as planned_start_date,
+ to_char(p.planned_end_date, 'Mon DD ''YY') as planned_end_date,
+ p.ongoing_p,
+ p.actual_hours_completed,
+ p.estimated_hours_total,
+ to_char(p.estimated_finish_date, 'Mon DD ''YY') as estimated_finish_date,
+ to_char(p.earliest_finish_date, 'Mon DD ''YY') as earliest_finish_date,
+ to_char(p.latest_finish_date, 'Mon DD ''YY') as latest_finish_date
+ FROM pm_projectsx p, cr_items i
+ WHERE p.project_id = i.live_revision and
+ p.parent_id = :root_folder
+ ORDER BY p.title
+
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/admin/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/admin/Attic/index.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/admin/index.adp 12 Sep 2003 01:20:57 -0000 1.1
@@ -0,0 +1,34 @@
+
+
+
+
+@project_term@s
+@context@
+
+Click on one of the following items to set it up:
+
+
+
+
+
+
+ Roles
+ the roles people can take on projects and tasks, such as manager, sales contact, tech support person, etc..
+
+
+
+ Default roles
+ the default roles a person takes on projects and tasks.
+
+
+
+ Manage workgroups
+ the default roles a person takes on projects and tasks.
+
+
+
+ Dependency type descriptions
+ the description given to the user for task dependencies.
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/admin/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/admin/Attic/index.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/admin/index.tcl 12 Sep 2003 01:20:57 -0000 1.1
@@ -0,0 +1,56 @@
+ad_page_contract {
+
+ Main admin view page
+
+ @author jader@bread.com
+ @creation-date 2003-09-10
+ @cvs-id $Id: index.tcl,v 1.1 2003/09/12 01:20:57 jader Exp $
+
+ @return title Page title.
+ @return context Context bar.
+ @return projects Multirow data set of projects.
+ @return task_term Terminology for tasks
+ @return task_term_lower Terminology for tasks (lower case)
+ @return project_term Terminology for projects
+ @return project_term_lower Terminology for projects (lower case)
+
+} -properties {
+
+ context:onevalue
+ projects:multirow
+ write_p:onevalue
+ create_p:onevalue
+ admin_p:onevalue
+ task_term:onevalue
+ task_term_lower:onevalue
+ project_term:onevalue
+ project_term_lower:onevalue
+}
+
+# --------------------------------------------------------------- #
+
+# terminology
+set task_term [parameter::get -parameter "TaskName" -default "Task"]
+set task_term_lower [parameter::get -parameter "taskname" -default "task"]
+set project_term [parameter::get -parameter "ProjectName" -default "Project"]
+set project_term_lower [parameter::get -parameter "projectname" -default "project"]
+
+# set up context bar
+set context [list]
+
+# the unique identifier for this package
+set package_id [ad_conn package_id]
+set user_id [ad_maybe_redirect_for_registration]
+
+# permissions
+permission::require_permission -party_id $user_id -object_id $package_id -privilege read
+
+set write_p [permission::permission_p -object_id $package_id -privilege write]
+set create_p [permission::permission_p -object_id $package_id -privilege create]
+set admin_p [permission::permission_p -object_id $package_id -privilege admin]
+
+# root CR folder
+set root_folder [db_string get_root "select pm_project__get_root_folder (:package_id, 'f')"]
+
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/contrib/packages/project-manager/www/admin/roles-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/admin/Attic/roles-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/admin/roles-postgresql.xql 12 Sep 2003 01:20:57 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+postgresql 7.2
+
+
+
+ SELECT
+ role_id,
+ one_line,
+ description,
+ is_observer_p,
+ sort_order
+ FROM
+ pm_roles
+
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/admin/roles.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/admin/Attic/roles.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/admin/roles.adp 12 Sep 2003 01:20:57 -0000 1.1
@@ -0,0 +1,10 @@
+
+
+
+
+@project_term@s
+@context_bar@
+
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/admin/roles.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/admin/Attic/roles.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/admin/roles.tcl 12 Sep 2003 01:20:57 -0000 1.1
@@ -0,0 +1,101 @@
+ad_page_contract {
+
+ page to view roles
+
+ @author jader@bread.com
+ @creation-date 2003-09-10
+ @cvs-id $Id: roles.tcl,v 1.1 2003/09/12 01:20:57 jader Exp $
+
+ @return title Page title.
+ @return context Context bar.
+ @return tasks Multirow data set of task roles
+ @return task_term Terminology for tasks
+ @return task_term_lower Terminology for tasks (lower case)
+ @return project_term Terminology for projects
+ @return project_term_lower Terminology for projects (lower case)
+} {
+ {orderby_r ""}
+} -properties {
+
+ context_bar:onevalue
+ roles:multirow
+ write_p:onevalue
+ create_p:onevalue
+ admin_p:onevalue
+ task_term:onevalue
+ task_term_lower:onevalue
+ project_term:onevalue
+ project_term_lower:onevalue
+}
+
+# --------------------------------------------------------------- #
+
+# terminology
+set task_term [parameter::get -parameter "TaskName" -default "Task"]
+set task_term_lower [parameter::get -parameter "taskname" -default "task"]
+set project_term [parameter::get -parameter "ProjectName" -default "Project"]
+set project_term_lower [parameter::get -parameter "projectname" -default "project"]
+
+# set up context bar
+set context_bar [ad_context_bar "View $project_term_lower roles"]
+
+# the unique identifier for this package
+set package_id [ad_conn package_id]
+set user_id [ad_maybe_redirect_for_registration]
+
+# permissions
+permission::require_permission -party_id $user_id -object_id $package_id -privilege read
+
+set write_p [permission::permission_p -object_id $package_id -privilege write]
+set create_p [permission::permission_p -object_id $package_id -privilege create]
+set admin_p [permission::permission_p -object_id $package_id -privilege admin]
+
+# root CR folder
+set root_folder [db_string get_root "select pm_project__get_root_folder (:package_id, 'f')"]
+
+# Project roles, using list-builder ---------------------------------
+
+template::list::create \
+ -name roles \
+ -multirow roles \
+ -key role_id \
+ -elements {
+ role_id {
+ label "Role ID"
+ link_url_col item_url
+ link_html { title "Edit this role" }
+ }
+ one_line {
+ label "One line description"
+ }
+ description {
+ label "Description"
+ }
+ is_observer_p {
+ label "Observer?"
+ }
+ sort_order {
+ label "Sort order"
+ }
+ } \
+ -filters {
+ orderby_r {}
+ } \
+ -orderby {
+ one_line {orderby one_line}
+ sort_order {orderby sort_order}
+ default_value sort_order,asc
+ } \
+ -orderby_name orderby_r \
+ -html {
+ width 100%
+ }
+
+
+db_multirow -extend { item_url } roles roles_query {
+} {
+ set item_url [export_vars -base "ask-role-add-edit" -override {{project_item_id}} {project_item_id}]
+}
+
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/contrib/packages/project-manager/www/admin/workgroups-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/admin/Attic/workgroups-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/admin/workgroups-postgresql.xql 12 Sep 2003 01:20:57 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+postgresql 7.2
+
+
+
+ SELECT
+ workgroup_id,
+ one_line,
+ description,
+ sort_order
+ FROM
+ pm_workgroup
+
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/admin/workgroups.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/admin/Attic/workgroups.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/admin/workgroups.adp 12 Sep 2003 01:20:57 -0000 1.1
@@ -0,0 +1,10 @@
+
+
+
+
+@project_term@s
+@context_bar@
+
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/admin/workgroups.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/admin/Attic/workgroups.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/admin/workgroups.tcl 12 Sep 2003 01:20:57 -0000 1.1
@@ -0,0 +1,98 @@
+ad_page_contract {
+
+ page to view workgroups
+
+ @author jader@bread.com
+ @creation-date 2003-09-10
+ @cvs-id $Id: workgroups.tcl,v 1.1 2003/09/12 01:20:57 jader Exp $
+
+ @return title Page title.
+ @return context Context bar.
+ @return tasks Multirow data set of task roles
+ @return task_term Terminology for tasks
+ @return task_term_lower Terminology for tasks (lower case)
+ @return project_term Terminology for projects
+ @return project_term_lower Terminology for projects (lower case)
+} {
+ {orderby_r ""}
+} -properties {
+
+ context_bar:onevalue
+ workgroup:multirow
+ write_p:onevalue
+ create_p:onevalue
+ admin_p:onevalue
+ task_term:onevalue
+ task_term_lower:onevalue
+ project_term:onevalue
+ project_term_lower:onevalue
+}
+
+# --------------------------------------------------------------- #
+
+# terminology
+set task_term [parameter::get -parameter "TaskName" -default "Task"]
+set task_term_lower [parameter::get -parameter "taskname" -default "task"]
+set project_term [parameter::get -parameter "ProjectName" -default "Project"]
+set project_term_lower [parameter::get -parameter "projectname" -default "project"]
+
+# set up context bar
+set context_bar [ad_context_bar "View $project_term_lower workgroups"]
+
+# the unique identifier for this package
+set package_id [ad_conn package_id]
+set user_id [ad_maybe_redirect_for_registration]
+
+# permissions
+permission::require_permission -party_id $user_id -object_id $package_id -privilege read
+
+set write_p [permission::permission_p -object_id $package_id -privilege write]
+set create_p [permission::permission_p -object_id $package_id -privilege create]
+set admin_p [permission::permission_p -object_id $package_id -privilege admin]
+
+# root CR folder
+set root_folder [db_string get_root "select pm_project__get_root_folder (:package_id, 'f')"]
+
+# Project workgroups, using list-builder ---------------------------------
+
+template::list::create \
+ -name workgroup \
+ -multirow workgroup \
+ -key role_id \
+ -elements {
+ workgroup_id {
+ label "Workgroup ID"
+ link_url_col item_url
+ link_html { title "Edit this role" }
+ }
+ one_line {
+ label "One line description"
+ }
+ description {
+ label "Description"
+ }
+ sort_order {
+ label "Sort order"
+ }
+ } \
+ -filters {
+ orderby_r {}
+ } \
+ -orderby {
+ one_line {orderby one_line}
+ sort_order {orderby sort_order}
+ default_value sort_order,asc
+ } \
+ -orderby_name orderby_r \
+ -html {
+ width 100%
+ }
+
+
+db_multirow -extend { item_url } workgroup wg_query {
+} {
+ set item_url [export_vars -base "ask-role-add-edit" -override {{project_item_id}} {project_item_id}]
+}
+
+
+# ------------------------- END OF FILE ------------------------- #