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.4 -r1.5
--- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql 1 Aug 2003 20:51:04 -0000 1.4
+++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql 7 Aug 2003 23:08:45 -0000 1.5
@@ -13,8 +13,8 @@
-- task constraint types
drop table pm_task_constraint_types cascade;
drop table pm_task_constraints cascade;
+drop sequence pm_task_constraint_seq;
-
create function inline_0 ()
returns integer as '
declare
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.4 -r1.5
--- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql 1 Aug 2003 20:51:04 -0000 1.4
+++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql 7 Aug 2003 23:08:45 -0000 1.5
@@ -140,25 +140,33 @@
-- cannot finish until Task X begins
create table pm_task_constraint_types (
- task_constraint_type_id integer
- constraint pm_task_const_type_id_pk
+ short_name varchar(100)
+ constraint pm_task_const_sn_pk
primary key,
- short_name varchar(100),
description varchar(1000)
);
+insert into pm_task_constraint_types (short_name, description) values ('start_before_start','Must start before this task can start');
+insert into pm_task_constraint_types (short_name, description) values ('start_before_finish','Must start before this task can finish');
+insert into pm_task_constraint_types (short_name, description) values ('finish_before_start','Must finish before this task can start');
+insert into pm_task_constraint_types (short_name, description) values ('finish_before_finish','Must finish before this task can finish');
+
+
+create sequence pm_task_constraint_seq;
+
create table pm_task_constraints (
+ constraint_id integer
+ constraint pm_task_const_id_pk
+ primary key,
task_id integer
constraint pm_tasks_const_task_id_fk
references pm_tasks
- on delete cascade
- constraint pm_task_const_task_id_pk
- primary key,
+ on delete cascade,
parent_task_id integer
constraint pm_tasks_const_parent_id_fk
references pm_tasks
on delete cascade,
- task_type integer
+ const_type varchar
constraint pm_tasks_const_type
references pm_task_constraint_types
);
Index: openacs-4/contrib/packages/project-manager/www/add-edit-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/add-edit-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/contrib/packages/project-manager/www/add-edit-postgresql.xql 30 Jul 2003 20:42:05 -0000 1.2
+++ openacs-4/contrib/packages/project-manager/www/add-edit-postgresql.xql 7 Aug 2003 23:08:45 -0000 1.3
@@ -33,8 +33,8 @@
:goal,
:description,
:deadline_scheduling,
- to_timestamp(:planned_start_date,'YYYY MM DD HH24 MI SS'),
- to_timestamp(:planned_end_date,'YYYY MM DD HH24 MI SS'),
+ :planned_start_date,
+ :planned_end_date,
null,
null,
:ongoing_p,
Index: openacs-4/contrib/packages/project-manager/www/add-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/add-edit.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/contrib/packages/project-manager/www/add-edit.tcl 6 Aug 2003 20:22:18 -0000 1.6
+++ openacs-4/contrib/packages/project-manager/www/add-edit.tcl 7 Aug 2003 23:08:45 -0000 1.7
@@ -5,6 +5,7 @@
@author jader@bread.com, ncarroll@ee.usyd.edu.au
@creation-date 2003-05-15
@cvs-id $Id$
+
@return context_bar Context bar.
@return title Page title.
@@ -19,6 +20,8 @@
{description ""}
{planned_start_date ""}
{planned_end_date ""}
+ {deadline_scheduling ""}
+ {ongoing_p ""}
} -properties {
@@ -85,6 +88,9 @@
}
+# We put this in an ad_form extend because we want to be able to
+# parameterize what the label calls projects.
+
set extend_txt "
{project_name:text
{label \"$project_term name\"}
@@ -111,17 +117,21 @@
{deadline_scheduling:text(select)
{label \"Scheduling\"}
{options {{\"From today\" \"t\"} {\"From deadline\" \"e\"}}
- {value \$deadline_scheduling}} }
+ {value $deadline_scheduling}} }
- {planned_start_date:date {value {[util::date acquire clock [clock scan $planned_start_date]]}} optional
+ {planned_start_date:date,to_sql(linear_date),from_sql(linear_date_no_time)
{label \"Planned start date\"}
{format \"MONTH DD YYYY\"}
+ {value \$planned_start_date}
+ {today}
{help}
}
- {planned_end_date:date {value {[util::date acquire clock [clock scan $planned_end_date]]}} optional
+ {planned_end_date:date,to_sql(linear_date),from_sql(linear_date_no_time)
{label \"Planned end date\"}
{format \"MONTH DD YYYY\"}
+ {value \$planned_end_date}
+ {today}
{help}
}
@@ -131,4 +141,6 @@
"
+ns_log Notice $extend_txt
+
ad_form -extend -name add_edit -form $extend_txt -select_query_name project_query
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.4 -r1.5
--- openacs-4/contrib/packages/project-manager/www/one-postgresql.xql 4 Aug 2003 23:44:51 -0000 1.4
+++ openacs-4/contrib/packages/project-manager/www/one-postgresql.xql 7 Aug 2003 23:08:45 -0000 1.5
@@ -75,11 +75,13 @@
SELECT
t.item_id,
t.title,
- to_char(t.start_date,'MM/DD/YYYY') as start_date,
- to_char(t.end_date,'MM/DD/YYYY') as end_date,
- percent_complete
+ to_char(t.start_date,'MM/DD/YY') as start_date,
+ to_char(t.end_date,'MM/DD/YY') as end_date,
+ t.percent_complete,
+ c.parent_task_id,
+ c.const_type
FROM
- pm_tasks_revisionsx t, cr_items i
+ pm_tasks_revisionsx t, cr_items i LEFT JOIN pm_task_constraints c ON i.item_id = c.task_id
WHERE
t.parent_id = :item_id and
t.revision_id = i.live_revision
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.11 -r1.12
--- openacs-4/contrib/packages/project-manager/www/one.adp 6 Aug 2003 20:22:18 -0000 1.11
+++ openacs-4/contrib/packages/project-manager/www/one.adp 7 Aug 2003 23:08:45 -0000 1.12
@@ -24,9 +24,10 @@
ID |
Name |
- Completed |
- Start date |
- End date |
+ Status |
+ Start |
+ End |
+ Constraints |
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.7 -r1.8
--- openacs-4/contrib/packages/project-manager/www/one.tcl 6 Aug 2003 20:22:18 -0000 1.7
+++ openacs-4/contrib/packages/project-manager/www/one.tcl 7 Aug 2003 23:08:45 -0000 1.8
@@ -40,6 +40,8 @@
write_p:onevalue
create_p:onevalue
versions:multirow
+ parent_task_id:onevalue
+ task_type:onevalue
} -validate {
item_id_exists {
if {![info exists item_id]} {
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.7 -r1.8
--- openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 6 Aug 2003 20:22:18 -0000 1.7
+++ openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 7 Aug 2003 23:08:45 -0000 1.8
@@ -20,6 +20,7 @@
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
@@ -111,19 +112,19 @@
set peeraddr [ad_conn peeraddr]
} -new_data {
-
+
+ set task_revisions [list]
for {set i 1} {$i <= $number} {incr i} {
- # ns_log Notice "task_title($i) = $task_title($i)"
- db_exec_plsql new_task_item { *SQL* }
+ lappend task_revisions [db_exec_plsql new_task_item { *SQL* }]
}
} -edit_data {
db_exec_plsql new_task_revision { *SQL* }
} -select_query_name task_query -after_submit {
-
- ad_returnredirect "one?item_id=$project_item_id&project_id=$project_id"
+
+ ad_returnredirect "task-constraint-add-edit?[export_vars -url task_revisions:multiple]"
ad_script_abort
}
@@ -167,7 +168,7 @@
}
-ad_form -extend -name add_edit -form $add_edit_definition -select_query_name task_query
+ad_form -extend -name add_edit -form $add_edit_definition
# we are editing?
Index: openacs-4/contrib/packages/project-manager/www/task-constraint-add-edit-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-constraint-add-edit-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/task-constraint-add-edit-postgresql.xql 7 Aug 2003 23:08:45 -0000 1.1
@@ -0,0 +1,85 @@
+
+
+
+
+ select
+ t.task_revision_id,
+ t.title as task_title,
+ t.item_id,
+ t.description,
+ t.name,
+ t.parent_id,
+ to_char(t.start_date,'YYYY MM DD') as start_date,
+ to_char(t.end_date,'YYYY MM DD') as end_date,
+ t.percent_complete
+ FROM
+ pm_tasks_revisionsx t, cr_items i
+ WHERE
+ t.item_id in ([join $task_id ", "]) and
+ t.revision_id = i.live_revision
+
+
+
+
+
+ select
+ t.revision_id,
+ t.title as task_title,
+ t.item_id,
+ t.description,
+ t.name,
+ t.parent_id,
+ to_char(t.start_date,'YYYY MM DD') as start_date,
+ to_char(t.end_date,'YYYY MM DD') as end_date,
+ t.percent_complete
+ FROM
+ pm_tasks_revisionsx t, cr_items i
+ WHERE
+ t.revision_id in ([join $task_revisions ", "]) and
+ i.item_id = t.item_id
+
+
+
+
+
+ select
+ t.item_id
+ FROM
+ pm_tasks_revisionsx t
+ WHERE
+ t.revision_id = :tr
+
+
+
+
+
+ select
+ short_name,
+ description
+ FROM
+ pm_task_constraint_types
+ ORDER BY
+ short_name
+
+
+
+
+
+ INSERT INTO pm_task_constraints
+ (constraint_id, task_id, parent_task_id, const_type)
+ VALUES
+ (:const_id, :tsk_id, :parent_tsk_id, :type_id)
+
+
+
+
+
+ select
+ t.parent_id
+ FROM
+ pm_tasks_revisionsx t
+ WHERE
+ t.revision_id = '[lindex $task_revisions 0]'
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/task-constraint-add-edit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-constraint-add-edit.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/task-constraint-add-edit.adp 7 Aug 2003 23:08:45 -0000 1.1
@@ -0,0 +1,21 @@
+
+@context_bar@
+@title@
+
+
+You may now add constraints to these
+@task_term_lower@s. Constraints describe the order in which items must
+be completed. For example, the boards must be delivered before
+construction can begin. Entering constraints is important because it
+allows the system to automatically compute schedules. Or, you can
+skip constraints.
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/contrib/packages/project-manager/www/task-constraint-add-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-constraint-add-edit.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/project-manager/www/task-constraint-add-edit.tcl 7 Aug 2003 23:08:45 -0000 1.1
@@ -0,0 +1,138 @@
+ad_page_contract {
+
+ Form to add task constraints
+
+ @author jader@bread.com
+ @creation-date 2003-08-06
+ @cvs-id $Id: task-constraint-add-edit.tcl,v 1.1 2003/08/07 23:08:45 jader Exp $
+
+ @return context_bar Context bar.
+ @return title Page title.
+ @return task_term_lower Terminology to use for Task
+ @return project_item_id item_id for the project
+
+ @param constraint_id The new ID for constraints we create
+
+} {
+
+ constraint_id:integer,optional
+ task_revisions:multiple
+ const_type:array,optional
+ const_task_id:array,optional
+
+} -properties {
+
+ context_bar:onevalue
+ title:onevalue
+ task_term_lower:onevalue
+ project_item_id:onevalue
+
+}
+
+# --------------------------------------------------------------- #
+
+# 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 constraints"
+set context_bar [ad_context_bar]
+# set context_bar [ad_context_bar [list "one?item_id=$project_item_id&project_id=$project_id" "One $project_term"] "New $task_term"]
+permission::require_permission -party_id $user_id -object_id $package_id -privilege create
+
+
+set project_item_id [db_string get_parent_project { }]
+
+ad_form -name add_edit -form {
+ constraint_id:key(pm_task_constraint_seq)
+
+ {task_revisions:text(hidden)
+ {value $task_revisions}
+ }
+
+} -on_submit {
+
+ set user_id [ad_conn user_id]
+ set peeraddr [ad_conn peeraddr]
+
+} -new_data {
+
+ foreach tr $task_revisions {
+ set type_id $const_type($tr)
+ set parent_tsk_id $const_task_id($tr)
+ set const_id [db_nextval pm_task_constraint_seq]
+ set tsk_revision_id $tr
+ set tsk_id [db_string get_task_id { }]
+
+ db_dml new_constraint { *SQL* }
+ }
+
+} -edit_data {
+
+} -after_submit {
+
+ ad_returnredirect "one?item_id=$project_item_id"
+ ad_script_abort
+}
+
+# get constraint types
+
+set options [list]
+db_foreach get_const_types { } -column_array consts {
+ lappend options "{\"$consts(description)\" $consts(short_name)}"
+}
+
+# get the information on tasks from their revision_numbers
+
+db_foreach get_task_info { } -column_array tasks {
+
+ append add_edit_definition "
+ {item_id.$tasks(revision_id):text(inform)
+ {label \"$task_term\"}
+ {value $tasks(item_id)}
+ }
+
+ {task_title.$tasks(revision_id):text(inform)
+ {label \"Subject\"}
+ {value $tasks(task_title)}
+ }
+
+ {const_type.$tasks(revision_id):text(select)
+ {label \"Constraint type\"}
+ {options {[join $options " "]}}
+ {value {finish_before_start}}
+ }
+
+ {const_task_id.$tasks(revision_id):text
+ {label \"Constraint\"}
+ {html {size 6}}
+ {help_text {$task_term ID constraint is based on}}
+ }
+
+ {description.$tasks(revision_id):text(inform)
+ {label \"Description\"}
+ {value $tasks(description)}
+ }
+
+ {start_date.$tasks(revision_id):text(inform)
+ {label \"Start date\"}
+ {value $tasks(start_date)}
+ }
+
+ {end_date.$tasks(revision_id):text(inform)
+ {label \"End date\"}
+ {value $tasks(end_date)}
+ }
+ "
+
+}
+
+
+ad_form -extend -name add_edit -form $add_edit_definition
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.5 -r1.6
--- openacs-4/contrib/packages/project-manager/www/task-one-postgresql.xql 4 Aug 2003 23:44:52 -0000 1.5
+++ openacs-4/contrib/packages/project-manager/www/task-one-postgresql.xql 7 Aug 2003 23:08:45 -0000 1.6
@@ -74,4 +74,24 @@
t.revision_id desc
+
+
+
+ SELECT
+ t.title as task_title,
+ to_char(t.start_date,'MM/DD/YYYY') as start_date,
+ to_char(t.end_date,'MM/DD/YYYY') as end_date,
+ t.percent_complete,
+ i.live_revision,
+ c.parent_task_id,
+ c.const_type
+ FROM
+ pm_tasks_revisionsx t, cr_items i, pm_task_constraints c
+ WHERE
+ c.task_id = :task_id and
+ c.parent_task_id = t.item_id and
+ t.revision_id = i.live_revision and
+ t.item_id = i.item_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.5 -r1.6
--- openacs-4/contrib/packages/project-manager/www/task-one.adp 6 Aug 2003 20:22:18 -0000 1.5
+++ openacs-4/contrib/packages/project-manager/www/task-one.adp 7 Aug 2003 23:08:45 -0000 1.6
@@ -11,16 +11,44 @@
+
+
-
+
+ Constraints |
-
-Constraints |
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @consts.task_title@ |
+ @consts.percent_complete@% done |
+ @consts.start_date@ |
+ @consts.end_date@ |
+
+
+
+
+
+
+
+
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.7 -r1.8
--- openacs-4/contrib/packages/project-manager/www/task-one.tcl 6 Aug 2003 20:22:18 -0000 1.7
+++ openacs-4/contrib/packages/project-manager/www/task-one.tcl 7 Aug 2003 23:08:45 -0000 1.8
@@ -9,7 +9,8 @@
@return task_term_lower Term to use for task
@return assignee_term Term to use for assignee
@return watcher_term Term to use for watcher
-
+ @return consts multirow that stores constraint information
+
@param task_id item_id for the task
@param project_item_id the item_id for the project. Used for navigational links
@param project_id the revision_id for the project. Used for navigational links
@@ -31,6 +32,7 @@
write_p:onevalue
create_p:onevalue
versions:multirow
+ consts:multirow
task_term:onevalue
task_term_lower:onevalue
assignee_term:onevalue
@@ -78,6 +80,8 @@
db_multirow versions task_revisions_query { }
+db_multirow consts consts_query { }
+
ad_return_template
# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/contrib/packages/project-manager/www/images/finish_before_finish.png
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/images/Attic/finish_before_finish.png,v
diff -u
Binary files differ
Index: openacs-4/contrib/packages/project-manager/www/images/finish_before_start.png
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/images/Attic/finish_before_start.png,v
diff -u
Binary files differ
Index: openacs-4/contrib/packages/project-manager/www/images/start_before_finish.png
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/images/Attic/start_before_finish.png,v
diff -u
Binary files differ
Index: openacs-4/contrib/packages/project-manager/www/images/start_before_start.png
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/images/Attic/start_before_start.png,v
diff -u
Binary files differ
|