Index: openacs-4/packages/curriculum/lib/curriculum-ave.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/lib/curriculum-ave.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/curriculum/lib/curriculum-ave.tcl 18 Jun 2003 15:21:51 -0000 1.4 +++ openacs-4/packages/curriculum/lib/curriculum-ave.tcl 28 Jun 2003 09:30:04 -0000 1.5 @@ -139,17 +139,6 @@ } } -# Add status field on display/edit mode for people with write privs. -if { !$new_p && $write_p } { - ad_form -extend -name curriculum -form { - {pretty_state:text(inform) - {label Status} - {before_html } - {after_html } - } - } -} - ad_form -extend -name curriculum -form { {description:richtext {mode $element_mode} @@ -160,18 +149,38 @@ } } +if { $write_p } { + ad_form -extend -name curriculum -form { + {comment:richtext + {mode $element_mode} + {label "Workflow Log"} + {help_text "Comment your action"} + {html {rows 5 cols 50 wrap soft}} + optional + } + } +} + +# Add status field on display/edit mode for people with write privs. if { !$new_p && $write_p } { + ad_form -extend -name curriculum -form { + {pretty_state:text(inform) + {label Status} + {before_html } + {after_html } + } + } # Extend the form with assignee widgets (only in edit or display mode). workflow::case::role::add_assignee_widgets -case_id $case_id -form_name curriculum # FIXME. Get values for the role assignment widgets. workflow::case::role::set_assignee_values -case_id $case_id -form_name curriculum - # Set values for description field. + # Set values for comment field. # Is before_html the right placement of this? Perhaps we should link # to a different page where we show the case log? - element set_properties curriculum description \ + element set_properties curriculum comment \ -before_html "[workflow::case::get_activity_html -case_id $case_id][ad_decode $action_id "" "" "

$action_pretty_name by user_first_names user_last_name

"]" # Single-curriculum notifications link. @@ -216,8 +225,7 @@ template::util::array_to_vars curriculum_array - # The first list element is the description and it needs to be set to be empty. - set description [list {} $desc_format] + set description [template::util::richtext::create $description $desc_format] # Hide elements that should be hidden because of a certain wf status. foreach element $curriculum_array(hide_fields) { @@ -237,6 +245,8 @@ -name $name \ -description [template::util::richtext::get_property contents $description] \ -desc_format [template::util::richtext::get_property format $description] \ + -comment [template::util::richtext::get_property contents $comment] \ + -comment_format [template::util::richtext::get_property format $comment] \ -owner_id $owner_id \ -package_id $package_id @@ -247,6 +257,8 @@ -name $name \ -description [template::util::richtext::get_property contents $description] \ -desc_format [template::util::richtext::get_property format $description] \ + -comment [template::util::richtext::get_property contents $comment] \ + -comment_format [template::util::richtext::get_property format $comment] \ -owner_id $owner_id \ -action_id $action_id \ -array curriculum_array 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 -N -r1.2 -r1.3 --- openacs-4/packages/curriculum/tcl/curriculum-procs.tcl 17 Jun 2003 15:43:59 -0000 1.2 +++ openacs-4/packages/curriculum/tcl/curriculum-procs.tcl 28 Jun 2003 09:30:03 -0000 1.3 @@ -33,20 +33,24 @@ -name:required {-description ""} {-desc_format "text/html"} + {-comment ""} + {-comment_format "text/html"} {-owner_id ""} -package_id:required {-sort_key ""} } { Create a new curriculum. - @param curriculum_id The pre-fetched object-id of the curriculum which should be created (normally not used). - @param name The name of the curriculum. - @param description Long description of the objective(s) of the curriculum. - @param desc_format The format of the description. 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. + @param curriculum_id The pre-fetched object-id of the curriculum which should be created (normally not used). + @param name The name of the curriculum. + @param description Long description of the objective(s) of the curriculum. + @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. @return The object-id of the newly created curriculum. @@ -72,8 +76,8 @@ workflow::case::new \ -workflow_id [workflow::get_id -object_id $package_id -short_name [workflow_short_name]] \ -object_id $curriculum_id \ - -comment $description \ - -comment_mime_type $desc_format + -comment $comment \ + -comment_mime_type $comment_format } return $curriculum_id @@ -85,6 +89,8 @@ -name:required {-description ""} {-desc_format "text/plain"} + {-comment ""} + {-comment_format "text/html"} -owner_id:required -action_id:required -array:required @@ -93,11 +99,13 @@ Edit a curriculum. - @param curriculum_id The object-id of the curriculum which should be updated. - @param name The new name. - @param description The new description. - @param desc_format The format of the description. Current formats are: text/enhanced text/plain text/html text/fixed-width - @param owner_id The new owner (party_id). + @param curriculum_id The object-id of the curriculum which should be updated. + @param name The new name. + @param description The new description. + @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 new owner (party_id). @return Nothing. @@ -131,8 +139,8 @@ workflow::case::action::execute \ -case_id $case_id \ -action_id $action_id \ - -comment $description \ - -comment_mime_type $desc_format \ + -comment $comment \ + -comment_mime_type $comment_format \ -entry_id $entry_id } @@ -329,10 +337,10 @@ pretty_name "Comment" pretty_past_tense "Commented" allowed_roles { author editor publisher } - privileges { read write } + privileges { write } always_enabled_p t edit_fields { - description + comment } } edit { @@ -345,17 +353,31 @@ edit_fields { name description + comment } } + reject { + pretty_name "Reject" + pretty_past_tense "Rejected" + new_state "rejected" + allowed_roles { publisher } + privileges { write } + always_enabled_p t + edit_fields { + comment + } + } publish { pretty_name "Publish" pretty_past_tense "Published" assigned_role "publisher" - enabled_states { authored edited } + enabled_states { authored edited archived } assigned_states { edited } new_state "published" privileges { write } - edit_fields { } + edit_fields { + comment + } } archive { pretty_name "Archive" @@ -364,7 +386,9 @@ assigned_states { published } new_state "archived" privileges { write } - edit_fields { } + edit_fields { + comment + } } } } 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 -N -r1.7 -r1.8 --- openacs-4/packages/curriculum/tcl/misc-procs.tcl 25 Jun 2003 17:34:17 -0000 1.7 +++ openacs-4/packages/curriculum/tcl/misc-procs.tcl 28 Jun 2003 09:30:03 -0000 1.8 @@ -15,7 +15,7 @@ ad_proc -public curriculum::package_keys { } { Builds a list that will be used as an argument to "site_node_closest_ancestor_package". - If .LRN is not installed it will be ste to "acs_subsite" and if it is installed, + If .LRN is not installed it will be set to "acs_subsite" and if it is installed, "dotlrn" will be prepended to the list. The Underlying reason we do this is because we want to allow one Curriculum instance under each dotLRN instance, if dotLRN is installed. And if it is installed it should take precedence over acs_subsite.