Index: openacs-4/packages/tlf-survey/tlf-survey.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tlf-survey/tlf-survey.info,v diff -u -r1.1.2.3 -r1.1.2.4 --- openacs-4/packages/tlf-survey/tlf-survey.info 15 Mar 2023 13:51:10 -0000 1.1.2.3 +++ openacs-4/packages/tlf-survey/tlf-survey.info 5 Jul 2023 09:12:44 -0000 1.1.2.4 @@ -9,11 +9,11 @@ f f - + Markus Moser 0 Fully programmable surveys based on workflows - + Index: openacs-4/packages/tlf-survey/catalog/tlf-survey.de_DE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tlf-survey/catalog/tlf-survey.de_DE.ISO-8859-1.xml,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/tlf-survey/catalog/tlf-survey.de_DE.ISO-8859-1.xml 15 Mar 2023 13:09:02 -0000 1.1.2.1 +++ openacs-4/packages/tlf-survey/catalog/tlf-survey.de_DE.ISO-8859-1.xml 5 Jul 2023 09:12:44 -0000 1.1.2.2 @@ -3,6 +3,7 @@ Aktionen Eigene Ausf�llinstanz l�schen Umfrage duplizieren + Diese Umfrage ist geschlossen Abgeschlossen Abschlusszeitpunkt Ersteller Index: openacs-4/packages/tlf-survey/catalog/tlf-survey.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tlf-survey/catalog/tlf-survey.en_US.ISO-8859-1.xml,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/tlf-survey/catalog/tlf-survey.en_US.ISO-8859-1.xml 15 Mar 2023 13:09:02 -0000 1.1.2.1 +++ openacs-4/packages/tlf-survey/catalog/tlf-survey.en_US.ISO-8859-1.xml 5 Jul 2023 09:12:44 -0000 1.1.2.2 @@ -3,6 +3,7 @@ Actions Delete my own submission Clone survey + This survey is currently closed Completed Completion time Creator Index: openacs-4/packages/tlf-survey/lib/survey.wf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tlf-survey/lib/survey.wf,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/tlf-survey/lib/survey.wf 15 Mar 2023 13:09:02 -0000 1.1.2.1 +++ openacs-4/packages/tlf-survey/lib/survey.wf 5 Jul 2023 09:12:44 -0000 1.1.2.2 @@ -292,6 +292,17 @@ ad_returnredirect [$wf_iter pretty_link]?m=create-or-use&parent_id=$parent ad_script_abort } else { + #case: survey already completed + #let the user access it + set survey_item [${:package_id} lookup -name en:___$user_id \ + -parent_id $parent -default_lang all] + if {$survey_item > 0} { + ::xo::db::CrClass get_instance_from_db -item_id $survey_item + if {[$survey_item set state] eq "done"} { + ad_returnredirect [$survey_item pretty_link] + ad_script_abort + } + } util_user_message -message [_ acs-subsite.403_message] #if a source url has been provided, return to this url set source_url [ns_queryget source ""] @@ -306,6 +317,7 @@ } } } else { + util_user_message -message "#tlf-survey.closed#" ad_returnredirect . ad_script_abort } Index: openacs-4/packages/tlf-survey/tcl/tlf-survey-context-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tlf-survey/tcl/tlf-survey-context-procs.tcl,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/tlf-survey/tcl/tlf-survey-context-procs.tcl 15 Mar 2023 13:09:02 -0000 1.1.2.1 +++ openacs-4/packages/tlf-survey/tcl/tlf-survey-context-procs.tcl 5 Jul 2023 09:12:44 -0000 1.1.2.2 @@ -38,23 +38,26 @@ } } lappend l "position" - foreach fn [concat [list name last_modified creation_date duration] $l] { + foreach fn [concat [list name last_modified creation_date duration state] $l] { append cols "$fn" } set tablecontent "" ::xo::dc foreach keys { select ci.name, to_char(o.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified, to_char(o.creation_date, 'YYYY-MM-DD HH24:MI:SS') as creation_date, + state, bt.instance_attributes as ia from xowiki_page_instance bt, cr_items ci, - acs_objects o + acs_objects o, + xowiki_form_page x where ci.parent_id = :parent - and page_template = :wf_item - and o.package_id = :pkg - and ci.live_revision = bt.page_instance_id - and o.object_id = ci.item_id + and bt.page_template = :wf_item + and o.package_id = :pkg + and ci.live_revision = bt.page_instance_id + and o.object_id = ci.item_id + and x.xowiki_form_page_id = ci.live_revision order by o.creation_date desc } { set duration [expr {[clock scan $last_modified] - [clock scan $creation_date]}] @@ -64,6 +67,7 @@ $last_modified $creation_date $duration + $state }] foreach col $l { set cnt [expr {[dict exists $ia $col] ? [dict get $ia $col] : ""}] @@ -111,9 +115,13 @@ lappend new_colheaders \ [expr {[dict exists $labels $key] ? [dict get $labels $key] : $key}] } - append csv [::csv::join [concat [list name last_modified username duration] $new_colheaders position] ";"]\n + append csv [::csv::join \ + [concat [list name last_modified username duration state]\ + $new_colheaders position] ";"]\n } else { - append csv [::csv::join [concat [list name last_modified username duration] $l position] ";"]\n + append csv [::csv::join \ + [concat [list name last_modified username duration state]\ + $l position] ";"]\n } lappend l position ::xo::dc foreach get_tablecontent { @@ -122,6 +130,7 @@ to_char((select creation_date from acs_objects where object_id = bt.item_id), 'YYYY-MM-DD HH24:MI:SS') as creation_date, instance_attributes as ia, + state, (select username from users where user_id = bt.creation_user) as username from xowiki_form_pagei bt, @@ -138,7 +147,8 @@ $name \ $last_modified \ $username \ - $duration] + $duration \ + $state] foreach col $l { set cnt [expr {[dict exists $ia $col] ? [dict get $ia $col] : ""}] lappend tablecontent $cnt @@ -266,7 +276,7 @@ }); }] return [:www-view "[template::multirow size tbl_members] [_ tlf-survey.Members] -
[template::list::render -name tbl_members] $table
"] +
$table
[template::list::render -name tbl_members]
"] } :proc www-preview_popup {} {