Index: openacs-4/packages/wp-slim/www/attach-del.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/attach-del.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/attach-del.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/attach-del.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -13,12 +13,11 @@ } -ad_require_permission $slide_item_id wp_edit_presentation db_exec_plsql revisions_and_item_delete { begin wp_attachment.delete(:attach_item_id); end; } -ad_returnredirect "attach-list?[export_url_vars slide_item_id]" \ No newline at end of file +ad_returnredirect "attach-list?[export_url_vars slide_item_id]" Index: openacs-4/packages/wp-slim/www/attach-detail.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/attach-detail.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/attach-detail.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/attach-detail.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -21,7 +21,6 @@ file_name } -ad_require_permission $slide_item_id wp_edit_presentation set pres_item_id [db_string pres_item_id_get { select parent_id @@ -63,4 +62,4 @@ set return_url [ns_urlencode "attach-detail?[export_url_vars slide_item_id attach_item_id file_name]"] -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/wp-slim/www/attach-detail.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/attach-detail.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/attach-detail.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,28 @@ + + + + + + + select parent_id + from cr_items + where content_type = 'cr_wp_slide' + and item_id = :slide_item_id + + + + + + + + + select i.live_revision, x.display + from cr_items i, cr_wp_attachments x + where x.attach_id = i.live_revision + and i.item_id = :attach_item_id + + + + + + Index: openacs-4/packages/wp-slim/www/attach-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/attach-list.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/attach-list.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/attach-list.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -16,7 +16,6 @@ att:multirow } -ad_require_permission $slide_item_id wp_edit_presentation set pres_item_id [db_string pres_item_id_get { select parent_id @@ -34,4 +33,4 @@ and parent_id = :slide_item_id } -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/wp-slim/www/attach-list.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/attach-list.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/attach-list.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,28 @@ + + + + + + + select parent_id + from cr_items + where content_type = 'cr_wp_slide' + and item_id = :slide_item_id + + + + + + + + + select name, item_id + from cr_items + where content_type = 'cr_wp_attachment' + and parent_id = :slide_item_id + + + + + + Index: openacs-4/packages/wp-slim/www/attach.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/attach.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/attach.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/attach.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -14,7 +14,6 @@ display:notnull } -ad_require_permission $slide_item_id wp_edit_presentation set user_id [ad_verify_and_get_user_id] set creation_ip [ad_conn peeraddr] @@ -28,6 +27,9 @@ set client_filename $attachment } + + + set exception_count 0 set exception_text "" @@ -74,13 +76,13 @@ and parent_id = :slide_item_id; exception when no_data_found then - :1 := content_item.new( - creation_user => :user_id, - creation_ip => :creation_ip, - creation_date => sysdate, - name => :client_filename, - parent_id => :slide_item_id, - content_type => 'cr_wp_attachment' + :1 := wp_attachment__new( + :attachment, + :display, + :slide_item_id, + now(), + :user_id, + :creation_ip ); end; }] @@ -103,43 +105,6 @@ } } -ns_ora exec_plsql_bind $db " -begin -:revision_id := content_revision.new(creation_user => :user_id, - creation_ip => :creation_ip, - creation_date => sysdate, - title => '', - item_id => :item_id, - mime_type => :mime_type, - data => null); -end;" revision_id - -ns_ora blob_dml_file_bind $db " -update cr_revisions -set content = empty_blob() -where revision_id = :revision_id -returning content into :1" [list 1] $path - ns_db releasehandle $db -#set live revision -db_exec_plsql live_revision_set { -begin - content_item.set_live_revision(:revision_id); -end; -} - -db_dml attributes_insert { - insert into cr_wp_attachments - ( - attach_id, - display - ) - select - :revision_id, - :display - from dual - where not exists (select 1 from cr_wp_attachments where attach_id = :revision_id) -} - -ad_returnredirect edit-slide?[export_url_vars slide_item_id pres_item_id] \ No newline at end of file +ad_returnredirect edit-slide?[export_url_vars slide_item_id pres_item_id] Index: openacs-4/packages/wp-slim/www/create-presentation-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/create-presentation-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/create-presentation-2.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/create-presentation-2.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -1,15 +1,13 @@ -# /packages/wimpy-point/www/presentation-create-2.tcl ad_page_contract { - # This file actually creates the presentation. @author Paul Konigsberg (paul@arsdigita.com) @creation-date Thu Nov 9 20:44:46 2000 @cvs-id $Id$ } { - { page_signature:html "" } - { copyright_notice:html "" } { audience:html "" } { background:html "" } + { page_signature:html "" } + { copyright_notice:html "" } pres_title:html,notnull { style:integer -1 } show_modified_p:notnull @@ -18,19 +16,17 @@ set package_id [ad_conn package_id] -ad_require_permission $package_id wp_create_presentation set user_id [ad_verify_and_get_user_id] set creation_ip [ad_conn peeraddr] -# We're inserting set pres_item_id [db_exec_plsql wp_presentation_insert { begin :1 := wp_presentation.new( + creation_date => sysdate, creation_user => :user_id, creation_ip => :creation_ip, - creation_date => sysdate, pres_title => :pres_title, page_signature => :page_signature, copyright_notice => :copyright_notice, @@ -43,23 +39,5 @@ end; }] -db_exec_plsql grant_owner_access { - begin - acs_permission.grant_permission(:pres_item_id,:user_id,'wp_admin_presentation'); - acs_permission.grant_permission(:pres_item_id,:user_id,'wp_view_presentation'); - acs_permission.grant_permission(:pres_item_id,:user_id,'wp_edit_presentation'); - acs_permission.grant_permission(:pres_item_id,:user_id,'wp_delete_presentation'); - end; -} - -if {[regexp {t} $public_p]} { - # -1 is the party id for 'the public'. - db_exec_plsql make_wp_presentation_public { - begin - acs_permission.grant_permission(:pres_item_id,acs.magic_object_id('the_public'),'wp_view_presentation'); - end; - } -} - ad_returnredirect "presentation-top?[export_url_vars pres_item_id]" Index: openacs-4/packages/wp-slim/www/create-presentation.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/create-presentation.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/create-presentation.adp 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/create-presentation.adp 4 Oct 2001 04:29:01 -0000 1.2 @@ -96,11 +96,13 @@
Audience: - +
Background: - + Index: openacs-4/packages/wp-slim/www/create-presentation.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/create-presentation.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/create-presentation.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/create-presentation.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -12,7 +12,6 @@ set package_id [ad_conn package_id] -ad_require_permission $package_id wp_create_presentation set title "Create Presentation" Index: openacs-4/packages/wp-slim/www/create-slide-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/create-slide-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/create-slide-2.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/create-slide-2.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -16,7 +16,6 @@ set package_id [ad_conn package_id] -ad_require_permission $package_id wp_create_presentation set user_id [ad_verify_and_get_user_id] set creation_ip [ad_conn peeraddr] @@ -48,4 +47,4 @@ end; } -ad_returnredirect "presentation-top?[export_url_vars pres_item_id]" \ No newline at end of file +ad_returnredirect "presentation-top?[export_url_vars pres_item_id]" Index: openacs-4/packages/wp-slim/www/create-slide.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/create-slide.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/create-slide.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/create-slide.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -7,7 +7,7 @@ @cvs-id $Id$ } { pres_item_id:naturalnum,notnull - {sort_key:integer,optional ""} + {sort_key:naturalnum,optional ""} } -properties { nav_bar pres_item_id @@ -17,7 +17,6 @@ set package_id [ad_conn package_id] -ad_require_permission $package_id wp_create_presentation db_1row get_presentaiton { select pres_title @@ -40,4 +39,4 @@ }] } -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/wp-slim/www/create-slide.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/create-slide.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/create-slide.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,31 @@ + + + + + + +select pres_title +from cr_wp_presentations p, + cr_items i +where i.item_id = :pres_item_id +and i.live_revision = p.presentation_id + + + + + + + + + select 1+max(sort_key) + from cr_wp_slides s, + cr_items i, + cr_revisions r + where i.parent_id = :pres_item_id + and s.slide_id = i.live_revision + + + + + + Index: openacs-4/packages/wp-slim/www/delete-slide-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/delete-slide-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/delete-slide-2.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/delete-slide-2.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -12,12 +12,11 @@ pres_item_id:naturalnum,notnull } -ad_require_permission $slide_item_id wp_delete_presentation db_exec_plsql delete_slide { begin wp_slide.delete(:slide_item_id); end; } -ad_returnredirect presentation-top?[export_url_vars pres_item_id] \ No newline at end of file +ad_returnredirect presentation-top?[export_url_vars pres_item_id] Index: openacs-4/packages/wp-slim/www/delete-slide.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/delete-slide.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/delete-slide.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/delete-slide.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -12,8 +12,7 @@ pres_item_id:naturalnum,notnull } -ad_require_permission $slide_item_id wp_delete_presentation set nav_bar [ad_context_bar "Delete a Slide"] -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/wp-slim/www/display-change.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/display-change.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/display-change.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/display-change.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -15,7 +15,6 @@ file_name:notnull } -ad_require_permission $slide_item_id wp_edit_presentation # check mime type set mime_type [db_string get_mime_type { @@ -38,4 +37,4 @@ where attach_id = :revision_id } -ad_returnredirect "attach-detail?[export_url_vars slide_item_id attach_item_id file_name]" \ No newline at end of file +ad_returnredirect "attach-detail?[export_url_vars slide_item_id attach_item_id file_name]" Index: openacs-4/packages/wp-slim/www/display-change.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/display-change.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/display-change.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,26 @@ + + + + + + + select mime_type + from cr_revisions + where revision_id = :revision_id + + + + + + + + + update cr_wp_attachments + set display = :display + where attach_id = :revision_id + + + + + + Index: openacs-4/packages/wp-slim/www/edit-presentation-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/edit-presentation-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/edit-presentation-2.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/edit-presentation-2.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -16,7 +16,6 @@ background } -ad_require_permission $pres_item_id wp_edit_presentation set user_id [ad_verify_and_get_user_id] set creation_ip [ad_conn peeraddr] @@ -54,4 +53,4 @@ } } -ad_returnredirect "presentation-top?[export_url_vars pres_item_id]" \ No newline at end of file +ad_returnredirect "presentation-top?[export_url_vars pres_item_id]" Index: openacs-4/packages/wp-slim/www/edit-presentation.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/edit-presentation.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/edit-presentation.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/edit-presentation.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -18,17 +18,33 @@ show_modified_p } -ad_require_permission $pres_item_id wp_edit_presentation set header [ad_header "Edit Presentation"] db_1row get_presentation_data { - select p.pres_title, p.page_signature, p.copyright_notice, p.public_p, p.show_modified_p, wp_presentation.get_audience(:pres_item_id) as audience, wp_presentation.get_background(:pres_item_id) as background + select p.pres_title, p.page_signature, p.copyright_notice, p.public_p, p.show_modified_p from cr_wp_presentations p, cr_items i where i.item_id = :pres_item_id and i.live_revision = p.presentation_id } +db_1row get_aud_data { + select name as audience + from cr_revisions, cr_items + where cr_items.content_type = 'cr_wp_presentation_aud' + and cr_items.parent_id = :pres_item_id + and cr_revisions.revision_id = cr_items.live_revision +} + + +db_1row get_back_data { + select name as background + from cr_revisions r, cr_items i + where i.content_type = 'cr_wp_presentation_back' + and i.parent_id = :pres_item_id + and r.revision_id = i.live_revision +} + #set public_p [db_string get_public_read_p " #select decode(count(*),1,'t','f') #from acs_permissions @@ -40,4 +56,4 @@ set nav_bar [ad_context_bar [list "presentation-top?[export_url_vars pres_item_id]" "$pres_title"] "Edit Presentation"] -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/wp-slim/www/edit-slide-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/edit-slide-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/edit-slide-2.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/edit-slide-2.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -24,7 +24,6 @@ attachment_count } -ad_require_permission $slide_item_id wp_edit_presentation set user_id [ad_verify_and_get_user_id] set creation_ip [ad_conn peeraddr] @@ -66,4 +65,4 @@ ad_return_template upload-attachments } else { ad_returnredirect presentation-top?[export_url_vars pres_item_id] -} \ No newline at end of file +} Index: openacs-4/packages/wp-slim/www/edit-slide-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/edit-slide-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/edit-slide-2.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,16 @@ + + + + + + + select count(1) + from cr_items + where content_type = 'cr_wp_attachment' + and parent_id = :slide_item_id + + + + + + Index: openacs-4/packages/wp-slim/www/edit-slide.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/edit-slide.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/edit-slide.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/edit-slide.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -20,7 +20,6 @@ original_slide_id } -ad_require_permission $slide_item_id wp_edit_presentation set nav_bar [ad_context_bar "Edit Slide"] @@ -36,6 +35,32 @@ and i.live_revision = s.slide_id } +db_1row get_pre_info { + select content as preamble + from cr_revisions, cr_items + where cr_items.content_type = 'cr_wp_slide_preamble' + and cr_items.parent_id = :slide_item_id + and cr_revisions.revision_id = cr_items.live_revision +} + +db_1row get_pos_info { +elect content as postamble + from cr_revisions, cr_items + where cr_items.content_type = 'cr_wp_slide_postamble' + and cr_items.parent_id = :slide_item_id + and cr_revisions.revision_id = cr_items.live_revision +} + +db_1row get_bul_info { +select content as bullet_items + from cr_revisions, cr_items + where cr_items.content_type = 'cr_wp_slide_bullet_items' + and cr_items.parent_id = :slide_item_id + and cr_revisions.revision_id = cr_items.live_revision; +} + + + set bullet_num [llength $bullet_items] ad_return_template Index: openacs-4/packages/wp-slim/www/get-binary-data.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/get-binary-data.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/get-binary-data.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/get-binary-data.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -23,7 +23,6 @@ ad_return_error "Wimpy Point" "Could not get a pres_item_id and slide_item_id out of url=$url" } -ad_require_permission $attach_id wp_view_presentation set mime_type [db_string get_mime_type { select mime_type Index: openacs-4/packages/wp-slim/www/get-binary-data.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/get-binary-data.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/get-binary-data.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,15 @@ + + + + + + +select mime_type +from cr_revisions +where revision_id = :attach_id + + + + + + Index: openacs-4/packages/wp-slim/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/index.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/index.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -13,7 +13,6 @@ set package_id [ad_conn package_id] -ad_require_permission $package_id wp_view_presentation set user_id [ad_verify_and_get_user_id] @@ -56,8 +55,9 @@ and ao.object_id = i.item_id and ao.creation_user <> :user_id and ao.creation_user = p.person_id - and acs_permission.permission_p(i.item_id, :user_id, 'wp_view_presentation') = 't' + and acs_permission.permission_p(i.item_id, :user_id, +'wp_view_presentation') = 'f' } ad_return_template index -} \ No newline at end of file +} Index: openacs-4/packages/wp-slim/www/invite-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/invite-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/invite-2.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + + + select persons.first_names || ' ' || persons.last_name as user_name, + parties.email as user_email + from persons, parties + where persons.person_id = :user_id + and parties.party_id = :user_id + + + + + + Index: openacs-4/packages/wp-slim/www/presentation-acl-add-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl-add-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/presentation-acl-add-2.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + + + select 1 + from acs_permissions + where object_id = :pres_item_id + and grantee_id = :user_id_from_search + and privilege = :privilege + + + + + + Index: openacs-4/packages/wp-slim/www/presentation-acl-add-3.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl-add-3.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/presentation-acl-add-3.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,15 @@ + + + + + + + select email as sender_email + from parties + where party_id = :user_id + + + + + + Index: openacs-4/packages/wp-slim/www/presentation-acl-add-group-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl-add-group-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/presentation-acl-add-group-2.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,19 @@ + + + + + + + select p.first_names, + p.last_name + from persons p, + group_member_map m + where m.group_id = :group_id + and m.member_id = p.person_id + order by p.last_name + + + + + + Index: openacs-4/packages/wp-slim/www/presentation-acl-add-group.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl-add-group.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/presentation-acl-add-group.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,15 @@ + + + + + + + select group_id, group_name + from groups + order by group_name + + + + + + Index: openacs-4/packages/wp-slim/www/presentation-acl.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/presentation-acl.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,69 @@ + + + + + + +select p.pres_title as title, + p.public_p, + ao.creation_user +from cr_wp_presentations p, + cr_items i, + acs_objects ao +where i.item_id = :pres_item_id +and i.live_revision = p.presentation_id +and ao.object_id = i.item_id + + + + + + + + + select p.person_id, + p.first_names, + p.last_name + from persons p, + acs_permissions perm + where perm.object_id = :pres_item_id + and perm.grantee_id = p.person_id + and perm.privilege = 'wp_view_presentation' + + + + + + + + + select p.person_id, + p.first_names, + p.last_name + from persons p, + acs_permissions perm + where perm.object_id = :pres_item_id + and perm.grantee_id = p.person_id + and perm.privilege = 'wp_edit_presentation' + + + + + + + + + select p.person_id, + p.first_names, + p.last_name + from persons p, + acs_permissions perm + where perm.object_id = :pres_item_id + and perm.grantee_id = p.person_id + and perm.privilege = 'wp_admin_presentation' + + + + + + Index: openacs-4/packages/wp-slim/www/presentation-public.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-public.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/presentation-public.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + + + update cr_wp_presentations + set public_p = :public_p + where presentation_id = (select live_revision + from cr_items + where item_id = :pres_item_id) + + + + + + Index: openacs-4/packages/wp-slim/www/presentation-publish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-publish.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/presentation-publish.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/presentation-publish.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -30,4 +30,4 @@ end; } -ad_returnredirect $return_url \ No newline at end of file +ad_returnredirect $return_url Index: openacs-4/packages/wp-slim/www/presentation-revisions.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-revisions.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/presentation-revisions.adp 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/presentation-revisions.adp 4 Oct 2001 04:29:01 -0000 1.2 @@ -14,14 +14,19 @@
  • -Created by @revisions.full_name@ from @revisions.creation_ip@ at @revisions.creation_date@ (view) +Created by @revisions.full_name@ from +@revisions.creation_ip@ at @revisions.creation_date@ (view) -Created by @revisions.full_name@ from @revisions.creation_ip@ at @revisions.creation_date@ (view | go live) +Created by @revisions.full_name@ from @revisions.creation_ip@ at +@revisions.creation_date@ (view | go live) +
  • +

    Create a new revision - \ No newline at end of file + Index: openacs-4/packages/wp-slim/www/presentation-revisions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-revisions.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/presentation-revisions.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/presentation-revisions.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -14,7 +14,6 @@ } -ad_require_permission $pres_item_id wp_edit_presentation db_multirow revisions revisions_get { select r.revision_id, @@ -37,4 +36,4 @@ set return_url [ns_urlencode "presentation-revisions?[export_url_vars pres_item_id]"] -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/wp-slim/www/presentation-top.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-top.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/presentation-top.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/presentation-top.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -21,7 +21,6 @@ subsite_name } -ad_require_permission $pres_item_id wp_edit_presentation set user_id [ad_verify_and_get_user_id] @@ -73,4 +72,4 @@ #}] -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/wp-slim/www/presentation-top.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-top.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/presentation-top.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,18 @@ + + + + + + +select s.sort_key, s.slide_title, i.item_id as slide_item_id +from cr_wp_slides s, + cr_items i +where i.parent_id = :pres_item_id +and i.live_revision = s.slide_id +order by s.sort_key + + + + + + Index: openacs-4/packages/wp-slim/www/serve-presentation-revision.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-presentation-revision.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/serve-presentation-revision.adp 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/serve-presentation-revision.adp 4 Oct 2001 04:29:01 -0000 1.2 @@ -35,14 +35,11 @@ -Audience -@audience@ - - - Background @background@ + + - \ No newline at end of file + Index: openacs-4/packages/wp-slim/www/serve-presentation-revision.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-presentation-revision.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/serve-presentation-revision.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/serve-presentation-revision.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -14,6 +14,8 @@ page_signature owner_name owner_id + audience + background } set url [ad_conn url] @@ -23,9 +25,6 @@ ad_return_error "Wimpy Point" "Could not get a pres_item_id and a pres_revision_id out of url=$url" } -ad_require_permission $pres_item_id wp_edit_presentation - - set subsite_name [ad_conn package_url] regexp {^(.+)/$} $subsite_name match subsite_name @@ -34,14 +33,26 @@ p.page_signature, p.copyright_notice, p.public_p, - p.show_modified_p, - wp_presentation.get_audience_revision(:pres_revision_id) as audience, - wp_presentation.get_background_revision(:pres_revision_id) as background + p.show_modified_p from cr_wp_presentations p, cr_items i where i.item_id = :pres_item_id and p.presentation_id = :pres_revision_id } +db_1row get_aud_data { + select content as audience + from cr_revisions r, cr_wp_presentations_aud pa + where pa.presentation_id = :pres_revision_id + and r.revision_id = pa.id +} + +db_1row get_back_data { + select content as background + from cr_revisions r, cr_wp_presentations_back pb + where pb.presentation_id = :pres_revision_id + and r.revision_id = pb.id +} + set nav_bar [ad_context_bar [list "$subsite_name/presentation-top?[export_url_vars pres_item_id]" "$pres_title"] "One Revision"] -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/wp-slim/www/serve-presentation.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-presentation.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/serve-presentation.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/serve-presentation.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -23,7 +23,6 @@ ad_return_error "Wimpy Point" "Could not get a pres_item_id and slide_item_id out of url=$url" } -ad_require_permission $pres_item_id wp_view_presentation set subsite_name [ad_conn package_url] regexp {^(.+)/$} $subsite_name match subsite_name @@ -59,4 +58,4 @@ order by s.sort_key " -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/wp-slim/www/serve-presentation.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-presentation.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/serve-presentation.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,54 @@ + + + + + + + select item_id as first_slide_item_id + from cr_items + where content_type = 'cr_wp_slide' + and parent_id = :pres_item_id + and exists (select 1 from cr_wp_slides s where s.slide_id=cr_items.live_revision and s.sort_key=1) + + + + + + + + + select p.pres_title, p.page_signature + from cr_wp_presentations p, cr_items i + where i.item_id = :pres_item_id + and i.live_revision = p.presentation_id + + + + + + + + + select first_names || ' ' || last_name as owner_name, person_id as owner_id + from persons, acs_objects + where persons.person_id = acs_objects.creation_user + and acs_objects.object_id = :pres_item_id + + + + + + + + +select s.slide_title, '$subsite_name/display/$pres_item_id/' || i.item_id || '.wimpy' as url +from cr_wp_slides s, cr_items i +where i.parent_id = :pres_item_id +and i.live_revision = s.slide_id +order by s.sort_key + + + + + + Index: openacs-4/packages/wp-slim/www/serve-slide-revision.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-slide-revision.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/serve-slide-revision.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/serve-slide-revision.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -30,8 +30,6 @@ ad_return_error "Wimpy Point" "Could not get a pres_item_id, slide_item_id and slide_revision_id out of url=$url" } -# permission is intentionally set to wp_edit_presentation instead of wp_view_presentation -ad_require_permission $pres_item_id wp_edit_presentation set subsite_name [ad_conn package_url] regexp {^(.+)/$} $subsite_name match subsite_name @@ -68,4 +66,4 @@ and i.live_revision = x.attach_id } -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/wp-slim/www/serve-slide-revision.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-slide-revision.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/serve-slide-revision.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,29 @@ + + + + + + + select p.page_signature, + p.show_modified_p + from cr_wp_presentations p, cr_items i + where i.item_id = :pres_item_id + and i.live_revision = p.presentation_id + + + + + + + + + select x.attach_id as attach_id, x.display, i.name as file_name + from cr_wp_attachments x, cr_items i + where i.parent_id = :slide_item_id + and i.live_revision = x.attach_id + + + + + + Index: openacs-4/packages/wp-slim/www/serve-slide.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-slide.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/serve-slide.adp 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/serve-slide.adp 4 Oct 2001 04:29:01 -0000 1.2 @@ -15,7 +15,7 @@ - @attach_list.file_name@ + @attach_list.file_name@ @@ -27,7 +27,7 @@ - @attach_list.file_name@ + @attach_list.file_name@ @@ -36,10 +36,10 @@ - @attach_list.file_name@ + @attach_list.file_name@ - @attach_list.file_name@ + @attach_list.file_name@ @@ -56,7 +56,7 @@ - @attach_list.file_name@ + @attach_list.file_name@ @@ -65,7 +65,7 @@ - @attach_list.file_name@ + @attach_list.file_name@ @@ -77,7 +77,7 @@ - @attach_list.file_name@ + @attach_list.file_name@ @@ -86,7 +86,7 @@ - @attach_list.file_name@ + @attach_list.file_name@ Index: openacs-4/packages/wp-slim/www/serve-slide.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-slide.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/serve-slide.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/serve-slide.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -28,7 +28,6 @@ ad_return_error "Wimpy Point" "Could not get a pres_item_id and slide_item_id out of url=$url" } -ad_require_permission $pres_item_id wp_view_presentation set subsite_name [ad_conn package_url] regexp {^(.+)/$} $subsite_name match subsite_name @@ -48,6 +47,33 @@ and ao.object_id = s.slide_id } +# Serve a specific slide. +db_1row get_pre_info { + select content as preamble + from cr_revisions, cr_items + where cr_items.content_type = 'cr_wp_slide_preamble' + and cr_items.parent_id = :slide_item_id + and cr_revisions.revision_id = cr_items.live_revision + +} + +db_1row get_pos_info { +select content as postamble + from cr_revisions, cr_items + where cr_items.content_type = 'cr_wp_slide_postamble' + and cr_items.parent_id = :slide_item_id + and cr_revisions.revision_id = cr_items.live_revision +} + +db_1row get_bul_info { +select content as bullet_items + from cr_revisions, cr_items + where cr_items.content_type = 'cr_wp_slide_bullet_items' + and cr_items.parent_id = :slide_item_id + and cr_revisions.revision_id = cr_items.live_revision; +} + + db_1row get_presentation_page_signature { select p.page_signature, p.show_modified_p @@ -106,4 +132,4 @@ } set href_back_forward "$href_back $href_forward" -ad_return_template serve-slide \ No newline at end of file +ad_return_template serve-slide Index: openacs-4/packages/wp-slim/www/serve-slide.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-slide.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/serve-slide.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,55 @@ + + + + + + + select p.page_signature, + p.show_modified_p + from cr_wp_presentations p, cr_items i + where i.item_id = :pres_item_id + and i.live_revision = p.presentation_id + + + + + + + + + select i.item_id + from cr_wp_slides s, cr_items i + where i.parent_id = :pres_item_id + and i.live_revision = s.slide_id + and s.sort_key = (:sort_key - 1) + + + + + + + + + select i.item_id as next_slide_item_id + from cr_wp_slides s, cr_items i + where i.parent_id = :pres_item_id + and i.live_revision = s.slide_id + and s.sort_key = :next_sort_key + + + + + + + + + select x.attach_id as attach_id, x.display, i.name as file_name + from cr_wp_attachments x, cr_items i + where i.parent_id = :slide_item_id + and i.live_revision = x.attach_id + + + + + + Index: openacs-4/packages/wp-slim/www/slide-revisions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/slide-revisions.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/slide-revisions.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/slide-revisions.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -16,7 +16,6 @@ subsite_name } -ad_require_permission $slide_item_id wp_edit_presentation set subsite_name [ad_conn package_url] @@ -42,4 +41,4 @@ set return_url [ns_urlencode "slide-revisions?[export_url_vars slide_item_id pres_item_id]"] -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/wp-slim/www/slides-reorder-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/slides-reorder-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/slides-reorder-2.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/slides-reorder-2.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -11,7 +11,6 @@ slide_item_id:multiple,naturalnum,notnull } -ad_require_permission $pres_item_id wp_edit_presentation # Just iterate over the values for slide_id in order and set their respective # sort_keys to 1, 2, 3, ... @@ -27,4 +26,4 @@ db_release_unused_handles -ad_returnredirect "presentation-top?[export_url_vars pres_item_id]" \ No newline at end of file +ad_returnredirect "presentation-top?[export_url_vars pres_item_id]" Index: openacs-4/packages/wp-slim/www/slides-reorder-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/slides-reorder-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/slides-reorder-2.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,15 @@ + + + + + + + update cr_wp_slides + set sort_key = :counter + where exists (select 1 from cr_revisions where cr_wp_slides.slide_id = cr_revisions.revision_id and cr_revisions.item_id = :id) + + + + + + Index: openacs-4/packages/wp-slim/www/slides-reorder.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/slides-reorder.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/slides-reorder.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/slides-reorder.tcl 4 Oct 2001 04:29:01 -0000 1.2 @@ -13,7 +13,6 @@ out } -ad_require_permission $pres_item_id wp_edit_presentation set header [ad_header "Reorder Slides"] Index: openacs-4/packages/wp-slim/www/slides-reorder.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/slides-reorder.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/slides-reorder.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + + + select s.sort_key, s.slide_title, i.item_id as slide_item_id + from cr_wp_slides s, cr_items i + where i.parent_id = :pres_item_id + and i.live_revision = s.slide_id + order by s.sort_key + + + + + + Index: openacs-4/packages/wp-slim/www/users.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/users.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/wp-slim/www/users.xql 4 Oct 2001 04:29:01 -0000 1.1 @@ -0,0 +1,19 @@ + + + + + + + select p.person_id, p.first_names, p.last_name, parties.email, count(i.item_id) as num_presentations + from persons p, cr_items i, acs_objects o, parties + where i.content_type = 'cr_wp_presentation' + and o.object_id = i.item_id + and p.person_id = o.creation_user + and parties.party_id = p.person_id + group by p.person_id, p.first_names, p.last_name, parties.email + + + + + +