Index: openacs-4/packages/ajaxhelper/tcl/ajax-listbuilder-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ajaxhelper/tcl/ajax-listbuilder-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ajaxhelper/tcl/ajax-listbuilder-procs.tcl 14 Aug 2008 00:48:06 -0000 1.1 +++ openacs-4/packages/ajaxhelper/tcl/ajax-listbuilder-procs.tcl 14 May 2009 20:15:29 -0000 1.2 @@ -220,7 +220,7 @@ # don't put URL vars in the key just the page we are looking at regexp {([^\?]*)\??} $return_url discard base_url set key [ns_sha1 [list $base_url $list_name]] - set url [export_vars -no_empty -base /acs-templating/list-add-filter {list_name filter_name key return_url filter_value}] + set url [export_vars -no_empty -base /ajax/list-add-filter {list_name filter_name key return_url filter_value}] return $url } @@ -234,7 +234,7 @@ # don't put URL vars in the key just the page we are looking at regexp {([^\?]*)\??} $return_url discard base_url set key [ns_sha1 [list $base_url $list_name]] - set url [export_vars -no_empty -base /acs-templating/list-add-filter {list_name filter_names key return_url}] + set url [export_vars -no_empty -base /ajax/list-add-filter {list_name filter_names key return_url}] return $url } @@ -407,7 +407,7 @@ } } -on_submit { if {[exists_and_not_null formbutton_delete]} { - ad_returnredirect [export_vars -base /acs-templating/list-view-delete {{list_name $___list_name} {view_name $__list_view} {return_url "[ad_conn url]"}}] + ad_returnredirect [export_vars -base /ajax/list-view-delete {{list_name $___list_name} {view_name $__list_view} {return_url "[ad_conn url]"} {parent_id "[ad_conn package_id]}}] ad_script_abort } } Index: openacs-4/packages/ajaxhelper/www/list-add-filter.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ajaxhelper/www/list-add-filter.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ajaxhelper/www/list-add-filter.tcl 14 May 2009 20:15:29 -0000 1.1 @@ -0,0 +1,32 @@ +ad_page_contract { + Add a filter to saved filter view for a list builder list +} { + return_url + list_name + {filter_name ""} + {filter_names ""} + {filter_value ""} + {filter_values ""} +} + +# get filters from existing session property +# don't put URL vars in the key just the page we are looking at +regexp {([^\?]*)\??} $return_url discard base_url +set key [ns_sha1 [list $base_url $list_name]] +if {$filter_name eq "__list_view"} { + set current_filters(${list_name}:filter:${filter_name}:properties) $filter_value +} elseif {[llength $filter_names]} { + array set current_filters [ad_get_client_property acs-templating ${key}] + foreach name $filter_names value $filter_values { + set current_filters(${list_name}:filter:${name}:properties) $value + } +} elseif {$filter_name ne ""} { + array set current_filters [ad_get_client_property acs-templating ${key}] + set current_filters(${list_name}:filter:${filter_name}:properties) $filter_value +} +ns_log notice "current filters +[array get current_filters] +" +ad_set_client_property acs-templating $key [array get current_filters] + +ad_returnredirect $return_url \ No newline at end of file Index: openacs-4/packages/ajaxhelper/www/list-view-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ajaxhelper/www/list-view-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ajaxhelper/www/list-view-delete.tcl 14 May 2009 20:15:29 -0000 1.1 @@ -0,0 +1,26 @@ +ad_page_contract { + Delete a view for a list +} { + list_name + view_name + return_url + parent_id +} + +set name "template:list:${list_name}:view:${view_name}" + +set view_item_id [db_string get_item_id "select item_id from cr_items where name=:name and parent_id=:parent_id" -default ""] +if {$view_item_id ne ""} { + if {[permission::permission_p \ + -object_id $view_item_id \ + -party_id [ad_conn user_id] \ + -privilege "admin"]} { + content::item::delete -item_id $view_item_id + } +} +regexp {([^\?]*)\??} $return_url discard base_url +set key [ns_sha1 [list $base_url $list_name]] + +ad_set_client_property acs-templating $key "" + +ad_returnredirect -message "[_ acs-templating.List_View_Deleted]" $return_url \ No newline at end of file