Index: openacs-4/packages/curriculum/catalog/curriculum.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/catalog/curriculum.en_US.ISO-8859-1.xml,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/curriculum/catalog/curriculum.en_US.ISO-8859-1.xml 25 Sep 2003 12:28:37 -0000 1.4 +++ openacs-4/packages/curriculum/catalog/curriculum.en_US.ISO-8859-1.xml 4 Oct 2003 13:10:51 -0000 1.5 @@ -9,6 +9,8 @@ Any Archive Archived + Assign + Assigned Author Comment Commented @@ -38,7 +40,7 @@ Help Information A leading "http://" indicates that the URL is external. - %action_pretty_name% by %user_name%: + %action_pretty_past_tense% by %user_name%: Activate this element Add resolution code to log title Add the dropped curriculum to the toolbar @@ -51,14 +53,14 @@ Are you sure you want to delete this element? Back to %ad_url%%return_url% Back to where you came from - Capture resolution code in the case activity log Could not get child package_id Create a new curriculum Deactivate this element Delete this curriculum and all of its data Delete this element and all of its data deleting curriculum %curriculum_id% in package_id %package_id% %element_name%, part of %curriculum_name% + Flush element cache Here is what the database said: I'm done now, update the bar for everyone Installing curriculum filter for %url_pattern% in package_id %package_id% @@ -81,7 +83,6 @@ Uncheck the visited elements in all curriculums Uncheck the visited elements Unsubscribe to notifications for activity on this curriculum - Update the toolbar for every user (use sparingly) URL may not be more than %length% characters long. %user_id% doesn't have permission to '%action%' on curriculum %curriculum_id% Visit this element again Index: openacs-4/packages/curriculum/catalog/curriculum.sv_SE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/catalog/curriculum.sv_SE.ISO-8859-1.xml,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/curriculum/catalog/curriculum.sv_SE.ISO-8859-1.xml 25 Sep 2003 12:28:37 -0000 1.3 +++ openacs-4/packages/curriculum/catalog/curriculum.sv_SE.ISO-8859-1.xml 4 Oct 2003 13:10:51 -0000 1.4 @@ -9,6 +9,8 @@ Alla Arkivera Arkiverad + Tilldela + Tilldelad Upphovsman Kommentera Kommenterad @@ -38,7 +40,7 @@ Hj�lp Information Ett inledande "http://" betyder att URL:en �r extern. - %action_pretty_name% av %user_name%: + %action_pretty_past_tense% av %user_name%: Aktivera detta element L�gg till uppl�sningskod till loggtiteln L�gg till den avbrutna kursplanen till panelen @@ -51,14 +53,14 @@ �r du s�ker p� att du vill radera detta element? Tillbaka till %ad_url%%return_url% Tillbaka dit du kom ifr�n - L�gg in uppl�sningskod i case activity-loggen Kunde inte hitta child package_id L�gg upp en ny kursplan Avaktivera detta element Radera denna kursplan och dess samtliga element Radera detta element och all dess data raderar kursplan %curriculum_id% i package_id %package_id% %element_name%, del av %curriculum_name% + Flusha element-cachen Det h�r �r vad databasen meddelade: Jag �r klar, uppdatera alla anv�ndares paneler installerar filter f�r %url_pattern% i package_id %package_id% @@ -79,7 +81,6 @@ Avmarkera de bes�kta elementen i samtliga kursplaner Avmarkera de bes�kta elementen S�g upp fortsatta notifieringar om �tg�rder p� denna kursplan - Uppdatera kursplanspanelen f�r samtliga anv�ndare (anv�nd sparsamt) URL:en f�r inte vara l�ngre �n %length% tecken l�ng. %user_id% saknar r�ttighet att '%action%' curriculum %curriculum_id% Bes�k detta element igen Index: openacs-4/packages/curriculum/lib/admin-curriculums.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/lib/admin-curriculums.adp,v diff -u -N -r1.13 -r1.14 --- openacs-4/packages/curriculum/lib/admin-curriculums.adp 15 Sep 2003 17:15:17 -0000 1.13 +++ openacs-4/packages/curriculum/lib/admin-curriculums.adp 4 Oct 2003 13:10:52 -0000 1.14 @@ -8,9 +8,6 @@ ]

-

- #curriculum.lt_Im_done_now_update_th# -

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.9 -r1.10 --- openacs-4/packages/curriculum/lib/curriculum-ave.tcl 22 Sep 2003 18:46:08 -0000 1.9 +++ openacs-4/packages/curriculum/lib/curriculum-ave.tcl 4 Oct 2003 13:10:51 -0000 1.10 @@ -16,6 +16,7 @@ set package_id [curriculum::conn package_id] set user_id [ad_conn user_id] +set owners_list [list] set actions [list] set element_mode {} set desc_help_text "[_ curriculum.lt_This_text_should_desc]" @@ -32,18 +33,20 @@ set form_mode edit set title "[_ curriculum.Create_Curriculum]" + lappend owners_list [list [person::name -person_id $user_id] "$user_id"] + } else { #### # Edit/display curriculum. #### + curriculum::get -curriculum_id $curriculum_id -array curriculum_array + set write_p [permission::permission_p -object_id $curriculum_id -privilege write] if { $write_p } { - #permission::require_permission -object_id $curriculum_id -privilege write - #### # Workflow. #### @@ -52,12 +55,6 @@ set action_id [form get_action curriculum] set wf_action_exists_p [expr ![empty_string_p $action_id]] - # FIXME. Do we need this when we require permission above already? - # Registration required for all actions. - # if { $wf_action_exists_p } { - # ad_maybe_redirect_for_registration - # } - set case_id [workflow::case::get_id \ -object_id $curriculum_id \ -workflow_short_name [curriculum::workflow_short_name]] @@ -71,7 +68,8 @@ if { !$wf_action_exists_p } { foreach available_action_id [workflow::case::get_available_actions -case_id $case_id] { workflow::action::get -action_id $available_action_id -array available_action - lappend actions [list " $available_action(pretty_name) " $available_action(action_id)] + lappend actions [list " [lang::util::localize $available_action(pretty_name)] " \ + $available_action(action_id)] } } @@ -85,36 +83,39 @@ # then the form will lose its OK and Cancel buttons when an action button is pressed. set element_mode display + + workflow::action::get -action_id $action_id -array action - set action_pretty_name [lang::util::localize [workflow::action::get_element \ - -action_id $action_id \ - -element pretty_name]] + set action_pretty_name [lang::util::localize $action(pretty_name)] + set action_pretty_past_tense [lang::util::localize $action(pretty_past_tense)] + } else { set action_pretty_name {} + set action_pretty_past_tense {} } - set curriculum_name [acs_object_name $curriculum_id] - set title "[ad_decode $action_pretty_name "" "[_ curriculum.View]" $action_pretty_name] [_ curriculum.Curriculum] $curriculum_name" + set title "[ad_decode $action_pretty_name "" "[_ curriculum.View]" $action_pretty_name] [_ curriculum.Curriculum] $curriculum_array(name)" + } else { # Display mode only! (User doesn't have write perms) set wf_action_exists_p 0 - set curriculum_name [acs_object_name $curriculum_id] - set title "[_ curriculum.Curriculum] $curriculum_name" + set title "[_ curriculum.View] [_ curriculum.Curriculum] $curriculum_array(name)" + } - set form_mode display + + lappend owners_list [list [person::name -person_id $curriculum_array(owner_id)] $curriculum_array(owner_id)] + } set context {$title} # Curriculum "owner" select box. -set users_list [list] -lappend users_list [list [person::name -person_id $user_id] "$user_id"] -lappend users_list [list "[_ curriculum.Search]" ":search:"] +lappend owners_list [list "[_ curriculum.Search]" ":search:"] #### @@ -134,14 +135,25 @@ -has_edit [expr !$write_p] \ -form { curriculum_id:key +} + +# 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 "[_ curriculum.Status]"} + {before_html } + {after_html } + } + } +} + +ad_form -extend -name curriculum -form { {name:text {mode $element_mode} {label "[_ curriculum.Name]"} {html {size 50}} } -} - -ad_form -extend -name curriculum -form { {description:richtext,optional {mode $element_mode} {label "[_ curriculum.Description]"} @@ -161,15 +173,7 @@ } } -# 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 "[_ curriculum.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 @@ -181,8 +185,9 @@ # Is before_html the right placement of this? Perhaps we should link # to a different page where we show the case log? set user_name [person::name -person_id $user_id] + element set_properties curriculum comment \ - -before_html "[workflow::case::get_activity_html -case_id $case_id][ad_decode $action_id "" "" "

[_ curriculum.lt_action_pretty_name_by]

"]" + -before_html "[workflow::case::get_activity_html -case_id $case_id][ad_decode $action_id "" "" "

[_ curriculum.lt_action_pretty_past_te]

"]" # Single-curriculum notifications link. set notification_link [curriculum::get_watch_link -curriculum_id $curriculum_id] @@ -200,7 +205,7 @@ {mode $element_mode} {result_datatype integer} {label "[_ curriculum.Owner]"} - {options $users_list} + {options $owners_list} {search_query {[db_map user_search]}} } } @@ -259,6 +264,7 @@ -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/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/tcl/apm-callback-procs.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/curriculum/tcl/apm-callback-procs.tcl 13 Jun 2003 19:51:06 -0000 1.3 +++ openacs-4/packages/curriculum/tcl/apm-callback-procs.tcl 4 Oct 2003 13:10:51 -0000 1.4 @@ -71,54 +71,32 @@ ad_proc -private curriculum::apm::register_implementations {} { db_transaction { - #curriculum::apm::register_capture_resolution_code_impl curriculum::apm::register_curriculum_owner_impl - curriculum::apm::register_format_log_title_impl curriculum::apm::register_curriculum_notification_info_impl + curriculum::apm::register_flush_elements_impl } } ad_proc -private curriculum::apm::unregister_implementations {} { db_transaction { - - #acs_sc::impl::delete \ - -contract_name [workflow::service_contract::action_side_effect] \ - -impl_name "CurriculumCaptureResolutionCode" - + acs_sc::impl::delete \ - -contract_name [workflow::service_contract::role_default_assignees] \ - -impl_name "CurriculumOwner" - + -contract_name [workflow::service_contract::role_default_assignees] \ + -impl_name "CurriculumOwner" + acs_sc::impl::delete \ - -contract_name [workflow::service_contract::activity_log_format_title] \ - -impl_name "CurriculumFormatLogTitle" - + -contract_name [workflow::service_contract::notification_info] \ + -impl_name "CurriculumNotificationInfo" + acs_sc::impl::delete \ - -contract_name [workflow::service_contract::notification_info] \ - -impl_name "CurriculumNotificationInfo" + -contract_name [workflow::service_contract::action_side_effect] \ + -impl_name "CurriculumFlushElementsCache" + } } -#ad_proc -private curriculum::apm::register_capture_resolution_code_impl {} { -# -# set spec { -# name "CurriculumCaptureResolutionCode" -# aliases { -# GetObjectType curriculum::object_type -# GetPrettyName curriculum::capture_resolution_code::pretty_name -# DoSideEffect curriculum::capture_resolution_code::do_side_effect -# } -# } -# -# lappend spec contract_name [workflow::service_contract::action_side_effect] -# lappend spec owner [curriculum::package_key] -# -# acs_sc::impl::new_from_spec -spec $spec -#} - - ad_proc -private curriculum::apm::register_curriculum_owner_impl {} { set spec { @@ -137,36 +115,36 @@ } -ad_proc -private curriculum::apm::register_format_log_title_impl {} { +ad_proc -private curriculum::apm::register_curriculum_notification_info_impl {} { set spec { - name "CurriculumFormatLogTitle" + name "CurriculumNotificationInfo" aliases { - GetObjectType curriculum::object_type - GetPrettyName curriculum::format_log_title::pretty_name - GetTitle curriculum::format_log_title::format_log_title + GetObjectType curriculum::object_type + GetPrettyName curriculum::notification_info::pretty_name + GetNotificationInfo curriculum::notification_info::get_notification_info } } - lappend spec contract_name [workflow::service_contract::activity_log_format_title] + lappend spec contract_name [workflow::service_contract::notification_info] lappend spec owner [curriculum::package_key] acs_sc::impl::new_from_spec -spec $spec } -ad_proc -private curriculum::apm::register_curriculum_notification_info_impl {} { - +ad_proc -private curriculum::apm::register_flush_elements_impl {} { + set spec { - name "CurriculumNotificationInfo" + name "CurriculumFlushElementsCache" aliases { - GetObjectType curriculum::object_type - GetPrettyName curriculum::notification_info::pretty_name - GetNotificationInfo curriculum::notification_info::get_notification_info + GetObjectType curriculum::object_type + GetPrettyName curriculum::flush_elements::pretty_name + DoSideEffect curriculum::flush_elements::do_side_effect } } - lappend spec contract_name [workflow::service_contract::notification_info] + lappend spec contract_name [workflow::service_contract::action_side_effect] lappend spec owner [curriculum::package_key] acs_sc::impl::new_from_spec -spec $spec 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.12 -r1.13 --- openacs-4/packages/curriculum/tcl/curriculum-procs.tcl 25 Sep 2003 12:28:37 -0000 1.12 +++ openacs-4/packages/curriculum/tcl/curriculum-procs.tcl 4 Oct 2003 13:10:51 -0000 1.13 @@ -10,10 +10,11 @@ namespace eval curriculum {} + +# Service contract implementation alias namespaces (phew, that was long!). namespace eval curriculum::owner {} -namespace eval curriculum::capture_resolution_code {} -namespace eval curriculum::format_log_title {} namespace eval curriculum::notification_info {} +namespace eval curriculum::flush_elements {} ad_proc -public curriculum::package_key {} { @@ -84,6 +85,7 @@ {-desc_format "text/html"} {-comment ""} {-comment_format "text/html"} + -owner_id:required -action_id:required -array:required {-entry_id {}} @@ -97,6 +99,7 @@ @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. @return curriculum_id (just for convenience). @@ -290,15 +293,13 @@ pretty_name \#curriculum.Editor\# callbacks { workflow.Role_PickList_CurrentAssignees - curriculum.CurriculumOwner workflow.Role_AssigneeSubquery_RegisteredUsers } } publisher { pretty_name \#curriculum.Publisher\# callbacks { workflow.Role_PickList_CurrentAssignees - curriculum.CurriculumOwner workflow.Role_AssigneeSubquery_RegisteredUsers } } @@ -327,6 +328,9 @@ pretty_past_tense \#curriculum.Created\# new_state authored initial_action_p t + edit_fields { + comment + } } comment { pretty_name \#curriculum.Comment\# @@ -350,14 +354,17 @@ description comment } + callbacks { + curriculum.CurriculumFlushElementsCache + } } reject { pretty_name \#curriculum.Reject\# pretty_past_tense \#curriculum.Rejected\# new_state rejected allowed_roles { publisher } enabled_states { authored edited } - privileges { write } + privileges { admin } edit_fields { comment } @@ -369,22 +376,41 @@ enabled_states { authored edited archived } assigned_states { edited } new_state published - privileges { write } - edit_fields { + privileges { admin } + edit_fields { comment } + callbacks { + curriculum.CurriculumFlushElementsCache + } } archive { pretty_name \#curriculum.Archive\# pretty_past_tense \#curriculum.Archived\# allowed_roles { publisher } enabled_states { published } new_state archived - privileges { write } - edit_fields { - comment - } + privileges { admin } + edit_fields { + comment + } + callbacks { + curriculum.CurriculumFlushElementsCache + } } + assign { + pretty_name \#curriculum.Assign\# + pretty_past_tense \#curriculum.Assigned\# + allowed_roles { publisher } + privileges { admin } + always_enabled_p t + edit_fields { + role_editor + role_publisher + owner_id + comment + } + } } } } @@ -489,87 +515,29 @@ #### # -# Capture resolution code. (Useful if we need to perform side effects but not being used right now.) +# Flush element cache (action side-effect). # #### -# FIXME -ad_proc -private curriculum::capture_resolution_code::pretty_name {} { - return "[_ curriculum.lt_Capture_resolution_co]" +ad_proc -private curriculum::flush_elements::pretty_name {} { + return "[_ curriculum.lt_Flush_element_cache]" } -ad_proc -private curriculum::capture_resolution_code::do_side_effect { +ad_proc -private curriculum::flush_elements::do_side_effect { case_id object_id action_id entry_id } { - db_dml insert_resolution_code {*NOT WRITTEN YET*} + # Force the curriculum bar to update. + curriculum::elements_flush } #### # -# Format log title. -# -#### - - -ad_proc -private curriculum::format_log_title::pretty_name {} { - return "[_ curriculum.lt_Add_resolution_code_t]" -} - - -ad_proc -private curriculum::format_log_title::format_log_title { - case_id - object_id - action_id - entry_id - data_arraylist -} { - array set data $data_arraylist - - if { [info exists data(resolution)] } { - return [resolution_pretty $data(resolution)] - } else { - return {WHAT?!} - } -} - - -# FIXME. Resolution ???? -ad_proc -private curriculum::resolution_get_options {} { - - return { - fixed "Fixed" - bydesign "By Design" - wontfix "Won't Fix" - postponed "Postponed" - duplicate "Duplicate" - norepro "Not Reproducable" - needinfo "Need Info" - } - -} - - -ad_proc -private curriculum::resolution_pretty { - resolution -} { - array set resolution_codes [resolution_get_options] - - if { [info exists resolution_codes($resolution)] } { - return $resolution_codes($resolution) - } else { - return {} - } -} - - -#### -# # Notification info. # #### Index: openacs-4/packages/curriculum/tcl/curriculum-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/tcl/curriculum-procs.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/curriculum/tcl/curriculum-procs.xql 1 Jul 2003 11:53:36 -0000 1.2 +++ openacs-4/packages/curriculum/tcl/curriculum-procs.xql 4 Oct 2003 13:10:51 -0000 1.3 @@ -6,7 +6,8 @@ update cu_curriculums set name = :name, description = :description, - desc_format = :desc_format + desc_format = :desc_format, + owner_id = :owner_id where curriculum_id = :curriculum_id
#curriculum.Name#