Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/ChangeLog'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/bboard.info'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/sql/oracle/bboard-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/sql/oracle/bboard-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/sql/oracle/bboard-packages.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/sql/oracle/bboard-views.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/sql/oracle/index_sync.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/sql/oracle/upgrade-4.0-4.0.1.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/sql/oracle/upgrade-4.0.1-4.0.2.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/sql/oracle/upgrade-4.0.2b3-4.0.2b4.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/sql/oracle/upgrade-4.0.2b5-4.0.2b6.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/sql/oracle/upgrade-4.0.2b6-4.0.2b7.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/sql/oracle/upgrade-4.0b-4.0.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/sql/postgresql/bboard-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/sql/postgresql/bboard-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.9 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/sql/postgresql/bboard-packages.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/sql/postgresql/bboard-views.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-init.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.13 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.10 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/attachment-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/attachment.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-delete-2-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-delete-2-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-delete-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-delete-2.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-delete.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-delete.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-edit-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-edit.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-edit.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-entry.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-new-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-new.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-new.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-subscribe.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-subscribe.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/category-unsubscribe.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-by-category-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-by-category-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-by-category.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-by-category.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-delete-2-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-delete-2-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-delete-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-delete-2.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-delete.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-delete.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-edit-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-edit.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-edit.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-entry.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-move-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-move-2.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-move.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-move.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-move.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-new-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-new.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-subscribe.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-unsubscribe.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum-view.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/forum.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/index-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/index-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/index.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/index.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-approve.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-approve.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-attach-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-attach.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-attach.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-delete-2-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-delete-2-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-delete-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-delete.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-delete.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-edit-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-edit-2.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-edit-3.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-edit.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-edit.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-entry.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-list.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-mail-2-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-mail-2-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-mail-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-mail-2.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-mail.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-mail.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-mail.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-move-2-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-move-2-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-move-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-move.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-move.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-move.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-new-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-new-2.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-new-3-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-new-3-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-new-3.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-new.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-new.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-preview.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-reject.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-subscribe.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-threaded-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-threaded-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-threaded.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-threaded.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-threaded.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message-unsubscribe.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/message.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/messages-by-user.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/messages-by-user.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/messages-by-user.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/search-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/search-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/search.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/search.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/simple-message-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/simple-message-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/simple-message.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/simple-message.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/subscriptions.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/subscriptions.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/subscriptions.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/test.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/doc/design.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/doc/index.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/doc/requirements.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/doc/xml/configuration.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/doc/xml/design.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/doc/xml/index.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/doc/xml/installation.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/doc/xml/intro.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/doc/xml/notes.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/doc/xml/requirements.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/doc/xml/support.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/doc/xml/top.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard-portlets/bboard-portlets.info'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard-portlets/sql/oracle/bboard-portlets-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard-portlets/sql/oracle/bboard-portlets-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard-portlets/sql/postgresql/bboard-portlets-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard-portlets/sql/postgresql/bboard-portlets-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard-portlets/tcl/bboard-portlets-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard-portlets/www/summarize-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard-portlets/www/summarize-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard-portlets/www/summarize.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard-portlets/www/summarize.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/contrib/obsolete-packages/wf-ticket-tracker/sql/postgresql/wf-ticket-tracker-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/wf-ticket-tracker/sql/postgresql/wf-ticket-tracker-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/contrib/obsolete-packages/wf-ticket-tracker/sql/postgresql/wf-ticket-tracker-create.sql 17 May 2003 12:45:36 -0000 1.4 +++ openacs-4/contrib/obsolete-packages/wf-ticket-tracker/sql/postgresql/wf-ticket-tracker-create.sql 28 Aug 2003 09:41:58 -0000 1.5 @@ -46,8 +46,8 @@ new__creation_user alias for $7; new__creation_ip alias for $8; v_creation_date timestamptz; - v_ticket_id number; - v_case_id number; + v_ticket_id integer; + v_case_id integer; begin if (new__creation_date is null) or (new__creation_date = 0) then v_creation_date = now(); Index: openacs-4/packages/acs-admin/tcl/apm-admin-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/tcl/apm-admin-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-admin/tcl/apm-admin-procs.tcl 17 May 2003 09:36:01 -0000 1.7 +++ openacs-4/packages/acs-admin/tcl/apm-admin-procs.tcl 28 Aug 2003 09:41:37 -0000 1.8 @@ -12,24 +12,24 @@ Build a dynamic section dimensional slider. } { set sections [db_list apm_parameter_sections { - select distinct(section_name) - from apm_parameters - where package_key = :package_key + select distinct(section_name) + from apm_parameters + where package_key = :package_key }] if { [llength $sections] > 1 } { - set i 0 - lappend section_list [list $package_key $package_key [list "where" "section_name is null"]] - foreach section $sections { - incr i - if { ![empty_string_p $section] } { - lappend section_list [list "section_$i" $section [list "where" "section_name = '[db_quote $section]'"]] - } - } - lappend section_list [list all "All" [list] ] - return [list [list section_name "Section:" $package_key $section_list]] + set i 0 + lappend section_list [list $package_key $package_key [list "where" "section_name is null"]] + foreach section $sections { + incr i + if { ![empty_string_p $section] } { + lappend section_list [list "section_$i" $section [list "where" "section_name = '[db_quote $section]'"]] + } + } + lappend section_list [list all "All" [list] ] + return [list [list section_name "Section:" $package_key $section_list]] } else { - return "" + return "" } } @@ -46,17 +46,17 @@ set apm_url "/acs-admin/apm" if { [llength $args] == 0 } { - set title $apm_title + set title $apm_title set context_bar [ad_context_bar $title] } else { - set title [lindex $args end] + set title [lindex $args end] set context [concat [list [list $apm_url $apm_title]] $args] set context_bar [eval ad_context_bar $context] } set header [ad_header $title ""] append body "$header\n" if {![empty_string_p $form]} { - append body "<form $form>" + append body "<form $form>" } return "$body\n @@ -70,132 +70,160 @@ set out "" set line_length 0 foreach element $cmd { - if { $line_length + [string length $element] > 72 } { - append out "\\\n " - set line_length 4 - } - append out "$element " - incr line_length [expr { [string length $element] + 1 }] + if { $line_length + [string length $element] > 72 } { + append out "\\\n " + set line_length 4 + } + append out "$element " + incr line_length [expr { [string length $element] + 1 }] } append out "\n" } -ad_proc -private apm_package_selection_widget {pkg_info_list {to_install ""} {to_enable ""}} { +ad_proc -private apm_package_selection_widget { + -install_enable:boolean + pkg_info_list + {to_install ""} + {to_enable ""} +} { Provides a widget for selecting packages. Displays dependency information if available. + + @param intall_enable Set this flag if you want separate install and enable checkboxes to be displayed. If you don't set it, + only the enable checkbox will be displayed, and the resulting page is expected to assume that enable also means install. } { if {[empty_string_p $pkg_info_list]} { - return "" + return "" } set checkbox_count 0 set counter 0 set band_colors { white "#ececec" } set widget "<blockquote><table cellpadding=5 cellspacing=5> -<tr bgcolor=\"\#f8f8f8\"><th>Install</th><th>Enable</th><th>Package</th><th>Directory</th><th>Comment</th></tr> +<tr bgcolor=\"\#f8f8f8\"><th>Install</th>[ad_decode $install_enable_p 1 "<th>Enable</th>" ""]<th>Package</th><th>Directory</th><th>Comment</th></tr> " foreach pkg_info $pkg_info_list { - - incr counter - set package_key [pkg_info_key $pkg_info] - set spec_file [pkg_info_spec $pkg_info] - array set package [apm_read_package_info_file $spec_file] - set version_name $package(name) - ns_log Debug "Selection widget: $package_key, Dependency: [pkg_info_dependency_p $pkg_info]" + + incr counter + set package_key [pkg_info_key $pkg_info] + set spec_file [pkg_info_spec $pkg_info] + array set package [apm_read_package_info_file $spec_file] + set version_name $package(name) + ns_log Debug "Selection widget: $package_key, Dependency: [pkg_info_dependency_p $pkg_info]" - append widget " <tr valign=baseline bgcolor=[lindex $band_colors \ - [expr { $counter % [llength $band_colors] }]]>" - if { ![string compare [pkg_info_dependency_p $pkg_info] "t"]} { - # Dependency passed. - if { ([lsearch -exact $to_install $package_key] != -1) } { - append widget " <td align=center><input type=checkbox checked - name=install value=\"$package_key\" - onclick=\"if (!checked) document.forms\[0\].elements\[$checkbox_count+1\].checked=false\"></td> " - } else { - append widget " <td align=center><input type=checkbox - name=install value=\"$package_key\" - onclick=\"if (!checked) document.forms\[0\].elements\[$checkbox_count+1\].checked=false\"></td>" - } - if { [lsearch -exact $to_enable $package_key] != -1 } { - append widget " - <td align=center><input type=checkbox checked - name=enable value=\"$package_key\" " - } else { - append widget " - <td align=center><input type=checkbox - name=enable value=\"$package_key\" " - } - - append widget " - onclick=\"if (checked) document.forms\[0\].elements\[$checkbox_count\].checked=true\"></td> - <td>$package(package-name) $package(name)</td> - <td>/packages/$package(package.key)/</td> - <td><font color=green>Dependencies satisfied.</font></td> - </tr> " - } elseif { ![string compare [pkg_info_dependency_p $pkg_info] "f"] } { - #Dependency failed. - append widget " <td align=center><input type=checkbox name=install value=\"$package_key\" - onclick=\"if (!checked) document.forms\[0\].elements\[$checkbox_count+1\].checked=false\"></td>" - append widget " - <td align=center><input type=checkbox name=enable value=\"$package_key\" " - append widget " - onclick=\"if (checked) document.forms\[0\].elements\[$checkbox_count\].checked=true\"></td> - <td>$package(package-name) $package(name)</td> - <td>/packages/$package(package.key)/</td> + append widget " <tr valign=baseline bgcolor=[lindex $band_colors \ + [expr { $counter % [llength $band_colors] }]]>" + if { ![string compare [pkg_info_dependency_p $pkg_info] "t"]} { + # Dependency passed. + + if { $install_enable_p } { + if { ([lsearch -exact $to_install $package_key] != -1) } { + append widget " <td align=center><input type=checkbox checked + name=install value=\"$package_key\" + onclick=\"if (!checked) document.forms\[0\].elements\[$checkbox_count+1\].checked=false\"></td> " + } else { + append widget " <td align=center><input type=checkbox + name=install value=\"$package_key\" + onclick=\"if (!checked) document.forms\[0\].elements\[$checkbox_count+1\].checked=false\"></td>" + } + } + if { [lsearch -exact $to_enable $package_key] != -1 } { + append widget " + <td align=center><input type=checkbox checked + name=enable value=\"$package_key\" " + } else { + append widget " + <td align=center><input type=checkbox + name=enable value=\"$package_key\" " + } + + if { $install_enable_p } { + append widget " + onclick=\"if (checked) document.forms\[0\].elements\[$checkbox_count\].checked=true\"" + } + + append widget "></td> + <td>$package(package-name) $package(name)</td> + <td>/packages/$package(package.key)/</td> + <td><font color=green>Dependencies satisfied.</font></td> + </tr> " + } elseif { ![string compare [pkg_info_dependency_p $pkg_info] "f"] } { + #Dependency failed. + if { $install_enable_p } { + append widget " <td align=center><input type=checkbox name=install value=\"$package_key\" + onclick=\"if (!checked) document.forms\[0\].elements\[$checkbox_count+1\].checked=false\"></td>" + } + append widget " + <td align=center><input type=checkbox name=enable value=\"$package_key\" " + + if { $install_enable_p } { + append widget "onclick=\"if (checked) document.forms\[0\].elements\[$checkbox_count\].checked=true\"" + } + + append widget "></td> + <td>$package(package-name) $package(name)</td> + <td>/packages/$package(package.key)/</td> <td><font color=red> - " - foreach comment [pkg_info_comment $pkg_info] { - append widget "$comment<br>" - } - append widget " - </font></td> - </tr> - " - } else { - # No dependency information. - # See if the install is already installed with a higher version number. - if {[apm_package_registered_p $package_key]} { - set higher_version_p [apm_higher_version_installed_p $package_key $version_name] - } else { - set higher_version_p 2 - } - if {$higher_version_p == 2 } { - set comment "New install." - } elseif {$higher_version_p == 1 } { - set comment "Upgrade." - } elseif {$higher_version_p == 0} { - set comment "Package version already installed." - } else { - set comment "Installing older version of package." - } - - append widget " <tr valign=baseline bgcolor=[lindex $band_colors [expr { $counter % [llength $band_colors] }]]>" + " + foreach comment [pkg_info_comment $pkg_info] { + append widget "$comment<br>" + } + append widget " + </font></td> + </tr> + " + } else { + # No dependency information. + # See if the install is already installed with a higher version number. + if {[apm_package_registered_p $package_key]} { + set higher_version_p [apm_higher_version_installed_p $package_key $version_name] + } else { + set higher_version_p 2 + } + if {$higher_version_p == 2 } { + set comment "New install." + } elseif {$higher_version_p == 1 } { + set comment "Upgrade." + } elseif {$higher_version_p == 0} { + set comment "Package version already installed." + } else { + set comment "Installing older version of package." + } + + append widget " <tr valign=baseline bgcolor=[lindex $band_colors [expr { $counter % [llength $band_colors] }]]>" - if { ([lsearch -exact $to_install $package_key] != -1) } { + if { ([lsearch -exact $to_install $package_key] != -1) } { set install_checked "checked" } else { set install_checked "" } - if { ([lsearch -exact $to_enable $package_key] != -1) } { + if { ([lsearch -exact $to_enable $package_key] != -1) } { set enable_checked "checked" } else { set enable_checked "" } - append widget " <td align=center><input type=checkbox $install_checked name=install value=\"$package_key\" - onclick=\"if (!checked) document.forms\[0\].elements\[$checkbox_count+1\].checked=false\"></td> - <td align=center><input type=checkbox $enable_checked name=enable value=\"$package_key\" - onclick=\"if (checked) document.forms\[0\].elements\[$checkbox_count\].checked=true\"></td> - <td>$package(package-name) $package(name)</td> + if { $install_enable_p } { + append widget "<td align=center><input type=checkbox $install_checked name=install value=\"$package_key\" + onclick=\"if (!checked) document.forms\[0\].elements\[$checkbox_count+1\].checked=false\"></td> + <td align=center><input type=checkbox $enable_checked name=enable value=\"$package_key\" + onclick=\"if (checked) document.forms\[0\].elements\[$checkbox_count\].checked=true\"></td>" + } else { + append widget " + <td align=center><input type=checkbox $enable_checked name=enable value=\"$package_key\"></td>" + } + + append widget " + <td>$package(package-name) $package(name)</td> <td>/packages/$package(package.key)/</td> - <td>$comment</td> - </tr>" - } - incr checkbox_count 2 + <td>$comment</td> + </tr>" + } + incr checkbox_count 2 } append widget "</table></blockquote>" return $widget Index: openacs-4/packages/acs-admin/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/Attic/index-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-admin/www/index-oracle.xql 27 Apr 2001 04:09:35 -0000 1.1 +++ openacs-4/packages/acs-admin/www/index-oracle.xql 28 Aug 2003 09:41:37 -0000 1.2 @@ -5,7 +5,7 @@ <fullquery name="subsite_admin_urls"> <querytext> - select site_node.url(node_id) || 'admin/' as subsite_admin_url, instance_name + select site_node.url(node_id) || 'admin/' as admin_url, instance_name from site_nodes s, apm_packages p where s.object_id = p.package_id and p.package_key = 'acs-subsite' Index: openacs-4/packages/acs-admin/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/Attic/index-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-admin/www/index-postgresql.xql 27 Apr 2001 04:09:35 -0000 1.1 +++ openacs-4/packages/acs-admin/www/index-postgresql.xql 28 Aug 2003 09:41:37 -0000 1.2 @@ -5,7 +5,7 @@ <fullquery name="subsite_admin_urls"> <querytext> - select site_node__url(node_id) || 'admin/' as subsite_admin_url, instance_name + select site_node__url(node_id) || 'admin/' as admin_url, instance_name from site_nodes s, apm_packages p where s.object_id = p.package_id and p.package_key = 'acs-subsite' Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-admin/www/index.adp'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-admin/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/index.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-admin/www/index.tcl 17 May 2003 09:36:15 -0000 1.6 +++ openacs-4/packages/acs-admin/www/index.tcl 28 Aug 2003 09:41:37 -0000 1.7 @@ -5,52 +5,24 @@ @cvs-id $Id$ } -set title "[ad_conn instance_name] for [ad_system_name]" +set page_title "[ad_conn instance_name] for [ad_system_name]" -set page " -[ad_admin_header $title] -<h2>$title</h2> -[ad_context_bar] -<hr> - -[ad_conn instance_name] is used to administer the site-wide services of the ArsDigita Community System. - -<ul> - <li><a href=apm>ACS Package Manager</a> - <li><a href=users>Users</a> - <li><a href=\"/acs-lang/admin\">Internationalization</a></li> - <li><a href=\"cache\">Cache Control</a></li> -</ul> -<p> -" - -db_foreach subsite_admin_urls { - select site_node.url(node_id) || 'admin/' as subsite_admin_url, +db_multirow subsites subsite_admin_urls { + select site_node.url(node_id) || 'admin/' as admin_url, instance_name from site_nodes s, apm_packages p where s.object_id = p.package_id and p.package_key = 'acs-subsite' -} { - lappend subsite_admin_list "<a href=\"$subsite_admin_url\">$instance_name Administration</a>" -} if_no_rows { - set subsite_admin_widget "No subsites are available on this system." } -if {! [exists_and_not_null subsite_admin_widget] } { - set subsite_admin_widget " -To administer a particular subsite, please select from the list below. -<ul>" - foreach url $subsite_admin_list { - append subsite_admin_widget "\n <li>$url</li><p>" +db_multirow -extend { admin_url } packages installed_packages { + select package_key, + pretty_name as pretty_name + from apm_package_types +} { + if { [apm_package_installed_p $package_key] && [file exists "[acs_package_root_dir $package_key]/www/sitewide-admin/"] } { + set admin_url "package/$package_key/" + } else { + continue } - append subsite_admin_widget " -</ul>\n" -} - -append page " -$subsite_admin_widget -<p> -[ad_admin_footer] -" - -ns_return 200 text/html $page +} Index: openacs-4/packages/acs-admin/www/apm/packages-install-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/packages-install-2.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-admin/www/apm/packages-install-2.tcl 17 May 2003 09:36:29 -0000 1.7 +++ openacs-4/packages/acs-admin/www/apm/packages-install-2.tcl 28 Aug 2003 09:41:37 -0000 1.8 @@ -14,6 +14,9 @@ # Install and enable are sets of keys; need to turn them back into spec files. set spec_files [ad_get_client_property apm spec_files] +# LARS HACK: I got rid of the separate install/enable checkboxes +set install $enable + # Clear out previous client properties. ad_set_client_property -clob t apm pkg_install_list "" ad_set_client_property -clob t apm pkg_enable_list "" Index: openacs-4/packages/acs-admin/www/apm/packages-install.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/packages-install.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/acs-admin/www/apm/packages-install.tcl 17 May 2003 09:36:29 -0000 1.15 +++ openacs-4/packages/acs-admin/www/apm/packages-install.tcl 28 Aug 2003 09:41:37 -0000 1.16 @@ -11,7 +11,7 @@ } ad_return_top_of_page "[apm_header "Package Installation"] -<p>Please wait while the installer loads ........<p> +<p>Please wait while the installer searches your system for packages to install ...<p> " @@ -74,31 +74,18 @@ ns_write " <h2>Select Packages to Install</h2><p> - Please select the set of packages you'd like to install - and enable. + <p>Please select the set of packages you'd like to install.</p>" - <ul> - <li>To <b>install</b> a package is to load its data model. - <li>To <b>enable</b> a package is to make it available to users. - </ul> - - If you think you might want to use a package later (but not right away), - install it but don't enable it.<p>" - - if { [llength $not_compatible_list] > 0 } { - ns_write "<p>If there's a package that you can't find in the list below, it may be because it's <a href=\"#incompatible\">incompatible</a> with your system. </p>" - } - ns_write " <script language=javascript> function uncheckAll() { - for (var i = 0; i < [expr [llength $spec_files] * 2]; ++i) + for (var i = 0; i < [expr [llength $spec_files] ]; ++i) document.forms\[0\].elements\[i\].checked = false; this.href=''; } function checkAll() { - for (var i = 0; i < [expr [llength $spec_files] * 2]; ++i) + for (var i = 0; i < [expr [llength $spec_files] ]; ++i) document.forms\[0\].elements\[i\].checked = true; this.href=''; } @@ -163,14 +150,15 @@ } if { [llength $not_compatible_list] > 0 } { - ns_write "<h3><a name=\"incompatible\">Incompatible Packages</a></h3><ul><li>[join $not_compatible_list "<li>"]</ul>" + ns_log Notice "APM packages-install: Incompatible Packages\n- [join $not_compatible_list "\n- "]" } if { [llength $already_installed_list] > 0 } { - ns_write "<h3>Already Installed Packages</h3><ul><li>[join $already_installed_list "<li>"]</ul>" + ns_log Notice "APM packages-install: Already Installed Packages\n- [join $already_installed_list "\n- "]" } + ns_write " [ad_footer] " Index: openacs-4/packages/acs-admin/www/apm/version-callback-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/version-callback-add-edit.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-admin/www/apm/version-callback-add-edit.tcl 23 May 2003 11:38:33 -0000 1.4 +++ openacs-4/packages/acs-admin/www/apm/version-callback-add-edit.tcl 28 Aug 2003 09:41:37 -0000 1.5 @@ -35,7 +35,7 @@ set page_title "Edit Tcl Callback" } -set context_bar [ad_context_bar [list "version-view?[export_vars { version_id }]" "$pretty_name $version_name"] [list $return_url "Tcl Callbacks"] $page_title] +set context_bar [ad_context_bar [list "." "ACS Package Manager Administration"] [list "version-view?[export_vars { version_id }]" "$pretty_name $version_name"] [list $return_url "Tcl Callbacks"] $page_title] set type_label "Tcl procedure name" ad_form -name callback -cancel_url $return_url -form { Index: openacs-4/packages/acs-admin/www/apm/version-callbacks.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/version-callbacks.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-admin/www/apm/version-callbacks.adp 22 May 2003 13:59:05 -0000 1.3 +++ openacs-4/packages/acs-admin/www/apm/version-callbacks.adp 28 Aug 2003 09:41:37 -0000 1.4 @@ -28,6 +28,118 @@ <if @unused_types_p@ eq 1> <p> - <a href="version-callback-add-edit?version_id=@version_id@">Add callback</a> + <b>»</b> <a href="version-callback-add-edit?version_id=@version_id@">Add callback</a> </p> </if> + +<h3>Help</h3> + +<p> + Below is the list of available callbacks and the parameters they will be called with. Note that the parameters are sent as named parameters. +</p> + +<p> + For install, uninstall, and upgrade, the before/after part of the + name refers to before or after the database create/upgrade/drop + scripts have been run. For mounting and instantiating, well, that should be fairly obvious. +</p> + +<p> + For the upgrade callbacks, you should definitely check out the <a + href="/api-doc/proc-view?proc=apm%5fupgrade%5flogic">apm_upgrade_logic</a>, + which makes it very easy to handle the logic of which things to + process depending on which version you're upgrading from and to. +</p> + +<table cellspacing="1" cellpadding="4" bgcolor="#999999"> + <tr bgcolor="white"> + <th>Callback</th> + <th>Parameters</th> + </tr> + + <tr bgcolor="white"> + <td> + before-install + </td> + <td> + + </td> + </tr> + + <tr bgcolor="white"> + <td> + after-install + </td> + <td> + + </td> + </tr> + + <tr bgcolor="white"> + <td> + before-upgrade + </td> + <td> + -from_version_name + -to_version_name + </td> + </tr> + + <tr bgcolor="white"> + <td> + after-upgrade + </td> + <td> + -from_version_name + -to_version_name + </td> + </tr> + + <tr bgcolor="white"> + <td> + before-uninstall + </td> + <td> + + </td> + </tr> + + <tr bgcolor="white"> + <td> + after-instantiate + </td> + <td> + -package_id + </td> + </tr> + + <tr bgcolor="white"> + <td> + before-uninstantiate + </td> + <td> + -package_id + </td> + </tr> + + <tr bgcolor="white"> + <td> + after-mount + </td> + <td> + -package_id + -node_id + </td> + </tr> + + <tr bgcolor="white"> + <td> + before-unmount + </td> + <td> + -package_id + -node_id + </td> + </tr> + +</table> Index: openacs-4/packages/acs-admin/www/apm/version-callbacks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/version-callbacks.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-admin/www/apm/version-callbacks.tcl 31 Jan 2003 13:12:48 -0000 1.2 +++ openacs-4/packages/acs-admin/www/apm/version-callbacks.tcl 28 Aug 2003 09:41:37 -0000 1.3 @@ -10,7 +10,7 @@ db_1row package_version_info "select pretty_name, version_name from apm_package_version_info where version_id = :version_id" set page_title "Tcl Callbacks" -set context_bar [ad_context_bar [list "version-view?[export_vars { version_id }]" "$pretty_name $version_name"] $page_title] +set context_bar [ad_context_bar [list "." "ACS Package Manager Administration"] [list "version-view?[export_vars { version_id }]" "$pretty_name $version_name"] $page_title] db_multirow callbacks get_all_callbacks { select type, @@ -24,4 +24,4 @@ set unused_types_p [ad_decode [llength $unused_callback_types] 0 0 1] -ad_return_template \ No newline at end of file +ad_return_template Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-admin/www/package/index.vuh'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-admin/www/users/one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/users/one.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-admin/www/users/one.adp 2 Aug 2003 06:22:37 -0000 1.8 +++ openacs-4/packages/acs-admin/www/users/one.adp 28 Aug 2003 09:41:37 -0000 1.9 @@ -32,7 +32,7 @@ </p> </if> -Member state: @member_state@ @user_finite_state_links@ +Member state: @member_state@ @user_finite_state_links;noquote@ <h2>This user is a member of the following groups:</h2> <p>Note: These are the groups to which the user has been granted Index: openacs-4/packages/acs-content-repository/sql/oracle/content-revision.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/content-revision.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-content-repository/sql/oracle/content-revision.sql 12 May 2002 20:57:02 -0000 1.5 +++ openacs-4/packages/acs-content-repository/sql/oracle/content-revision.sql 28 Aug 2003 09:41:38 -0000 1.6 @@ -321,6 +321,25 @@ end get_number; +function revision_name( + revision_id IN cr_revisions.revision_id%TYPE +) return varchar2 is + + v_text varchar2(500); + v_sql varchar2(500); + +begin + + v_sql := 'select ''Revision '' || content_revision.get_number(r.revision_id) || '' of '' || (select count(*) from cr_revisions where item_id = r.item_id) || '' for item: '' || content_item.get_title(item_id) + from cr_revisions r + where r.revision_id = ' || revision_name.revision_id; + + execute immediate v_sql into v_text; + + return v_text; + +end revision_name; + procedure index_attributes( revision_id IN cr_revisions.revision_id%TYPE ) is Index: openacs-4/packages/acs-content-repository/sql/oracle/packages-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/packages-create.sql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-content-repository/sql/oracle/packages-create.sql 7 Jul 2003 12:25:53 -0000 1.9 +++ openacs-4/packages/acs-content-repository/sql/oracle/packages-create.sql 28 Aug 2003 09:41:38 -0000 1.10 @@ -894,6 +894,12 @@ revision_id in cr_revisions.revision_id%TYPE ) return number; +function revision_name ( + --/** Return a pretty string 'revision x of y' + --*/ + revision_id in cr_revisions.revision_id%TYPE +) return varchar2; + procedure index_attributes( --/** Generates an XML document for insertion into cr_revision_attributes, -- which is indexed by Intermedia for searching attributes. Index: openacs-4/packages/acs-content-repository/sql/oracle/types-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/types-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-content-repository/sql/oracle/types-create.sql 24 Mar 2001 22:00:48 -0000 1.1 +++ openacs-4/packages/acs-content-repository/sql/oracle/types-create.sql 28 Aug 2003 09:41:38 -0000 1.2 @@ -235,7 +235,8 @@ pretty_name => 'Basic Item', pretty_plural => 'Basic Items', table_name => 'cr_revisions', - id_column => 'revision_id' + id_column => 'revision_id', + name_method => 'content_revision.revision_name' ); attr_id := content_type.create_attribute ( Index: openacs-4/packages/acs-content-repository/tcl/extlink-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/extlink-procs-oracle.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-content-repository/tcl/extlink-procs-oracle.xql 23 Jun 2003 18:11:44 -0000 1.4 +++ openacs-4/packages/acs-content-repository/tcl/extlink-procs-oracle.xql 28 Aug 2003 09:41:38 -0000 1.5 @@ -48,7 +48,8 @@ <fullquery name="content_extlink::extlink_p.extlink_check"> <querytext> - select content_extlink.is_extlink (:item_id) from dual + select content_extlink.is_extlink (:item_id) + from dual </querytext> </fullquery> Index: openacs-4/packages/acs-content-repository/tcl/extlink-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/extlink-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-content-repository/tcl/extlink-procs.tcl 17 May 2003 09:43:54 -0000 1.2 +++ openacs-4/packages/acs-content-repository/tcl/extlink-procs.tcl 28 Aug 2003 09:41:38 -0000 1.3 @@ -87,3 +87,15 @@ } { return [db_string extlink_check {}] } + +ad_proc content_extlink::extlink_name { + -item_id:required +} { + + Returns the name of an extlink + + @item_id The object id of the item to check. + +} { + return [db_string extlink_name {}] +} Index: openacs-4/packages/acs-content-repository/tcl/extlink-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/extlink-procs.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-content-repository/tcl/extlink-procs.xql 17 May 2003 09:43:54 -0000 1.2 +++ openacs-4/packages/acs-content-repository/tcl/extlink-procs.xql 28 Aug 2003 09:41:38 -0000 1.3 @@ -13,4 +13,12 @@ </querytext> </fullquery> + <fullquery name="content_extlink::extlink_name.extlink_name"> + <querytext> + select label + from cr_extlinks + where extlink_id = :item_id + </querytext> + </fullquery> + </queryset> Index: openacs-4/packages/acs-content-repository/tcl/item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/item-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-content-repository/tcl/item-procs.tcl 28 Jul 2003 12:43:29 -0000 1.8 +++ openacs-4/packages/acs-content-repository/tcl/item-procs.tcl 28 Aug 2003 09:41:38 -0000 1.9 @@ -269,6 +269,17 @@ return $file_url } +ad_proc -public item::get_type { item_id } { + Returns the content type of the specified item, or empty string + if the item_id is invalid +} { + if { [db_0or1row get_content_type ""] } { + return $content_type + } else { + return "" + } +} + ad_proc item::copy { -item_id:required -target_folder_id:required Index: openacs-4/packages/acs-content-repository/tcl/item-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/item-procs.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-content-repository/tcl/item-procs.xql 13 Aug 2002 04:21:33 -0000 1.2 +++ openacs-4/packages/acs-content-repository/tcl/item-procs.xql 28 Aug 2003 09:41:38 -0000 1.3 @@ -1,6 +1,13 @@ <?xml version="1.0"?> <queryset> +<fullquery name="item::get_type.get_content_type"> + <querytext> + select content_type from cr_items + where item_id = :item_id + </querytext> +</fullquery> + <fullquery name="item::get_live_revision.glr_get_live_revision"> <querytext> Index: openacs-4/packages/acs-content-repository/tcl/keyword-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/keyword-procs-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-content-repository/tcl/keyword-procs-oracle.xql 5 Mar 2003 17:02:40 -0000 1.2 +++ openacs-4/packages/acs-content-repository/tcl/keyword-procs-oracle.xql 28 Aug 2003 09:41:38 -0000 1.3 @@ -20,6 +20,14 @@ </querytext> </fullquery> + <fullquery name="cr::keyword::delete.delete_keyword"> + <querytext> + begin + content_keyword.delete(:keyword_id); + end; + </querytext> + </fullquery> + <fullquery name="cr::keyword::set_heading.set_heading"> <querytext> begin Index: openacs-4/packages/acs-content-repository/tcl/keyword-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/keyword-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-content-repository/tcl/keyword-procs-postgresql.xql 5 Mar 2003 17:02:40 -0000 1.2 +++ openacs-4/packages/acs-content-repository/tcl/keyword-procs-postgresql.xql 28 Aug 2003 09:41:38 -0000 1.3 @@ -17,6 +17,12 @@ </querytext> </fullquery> + <fullquery name="cr::keyword::delete.delete_keyword"> + <querytext> + select content_keyword__delete (:keyword_id) + </querytext> + </fullquery> + <fullquery name="cr::keyword::set_heading.set_heading"> <querytext> select content_keyword__set_heading(:keyword_id, :heading) Index: openacs-4/packages/acs-content-repository/tcl/keyword-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/keyword-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-content-repository/tcl/keyword-procs.tcl 5 Mar 2003 17:02:40 -0000 1.2 +++ openacs-4/packages/acs-content-repository/tcl/keyword-procs.tcl 28 Aug 2003 09:41:38 -0000 1.3 @@ -27,6 +27,16 @@ return $keyword_id } +ad_proc -public cr::keyword::delete { + {-keyword_id:required} +} { + Delete a keyword. + + @author Peter Marklund +} { + db_exec_plsql delete_keyword {} +} + ad_proc -public cr::keyword::set_heading { {-keyword_id:required} {-heading:required} @@ -113,4 +123,26 @@ return $keyword_list } +ad_proc -public cr::keyword::get_options_flat { + {-parent_id ""} +} { + Returns a flat options list of the keywords with the given parent_id. +} { + return [db_list_of_lists select_keyword_options {}] +} +ad_proc -public cr::keyword::get_children { + {-parent_id ""} +} { + Returns the ids of the keywords having the given parent_id. Returns + an empty list if there are no children. + + @author Peter Marklund +} { + return [db_list select_child_keywords { + select keyword_id + from cr_keywords + where parent_id = :parent_id + }] +} + Index: openacs-4/packages/acs-content-repository/tcl/keyword-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/keyword-procs.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-content-repository/tcl/keyword-procs.xql 5 Mar 2003 17:02:40 -0000 1.2 +++ openacs-4/packages/acs-content-repository/tcl/keyword-procs.xql 28 Aug 2003 09:41:38 -0000 1.3 @@ -46,5 +46,15 @@ </querytext> </fullquery> + <fullquery name="cr::keyword::get_options_flat.select_keyword_options"> + <querytext> + select heading, + keyword_id + from cr_keywords + where [ad_decode $parent_id "" "parent_id is null" "parent_id = :parent_id"] + order by lower(heading) + </querytext> + </fullquery> + </queryset> Index: openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql 22 Aug 2003 15:05:20 -0000 1.7 +++ openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql 28 Aug 2003 09:41:38 -0000 1.8 @@ -237,11 +237,12 @@ -- Make the "Unregistered Visitor" be object 0, which corresponds -- with the user_id assigned throughout the toolkit Tcl code + -- LARS: Make object_id 0 be a user, not a person insert into acs_objects (object_id, object_type) values - (0, 'person'); + (0, 'user'); insert into parties (party_id) @@ -253,6 +254,11 @@ values (0, 'Unregistered', 'Visitor'); + insert into users + (user_id, username) + values + (0, 'guest'); + insert into acs_magic_objects (name, object_id) values @@ -261,7 +267,8 @@ -- Create the public group foo := acs_group.new ( group_id => -1, - group_name => 'The Public' + group_name => 'The Public', + join_policy => 'closed' ); insert into acs_magic_objects @@ -282,7 +289,8 @@ foo := acs_group.new ( group_id => -2, - group_name => 'Registered Users' + group_name => 'Registered Users', + join_policy => 'closed' ); insert into acs_magic_objects Index: openacs-4/packages/acs-kernel/sql/oracle/acs-objects-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/acs-objects-create.sql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-kernel/sql/oracle/acs-objects-create.sql 23 Aug 2003 23:47:16 -0000 1.9 +++ openacs-4/packages/acs-kernel/sql/oracle/acs-objects-create.sql 28 Aug 2003 09:41:38 -0000 1.10 @@ -430,6 +430,8 @@ procedure update_last_modified ( object_id in acs_objects.object_id%TYPE, + modifying_user in acs_objects.modifying_user%TYPE, + modifying_ip in acs_objects.modifying_ip%TYPE, last_modified in acs_objects.last_modified%TYPE default sysdate ); @@ -1047,13 +1049,15 @@ procedure update_last_modified ( object_id in acs_objects.object_id%TYPE, + modifying_user in acs_objects.modifying_user%TYPE, + modifying_ip in acs_objects.modifying_ip%TYPE, last_modified in acs_objects.last_modified%TYPE default sysdate ) is v_parent_id acs_objects.context_id%TYPE; begin update acs_objects - set acs_objects.last_modified = acs_object.update_last_modified.last_modified + set acs_objects.last_modified = acs_object.update_last_modified.last_modified, acs_objects.modifying_user = acs_object.update_last_modified.modifying_user, acs_objects.modifying_ip = acs_object.update_last_modified.modifying_ip where acs_objects.object_id in (select ao.object_id from acs_objects ao connect by prior ao.context_id = ao.object_id Index: openacs-4/packages/acs-kernel/sql/oracle/community-core-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/community-core-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-kernel/sql/oracle/community-core-create.sql 22 Aug 2003 15:05:20 -0000 1.7 +++ openacs-4/packages/acs-kernel/sql/oracle/community-core-create.sql 28 Aug 2003 09:41:38 -0000 1.8 @@ -538,6 +538,7 @@ salt char(40), password_question varchar2(1000), password_answer varchar2(1000), + password_changed_date date, -- table constraints constraint users_authority_username_un unique (authority_id, username) Index: openacs-4/packages/acs-kernel/sql/oracle/groups-body-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/groups-body-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-kernel/sql/oracle/groups-body-create.sql 17 May 2003 01:46:41 -0000 1.7 +++ openacs-4/packages/acs-kernel/sql/oracle/groups-body-create.sql 28 Aug 2003 09:41:38 -0000 1.8 @@ -677,6 +677,53 @@ +create or replace package body admin_rel +as + + function new ( + rel_id in admin_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'admin_rel', + object_id_one in acs_rels.object_id_one%TYPE, + object_id_two in acs_rels.object_id_two%TYPE, + member_state in membership_rels.member_state%TYPE default 'approved', + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return admin_rels.rel_id%TYPE + is + v_rel_id integer; + begin + v_rel_id := membership_rel.new ( + rel_id => rel_id, + rel_type => rel_type, + object_id_one => object_id_one, + object_id_two => object_id_two, + member_state => member_state, + creation_user => creation_user, + creation_ip => creation_ip + ); + + insert into admin_rels + (rel_id) + values + (v_rel_id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in admin_rels.rel_id%TYPE + ) + is + begin + membership_rel.delete(rel_id); + end; + +end admin_rel; +/ +show errors + + + create or replace package body acs_group is function new ( Index: openacs-4/packages/acs-kernel/sql/oracle/groups-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/groups-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-kernel/sql/oracle/groups-create.sql 5 Dec 2002 13:07:43 -0000 1.5 +++ openacs-4/packages/acs-kernel/sql/oracle/groups-create.sql 28 Aug 2003 09:41:38 -0000 1.6 @@ -34,6 +34,14 @@ 'banned', 'rejected', 'deleted')) ); +create table admin_rels ( + rel_id integer constraint admin_rel_rel_id_fk + references membership_rels (rel_id) + constraint admin_rel_rel_id_pk + primary key +); + + create index member_rels_member_state_idx on membership_rels (member_state); declare @@ -101,6 +109,22 @@ min_n_rels_two => 0, max_n_rels_two => null ); + acs_rel_type.create_role ('admin', 'Administrator', 'Administrators'); + + acs_rel_type.create_type ( + rel_type => 'admin_rel', + pretty_name => 'Administrator Relation', + pretty_plural => 'Administrator Relationships', + supertype => 'membership_rel', + table_name => 'admin_rels', + id_column => 'rel_id', + package_name => 'admin_rel', + object_type_one => 'group', + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'person', role_two => 'admin', + min_n_rels_two => 0, max_n_rels_two => null + ); + commit; end; / @@ -446,6 +470,28 @@ show errors +create or replace package admin_rel +as + + function new ( + rel_id in admin_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'admin_rel', + object_id_one in acs_rels.object_id_one%TYPE, + object_id_two in acs_rels.object_id_two%TYPE, + member_state in membership_rels.member_state%TYPE default 'approved', + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return admin_rels.rel_id%TYPE; + + procedure delete ( + rel_id in admin_rels.rel_id%TYPE + ); + +end admin_rel; +/ +show errors + + create or replace package acs_group is function new ( Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.6.3-4.6.4.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.6.4-4.6.5.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.6.5-4.6.6.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql,v diff -u -r1.16 -r1.17 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql 22 Aug 2003 15:05:20 -0000 1.16 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql 28 Aug 2003 09:41:38 -0000 1.17 @@ -237,7 +237,7 @@ insert into acs_objects (object_id, object_type) values - (0, ''person''); + (0, ''user''); insert into parties (party_id) @@ -249,6 +249,11 @@ values (0, ''Unregistered'', ''Visitor''); + insert into users + (user_id, username) + values + (0, ''guest''); + insert into acs_magic_objects (name, object_id) values @@ -263,7 +268,7 @@ null, null, ''The Public'', - null, + ''closed'', null ); @@ -310,7 +315,7 @@ null, null, ''Registered Users'', - null, + ''closed'', null ); Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql,v diff -u -r1.42 -r1.43 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql 25 Aug 2003 21:40:16 -0000 1.42 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql 28 Aug 2003 09:41:38 -0000 1.43 @@ -1340,21 +1340,25 @@ end;' language 'plpgsql'; -create function acs_object__update_last_modified (integer) +create function acs_object__update_last_modified (integer, integer, integer) returns integer as ' declare - acs_object__update_last_modified__object_id alias for $1; + acs_object__update_last_modified__object_id alias for $1; + acs_object__update_last_modified__modifying_user alias for $2; + acs_object__update_last_modified__modifying_ip alias for $3; begin - return acs_object__update_last_modified(acs_object__update_last_modified__object_id, now()); + return acs_object__update_last_modified(acs_object__update_last_modified__object_id, acs_object__update_last_modified__modifying_user, acs_object__update_last_modified__modifying_ip, now()); end;' language 'plpgsql'; -create function acs_object__update_last_modified (integer, timestamptz) +create function acs_object__update_last_modified (integer, integer, integer, timestamptz) returns integer as ' declare - acs_object__update_last_modified__object_id alias for $1; - acs_object__update_last_modified__last_modified alias for $2; -- default now() - v_parent_id integer; - v_last_modified timestamptz; + acs_object__update_last_modified__object_id alias for $1; + acs_object__update_last_modified__modifying_user alias for $2; + acs_object__update_last_modified__modifying_ip alias for $3; + acs_object__update_last_modified__last_modified alias for $4; -- default now() + v_parent_id integer; + v_last_modified timestamptz; begin if acs_object__update_last_modified__last_modified is null then v_last_modified := now(); @@ -1363,7 +1367,9 @@ end if; update acs_objects - set last_modified = v_last_modified + set last_modified = v_last_modified, + modifying_user = acs_object__update_last_modified__modifying_user, + modifying_ip = acs_object__update_last_modified__modifying_ip where object_id = acs_object__update_last_modified__object_id; select context_id @@ -1372,7 +1378,7 @@ where object_id = acs_object__update_last_modified__object_id; if v_parent_id is not null and v_parent_id != 0 then - perform acs_object__update_last_modified(v_parent_id, v_last_modified); + perform acs_object__update_last_modified(v_parent_id, acs_object__update_last_modified__modifying_user, acs_object__update_last_modified__modifying_ip, v_last_modified); end if; return acs_object__update_last_modified__object_id; Index: openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql,v diff -u -r1.41 -r1.42 --- openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql 15 Aug 2003 14:35:50 -0000 1.41 +++ openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql 28 Aug 2003 09:41:38 -0000 1.42 @@ -1448,7 +1448,7 @@ from apm_parameters p left outer join apm_parameter_values v using (parameter_id), apm_packages ap where p.package_key = ap.package_key - and v.attr_value = null + and v.attr_value is null and p.package_key = register_parameter__package_key loop PERFORM apm__set_value( Index: openacs-4/packages/acs-kernel/sql/postgresql/community-core-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/community-core-create.sql,v diff -u -r1.14 -r1.15 --- openacs-4/packages/acs-kernel/sql/postgresql/community-core-create.sql 22 Aug 2003 15:05:20 -0000 1.14 +++ openacs-4/packages/acs-kernel/sql/postgresql/community-core-create.sql 28 Aug 2003 09:41:38 -0000 1.15 @@ -516,6 +516,7 @@ salt char(40), password_question varchar(1000), password_answer varchar(1000), + password_changed_date timestamptz, -- table constraints constraint users_authority_username_un unique (authority_id, username) Index: openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql,v diff -u -r1.23 -r1.24 --- openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql 17 May 2003 01:47:10 -0000 1.23 +++ openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql 28 Aug 2003 09:41:38 -0000 1.24 @@ -994,3 +994,70 @@ -- show errors + + +-- create or replace package body admin_rel +-- function new +select define_function_args('admin_rel__new','rel_id,rel_type;admin_rel,object_id_one,object_id_two,member_state;approved,creation_user,creation_ip'); + +create or replace function admin_rel__new (integer,varchar,integer,integer,varchar,integer,varchar) +returns integer as ' +declare + p_rel_id alias for $1; -- default null + p_rel_type alias for $2; -- default ''admin_rel'' + p_object_id_one alias for $3; + p_object_id_two alias for $4; + p_member_state alias for $5; -- default ''approved'' + p_creation_user alias for $6; -- default null + p_creation_ip alias for $7; -- default null + v_rel_id integer; +begin + v_rel_id := membership_rel__new ( + p_rel_id, -- rel_id + p_rel_type, -- rel_type + p_object_id_one, -- object_id_one + p_object_id_two, -- object_id_two + p_member_state, -- member_state + p_creation_user, -- creation_usre + p_creation_ip -- creation_ip + ); + + insert into admin_rels + (rel_id) + values + (v_rel_id); + + return v_rel_id; + +end;' language 'plpgsql'; + +-- function new +create or replace function admin_rel__new (integer,integer) +returns integer as ' +declare + object_id_one alias for $1; + object_id_two alias for $2; +begin + return membership_rel__new( + null, -- rel_id + ''admin_rel'', -- rel_type + object_id_one, -- object_id_one + object_id_two, -- object_id_two + ''approved'', -- member_state + null, -- creation_user + null -- creation_ip + ); +end;' language 'plpgsql'; + +-- procedure delete +create or replace function admin_rel__delete (integer) +returns integer as ' +declare + rel_id alias for $1; +begin + PERFORM membership_rel__delete(rel_id); + + return 0; +end;' language 'plpgsql'; + + Index: openacs-4/packages/acs-kernel/sql/postgresql/groups-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/groups-create.sql,v diff -u -r1.15 -r1.16 --- openacs-4/packages/acs-kernel/sql/postgresql/groups-create.sql 17 May 2003 01:47:10 -0000 1.15 +++ openacs-4/packages/acs-kernel/sql/postgresql/groups-create.sql 28 Aug 2003 09:41:38 -0000 1.16 @@ -34,6 +34,13 @@ 'banned', 'rejected', 'deleted')) ); +create table admin_rels ( + rel_id integer constraint admin_rel_rel_id_fk + references membership_rels (rel_id) + constraint admin_rel_rel_id_pk + primary key +); + create function inline_0 () returns integer as ' declare @@ -102,23 +109,46 @@ attr_id := acs_rel_type__create_role (''member'', ''#acs-kernel.member_role_pretty_name#'', ''#acs-kernel.member_role_pretty_plural#''); attr_id := acs_rel_type__create_type ( - ''membership_rel'', - ''Membership Relation'', - ''Membership Relationships'', - ''relationship'', - ''membership_rels'', - ''rel_id'', - ''membership_rel'', - ''group'', - null, - 0, - null, - ''person'', - ''member'', - 0, - null + ''membership_rel'', -- rel_type + ''Membership Relation'', -- pretty_name + ''Membership Relationships'', -- pretty_plural + ''relationship'', -- supertype + ''membership_rels'', -- table_name + ''rel_id'', -- id_column + ''membership_rel'', -- package_name + ''group'', -- object_type_one + null, -- role_one + 0, -- min_n_rels_one + null, -- max_n_rels_one + ''person'', -- object_type_two + ''member'', -- role_two + 0, -- min_n_rels_two + null -- max_n_rels_two ); + -- + -- Administrator Relationship + -- + attr_id := acs_rel_type__create_role (''admin'', ''Administrator'', ''Administrators''); + + attr_id := acs_rel_type__create_type ( + ''admin_rel'', -- rel_type + ''Administrator Relation'', -- pretty_name + ''Administrator Relationships'', -- pretty_plural + ''membership_rel'', -- supertype + ''admin_rels'', -- table_name + ''rel_id'', -- id_column + ''admin_rel'', -- package_name + ''group'', -- object_type_one + null, -- role_one + 0, -- min_n_rels_one + null, -- max_n_rels_one + ''person'', -- object_type_two + ''admin'', -- role_two + 0, -- min_n_rels_two + null -- max_n_rels_two + ); + return 0; end;' language 'plpgsql'; Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6.3-4.6.4.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6.4-4.6.5.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6.5-4.6.6.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-lang/sql/oracle/ad-locales.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/oracle/ad-locales.sql,v diff -u -r1.16 -r1.17 --- openacs-4/packages/acs-lang/sql/oracle/ad-locales.sql 28 Aug 2003 08:57:21 -0000 1.16 +++ openacs-4/packages/acs-lang/sql/oracle/ad-locales.sql 28 Aug 2003 09:41:39 -0000 1.17 @@ -35,10 +35,9 @@ mime_charset varchar2(30), -- is this the default locale for its language default_p char(1) default 'f' - constraint ad_locale_defp_tf check(default_p in ('t','f')) + constraint ad_locale_defp_tf check (default_p in ('t','f')), enabled_p char(1) default 't' - constraint ad_locale_enp_tf check(enabled_p in ('t','f')) - + constraint ad_locale_enp_tf check (enabled_p in ('t','f')) ); comment on table ad_locales is ' Index: openacs-4/packages/acs-messaging/sql/postgresql/acs-messaging-packages.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-messaging/sql/postgresql/acs-messaging-packages.sql,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-messaging/sql/postgresql/acs-messaging-packages.sql 17 May 2003 09:54:26 -0000 1.12 +++ openacs-4/packages/acs-messaging/sql/postgresql/acs-messaging-packages.sql 28 Aug 2003 09:41:39 -0000 1.13 @@ -10,7 +10,7 @@ -- updated for OpenACS by Jon Griffin -- -create function acs_message__edit (integer,varchar,varchar,varchar,text,integer,timestamptz,integer,varchar,boolean) +create or replace function acs_message__edit (integer,varchar,varchar,varchar,text,integer,timestamptz,integer,varchar,boolean) returns integer as ' declare p_message_id alias for $1; @@ -73,7 +73,7 @@ -- Jon Griffin 05-21-2001 ---------------- -create function acs_message__new (integer,integer,timestamptz,integer, +create or replace function acs_message__new (integer,integer,timestamptz,integer, varchar,varchar,varchar,varchar,text,integer,integer,integer,integer, varchar,varchar,boolean) returns integer as ' @@ -167,7 +167,7 @@ return v_message_id; end;' language 'plpgsql'; -create function acs_message__delete (integer) +create or replace function acs_message__delete (integer) returns integer as ' declare p_message_id alias for $1; @@ -177,7 +177,7 @@ return 1; end;' language 'plpgsql'; -create function acs_message__message_p (integer) +create or replace function acs_message__message_p (integer) returns boolean as ' declare p_message_id alias for $1; @@ -193,7 +193,7 @@ end if; end;' language 'plpgsql'; -create function acs_message__send (integer,varchar,integer,timestamptz) +create or replace function acs_message__send (integer,varchar,integer,timestamptz) returns integer as ' declare p_message_id alias for $1; @@ -210,7 +210,7 @@ return 1; end;' language 'plpgsql'; -create function acs_message__send (integer,integer,integer,timestamptz) +create or replace function acs_message__send (integer,integer,integer,timestamptz) returns integer as ' declare p_message_id alias for $1; @@ -231,7 +231,7 @@ -- Ported to take advantage of tree_sortkey column by DLP -create function acs_message__first_ancestor (integer) +create or replace function acs_message__first_ancestor (integer) returns integer as ' declare p_message_id alias for $1; @@ -256,7 +256,7 @@ -- functions will migrate to another PL/SQL package or be replaced -- by direct calls to CR code in the near future. -create function acs_message__new_file (integer,integer,varchar,varchar, +create or replace function acs_message__new_file (integer,integer,varchar,varchar, text,varchar,integer,timestamptz,integer,varchar,boolean,varchar) returns integer as ' declare @@ -310,7 +310,7 @@ return v_file_id; end;' language 'plpgsql'; -create function acs_message__edit_file (integer,varchar,text,varchar, +create or replace function acs_message__edit_file (integer,varchar,text,varchar, integer,timestamptz,integer,varchar,boolean) returns integer as ' declare @@ -347,7 +347,7 @@ return v_revision_id; end;' language 'plpgsql'; -create function acs_message__delete_file (integer) +create or replace function acs_message__delete_file (integer) returns integer as ' declare p_file_id alias for $1; @@ -356,7 +356,7 @@ return 1; end;' language 'plpgsql'; -create function acs_message__new_image (integer,integer,varchar,varchar, +create or replace function acs_message__new_image (integer,integer,varchar,varchar, text,varchar,integer,integer,integer,timestamptz,integer,varchar,boolean,varchar) returns integer as ' declare @@ -414,7 +414,7 @@ return v_image_id; end;' language 'plpgsql'; -create function acs_message__edit_image (integer,varchar,text,varchar, +create or replace function acs_message__edit_image (integer,varchar,text,varchar, integer,integer,integer,timestamptz,integer,varchar,boolean) returns integer as ' declare @@ -461,7 +461,7 @@ return v_revision_id; end;' language 'plpgsql'; -create function acs_message__delete_image (integer) +create or replace function acs_message__delete_image (integer) returns integer as ' declare p_image_id alias for $1; @@ -474,7 +474,7 @@ end;' language 'plpgsql'; -- XXX should just call content_extlink.new -create function acs_message__new_extlink (varchar,integer,varchar, +create or replace function acs_message__new_extlink (varchar,integer,varchar, varchar,text,integer,timestamptz,integer,varchar) returns integer as ' declare @@ -505,7 +505,7 @@ end;' language 'plpgsql'; -- XXX should just edit extlink -create function acs_message__edit_extlink (integer,varchar,varchar,text) +create or replace function acs_message__edit_extlink (integer,varchar,varchar,text) returns integer as ' declare p_extlink_id alias for $1; @@ -525,7 +525,7 @@ return 0; end;' language 'plpgsql'; -create function acs_message__delete_extlink (integer) +create or replace function acs_message__delete_extlink (integer) returns integer as ' declare p_extlink_id alias for $1; @@ -535,7 +535,7 @@ return 0; end;' language 'plpgsql'; -create function acs_message__name (integer) +create or replace function acs_message__name (integer) returns varchar as ' declare p_message_id alias for $1; Index: openacs-4/packages/acs-service-contract/tcl/contract-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/tcl/contract-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-service-contract/tcl/contract-procs.tcl 25 Feb 2003 15:15:33 -0000 1.2 +++ openacs-4/packages/acs-service-contract/tcl/contract-procs.tcl 28 Aug 2003 09:41:39 -0000 1.3 @@ -39,8 +39,80 @@ ad_proc -public acs_sc::contract::new_from_spec { {-spec:required} } { - Takes a complete notification spec and parses the - name, description and operations + Takes a complete service contract specification and creates the new service contract. + + <p> + + The spec looks like this: + + <blockquote><pre> + set spec { + name "Action_SideEffect" + description "Get the name of the side effect to create action" + operations { + GetObjectTypes { + description "Get the object types for which this implementation is valid." + output { object_types:string,multiple } + iscachable_p "t" + } + GetPrettyName { + description "Get the pretty name of this implementation." + output { pretty_name:string } + iscachable_p "t" + } + DoSideEffect { + description "Do the side effect" + input { + case_id:integer + object_id:integer + action_id:integer + entry_id:integer + } + } + } + } + + acs_sc::contract::new_from_spec -spec $spec + </pre></blockquote> + + Here's the detailed explanation: + + <p> + + The spec should be an array-list with 3 entries: + + <ul> + <li>name: The name of the service contract. + <li>description: A human-readable descirption. + <li>operations: An array-list of operations in this service contract. + </ul> + + The operations array-list has the operation name as key, and + another array-list containing the specification for the operation as the value. + That array-list has the following entries: + + <ul> + <li>description: Human-readable description of the operation. + <li>input: Specification of the input to this operation. + <li>output: Specification of the output of this operation. + <li>iscachable_p: A 't' or 'f' for whether output from this service contract implementation + should automatically be cached using util_memoize. + </ul> + + <p> + + The format of the 'input' and 'output' specs is a Tcl list of parameter specs, + each of which consist of name, colon (:), + datatype plus an optional comma (,) and the flag 'multiple'. + + + @param spec The service contract specification as described above. + + @return The contract_id of the newly created service contract. + + @see util_memoize + @see acs_sc::invoke + } { # Default values Index: openacs-4/packages/acs-service-contract/tcl/implementation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/tcl/implementation-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-service-contract/tcl/implementation-procs.tcl 25 Feb 2003 15:15:33 -0000 1.2 +++ openacs-4/packages/acs-service-contract/tcl/implementation-procs.tcl 28 Aug 2003 09:41:39 -0000 1.3 @@ -46,9 +46,47 @@ ad_proc -public acs_sc::impl::new_from_spec { {-spec:required} } { - Add new service contract implementation from an array-list style implementation. + Add new service contract implementation from an array-list style implementation, + and binds it to the specified contract. - @return the ID of the new implementation + <p> + + The specification takes the following form: + + <blockquote><pre> + set spec { + contract_name "Action_SideEffect" + owner "bug-tracker" + name "CaptureResolutionCode" + aliases { + GetObjectType bug_tracker::bug::object_type + GetPrettyName bug_tracker::bug::capture_resolution_code::pretty_name + DoSideEffect bug_tracker::bug::capture_resolution_code::do_side_effect + } + } + acs_sc::impl::new_from_spec -spec $spec + </pre></blockquote> + + And here's the explanation: + + <p> + + The spec is an array-list with the following entries: + + <ul> + <li>contract_name: The name of the service contract you're implementing. + <li>owner: Owner of the implementation, use the package-key. + <li>name: Name of your implementation. + <li>aliases: Specification of the tcl procedures for each of the service contract's operations. + </ul> + + The aliases section is itself an array-list. The keys are the operation names + from the service contract. The values are the names of Tcl procedures in your package, + which implement these operations. + + @param spec The specification for the new service contract implementation. + + @return the impl_id of the newly registered implementation } { # Spec contains: contract_name, name, owner, aliases array set impl $spec Index: openacs-4/packages/acs-subsite/acs-subsite.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/acs-subsite.info,v diff -u -r1.43 -r1.44 --- openacs-4/packages/acs-subsite/acs-subsite.info 28 Aug 2003 07:58:56 -0000 1.43 +++ openacs-4/packages/acs-subsite/acs-subsite.info 28 Aug 2003 09:41:39 -0000 1.44 @@ -10,22 +10,24 @@ <version name="5.0d1" url="http://www.openacs.org/repository/download/apm/acs-subsite-5.0d1.apm"> <database-support> + <database>oracle</database> + <database>postgresql</database> </database-support> <owner>Michael Bryzek</owner> <owner>Oumi Mehrotra</owner> <owner>Rafael Schloming</owner> <owner>Michael Yoon</owner> <summary>Provides the ability to create subsite within the OpenACS Community System.</summary> - <release-date>2002-10-24</release-date> + <release-date>2003-08-27</release-date> <vendor url="http://www.openacs.org/">OpenACS</vendor> <description format="text/html">Aware of parties, groups, users, portraits, ...</description> <provides url="acs-subsite" version="5.0d1"/> + <requires url="acs-content-repository" version="4.1"/> - <requires url="acs-kernel" version="4.6.2"/> + <requires url="acs-kernel" version="4.6.4"/> <requires url="acs-tcl" version="4.1"/> - <!-- No files --> <callbacks> <callback type="after-mount" proc="subsite::after_mount"/> <callback type="before-uninstantiate" proc="subsite::before_uninstantiate"/> @@ -56,10 +58,15 @@ <parameter datatype="string" min_n_values="1" max_n_values="1" name="EmailChangedPasswordP" default="0" description="if the admin changes the password, should it be mailed to the user" section_name="user-login"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="AllowPersistentLoginP" default="1" description="do we allow persistent logins?" section_name="user-login"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="EmailForgottenPasswordP" default="1" description="Email users forgotten passwords" section_name="user-login"/> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultMaster" default="/www/default-master" description="Path to the default master page (skin) for acs-templating. Extensions .adp/.tcl are implied."/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="IndexRedirectUrl" default="" description="A URL to redirect to instead of showing the subsite index page. Useful if you want to replace the index page with a page generated by portals, by edit-this-page, or to one of the applications installed at the subsite."/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultMaster" default="/www/default-master" description="Path to the default master page (skin) for acs-templating. Extensions .adp/.tcl are implied."/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultFormStyle" default="" description="The default form template to use if a particular form doesn't have something more specific defined already."/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultListStyle" default="table" description="The default list template to use if a particular list does not explicitly specify the list style to use."/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="RequireQuestionForPasswordResetP" default="1" description="Do we require a question/answer pair to reset a users password?" section_name="user-login"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="application" default="default" description="Name of the ETP application to use (default, faq, wiki, or create your own with the etp::define_applicaton procedure)" section_name="EditThisPage"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="subtopic_application" default="default" description="Name of the ETP application to use when creating a subtopic" section_name="EditThisPage"/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="PasswordExpirationDays" default="0" description="How long can a password be used before it expires and must be changed. Specify 0 to disable password expiration." section_name="user-login"/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="ApprovalExpirationDays" default="0" description="The number of days after which registration approval expires, which will cause the user to change state to 'needs_approval'. Set to 0 to disable expiration of approval." section_name="user-login"/> </parameters> </version> Index: openacs-4/packages/acs-subsite/sql/oracle/application-groups-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/sql/oracle/application-groups-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/sql/oracle/application-groups-create.sql 5 Apr 2001 18:23:38 -0000 1.1 +++ openacs-4/packages/acs-subsite/sql/oracle/application-groups-create.sql 28 Aug 2003 09:41:39 -0000 1.2 @@ -162,6 +162,11 @@ values (acs_object_id_seq.nextval, 'application_group', 'membership_rel'); +insert into group_type_rels +(group_rel_type_id, group_type, rel_type) +values +(acs_object_id_seq.nextval, 'application_group', 'admin_rel'); + ----------- -- Views -- ----------- Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/sql/oracle/upgrade/upgrade-4.6.4.1-4.6.4.2.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/sql/postgresql/application-groups-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/sql/postgresql/application-groups-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-subsite/sql/postgresql/application-groups-create.sql 17 May 2003 09:58:17 -0000 1.7 +++ openacs-4/packages/acs-subsite/sql/postgresql/application-groups-create.sql 28 Aug 2003 09:41:39 -0000 1.8 @@ -123,6 +123,11 @@ values (acs_object_id_seq.nextval, 'application_group', 'membership_rel'); +insert into group_type_rels +(group_rel_type_id, group_type, rel_type) +values +(acs_object_id_seq.nextval, 'application_group', 'admin_rel'); + ----------- -- Views -- ----------- Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/sql/postgresql/upgrade/upgrade-4.6.4.1-4.6.4.2.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/tcl/application-group-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/application-group-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/tcl/application-group-procs.tcl 17 May 2003 09:58:37 -0000 1.3 +++ openacs-4/packages/acs-subsite/tcl/application-group-procs.tcl 28 Aug 2003 09:41:39 -0000 1.4 @@ -235,6 +235,14 @@ Delete the given application group and all relational segments and constraints dependent on it (handled by the PL/[pg]SQL API } { + # LARS HACK: + # Delete permissions on: + # - the application group + # - any relational segment of this group + # - any relation with this gorup + # We really ought to have cascading deletes on acs_permissions.grantee_id (and object_id) + db_dml delete_perms {} + db_exec_plsql delete {} } Index: openacs-4/packages/acs-subsite/tcl/application-group-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/Attic/application-group-procs.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-subsite/tcl/application-group-procs.xql 17 May 2003 09:58:37 -0000 1.4 +++ openacs-4/packages/acs-subsite/tcl/application-group-procs.xql 28 Aug 2003 09:41:39 -0000 1.5 @@ -10,5 +10,16 @@ </querytext> </fullquery> + +<fullquery name="application_group::delete.delete_perms"> + <querytext> + + delete from acs_permissions + where grantee_id = :group_id + or grantee_id in (select segment_id from rel_segments where group_id = :group_id) + or grantee_id in (select rel_id from acs_rels where object_id_one = :group_id or object_id_two = :group_id) + + </querytext> +</fullquery> </queryset> Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/tcl/approval-expiration-init.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/tcl/approval-expiration-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/tcl/approval-expiration-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/tcl/approval-expiration-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/tcl/group-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/group-procs-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/tcl/group-procs-oracle.xql 23 Feb 2002 02:43:45 -0000 1.3 +++ openacs-4/packages/acs-subsite/tcl/group-procs-oracle.xql 28 Aug 2003 09:41:39 -0000 1.4 @@ -34,4 +34,21 @@ </fullquery> +<fullquery name="group::get_rel_types_options.select_rel_types"> + <querytext> + select role.pretty_name, + gr.rel_type + from group_rels gr, + acs_rel_types rt, + acs_rel_roles role + where gr.group_id = :group_id + and rt.rel_type = gr.rel_type + and role.role = rt.role_two + and rt.object_type_two = :object_type + order by decode(gr.rel_type, 'membership_rel', 0, 1)||role.pretty_name + + </querytext> +</fullquery> + + </queryset> Index: openacs-4/packages/acs-subsite/tcl/group-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/group-procs-postgresql.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/tcl/group-procs-postgresql.xql 28 Aug 2002 13:43:46 -0000 1.6 +++ openacs-4/packages/acs-subsite/tcl/group-procs-postgresql.xql 28 Aug 2003 09:41:39 -0000 1.7 @@ -36,5 +36,24 @@ </querytext> </fullquery> + +<fullquery name="group::get_rel_types_options.select_rel_types"> + <querytext> + + select role.pretty_name, + gr.rel_type + from group_rels gr, + acs_rel_types rt, + acs_rel_roles role + where gr.group_id = :group_id + and rt.rel_type = gr.rel_type + and role.role = rt.role_two + and rt.object_type_two = :object_type + order by (case when gr.rel_type = 'membership_rel' then 0 else 1 end)||role.pretty_name + + </querytext> +</fullquery> + + </queryset> Index: openacs-4/packages/acs-subsite/tcl/group-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/group-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-subsite/tcl/group-procs.tcl 4 Jun 2003 10:33:43 -0000 1.4 +++ openacs-4/packages/acs-subsite/tcl/group-procs.tcl 28 Aug 2003 09:41:39 -0000 1.5 @@ -306,3 +306,26 @@ } +ad_proc -public group::get_rel_types_options { + {-group_id:required} + {-object_type "person"} +} { + Get the valid relationship-types for this group in a format suitable for a select widget in the form builder. + The label used is the name of the role for object two. + + @param group_id The ID of the group for which to get options. + + @param object_type The object type which must occupy side two of the relationship. Typically 'person' or 'group'. + + @return a list of lists with label (role two pretty name) and ID (rel_type) +} { + # LARS: + # The query has a hack to make sure 'membership_rel' appears before all other rel types + set rel_types [list] + db_foreach select_rel_types {} { + # Localize the name + lappend rel_types [list [lang::util::localize $pretty_name] $rel_type] + } + return $rel_types +} + Index: openacs-4/packages/acs-subsite/tcl/group-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/Attic/group-procs.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/tcl/group-procs.xql 23 Feb 2002 02:43:45 -0000 1.2 +++ openacs-4/packages/acs-subsite/tcl/group-procs.xql 28 Aug 2003 09:41:39 -0000 1.3 @@ -38,4 +38,6 @@ </fullquery> + + </queryset> Index: openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl 17 May 2003 09:58:37 -0000 1.3 +++ openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl 28 Aug 2003 09:41:39 -0000 1.4 @@ -62,6 +62,24 @@ set creation_ip [ad_conn peeraddr] db_exec_plsql add_constraint {} + # Create segment of registered users for administrators + set segment_name "$truncated_subsite_name Administrators" + set admin_segment_id [rel_segments_new $subsite_group_id admin_rel $segment_name] + + # Grant admin privileges to the admin segment + permission::grant \ + -party_id $admin_segment_id \ + -object_id $package_id \ + -privilege admin + + # Grant read/write/create privileges to the member segment + foreach privilege { read create write } { + permission::grant \ + -party_id $segment_id \ + -object_id $package_id \ + -privilege $privilege + } + } } } @@ -316,3 +334,250 @@ return $first_url } + + +ad_proc subsite::define_pageflow { + {-sections_multirow "sections"} + {-subsections_multirow "subsections"} + {-section ""} +} { + Defines the page flow of the subsite +} { + set pageflow [get_pageflow_struct] + + # TODO: add an image + # TODO: add link_p/selected_p for subsections + + set base_url [site_node_closest_ancestor_package_url] + + template::multirow create $sections_multirow name label title url selected_p link_p + + template::multirow create $subsections_multirow name label title url selected_p link_p + + foreach { section_name section_spec } $pageflow { + array set section_a { + label {} + url {} + title {} + subsections {} + folder {} + selected_patterns {} + } + + array set section_a $section_spec + set section_a(name) $section_name + + set selected_p [add_section_row \ + -array section_a \ + -base_url $base_url \ + -multirow $sections_multirow] + + if { $selected_p } { + foreach { subsection_name subsection_spec } $section_a(subsections) { + array set subsection_a { + label {} + title {} + folder {} + url {} + selected_patterns {} + } + array set subsection_a $subsection_spec + set subsection_a(name) $subsection_name + set subsection_a(folder) [file join $section_a(folder) $subsection_a(folder)] + + add_section_row \ + -array subsection_a \ + -base_url $base_url \ + -multirow $subsections_multirow + } + } + } +} + + +ad_proc subsite::add_section_row { + {-array:required} + {-base_url:required} + {-multirow:required} + {-section {}} +} { + upvar $array info + + # the folder index page is called . + if { [string equal $info(url) ""] || [string equal $info(url) "index"] || \ + [string match "*/" $info(url)] || [string match "*/index" $info(url)] } { + set info(url) "[string range $info(url) 0 [string last / $info(url)]]." + } + + if { [ad_conn node_id] == [ad_conn subsite_id] } { + set current_url [ad_conn extra_url] + } else { + # Need to prepend the path from the subsite to this package + set current_url [string range [ad_conn url] [string length $base_url] end] + } + if { [empty_string_p $current_url] || [string equal $current_url "index"] || \ + [string match "*/" $current_url] || [string match "*/index" $current_url] } { + set current_url "[string range $current_url 0 [string last / $current_url]]." + } + + set info(url) [file join $info(folder) $info(url)] + + # Default to not selected + set selected_p 0 + + if { [string equal $current_url $info(url)] || [string equal $info(name) $section] } { + set selected_p 1 + } else { + foreach pattern $info(selected_patterns) { + set full_pattern [file join $info(folder) $pattern] + ns_log Notice "LARS: pattern = $pattern ; current_url = $current_url ; full_pattern = $full_pattern ; info(folder) = $info(folder)" + if { [string match $full_pattern $current_url] } { + set selected_p 1 + break + } + } + } + + set link_p [expr ![string equal $current_url $info(url)]] + + template::multirow append $multirow \ + $info(name) \ + $info(label) \ + $info(title) \ + [file join $base_url $info(url)] \ + $selected_p \ + $link_p + + return $selected_p +} + +ad_proc -public subsite::get_section_info { + {-array "section_info"} + {-sections_multirow "sections"} +} { + upvar $array row + # Find the label of the selected section + + array set row { + label {} + url {} + } + + template::multirow foreach $sections_multirow { + if { [template::util::is_true $selected_p] } { + set row(label) $label + set row(url) $url + break + } + } +} + +ad_proc subsite::get_pageflow_struct {} { + # This is where the page flow structure is defined + set pageflow { + home { + label "Home" + folder "" + url "" + selected_patterns { + "" + "groups" + } + subsections { + home { + label "Home" + url "" + } + groups { + label "Groups" + url "groups" + } + } + } + members { + label "Members" + default_section members + folder "members" + url "" + selected_patterns { + * + } + subsections { + members { + label "Members" + url "" + selected_patterns { + * + } + } + } + } + } + + set subsite_url [site_node_closest_ancestor_package_url] + array set subsite_sitenode [site_node::get -url $subsite_url] + set subsite_node_id $subsite_sitenode(node_id) + + set child_urls [site_node::get_children -node_id $subsite_node_id -package_type apm_application] + + foreach child_url $child_urls { + array set child_node [site_node::get_from_url -exact -url $child_url] + lappend pageflow $child_node(name) [list \ + label $child_node(instance_name) \ + folder $child_node(name) \ + url {} \ + selected_patterns *] + } + + if { [permission::permission_p -object_id [ad_conn subsite_id] -privilege admin] } { + lappend pageflow admin { + label "Administration" + folder "admin" + url "configure" + selected_patterns { + * + } + subsections { + configuration { + label "Configuration" + url "configure" + } + applications { + label "Applications" + folder "applications" + url "" + selected_patterns { + * + } + } + permissions { + label "Permissions" + url "permissions" + selected_patterns { + permissions* + } + } + parameters { + label "Parameters" + url "parameters" + } + advanced { + label "Advanced" + url "." + selected_patterns { + site-map/* + groups/* + group-types/* + rel-segments/* + rel-types/* + host-node-map/* + object-types/* + } + } + } + } + } + + return $pageflow +} + Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/group-master.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/group-master.css'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/group-master.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/groups-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/groups-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/groups.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/groups.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/index.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/www/index.tcl 16 Jan 2003 13:38:49 -0000 1.6 +++ openacs-4/packages/acs-subsite/www/index.tcl 28 Aug 2003 09:41:40 -0000 1.7 @@ -16,6 +16,14 @@ user_id:onevalue } +# We may have to redirect to some application page +set redirect_url [parameter::get -parameter IndexRedirectUrl -default {}] + +if { ![empty_string_p $redirect_url] } { + ad_returnredirect $redirect_url + ad_script_abort +} + set context [list] set package_id [ad_conn package_id] set admin_p [ad_permission_p $package_id admin] Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/configure.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/configure.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/parameters-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/parameters-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/parameters.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/parameters.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/permissions-user-add.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/permissions-user-add.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/permissions.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/permissions.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/applications/application-add-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/applications/application-add-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/applications/application-add.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/applications/application-add.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/applications/application-add.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/applications/application-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/applications/index.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/applications/index.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.4 +++ openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-postgresql.xql 28 Aug 2003 09:41:40 -0000 1.5 @@ -10,11 +10,9 @@ t.pretty_name, t.rel_type from (select t2.pretty_name, t2.object_type as rel_type, tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey) + 1 as type_level from acs_object_types t1, - acs_object_types t2, - group_rels g + acs_object_types t2 where t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey) - and t2.object_type <> g.rel_type - and g.group_id = :group_id + and t2.object_type not in (select g.rel_type from group_rels g where g.group_id = :group_id) and t1.object_type in ('membership_rel', 'composition_rel')) t, acs_rel_types rel_type where t.rel_type = rel_type.rel_type Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/rel-segments/edit.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/rel-segments/edit.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/one.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/one.adp 22 May 2003 14:09:02 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/one.adp 28 Aug 2003 09:41:40 -0000 1.4 @@ -5,9 +5,10 @@ <h4>Properties of this segment</h4> <ul> - <li> Group: <a href=../groups/one?group_id=@props.group_id@>@props.group_name@</a> </li> - <li> Relationship type: <a href=../rel-types/one?rel_type=@props.rel_type@>@props.rel_type_pretty_name@</a> </li> - <li> Number of @props.role_pretty_plural@: <a href=elements?segment_id=@segment_id@>@number_elements@</a> </li> + <li> Name: @props.segment_name@ (<a href="@name_edit_url@">Edit</a>) </li> + <li> Group: <a href="../groups/one?group_id=@props.group_id@" title="View this group">@props.group_name@</a> </li> + <li> Relationship type: <a href="../rel-types/one?rel_type=@props.rel_type@" title="View this relationship type">@props.rel_type_pretty_name@</a> </li> + <li> Number of @props.role_pretty_plural@: <a href="elements?segment_id=@segment_id@" title="View the elements in this relational segment">@number_elements@</a> </li> </ul> <h4>Constraints on this segment</h4> Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/one.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/one.tcl 6 Sep 2002 21:50:01 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/one.tcl 28 Aug 2003 09:41:40 -0000 1.4 @@ -42,6 +42,8 @@ return } +set name_edit_url [export_vars -base edit { segment_id }] + # Pull out the number of elements that the current user can see. We do # this separately to avoid the join above. This query may need to # removed or changed to handle the permissions check more efficiently Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/site-map/application-new-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/site-map/application-new-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/site-map/application-new.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/site-map/application-new.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/site-map/application-new.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl 18 Aug 2003 15:30:39 -0000 1.13 +++ openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl 28 Aug 2003 09:41:41 -0000 1.14 @@ -53,6 +53,10 @@ [ad_context_bar "Site Map"] <hr> +<p> + <b>»</b> <a href=\"application-new\">Create new application</a> +</p> + <blockquote> <table align=center width=90% cellspacing=0 cellpadding=1 border=0> Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/members/index.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/members/index.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/members/make-admin.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/members/make-member.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/members/member-invite-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/members/member-invite-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/members/member-invite.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/members/member-invite.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/members/member-remove.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/members/user-new.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/members/user-new.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-include-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-include-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-include.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-include.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-modify-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-modify-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-modify.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-modify.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-user-add-2-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-user-add-2-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-user-add-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-user-add-include-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-user-add-include-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-user-add-include.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-user-add-include.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-user-add.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/perm-user-add.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/www/permissions/toggle-inherit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/toggle-inherit.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/permissions/toggle-inherit.tcl 17 May 2003 10:02:04 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/permissions/toggle-inherit.tcl 28 Aug 2003 09:41:41 -0000 1.4 @@ -2,18 +2,19 @@ ad_page_contract { - Toggles the security_inherit_p flag. + Toggles the security_inherit_p flag. - @author rhs@mit.edu - @creation-date 2000-09-30 - @cvs-id $Id$ + @author rhs@mit.edu + @creation-date 2000-09-30 + @cvs-id $Id$ } { - object_id:integer,notnull - {application_url ""} + object_id:integer,notnull + {application_url ""} + {return_url {[export_vars -base "one" {application_url object_id}]}} } ad_require_permission $object_id admin permission::toggle_inherit -object_id $object_id -ad_returnredirect one?[export_vars {application_url object_id}] +ad_returnredirect $return_url Index: openacs-4/packages/acs-subsite/www/pvt/home.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/pvt/home.adp,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-subsite/www/pvt/home.adp 15 Aug 2003 21:18:12 -0000 1.7 +++ openacs-4/packages/acs-subsite/www/pvt/home.adp 28 Aug 2003 09:41:42 -0000 1.8 @@ -1,62 +1,35 @@ <master> -<property name=title>@full_name;noquote@'s workspace at @system_name;noquote@</property> -<property name="context">@context;noquote@</property> + <property name=title>@page_title@</property> + <property name="context">@context;noquote@</property> + <property name="focus">user_info.first_names</property> -<ul> +<h2>#acs-subsite.Basic_Information#</h2> -<p> +<formtemplate id="user_info"></formtemplate> -<li><a href="@subsite_url@register/logout?return_url=@subsite_url@">Log Out</a> -<p> +<if @form_request_p@ true> + <p> + <b>»</b> <a href="../user/password-update">#acs-subsite.Change_my_Password#</a> + </p> -<li><a href="@subsite_url@user/password-update?return_url=@pvt_home_url@">#acs-subsite.Change_my_Password#</a> + <p> + <b>»</b> <a href="@community_member_url@">What other people see when they click your name</a> + </p> + <p> + <b>»</b> <a href="unsubscribe">#acs-subsite.Unsubscribe#</a> (#acs-subsite.lt_for_a_period_of_vacat#) + </p> -</ul> - -<h3>#acs-subsite.lt_What_we_tell_other_us#</h3> - -#acs-subsite.lt_In_general_we_identif# - -<p> - -#acs-subsite.lt_If_you_want_to_check_# - -<h4>#acs-subsite.Basic_Information#</h4> - -<ul> -<li>#acs-subsite.Name# @full_name@</li> -<li>#acs-subsite.email_address# @email@</li> -<li>#acs-subsite.personal_URL# <a target=new_window href="@url@">@url@</a></li> -<li>#acs-subsite.screen_name# @screen_name;noquote@</li> -<li>#acs-subsite.bio# @bio@</li> -</ul> -<p>(<a href="@subsite_url@user/basic-info-update?return_url=@pvt_home_url@">#acs-subsite.Update#</a>)</p> - - -<if @portrait_state@ eq upload> - -<h4>#acs-subsite.Your_Portrait#</h4> -#acs-subsite.lt_Show_everyone_else_at# <a href="@subsite_url@user/portrait/upload?return_url=@pvt_home_url@">#acs-subsite.upload_a_portrait#</a> - + <if @portrait_state@ eq upload> + <h2>#acs-subsite.Your_Portrait#</h2> + <p> + #acs-subsite.lt_Show_everyone_else_at# <a href="@portrait_upload_url@">#acs-subsite.upload_a_portrait#</a> + </p> + </if> + <if @portrait_state@ eq show> + <h2>#acs-subsite.Your_Portrait#</h2> + <p> + #acs-subsite.lt_On_portrait_publish_d#. + </p> + </if> </if> -<if @portrait_state@ eq show> - -<h4>#acs-subsite.Your_Portrait#</h4> -#acs-subsite.lt_On_portrait_publish_d#. - -</if> - - - -<h3>#acs-subsite.lt_If_youre_getting_too_#</h3> - -#acs-subsite.lt_Then_you_should_eithe# - -<ul> -<li><a href="alerts?return_url=@pvt_home_url@">#acs-subsite.edit_your_alerts#</a></li> -</ul> -<p>#acs-subsite.or#</p> -<ul> -<li><a href="unsubscribe?return_url=@pvt_home_url@">#acs-subsite.Unsubscribe#</a> (#acs-subsite.lt_for_a_period_of_vacat#)</li> -</ul> Index: openacs-4/packages/acs-subsite/www/pvt/home.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/pvt/home.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-subsite/www/pvt/home.tcl 15 Aug 2003 21:18:12 -0000 1.8 +++ openacs-4/packages/acs-subsite/www/pvt/home.tcl 28 Aug 2003 09:41:42 -0000 1.9 @@ -21,48 +21,89 @@ pvt_home_url:onevalue } -set user_id [ad_verify_and_get_user_id] +ad_maybe_redirect_for_registration -set subsite_url [subsite::get_element -element url] -set pvt_home_url [ad_pvt_home] +set user_id [ad_conn user_id] -set user_exists_p [db_0or1row pvt_home_user_info { - select first_names, last_name, email, url, - nvl(screen_name,'< none set up >') as screen_name - from cc_users - where user_id=:user_id -}] +acs_user::get -array user -include_bio -if { $user_exists_p && [empty_string_p $screen_name] } { - set screen_name "[_ acs-subsite.no_screen_name_message]" -} +set page_title [ad_pvt_home_name] -set bio [db_string biography " -select attr_value -from acs_attribute_values -where object_id = :user_id -and attribute_id = - (select attribute_id - from acs_attributes - where object_type = 'person' - and attribute_name = 'bio')" -default ""] +set context [list $page_title] -if { ! $user_exists_p } { - if {$user_id == 0} { - ad_redirect_for_registration - ad_script_abort +set ad_url [ad_url] + +set community_member_url [acs_community_member_url -user_id $user_id] + +set system_name [ad_system_name] + +set portrait_upload_url [export_vars -base "../user/portrait/upload" { { return_url [ad_return_url] } }] + +ad_form -name user_info -cancel_url [ad_conn url] -mode display -form { + {first_names:text + {label "First names"} + {html {size 50}} } - ad_return_error "Account Unavailable" "We can't find you (user #$user_id) in the users table. Probably your account was deleted for some reason. You can visit <a href=\"/register/logout\">the log out page</a> and then start over." + {last_name:text + {label "Last Name"} + {html {size 50}} + } + {email:text + {label "Email"} + {html {size 50}} + } + {screen_name:text,optional + {label "Screen name"} + {html {size 50}} + } + {url:text,optional + {label "Home Page"} + {html {size 80}} + } + {bio:text(textarea),optional + {label "About yourself"} + {html {rows 8 cols 60}} + } +} -on_request { + foreach var { first_names last_name email screen_name url bio } { + set $var $user($var) + } +} -on_submit { + db_transaction { + person::update \ + -person_id $user_id \ + -first_names $first_names \ + -last_name $last_name + + party::update \ + -party_id $user_id \ + -email $email \ + -url $url + + acs_user::update \ + -user_id $user_id \ + -screen_name $screen_name + + person::update_bio \ + -person_id $user_id \ + -bio $bio + } +} -after_submit { + ad_returnredirect [ad_conn url] ad_script_abort } -if { ![empty_string_p $first_names] || ![empty_string_p $last_name] } { - set full_name "$first_names $last_name" -} else { - set full_name "name unknown" +# TODO: Validate email: [util_email_valid_p $email] +# TODO: Validate email unique + +# LARS HACK: Make the URL and email elements real links +if { ![form is_valid user_info] } { + element set_properties user_info email -display_value "<a href=\"mailto:[element get_value user_info email]\">[element get_value user_info email]</a>" + element set_properties user_info url -display_value "<a href=\"[element get_value user_info url]\">[element get_value user_info url]</a>" } -set system_name [ad_system_name] +# The template needs to know if this is a request +set form_request_p [expr [form is_request user_info] && [empty_string_p [form get_action user_info]]] if [ad_parameter SolicitPortraitP "user-info" 0] { # we have portraits for some users @@ -87,16 +128,3 @@ set portrait_state "none" } -set header [ad_header "$full_name's workspace at $system_name"] - -set context [list "[ad_pvt_home_name]"] - -set export_user_id [export_url_vars user_id] -set ad_url [ad_url] - -set member_link [acs_community_member_link -user_id $user_id -label "${ad_url}[acs_community_member_url -user_id $user_id]"] - -set interest_items "" - -ad_return_template - Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/register/login-include.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/register/login-include.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/register/user-login-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/register/user-login-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/www/register/user-login.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/Attic/user-login.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/register/user-login.tcl 18 Sep 2002 12:16:48 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/register/user-login.tcl 28 Aug 2003 09:41:42 -0000 1.4 @@ -33,10 +33,7 @@ set email [string tolower $email] -if { ![db_0or1row user_login_user_id_from_email { - select user_id, member_state, email_verified_p - from cc_users - where email = :email}] } { +if { ![db_0or1row user_login_user_id_from_email {}] } { # The user is not in the database. Redirect to user-new.tcl so the user can register. ad_set_client_property -persistent "f" register password $password @@ -54,6 +51,16 @@ ad_script_abort } if { [ad_check_password $user_id $password] } { + + set PasswordExpirationDays [parameter::get -parameter PasswordExpirationDays -default 0] + + # We also allow for empty value of password_age_days, in case the column is null after upgrading + if { $PasswordExpirationDays > 0 && ([empty_string_p $password_age_days] || $password_age_days > $PasswordExpirationDays) } { + # Password is expired, must be changed now + ad_returnredirect "[ad_conn package_url]/user/password-update?[export_vars { user_id return_url { expired_p 1 }}]" + ad_script_abort + } + # The user has provided a correct, non-empty password. Log # him/her in and redirect to return_url. ad_user_login -forever=$persistent_cookie_p $user_id Index: openacs-4/packages/acs-subsite/www/register/user-login.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/Attic/user-login.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/register/user-login.xql 9 Mar 2002 02:00:02 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/register/user-login.xql 28 Aug 2003 09:41:42 -0000 1.4 @@ -4,7 +4,7 @@ <fullquery name="user_login_user_id_from_email"> <querytext> - select user_id, member_state, email_verified_p + select user_id, member_state, email_verified_p, password_changed_date from cc_users where email = lower(:email) </querytext> Index: openacs-4/packages/acs-subsite/www/register/user-new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/Attic/user-new-2.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-subsite/www/register/user-new-2.tcl 17 May 2003 10:02:25 -0000 1.11 +++ openacs-4/packages/acs-subsite/www/register/user-new-2.tcl 28 Aug 2003 09:41:42 -0000 1.12 @@ -11,7 +11,7 @@ { last_name:notnull } { question "" } { answer "" } - { url } + { url "" } { user_id:integer,notnull } { return_url [ad_pvt_home] } { persistent_cookie_p 0 } @@ -37,11 +37,19 @@ append exception_text "<li> [_ acs-subsite.lt_You_cant_have_a_lt_in_1]" } -if { [info exists url] && [string compare $url "http://"] == 0 } { - # the user left the default hint for the url +if { [info exists url] && \ + ( [empty_string_p $url] || \ + [string compare $url "http://"] == 0 ) } { + + # + # The user left the default hint for the url, or it's empty. + # set url "" + } elseif { ![util_url_valid_p $url] } { + # there is a URL but it doesn't match our REGEXP + incr exception_count set valid_url_example "http://photo.net/philg/" append exception_text "<li>[_ acs-subsite.lt_Your_URL_doesnt_have_]\n" Index: openacs-4/packages/acs-subsite/www/register/user-new.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/user-new.adp,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-subsite/www/register/user-new.adp 15 Aug 2003 21:18:12 -0000 1.9 +++ openacs-4/packages/acs-subsite/www/register/user-new.adp 28 Aug 2003 09:41:42 -0000 1.10 @@ -1,10 +1,11 @@ <master> -<property name="title">#acs-subsite.Register#</property> -<property name="context">#acs-subsite.Register#</property> + <property name="title">#acs-subsite.Register#</property> + <property name="context">#acs-subsite.Register#</property> + <property name="focus">usernew.password_confirmation</property> #acs-subsite.lt_Register_as_a_user_of# <a href="index">@system_name@</a> -<form method=post action="user-new-2"> +<form method=post action="user-new-2" name="usernew"> @export_vars;noquote@ <if @no_require_password_p@ eq 0> Index: openacs-4/packages/acs-subsite/www/shared/community-member-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/Attic/community-member-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/shared/community-member-postgresql.xql 22 Apr 2001 16:13:15 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/shared/community-member-postgresql.xql 28 Aug 2003 09:41:42 -0000 1.3 @@ -8,7 +8,7 @@ from acs_objects a, acs_object_types at where a.object_type = at.object_type and a.creation_user = :user_id -order by object_name, creation_date +order by at.pretty_name, creation_date desc </querytext> </fullquery> Index: openacs-4/packages/acs-subsite/www/shared/community-member.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/community-member.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/www/shared/community-member.adp 15 Aug 2003 21:18:13 -0000 1.6 +++ openacs-4/packages/acs-subsite/www/shared/community-member.adp 28 Aug 2003 09:41:42 -0000 1.7 @@ -1,77 +1,75 @@ <master> -<property name="title">@first_names;noquote@ @last_name;noquote@</property> -<property name="context">Community Member</property> + <property name="title">@page_title@</property> + <property name="context">@context;noquote@</property> <if @inline_portrait_state@ eq "inline"> - <a href="portrait?@portrait_export_vars@"><img src="portrait-bits?@portrait_export_vars@" align="right" width="@width@" height="@height@"></a><br /> - + <a href="portrait?@portrait_export_vars@"><img src="portrait-bits?@portrait_export_vars@" align="right" width="@width@" height="@height@"></a> </if> -<else><if @inline_portrait_state eq "link"> - <a href="portrait?@portrait_export_vars@">Portrait</a> -</if></else> +<else> + <if @inline_portrait_state eq "link"> + <p> + <b>»</b> <a href="portrait?@portrait_export_vars@">Portrait</a> + </p> + </if> +</else> -A member of the @system_name@ community since @pretty_creation_date@ +<p> + A member of the @system_name@ community since <b>@pretty_creation_date@</b>. +</p> <if @member_state@ eq "deleted"> - - <blockquote><font color="red">this user is deleted</font></blockquote> - + <blockquote> + <font color="red"> + This user has left the community. + </font> + </blockquote> </if> -<else><if @member_state@ eq "banned"> +<else> + <if @member_state@ eq "banned"> + <blockquote> + <font color="red"> + This user is deleted and banned from the community. + </font> + </blockquote> + </if> +</else> - <blockquote><font color="red">this user is deleted and - banned from the community.</font></blockquote> - -</if></else> +<p> + <b>Name:</b> @first_names@ @last_name@ +</p> -<if @show_intranet_info_p@ eq 1> +<if @show_email_p@ true> + <p> + <b>E-mail:</b> <a href="mailto:@email@">@email@</a> + </p> +</if> - @intranet_info@ +<if @url@ not nil> + <p> + <b>Home page:</b> <a href="@url@">@url@</a> + </p> +</if> +<if @bio@ not nil> + <p> + <b>Biography:</b> + </p> + <blockquote> + @bio@ + </blockquote> </if> -<else> - <if @show_email_p@ eq 1> - <ul> - <li>E-mail @first_names@ @last_name@: - <a href="mailto:@email@">@email@</a></li> - <if @url@ not nil> - <li>Personal home page: <a href="@url@">@url@</a></li> - </if> - - <if @bio@ not nil> - <p> Biography:</p><p>@bio@</p> - </if> - - </ul> - - </if> - <else> - - <if @url@ not nil> - <ul><li>Personal home page: <a href="@url@">@url@</a></li></ul> - </if> - - </else> -</else> - <if @verified_user_id@ eq 0> - <blockquote> - If you were to <a href="@subsite_url@register/index?@login_export_vars@">log in</a>, you'd be able to get more information on your fellow community member. + If you were to <a href="@subsite_url@register/index?@login_export_vars@">log in</a>, you'd be able to get more information on your fellow community member. </blockquote> +</if> +<if @site_wide_admin_p@> + <h3>For Site-Wide Administrators</h3> + <p> + <b>»</b> <a href="@admin_user_url@">Administrative options for this user</a> + </p> </if> -<multiple name="user_contributions"> - - <h3>@user_contributions.pretty_plural@</h3> - <ul> - - <group column="pretty_name"> - <li>@user_contributions.creation_date@: @user_contributions.object_name@</li> - </group> - </ul> - -</multiple> Index: openacs-4/packages/acs-subsite/www/shared/community-member.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/community-member.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/www/shared/community-member.tcl 15 Aug 2003 21:18:13 -0000 1.6 +++ openacs-4/packages/acs-subsite/www/shared/community-member.tcl 28 Aug 2003 09:41:42 -0000 1.7 @@ -17,9 +17,7 @@ height:onevalue system_name:onevalue pretty_creation_date:onevalue - show_intranet_info_p:onevalue show_email_p:onevalue - intranet_info:onevalue url:onevalue bio:onevalue verified_user_id:onevalue @@ -36,6 +34,9 @@ ad_script_abort } +set site_wide_admin_p [acs_user::site_wide_admin_p] +set admin_user_url [acs_community_member_admin_url -user_id $user_id] + set verified_user_id [ad_verify_and_get_user_id] if { [empty_string_p $user_id] } { @@ -49,15 +50,6 @@ set bind_vars [ad_tcl_vars_to_ns_set user_id] -# XXX add portraits to this page - -# if { ![db_0or1row user_information "select first_names, last_name, email, priv_email, -# url, banning_note, registration_date, user_state, -# portrait_upload_date, portrait_original_width, portrait_original_height, portrait_client_file_name, bio, -# portrait_thumbnail_width, portrait_thumbnail_height -# from users -# where user_id=:user_id" -bind $bind_vars] } { -# } if { ![db_0or1row user_information "select first_names, last_name, email, priv_email, url, creation_date, member_state from cc_users where user_id = :user_id" -bind $bind_vars]} { @@ -66,23 +58,8 @@ return } - set bio [db_string biography " - select attr_value - from acs_attribute_values - where object_id = :user_id - and attribute_id = - (select attribute_id - from acs_attributes - where object_type = 'person' - and attribute_name = 'bio')" -default ""] +set bio [person::get_bio -person_id $user_id] -# set bio [db_exec_plsql bio " -# begin -# :1 := acs_object.get_attribute ( -# object_id_in => :user_id, -# attribute_name_in => 'bio'); -# end;"] - # Do we show the portrait? set inline_portrait_state "none" set portrait_export_vars [export_url_vars user_id] @@ -106,39 +83,21 @@ } } -# Let's see if we can show all intranet-specific information -# set show_intranet_info_p 1 -# if { [im_enabled_p] && [ad_parameter KeepSharedInfoPrivate intranet 0] } { -# set current_user_id [ad_get_user_id] -# if { $current_user_id != $user_id && ![im_user_is_authorized_p $current_user_id] } { - set show_intranet_info_p 0 -# } -#} -if { $show_intranet_info_p } { - set intranet_info [im_user_information $user_id] +if { $priv_email <= [ad_privacy_threshold] } { + set show_email_p 1 } else { - - if { $priv_email <= [ad_privacy_threshold] } { - set show_email_p 1 - } else { - set show_email_p 0 - # guy doesn't want his email address shown, but we can still put out - # the home page - } + set show_email_p 0 + # guy doesn't want his email address shown, but we can still put out + # the home page } -# XXX Make sure to make the following into links and this looks okay - -db_multirow user_contributions user_contributions "select at.pretty_name, at.pretty_plural, a.creation_date, acs_object.name(a.object_id) object_name -from acs_objects a, acs_object_types at -where a.object_type = at.object_type -and a.creation_user = :user_id -order by object_name, creation_date" - -set context [list "Community member"] +set page_title "$first_names $last_name" +set context [list "Community Member"] set system_name [ad_system_name] set pretty_creation_date [lc_time_fmt $creation_date "%q"] set login_export_vars "return_url=[ns_urlencode [acs_community_member_url -user_id $user_id]]" +set login_url [export_vars -base "/register/." { { return_url [ad_return_url]} }] + ad_return_template Index: openacs-4/packages/acs-subsite/www/shared/images/info.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/images/info.gif,v diff -u -r1.1 -r1.2 Binary files differ Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/user/basic-info-update-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/user/basic-info-update-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/www/user/basic-info-update.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/basic-info-update.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/www/user/basic-info-update.adp 15 Aug 2003 21:18:13 -0000 1.5 +++ openacs-4/packages/acs-subsite/www/user/basic-info-update.adp 28 Aug 2003 09:41:42 -0000 1.6 @@ -28,4 +28,14 @@ <input type=submit value="Update"> </center></p> +<if @portrait_state@ eq upload> +<a href="/user/portrait/upload">Upload a Portrait</a> + +</if> +<if @portrait_state@ eq show> + +On @portrait_publish_date@, you uploaded <a href="/user/portrait/">@portrait_title@</a>. + +</if> + Index: openacs-4/packages/acs-subsite/www/user/basic-info-update.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/basic-info-update.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/user/basic-info-update.tcl 20 Sep 2002 22:28:56 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/user/basic-info-update.tcl 28 Aug 2003 09:41:42 -0000 1.3 @@ -30,11 +30,23 @@ db_1row general_info {} -set bio [db_string biography {} -default ""] +set bio [person::get_bio -person_id $user_id] db_release_unused_handles set site_link [ad_site_home_link] set export_vars [export_form_vars return_url user_id] -ad_return_template \ No newline at end of file +# moved from acs-subsite/www/pvt/home.tcl +if [ad_parameter SolicitPortraitP "user-info" 0] { + # we have portraits for some users + if ![db_0or1row get_portrait_info ""] { + set portrait_state "upload" + } else { + set portrait_state "show" + set portrait_publish_date [util_AnsiDatetoPrettyDate $publish_date] + } +} else { + set portrait_state "none" +} + Index: openacs-4/packages/acs-subsite/www/user/password-update-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/Attic/password-update-2.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-subsite/www/user/password-update-2.tcl 16 May 2002 21:17:44 -0000 1.9 +++ openacs-4/packages/acs-subsite/www/user/password-update-2.tcl 28 Aug 2003 09:41:42 -0000 1.10 @@ -27,6 +27,11 @@ ad_complain "Your passwords don't match! Presumably, you made a typo while entering one of them." } } + new_password_old_password_different -requires { new_password_match } { + if { [string equal $password_old $password_1] } { + ad_complain "Your new password is identical to your old password. If you don't want to change your password, use your browser's back button to get out." + } + } } if {[empty_string_p $user_id]} { @@ -43,7 +48,7 @@ ad_return_error "Wasn't able to change your password. Please contact the system administrator." } -if {![ad_conn user_id]} { +if { ![ad_conn user_id] } { ad_user_login $user_id } Index: openacs-4/packages/acs-subsite/www/user/password-update.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/password-update.adp,v diff -u -r1.10 -r1.11 --- openacs-4/packages/acs-subsite/www/user/password-update.adp 15 Aug 2003 21:18:13 -0000 1.10 +++ openacs-4/packages/acs-subsite/www/user/password-update.adp 28 Aug 2003 09:41:42 -0000 1.11 @@ -1,12 +1,22 @@ <master> -<property name="title">#acs-subsite.Update_Password#</property> -<property name="context_bar">#acs-subsite.lt_for_first_names_last_#</property> -<property name="context">#acs-subsite.Update_Password#</property> + <property name="title">#acs-subsite.Update_Password#</property> + <property name="context_bar">#acs-subsite.lt_for_first_names_last_#</property> + <property name="context">#acs-subsite.Update_Password#</property> + <property name="focus">@focus@</property> -<form method="post" action="password-update-2"> - <input type="hidden" name="user_id" value="@user_id@" /> - <input type="hidden" name="return_url" value="@return_url@" /> +<if @expired_p@ true> + <p> + Welcome to @system_name@. + </p> + <p> + Your login was successful, but your password has expired, and must + be updated now, before you can proceed to use @system_name@. + </p> +</if> +<form method="post" action="password-update-2" name="pwd"> + @export_vars@ + <table> <if @admin_p@ false and @password_old@ eq ""> Index: openacs-4/packages/acs-subsite/www/user/password-update.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/password-update.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-subsite/www/user/password-update.tcl 10 Sep 2002 22:22:14 -0000 1.9 +++ openacs-4/packages/acs-subsite/www/user/password-update.tcl 28 Aug 2003 09:41:42 -0000 1.10 @@ -7,6 +7,7 @@ {user_id ""} {return_url ""} {password_old ""} + {expired_p:boolean "0"} } -properties { first_names:onevalue last_name:onevalue @@ -19,6 +20,13 @@ set user_id [ad_verify_and_get_user_id] } +# We have a special provision here for expired passwords +# The user will not be logged in, but we're supposed to log them in after we're done +# We use template::util::is_true in order to be liberal in the input we accept +set expired_p [template::util::is_true $expired_p] + +set system_name [ad_system_name] + set admin_p [permission::permission_p -object_id $user_id -privilege admin] if {!$admin_p} { @@ -29,4 +37,12 @@ set site_link [ad_site_home_link] +set export_vars [export_vars -form { user_id return_url }] + +if { !$admin_p && [empty_string_p $password_old] } { + set focus "pwd.password_old" +} else { + set focus "pwd.password_1" +} + ad_return_template Index: openacs-4/packages/acs-subsite/www/user/portrait/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/portrait/index.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/www/user/portrait/index.adp 15 Aug 2003 21:18:13 -0000 1.6 +++ openacs-4/packages/acs-subsite/www/user/portrait/index.adp 28 Aug 2003 09:41:43 -0000 1.7 @@ -2,14 +2,14 @@ <property name="title">Portrait of @first_names;noquote@ @last_name;noquote@</property> <property name="context">@context;noquote@</property> +<if @admin_p@ eq 1> <p>This is the image that we show to other users at @system_name@:</p> +</if> <center> <img @widthheight@ src="@subsite_url@shared/portrait-bits.tcl?@export_vars@"> </center> -Data: - <ul> <li>Uploaded: @pretty_date@</li> <li>Comment: @@ -19,6 +19,7 @@ </li> </ul> +<if @admin_p@ eq 1> Options: <ul> @@ -28,5 +29,4 @@ <li><a href="erase?@export_edit_vars@">erase portrait</a></li> </ul> - - +</if> Index: openacs-4/packages/acs-subsite/www/user/portrait/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/portrait/index.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/www/user/portrait/index.tcl 15 Aug 2003 21:18:13 -0000 1.5 +++ openacs-4/packages/acs-subsite/www/user/portrait/index.tcl 28 Aug 2003 09:41:43 -0000 1.6 @@ -25,12 +25,15 @@ if [empty_string_p $user_id] { set user_id $current_user_id - set admin_p 0 -} else { +} + +if { $current_user_id == $user_id } { set admin_p 1 + ad_require_permission $user_id "write" +} else { + set admin_p 0 } -ad_require_permission $user_id "write" if ![db_0or1row user_info "select first_names, Index: openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/00-database-procs.tcl,v diff -u -r1.35 -r1.36 --- openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 27 Aug 2003 13:18:27 -0000 1.35 +++ openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 28 Aug 2003 09:41:43 -0000 1.36 @@ -4,7 +4,7 @@ @creation-date 15 Apr 2000 @author Jon Salz (jsalz@arsdigita.com) - @cvs-id $Id$ + @cvs-id 00-database-procs.tcl,v 1.19.2.5 2003/05/23 13:11:29 lars Exp } # As originally released in (at least) ACS 4.2 through OpenACS 4.6, @@ -2032,7 +2032,7 @@ error $on_errmsg $errorInfo $errorCode } else { # Good, no error thrown by the on_error block. - if [db_abort_transaction_p] { + if { [db_abort_transaction_p] } { # This means we should abort the transaction. if { $level == 1 } { set db_state(db_abort_p,$dbh) 0 @@ -2067,7 +2067,7 @@ } } else { # There was no error from the transaction code. - if [db_abort_transaction_p] { + if { [db_abort_transaction_p] } { # The user requested the transaction be aborted. if { $level == 1 } { set db_state(db_abort_p,$dbh) 0 Index: openacs-4/packages/acs-tcl/tcl/admin-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/admin-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/acs-tcl/tcl/admin-procs.tcl 12 Nov 2002 08:53:07 -0000 1.10 +++ openacs-4/packages/acs-tcl/tcl/admin-procs.tcl 28 Aug 2003 09:41:43 -0000 1.11 @@ -4,7 +4,7 @@ @author Multiple @creation-date 11/18/98 - @cvs-id $Id$ + @cvs-id admin-procs.tcl,v 1.9 2002/09/18 18:55:29 jeffd Exp } @@ -432,15 +432,15 @@ if { [llength $join_clauses] == 0 } { set final_query "select [join $select_list ",\n "] from [join $tables ", "]" - if ![empty_string_p $complete_where] { + if { ![empty_string_p $complete_where] } { append final_query "\nwhere $complete_where" } } else { # we're joining at set final_query "select [join $select_list ",\n "] from [join $tables ", "] where [join $join_clauses "\nand "]" - if ![empty_string_p $complete_where] { + if { ![empty_string_p $complete_where] } { append final_query "\n and ($complete_where)" } } Index: openacs-4/packages/acs-tcl/tcl/aolserver-3-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/aolserver-3-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-tcl/tcl/aolserver-3-procs.tcl 24 Apr 2001 22:38:12 -0000 1.2 +++ openacs-4/packages/acs-tcl/tcl/aolserver-3-procs.tcl 28 Aug 2003 09:41:43 -0000 1.3 @@ -5,7 +5,7 @@ @creation-date 27 Feb 2000 @author Jon Salz [jsalz@arsdigita.com] - @cvs-id $Id$ + @cvs-id aolserver-3-procs.tcl,v 1.2 2001/04/24 22:38:12 donb Exp } # -1 = Not there or value was "" @@ -23,7 +23,7 @@ set value [ns_set get $formdata $column] - if [string match $value ""] { + if { [string match $value ""] } { switch $type { date { @@ -53,7 +53,7 @@ } } } - if [string match $value ""] { + if { [string match $value ""] } { return -1 } else { return 1 @@ -110,15 +110,15 @@ proc _ns_updatebutton {table var} { upvar $var updatebutton - if ![info exists updatebutton] { + if { ![info exists updatebutton] } { set updatebutton "" } - if [string match "" $updatebutton] { + if { [string match "" $updatebutton] } { db_with_handle db { set updatebutton [ns_table value $db $table update_button_label] } } - if [string match "" $updatebutton] { + if { [string match "" $updatebutton] } { set updatebutton "Update Record" } } Index: openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl,v diff -u -r1.46 -r1.47 --- openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 26 Aug 2003 15:16:38 -0000 1.46 +++ openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 28 Aug 2003 09:41:43 -0000 1.47 @@ -790,12 +790,10 @@ Upgrades the parameters to the current version. } { - set current_parameter_names [list] # Update each parameter that exists. foreach parameter $parameters { set parameter_name [lindex $parameter 0] # Keep a running tally of all parameters that are in the current version. - lappend current_parameter_names $parameter_name set description [lindex $parameter 1] set section_name [lindex $parameter 2] set datatype [lindex $parameter 3] @@ -816,18 +814,6 @@ $datatype $section_name $min_n_values $max_n_values } } - ns_log Debug "APM: Removing parameters." - # Find parameters that are not in the current version and remove them. - db_foreach all_parameters_for_package_key { - select parameter_id, parameter_name - from apm_parameters - where package_key =:package_key - } { - ns_log Debug "APM Checking parameter $parameter_name..." - if {[lsearch -exact $current_parameter_names $parameter_name] == -1} { - apm_parameter_unregister $parameter_id - } - } ns_log Debug "APM: Parameter Upgrade Complete." } Index: openacs-4/packages/acs-tcl/tcl/apm-install-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-install-procs.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-tcl/tcl/apm-install-procs.xql 17 May 2003 10:04:18 -0000 1.4 +++ openacs-4/packages/acs-tcl/tcl/apm-install-procs.xql 28 Aug 2003 09:41:43 -0000 1.5 @@ -34,17 +34,6 @@ </fullquery> -<fullquery name="apm_package_upgrade_parameters.all_parameters_for_package_key"> - <querytext> - - select parameter_id, parameter_name - from apm_parameters - where package_key =:package_key - - </querytext> -</fullquery> - - <fullquery name="apm_package_install_dependencies.all_dependencies_for_version"> <querytext> Index: openacs-4/packages/acs-tcl/tcl/apm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs.tcl,v diff -u -r1.50 -r1.51 --- openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 14 Aug 2003 09:46:05 -0000 1.50 +++ openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 28 Aug 2003 09:41:43 -0000 1.51 @@ -1308,7 +1308,17 @@ @author Peter Marklund } { - return [list before-install after-install after-instantiate after-mount before-uninstantiate before-uninstall before-unmount before-upgrade after-upgrade] + return { + before-install + after-install + before-upgrade + after-upgrade + before-uninstall + after-instantiate + before-uninstantiate + after-mount + before-unmount + } } ad_proc -private apm_callback_has_valid_args { Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-tcl/tcl/base64.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-tcl/tcl/community-core-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs-oracle.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-tcl/tcl/community-core-procs-oracle.xql 28 Aug 2003 09:30:19 -0000 1.6 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs-oracle.xql 28 Aug 2003 09:41:43 -0000 1.7 @@ -9,18 +9,17 @@ begin :1 := acs.add_user( user_id => :user_id, - object_type => 'user', + email => :email, + url => :url, + username => :username, + first_names => :first_names, + last_name => :last_name, + password => :hashed_password, + salt => :salt, creation_user => :creation_user, - creation_ip => :peeraddr, - username => :username, - email => :email, - url => :url, - first_names => :first_names, - last_name => :last_name, - password => :password, - salt => :salt, - email_verified_p => :email_verified_p, - member_state => :member_state + creation_ip => :peeraddr, + email_verified_p => :email_verified_p, + member_state => :member_state ); end; @@ -45,5 +44,16 @@ </querytext> </fullquery> +<fullquery name="user_search"> + <querytext> + select distinct u.first_names || ' ' || u.last_name || ' (' || u.email || ')' as name, u.user_id + from cc_users u + where upper(nvl(u.first_names || ' ', '') || + nvl(u.last_name || ' ', '') || + u.email || ' ' || + nvl(u.screen_name, '')) like upper('%'||:value||'%') + order by name + </querytext> +</fullquery> </queryset> Index: openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql 25 Aug 2003 13:46:41 -0000 1.9 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql 28 Aug 2003 09:41:43 -0000 1.10 @@ -42,4 +42,16 @@ </querytext> </fullquery> +<fullquery name="user_search"> + <querytext> + select distinct u.first_names || ' ' || u.last_name || ' (' || u.email || ')' as name, u.user_id + from cc_users u + where upper(coalesce(u.first_names || ' ', '') || + coalesce(u.last_name || ' ', '') || + u.email || ' ' || + coalesce(u.screen_name, '')) like upper('%'||:value||'%') + order by name + </querytext> +</fullquery> + </queryset> Index: openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 28 Aug 2003 09:30:19 -0000 1.18 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 28 Aug 2003 09:41:43 -0000 1.19 @@ -8,6 +8,8 @@ } +namespace eval party {} + ad_proc -private cc_lookup_screen_name_user { screen_name } { return [db_string user_select { select user_id from cc_users where upper(screen_name) = upper(:screen_name) @@ -231,6 +233,81 @@ } } +ad_proc -public person::get_bio { + {-person_id {}} + {-exists_var {}} +} { + Get the value of the user's bio(graphy) field. + + @option person_id The person_id of the person to get the bio for. Leave blank for currently logged in user. + + @option exists_var The name of a variable in the caller's namespace, which will be set to 1 + if a bio was found, or 0 if no bio was found. Leave blank if you're not + interested in this information. + + @return The bio of the user as a text string. + + @author Lars Pind (lars@collaboraid.biz) +} { + if { [empty_string_p $person_id] } { + set person_id [ad_conn user_id] + } + + if { ![empty_string_p $exists_var] } { + upvar $exists_var exists_p + } + + set exists_p [db_0or1row select_bio {}] + + if { !$exists_p } { + set bio {} + } + + return $bio +} + +ad_proc -public person::update_bio { + {-person_id:required} + {-bio:required} +} { + Update the bio for a person. + + @param person_id The ID of the person to edit bio for + @param bio The new bio for the person + + @author Lars Pind (lars@collaboraid.biz) +} { + # This will set exists_p to whether or not a row for the bio existed + set bio_old [get_bio -person_id $person_id -exists_var exists_p] + + # bio_change_to = 0 -> insert + # bio_change_to = 1 -> don't change + # bio_change_to = 2 -> update + + if { !$exists_p } { + # There is no bio yet. + # If new bio is empty, that's a don't change (1) + # If new bio is non-empty, that's an insert (0) + set bio_change_to [empty_string_p $bio] + } else { + if { [string equal $bio $bio_old] } { + set bio_change_to 1 + } else { + set bio_change_to 2 + } + } + + if { $bio_change_to == 0 } { + # perform the insert + db_dml insert_bio {} + } elseif { $bio_change_to == 2 } { + # perform the update + db_dml update_bio {} + } +} + + + namespace eval acs_user { ad_proc -public change_state { @@ -326,3 +403,114 @@ } -default ""] } } + + +ad_proc -public acs_user::get { + {-user_id {}} + {-array:required} + {-include_bio:boolean} +} { + Get basic information about a user. + + @option user_id The user_id of the user to get the bio for. Leave blank for current user. + + @option include_bio Whether to include the bio in the user information + + @param array The name of an array into which you want the information put. + + The attributes returned are: + user_id, + first_names, + last_name, + name (first_names last_name), + email, + url, + screen_name, + priv_name, + priv_email, + email_verified_p, + email_bouncing_p, + no_alerts_until, + last_visit, + second_to_last_visit, + n_sessions, + password_question, + password_answer, + password_changed_date, + member_state, + rel_id, + bio (if -include_bio switch is present) + + @author Lars Pind (lars@collaboraid.biz) +} { + if { [empty_string_p $user_id] } { + set user_id [ad_conn user_id] + } + + upvar $array row + db_1row select_user_info {} -column_array row + + if { $include_bio_p } { + set row(bio) [person::get_bio -person_id $user_id] + } +} + +ad_proc -public acs_user::update { + {-user_id:required} + {-screen_name} + {-password_question} + {-password_answer} +} { + Update information about a user. + Feel free to expand this with more switches later as needed, as long as they're optional. + + @param party_id The ID of the party to edit + @option screen_name The new screen_name for the user + @option password_question The new password_question for the user + @option password_answer The new password_question for the user + + @author Lars Pind (lars@collaboraid.biz) +} { + set cols [list] + foreach var { screen_name password_question password_answer } { + if { [info exists $var] } { + lappend cols "$var = :$var" + } + } + db_dml user_update {} +} + +ad_proc -public acs_user::site_wide_admin_p { + {-user_id ""} +} { + Return 1 if the specified user (defaults to logged in user) + is site-wide administrator and 0 otherwise. + + @param user_id The id of the user to check for admin privilege. + + @author Peter Marklund +} { + if { [empty_string_p $user_id]} { + set user_id [ad_conn user_id] + } + + return [permission::permission_p -party_id $user_id \ + -object_id [acs_lookup_magic_object security_context_root] \ + -privilege "admin"] +} + +ad_proc -public party::update { + {-party_id:required} + {-email:required} + {-url:required} +} { + Update information about a party. + + @param party_id The ID of the party to edit + @param email The new email for the party + @param url The new URL for the party + + @author Lars Pind (lars@collaboraid.biz) +} { + db_dml party_update {} +} Index: openacs-4/packages/acs-tcl/tcl/community-core-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-tcl/tcl/community-core-procs.xql 17 May 2003 10:04:18 -0000 1.3 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs.xql 28 Aug 2003 09:41:43 -0000 1.4 @@ -10,15 +10,6 @@ </fullquery> -<fullquery name="cc_lookup_screen_name_user.user_select"> - <querytext> - - select user_id from cc_users where upper(screen_name) = upper(:screen_name) - - </querytext> -</fullquery> - - <fullquery name="cc_email_from_party.email_from_party"> <querytext> @@ -67,5 +58,93 @@ </querytext> </fullquery> +<fullquery name="person::get_bio.select_bio"> + <querytext> + select attr_value as bio + from acs_attribute_values + where object_id = :person_id + and attribute_id = + (select attribute_id + from acs_attributes + where object_type = 'person' + and attribute_name = 'bio') + </querytext> +</fullquery> + +<fullquery name="person::update_bio.insert_bio"> + <querytext> + insert into acs_attribute_values + (object_id, attribute_id, attr_value) + values + (:person_id, (select attribute_id + from acs_attributes + where object_type = 'person' + and attribute_name = 'bio'), :bio) + </querytext> +</fullquery> + +<fullquery name="person::update_bio.update_bio"> + <querytext> + update acs_attribute_values + set attr_value = :bio + where object_id = :person_id + and attribute_id = + (select attribute_id + from acs_attributes + where object_type = 'person' + and attribute_name = 'bio') + </querytext> +</fullquery> + +<fullquery name="acs_user::get.select_user_info"> + <querytext> + + select user_id, + first_names, + last_name, + first_names || ' ' || last_name as name, + email, + url, + screen_name, + priv_name, + priv_email, + email_verified_p, + email_bouncing_p, + no_alerts_until, + last_visit, + second_to_last_visit, + n_sessions, + password_question, + password_answer, + password_changed_date, + member_state, + rel_id + from cc_users + where user_id=:user_id + + </querytext> +</fullquery> + +<fullquery name="acs_user::update.user_update"> + <querytext> + + update users + set [join $cols ", "] + where user_id = :user_id + + </querytext> +</fullquery> + +<fullquery name="party::update.party_update"> + <querytext> + + update parties + set email = :email, + url = :url + where party_id = :party_id + + </querytext> +</fullquery> + </queryset> Index: openacs-4/packages/acs-tcl/tcl/defs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/defs-procs.tcl,v diff -u -r1.26 -r1.27 --- openacs-4/packages/acs-tcl/tcl/defs-procs.tcl 14 Aug 2003 20:38:03 -0000 1.26 +++ openacs-4/packages/acs-tcl/tcl/defs-procs.tcl 28 Aug 2003 09:41:43 -0000 1.27 @@ -5,7 +5,7 @@ @author Many others at ArsDigita and in the OpenACS community. @creation-date 2 April 1998 - @cvs-id $Id$ + @cvs-id defs-procs.tcl,v 1.19.2.2 2003/03/28 13:43:28 lars Exp } ad_proc ad_acs_version {} { @@ -186,8 +186,7 @@ } { @return the url for the community member admin page of a particular user } { - return "[subsite::get_element -element url -notrailing][ad_parameter \ - -package_id [ad_acs_kernel_id] CommunityMemberAdminURL]?[export_vars user_id]" + return [export_vars -base [parameter::get -package_id [ad_acs_kernel_id] -parameter CommunityMemberAdminURL] { user_id }] } ad_proc -public acs_community_member_admin_link { @@ -289,7 +288,7 @@ and then closes the BODY and HTML tags } { global sidegraphic_displayed_p - if [empty_string_p $signatory] { + if { [empty_string_p $signatory] } { set signatory [ad_system_owner] } if { [info exists sidegraphic_displayed_p] && $sidegraphic_displayed_p } { @@ -562,9 +561,9 @@ @author Roberto Mello } { set lines [list] - if [empty_string_p $line2] { + if { [empty_string_p $line2] } { lappend lines $line1 - } elseif [empty_string_p $line1] { + } elseif { [empty_string_p $line1] } { lappend lines $line2 } else { lappend lines $line1 @@ -588,14 +587,14 @@ } { uplevel { set user_id [ad_conn user_id] - if [catch { + if { [catch { db_1row user_name_select { select first_names, last_name, email from persons, parties where person_id = :user_id and person_id = party_id } - } errmsg] { + } errmsg] } { ad_return_error "Couldn't find user info" "Couldn't find user info." return } @@ -613,7 +612,7 @@ string, ad_decorate_top will make a one-row table for the top of the page } { - if [empty_string_p $potential_decoration] { + if { [empty_string_p $potential_decoration] } { return $simple_headline } else { return "<table cellspacing=10><tr><td>$potential_decoration<td>$simple_headline</tr></table>" Index: openacs-4/packages/acs-tcl/tcl/deprecated-utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/deprecated-utilities-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-tcl/tcl/deprecated-utilities-procs.tcl 24 Sep 2002 19:34:53 -0000 1.4 +++ openacs-4/packages/acs-tcl/tcl/deprecated-utilities-procs.tcl 28 Aug 2003 09:41:43 -0000 1.5 @@ -5,7 +5,7 @@ @author yon [yon@arsdigita.com] @creation-date 9 Jul 2000 - @cvs-id $Id$ + @cvs-id deprecated-utilities-procs.tcl,v 1.4 2002/09/24 19:34:53 jeffd Exp } @@ -224,7 +224,7 @@ ad_proc -deprecated -warn remove_whitespace {input_string} { to be removed. } { - if [regsub -all "\[\015\012\t \]" $input_string "" output_string] { + if { [regsub -all "\[\015\012\t \]" $input_string "" output_string] } { return $output_string } else { return $input_string @@ -234,7 +234,7 @@ ad_proc -deprecated -warn util_just_the_digits {input_string} { to be removed. } { - if [regsub -all {[^0-9]} $input_string "" output_string] { + if { [regsub -all {[^0-9]} $input_string "" output_string] } { return $output_string } else { return $input_string Index: openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl,v diff -u -r1.32 -r1.33 --- openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl 22 Aug 2003 10:10:16 -0000 1.32 +++ openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl 28 Aug 2003 09:41:43 -0000 1.33 @@ -18,10 +18,12 @@ <p> - We use the standard ATS form builder's form and element create procedures to generate forms, - and its state-tracking code to determine when to execute various code blocks. Because of - this, you can use any form builder datatype or widget with this procedure, and extending its - functionality is a simple matter of implementing new ones. + We use the standard OpenACS Templating System (ATS) form builder's form and element create + procedures to generate forms, and its state-tracking code to determine when to execute + various code blocks. Because of this, you can use any form builder datatype or widget + with this procedure, and extending its functionality is a simple matter of implementing + new ones. Because ad_form is just a wrapper for the ATS, you <b>must</b> familiarize + yourself with it to be able to use ad_form effectively. <p> @@ -56,6 +58,7 @@ ad_page_contract { + Simple add/edit form } { @@ -151,10 +154,49 @@ being served. </dd> + <p><dt><b>-actions</b></dt><p> + <dd>A list of lists of actions (e.g. {{" Delete " delete} {" Resolve " resolve}} ), which gets + translated to buttons at the bottom of the form. You can find out what button was pressed + with [template::form get_action form_id], usually in the -edit_request block to perform whatever + actions you deem appropriate. When the form is loaded the action will be empty. + </dd> + + <p><dt><b>-mode { display | edit }</b></dt><p> + <dd>If set to 'display', the form is shown in display-only mode, where the user cannot edit the fields. + Each widget knows how to display its contents appropriately, e.g. a select widget will show + the label, not the value. If set to 'edit', the form is displayed as normal, for editing. + Defaults to 'edit'. Switching to edit mode when a button is clicked in display mode is handled + automatically + </dd> + + <p><dt><b>-has_edit { 0 | 1 }</b></dt><p> + <dd>Set to 1 to suppress the Edit button automatically added by the form builder. Use this if you + include your own. + </dd> + + <p><dt><b>-has_submit { 0 | 1 }</b></dt><p> + <dd>Set to 1 to suppress the OK button automatically added by the form builder. Use this if you + include your own. + </dd> + + <p><dt><b>-method</b></dt><p> + <dd>The standard METHOD attribute to specify in the HTML FORM tag at the beginning of the rendered + form. Defaults to POST. + </dd> + + <p><dt><b>-form</b></dt><p> + <dd>Declare form elements (described in detail below) + </dd> + <p><dt><b>-cancel_url</b></dt><p> - <dd>The URL the cancel button should take you to. If this is specified, a cancel button will show up. + <dd>The URL the cancel button should take you to. If this is specified, a cancel button will show up + during the edit phase. </dd> + <p><dt><b>-cancel_label</b></dt><p> + <dd>The label for the cancel button. + </dd> + <p><dt><b>-html</b></dt><p> <dd>The given html will be added to the "form" tag when page is rendered. This is commonly used to define multipart file handling forms. @@ -167,17 +209,6 @@ similar flags are not allowed though it would be good to do so in the future. </dd> - <p><dt><b>-form</b></dt><p> - <dd>Declare form elements (described in detail below) - </dd> - - <p><dt><b>-on_request</b></dt><p> - <dd>A code block which sets the values for each element of the form meant to be modifiable by - the user when the built-in key management feature is being used or to define options for - select lists etc. You just need to set the values as local - variables in the code block, and they'll get fetched and used as element values for you. - </dd> - <p><dt><b>-select_query</b></dt><p> <dd>Defines a query that returns a single row containing values for each element of the form meant to be modifiable by the user. Can only be used if an element of type key has been declared. @@ -191,11 +222,25 @@ declared </dd> + <p><dt><b>-show_required_p { 0 | 1 }</b></dt><p> + <dd>Should the form template show which elements are required. Use 1 or t for true, 0 or f for false. + Defaults to true. + </dd> + + <p><dt><b>-on_request</b></dt><p> + <dd>A code block which sets the values for each element of the form meant to be modifiable by + the user when the built-in key management feature is being used or to define options for + select lists etc. Set the values as local variables in the code block, and they'll get + fetched and used as element values for you. This block is executed <i>everytime</i> the + form is loaded <i>except</i> when the form is being submitted (in which case the -on_submit + block is executed.) + </dd> + <p><dt><b>-edit_request</b></dt><p> <dd>A code block which sets the values for each element of the form meant to be modifiable by the user. Use this when a single query to grab database values is insufficient. Can only be used if an element of type key is defined. This block is only executed if the page is called with a valid key, i.e. a - self-submit form to add or edit an item called to edit the data. You just need to set the values as local + self-submit form to add or edit an item called to edit the data. Set the values as local variables in the code block, and they'll get fetched and used as element values for you. </dd> @@ -252,6 +297,18 @@ executed. It is useful for putting in stuff like ad_returnredirect that is the same for new and edit. </dd> + <p><dt><b>-validate</b></dt><p> + <dd>A code block that validates the elements in the form. The elements are set as local values. + The block has the following form: + <pre> +{element_name + {tcl code that returns 1 or 0} + "Message to be shown by that element in case of error" +} +{...} + </pre> + </dd> + </dl> Two hidden values of interest are available to the caller of ad_form when processing a submit: @@ -367,6 +424,10 @@ <p> </blockquote> + @see ad_form_new_p + @see ad_set_element_value + @see ad_set_form_values + } { set level [template::adp_level] @@ -388,7 +449,7 @@ set valid_args { form method action mode html name select_query select_query_name new_data on_refresh edit_data validate on_submit after_submit confirm_template on_request new_request edit_request - export cancel_url cancel_label has_edit actions edit_buttons }; + export cancel_url cancel_label has_submit has_edit actions edit_buttons show_required_p }; ad_arg_parser $valid_args $args @@ -426,7 +487,7 @@ # and validation block to be extended, for now at least until I get more experience # with this ... - if { [lsearch { name form method action html validate export mode cancel_url has_edit actions edit_buttons } $valid_arg ] == -1 } { + if { [lsearch { name form method action html validate export mode cancel_url has_edit has_submit actions edit_buttons } $valid_arg ] == -1 } { set af_parts(${form_name}__extend) "" } } @@ -558,6 +619,10 @@ lappend create_command "-has_edit" $has_edit } + if { [info exists has_submit] } { + lappend create_command "-has_submit" $has_submit + } + if { [info exists actions] } { lappend create_command "-actions" $actions } @@ -566,6 +631,10 @@ lappend create_command "-edit_buttons" $edit_buttons } + if { [info exists show_required_p] } { + lappend create_command "-show_required_p" $show_required_p + } + # Create the form eval $create_command @@ -683,34 +752,7 @@ foreach extra_arg $af_extra_args($element_name) { lappend form_command "-[lindex $extra_arg 0]" - switch [lindex $extra_arg 0] { - html - - values - - validate - - options { - lappend form_command [uplevel [list subst [lindex $extra_arg 1]]] - } - help_text - - label - - format - - mode - - value - - section - - before_html - - after_html - - result_datatype - - search_query - - search_query_name - - maxlength { - if { [llength $extra_arg] > 2 || [llength $extra_arg] == 1 } { - return -code error "element $element_name: \"$extra_arg\" requires exactly one argument" - } - lappend form_command [uplevel [list subst [lindex $extra_arg 1]]] - } - default { - ns_log Error "Unknown switch '[lindex $extra_arg 0]' to ad_form on url [ad_return_url]" - } - } + lappend form_command [uplevel [list subst [lindex $extra_arg 1]]] } eval $form_command @@ -912,9 +954,13 @@ } if { [template::form is_submission $form_name] && - [uplevel #$level {set __refreshing_p}] && - [info exists on_refresh] } { - ad_page_contract_eval uplevel #$level $on_refresh + [uplevel #$level {set __refreshing_p}] } { + + uplevel array unset ${form_name}:error + + if { [info exists on_refresh] } { + ad_page_contract_eval uplevel #$level $on_refresh + } } if { [template::form is_valid $form_name] && ![uplevel #$level {set __refreshing_p}] } { Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-tcl/tcl/html-email-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-tcl/tcl/md5.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-tcl/tcl/membership-rel-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/membership-rel-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-tcl/tcl/membership-rel-procs.tcl 10 Sep 2002 22:22:14 -0000 1.2 +++ openacs-4/packages/acs-tcl/tcl/membership-rel-procs.tcl 28 Aug 2003 09:41:43 -0000 1.3 @@ -14,12 +14,27 @@ } { Change the state of a membership relation } { - switch -exact $state { - "approved" { db_exec_plsql approve {} } - "banned" { db_exec_plsql ban {} } - "rejected" { db_exec_plsql reject {} } - "deleted" { db_exec_plsql delete {} } - "needs approval" { db_exec_plsql unapprove {} } + db_transaction { + switch -exact $state { + "approved" { db_exec_plsql approve {} } + "banned" { db_exec_plsql ban {} } + "rejected" { db_exec_plsql reject {} } + "deleted" { db_exec_plsql delete {} } + "needs approval" { db_exec_plsql unapprove {} } + } + + # Record who changed the state + # This will trigger an update of the acs_objects.modified_date column. + # We use this in the ApprovalExpiration feature to make sure that a user isn't + # bumped back to needs_approval right after an administrator has approved them, + # even if the user doesn't log in in the meantime. + + if { [ad_conn isconnected] } { + set user_id [ad_conn user_id] + } else { + set user_id [db_null] + } + db_dml update_modifying_user {} } } Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-tcl/tcl/membership-rel-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-tcl/tcl/memoize-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/memoize-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-tcl/tcl/memoize-procs.tcl 17 May 2003 10:04:18 -0000 1.6 +++ openacs-4/packages/acs-tcl/tcl/memoize-procs.tcl 28 Aug 2003 09:41:43 -0000 1.7 @@ -5,7 +5,7 @@ @author Various [acs@arsdigita.com] @author Rob Mayoff <mayoff@arsdigita.com> @creation-date 2000-10-19 - @cvs-id $Id$ + @cvs-id memoize-procs.tcl,v 1.4.2.1 2003/03/05 14:40:42 lars Exp } # Use shiny new ns_cache-based util_memoize. @@ -161,7 +161,7 @@ if $log_p { ns_log Notice "flush_regexp: checking $name for $expr" } - if [regexp $expr $name] { + if { [regexp $expr $name] } { if $log_p { ns_log Notice "flush_regexp: flushing $name" } Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-tcl/tcl/mime.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl 14 Aug 2003 19:34:45 -0000 1.13 +++ openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl 28 Aug 2003 09:41:43 -0000 1.14 @@ -2,7 +2,6 @@ Provides procedures to spit out the navigational parts of the site. @cvs-id $Id$ - @author philg@mit.edu @creation-date 11/5/98 (adapted originally from the Cognet server) } @@ -42,23 +41,20 @@ } ad_proc ad_context_node_list { - -from_node + {-from_node ""} node_id } { Starting with the given node_id, return a list of [list url instance_name] items for parent nodes. - Do not include links to from_node and above, if provided. - + @option from_node The top-most node_id for which we'll show context bar. This can be used with + the node_id of the nearest subsite to get the context-bar only up to the nearest subsite. + @author Peter Marklund } { set context [list] - if { ![info exists from_node] } { - set from_node "" - } - - while { ![empty_string_p $node_id] && ![string match $node_id $from_node] } { + while { ![empty_string_p $node_id] } { array set node [site_node::get -node_id $node_id] # JCD: Provide something for the name if the instance name is @@ -71,15 +67,20 @@ set context [concat [list [list $node(url) $node(instance_name)]] $context] + # We have the break here, so that 'from_node' itself is included + if { [string equal $node_id $from_node] } { + break + } + set node_id $node(parent_id) } return $context } ad_proc -public ad_context_bar { + {-from_node ""} -node_id - -from_node -separator args } { @@ -101,16 +102,8 @@ set node_id [ad_conn node_id] } - set context [list] + set context [ad_context_node_list -from_node $from_node $node_id] - if { [info exists from_node] } { - set context [concat $context \ - [ad_context_node_list -from_node $from_node $node_id]] - } else { - set context [concat $context [ad_context_node_list $node_id]] - } - - if { [string match admin/* [ad_conn extra_url]] } { lappend context [list "[ad_conn package_url]admin/" \ "Administration"] @@ -334,7 +327,7 @@ foreach naked_pattern [ad_naked_html_patterns] { - if [string match $naked_pattern $url_stub] { + if { [string match $naked_pattern $url_stub] } { # want the global admins with no menu, but not the domain admin return "" } @@ -486,7 +479,7 @@ set uplevel_string "<TD align=right><A href=\"[menu_uplevel $section $uplink]\" onMouseOver=\"hiLite(\'up_one_level\')\" onMouseOut=\"unhiLite(\'up_one_level\')\"><img name=\"up_one_level\" src=\"/graphics/36_up_one_level.gif\" border=0 width=120 height=36 \" alt=\"Up\"></A></TD></TR>" foreach url_pattern [ad_no_uplevel_patterns] { - if [regexp $url_pattern $url_stub match] { + if { [regexp $url_pattern $url_stub match] } { set uplevel_string "" } } @@ -537,7 +530,7 @@ set full_filename "[ns_info pageroot]$url_stub" foreach naked_pattern [ad_naked_html_patterns] { - if [string match $naked_pattern $url_stub] { + if { [string match $naked_pattern $url_stub] } { return "" } } Index: openacs-4/packages/acs-tcl/tcl/parameter-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/parameter-procs.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-tcl/tcl/parameter-procs.tcl 9 Apr 2003 09:09:24 -0000 1.9 +++ openacs-4/packages/acs-tcl/tcl/parameter-procs.tcl 28 Aug 2003 09:41:43 -0000 1.10 @@ -42,7 +42,7 @@ @param package_id what package to get the parameter from. defaults to [ad_conn package_id] @param parameter which parameter's value to get - @param default what to return if we don't find a value + @param default what to return if we don't find a value. Defaults to returning the empty string. @return The string trimmed (leading and trailing spaces removed) parameter value } { Index: openacs-4/packages/acs-tcl/tcl/request-processor-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/request-processor-init.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-tcl/tcl/request-processor-init.tcl 3 Jul 2003 23:02:36 -0000 1.5 +++ openacs-4/packages/acs-tcl/tcl/request-processor-init.tcl 28 Aug 2003 09:41:43 -0000 1.6 @@ -4,7 +4,7 @@ @creation-date 30 May 2000 @author Jon Salz [jsalz@arsdigita.com] - @cvs-id $Id$ + @cvs-id request-processor-init.tcl,v 1.3 2002/09/20 21:46:34 jeffd Exp } # These procedures are dynamically defined at startup to alleviate @@ -21,7 +21,7 @@ return [ad_acs_admin_id_mem] " -if [ad_parameter -package_id [ad_acs_kernel_id] PerformanceModeP request-processor 0] { +if { [ad_parameter -package_id [ad_acs_kernel_id] PerformanceModeP request-processor 0] } { ad_proc -private rp_performance_mode {} { Returns 1 if the request processor is in performance mode, 0 otherwise. } { Index: openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl,v diff -u -r1.41 -r1.42 --- openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 21 Jul 2003 04:52:44 -0000 1.41 +++ openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 28 Aug 2003 09:41:43 -0000 1.42 @@ -650,6 +650,9 @@ admin/* { permission::require_permission -object_id [ad_conn object_id] -privilege admin } + sitewide-admin/* { + permission::require_permission -object_id [acs_lookup_magic_object security_context_root] -privilege admin + } default { permission::require_permission -object_id [ad_conn object_id] -privilege read } Index: openacs-4/packages/acs-tcl/tcl/rollout-email-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/rollout-email-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-tcl/tcl/rollout-email-procs.tcl 11 Mar 2003 22:36:59 -0000 1.2 +++ openacs-4/packages/acs-tcl/tcl/rollout-email-procs.tcl 28 Aug 2003 09:41:43 -0000 1.3 @@ -81,7 +81,7 @@ } { set targets [ns_config ns/server/[ns_info server]/acs/acs-rollout-support EmailRedirectTo] - if ![string equal $targets ""] { + if { ![string equal $targets ""] } { set body "The following email would have been sent from \"[ad_parameter SystemName]\", but was instead redirected to you. Index: openacs-4/packages/acs-tcl/tcl/security-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/security-procs-oracle.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-tcl/tcl/security-procs-oracle.xql 1 Mar 2002 23:16:13 -0000 1.5 +++ openacs-4/packages/acs-tcl/tcl/security-procs-oracle.xql 28 Aug 2003 09:41:43 -0000 1.6 @@ -79,4 +79,14 @@ </querytext> </fullquery> +<fullquery name="ad_change_password.password_update"> + <querytext> + update users + set password = :new_password, + salt = :salt, + password_changed_date = sysdate + where user_id = :user_id + </querytext> +</fullquery> + </queryset> Index: openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql 1 Mar 2002 23:16:13 -0000 1.9 +++ openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql 28 Aug 2003 09:41:43 -0000 1.10 @@ -64,4 +64,15 @@ </querytext> </fullquery> +<fullquery name="ad_change_password.password_update"> + <querytext> + update users + set password = :new_password, + salt = :salt, + password_changed_date = current_timestamp + where user_id = :user_id + </querytext> +</fullquery> + + </queryset> Index: openacs-4/packages/acs-tcl/tcl/security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/security-procs.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/acs-tcl/tcl/security-procs.tcl 14 Aug 2003 20:38:03 -0000 1.15 +++ openacs-4/packages/acs-tcl/tcl/security-procs.tcl 28 Aug 2003 09:41:43 -0000 1.16 @@ -7,7 +7,7 @@ @author Jon Salz (jsalz@arsdigita.com) @author Richard Li (richardl@arsdigita.com) @author Archit Shah (ashah@arsdigita.com) - @cvs-id $Id$ + @cvs-id security-procs.tcl,v 1.13.2.5 2003/06/06 08:48:50 lars Exp } # cookies (all are signed cookies): @@ -226,8 +226,7 @@ # this and still support old users by changing the salt below. set salt [sec_random_token] set new_password [ns_sha1 "$new_password$salt"] - db_dml password_update "update users set password = :new_password, salt = :salt where user_id = :user_id" - + db_dml password_update {} } ad_proc -private sec_setup_session { new_user_id } { @@ -532,30 +531,77 @@ to the current location. All variables in ns_getform (both posts and gets) will be maintained. + <p> + + It's up to the caller to issue an ad_script_abort, if that's what you want. + + @see ad_get_login_url } { - set form [ns_getform] - set url_args "" + ad_returnredirect [ad_get_login_url -return] +} + +ad_proc -public ad_get_login_url { + -return:boolean +} { - # note that there is no built-in function that will change - # posted variables to url variables, so we write our own + Returns a URL to the login page of the closest subsite, or the main site, if there's no current connection. - if ![empty_string_p $form] { - set form_size [ns_set size $form] - set form_counter_i 0 - while { $form_counter_i<$form_size } { - if {[string compare $form_counter_i "0"] == 0} { - append url_args "?" - } else { - append url_args "&" - } - append url_args "[ns_set key $form $form_counter_i]=[ns_urlencode [ns_set value $form $form_counter_i]]" - incr form_counter_i - } + @option return If set, will export the current form, so when the registration is complete, + the user will be returned to the current location. All variables in + ns_getform (both posts and gets) will be maintained. + + @author Lars Pind (lars@collaboraid.biz) +} { + if { [ad_conn isconnected] } { + set url [site_node_closest_ancestor_package_url] + + # Check to see that the user (most likely "The Public" party, since there's probably no user logged in) + # actually have permission to view that subsite, otherwise we'll get into an infinite redirect loop + array set site_node [site_node::get_from_url -url $url] + set package_id $site_node(object_id) + if { ![permission::permission_p -object_id $site_node(object_id) -privilege read] } { + set url / + } + } else { + set url / } - ad_returnredirect "[subsite::get_element -element url]register/?return_url=[ns_urlencode [ad_conn url]$url_args]" - return + + append url "register/" + + if { $return_p } { + set url [export_vars -base $url { { return_url [ad_return_url] } }] + } + + return $url } +ad_proc -public ad_get_logout_url { + -return:boolean +} { + + Returns a URL to the logout page of the closest subsite, or the main site, if there's no current connection. + + @option return If set, will export the current form, so when the logout is complete + the user will be returned to the current location. All variables in + ns_getform (both posts and gets) will be maintained. + + @author Lars Pind (lars@collaboraid.biz) +} { + if { [ad_conn isconnected] } { + set url [subsite::get_element -element url] + } else { + set url / + } + + append url "register/logout" + + if { $return_p } { + set url [export_vars -base $url { { return_url [ad_return_url] } }] + } + + return $url +} + ad_proc -public ad_maybe_redirect_for_registration {} { Checks to see if a user is logged in. If not, redirects to @@ -566,6 +612,7 @@ the caller need not explicitly call "return". Returns the user id if login was succesful. + @see ad_redirect_for_registration } { set user_id [ad_conn user_id] if { $user_id != 0 } { @@ -623,7 +670,7 @@ @see ad_page_contract } { set form [ns_getform] - if [empty_string_p $form] { return filter_ok } + if { [empty_string_p $form] } { return filter_ok } # Check each form data variable to see if it contains malicious # user input that we don't want to interpolate into our SQL @@ -786,7 +833,7 @@ <pre> } { - if [regexp {[^0-9]} $value] { + if { [regexp {[^0-9]} $value] } { return 0 } else { return 1 @@ -801,7 +848,7 @@ <pre> } { - if [string match *..* $value] { + if { [string match *..* $value] } { return 0 } else { return 1 @@ -816,7 +863,7 @@ <pre> } { - if [regexp {[/\\]} $value] { + if { [regexp {[/\\]} $value] } { return 0 } else { return 1 @@ -830,7 +877,7 @@ # <pre> } { - if [catch {expr 1.0 * $value}] { + if { [catch {expr 1.0 * $value}] } { return 0 } else { return 1 @@ -846,7 +893,7 @@ </pre> } { - if [regexp {[^-A-Za-z0-9_]} $value] { + if { [regexp {[^-A-Za-z0-9_]} $value] } { return 0 } else { return 1 @@ -877,7 +924,7 @@ <pre> } { - if [string match *'* $value] { + if { [string match *'* $value] } { return 0 } else { return 1 @@ -896,7 +943,7 @@ <pre> } { - if [regexp {[^ 0-9,]} $value] { + if { [regexp {[^ 0-9,]} $value] } { return 0 } else { return 1 @@ -924,7 +971,7 @@ set third_url_element [lindex [ad_conn urlv] 3] - if [regexp {[^0-9]} $third_url_element] { + if { [regexp {[^0-9]} $third_url_element] } { return 0 } else { return 1 Index: openacs-4/packages/acs-tcl/tcl/security-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/security-procs.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-tcl/tcl/security-procs.xql 17 May 2003 10:04:18 -0000 1.7 +++ openacs-4/packages/acs-tcl/tcl/security-procs.xql 28 Aug 2003 09:41:43 -0000 1.8 @@ -18,13 +18,6 @@ </fullquery> -<fullquery name="ad_change_password.password_update"> - <querytext> - update users set password = :new_password, salt = :salt where user_id = :user_id - </querytext> -</fullquery> - - <fullquery name="sec_lookup_property.property_lookup_sec"> <querytext> Index: openacs-4/packages/acs-tcl/tcl/set-operation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/set-operation-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-tcl/tcl/set-operation-procs.tcl 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-tcl/tcl/set-operation-procs.tcl 28 Aug 2003 09:41:43 -0000 1.2 @@ -4,7 +4,7 @@ @creation-date 19 January 2001 @author Eric Lorenzo (elorenzo@arsdigita.com) - @cvs-id $Id$ + @cvs-id set-operation-procs.tcl,v 1.1.1.1 2001/03/13 22:59:26 ben Exp } @@ -31,7 +31,7 @@ } { upvar $s-name s - if ![set_member? $s $v] { + if { ![set_member? $s $v] } { lappend s $v } } @@ -44,7 +44,7 @@ set result $u foreach ve $v { - if ![set_member? $result $ve] { + if { ![set_member? $result $ve] } { lappend result $ve } } @@ -61,7 +61,7 @@ upvar $u-name u foreach ve $v { - if ![set_member? $u $ve] { + if { ![set_member? $u $ve] } { lappend u $ve } } @@ -78,7 +78,7 @@ set result [list] foreach ue $u { - if [set_member? $v $ue] { + if { [set_member? $v $ue] } { lappend result $ue } } @@ -96,7 +96,7 @@ set result [list] foreach ue $u { - if [set_member? $v $ue] { + if { [set_member? $v $ue] } { lappend result $ue } } @@ -116,7 +116,7 @@ set result [list] foreach ue $u { - if ![set_member? $v $ue] { + if { ![set_member? $v $ue] } { lappend result $ue } } @@ -134,7 +134,7 @@ set result [list] foreach ue $u { - if ![set_member? $v $ue] { + if { ![set_member? $v $ue] } { lappend result $ue } } Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs-oracle.xql,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-tcl/tcl/site-nodes-procs-oracle.xql 17 May 2003 10:04:18 -0000 1.12 +++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs-oracle.xql 28 Aug 2003 09:41:43 -0000 1.13 @@ -23,10 +23,13 @@ where acs_objects.object_id = site_nodes.object_id) as object_type, apm_packages.package_key, apm_packages.package_id, - apm_packages.instance_name + apm_packages.instance_name, + apm_package_types.package_type from site_nodes, - apm_packages + apm_packages, + apm_package_types where site_nodes.object_id = apm_packages.package_id(+) + and apm_package_types.package_key = apm_packages.package_key </querytext> </fullquery> @@ -44,11 +47,14 @@ where acs_objects.object_id = site_nodes.object_id) as object_type, apm_packages.package_key, apm_packages.package_id, - apm_packages.instance_name + apm_packages.instance_name, + apm_package_types.package_type from site_nodes, - apm_packages + apm_packages, + apm_package_types where site_nodes.node_id = :node_id and site_nodes.object_id = apm_packages.package_id(+) + and apm_package_types.package_key = apm_packages.package_key </querytext> </fullquery> Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs-postgresql.xql,v diff -u -r1.16 -r1.17 --- openacs-4/packages/acs-tcl/tcl/site-nodes-procs-postgresql.xql 17 May 2003 10:04:18 -0000 1.16 +++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs-postgresql.xql 28 Aug 2003 09:41:43 -0000 1.17 @@ -23,8 +23,11 @@ where acs_objects.object_id = site_nodes.object_id) as object_type, apm_packages.package_key, apm_packages.package_id, - apm_packages.instance_name - from site_nodes left join apm_packages on site_nodes.object_id = apm_packages.package_id + apm_packages.instance_name, + apm_package_types.package_type + from site_nodes left join + apm_packages on site_nodes.object_id = apm_packages.package_id left join + apm_package_types using (package_key) </querytext> </fullquery> @@ -42,8 +45,11 @@ where acs_objects.object_id = site_nodes.object_id) as object_type, apm_packages.package_key, apm_packages.package_id, - apm_packages.instance_name - from site_nodes left join apm_packages on site_nodes.object_id = apm_packages.package_id + apm_packages.instance_name, + apm_package_types.package_type + from site_nodes left join + apm_packages on site_nodes.object_id = apm_packages.package_id left join + apm_package_types using (package_key) where site_nodes.node_id = :node_id </querytext> </fullquery> Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl,v diff -u -r1.30 -r1.31 --- openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 7 Jul 2003 12:00:01 -0000 1.30 +++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 28 Aug 2003 09:41:43 -0000 1.31 @@ -53,6 +53,28 @@ apm_invoke_callback_proc -package_key [apm_package_key_from_id $object_id] -type "after-mount" -arg_list [list node_id $node_id package_id $object_id] } + ad_proc -public rename { + {-node_id:required} + {-name:required} + } { + Rename the site node. + } { + # We need to update the cache for all the child nodes as well + set node_url [get_url -node_id $node_id] + set child_node_ids [get_children -all -node_id $node_id -element node_id] + + db_dml rename_node {} + + # Unset all cache entries under the old path + foreach name [nsv_array names site_nodes "${node_url}*"] { + nsv_unset site_nodes $name + } + + foreach node_id [concat $node_id $child_node_ids] { + update_cache -node_id $node_id + } + } + ad_proc -public instantiate_and_mount { {-node_id ""} {-parent_node_id ""} @@ -331,6 +353,70 @@ return $node(object_id) } + ad_proc -public get_children { + {-all:boolean} + {-package_type {}} + {-element {}} + {-node_id:required} + } { + @param node_id The node for which you want to find the children. + + @option all Set this if you want all children, not just direct children + + @option package_type If specified, this will limit the returned nodes to those with an + package of the specified package type (normally apm_service or + apm_application) mounted + + @param element The element of the site node you wish returned. Defaults to url, but you + can say 'node_id' instead. + + @return A list of URLs of the site_nodes immediately under this site node, or all children, + if the -all switch is specified. + + @author Lars Pind (lars@collaboraid.biz) + } { + set node_url [get_url -node_id $node_id] + + set child_urls [nsv_array names site_nodes "${node_url}*"] + + if { !$all_p } { + set org_child_urls $child_urls + set child_urls [list] + foreach child_url $org_child_urls { + if { [regexp "^${node_url}\[^/\]*/\$" $child_url] } { + lappend child_urls $child_url + } + } + } + + if { ![empty_string_p $package_type] } { + set org_child_urls $child_urls + set child_urls [list] + foreach child_url $org_child_urls { + array unset site_node + array set site_node [get_from_url -exact -url $child_url] + + if { [string equal $site_node(package_type) $package_type] } { + lappend child_urls $child_url + } + } + } + + if { ![empty_string_p $element] } { + # We need to update the cache for all the child nodes as well + set return_val [list] + foreach child_url $child_urls { + array unset site_node + array set site_node [site_node::get_from_url -url $child_url] + + lappend return_val $site_node($element) + } + return $return_val + } else { + return $child_urls + } + } + ad_proc -public closest_ancestor_package { {-url ""} {-node_id ""} Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-tcl/tcl/site-nodes-procs.xql 21 Jun 2002 18:54:47 -0000 1.5 +++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs.xql 28 Aug 2003 09:41:43 -0000 1.6 @@ -9,6 +9,14 @@ </querytext> </fullquery> + <fullquery name="site_node::rename.rename_node"> + <querytext> + update site_nodes + set name = :name + where node_id = :node_id + </querytext> + </fullquery> + <fullquery name="site_node::unmount.unmount_object"> <querytext> update site_nodes Index: openacs-4/packages/acs-tcl/tcl/table-display-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/table-display-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/acs-tcl/tcl/table-display-procs.tcl 17 Mar 2003 20:19:00 -0000 1.10 +++ openacs-4/packages/acs-tcl/tcl/table-display-procs.tcl 28 Aug 2003 09:41:43 -0000 1.11 @@ -1,7 +1,7 @@ ad_library { This is the table, dimensional bar and sort tools. an example of their use can be found in /acs-examples - @cvs-id $Id$ + @cvs-id table-display-procs.tcl,v 1.9 2002/09/20 22:18:16 jeffd Exp } # Dimensional selection bars. @@ -860,7 +860,7 @@ proc_doc ad_same_page_link {variable value text {form ""}} { Makes a link to this page, with a new value for "variable". } { - if [empty_string_p $form] { + if { [empty_string_p $form] } { set form [ns_getform] } set url_vars [export_ns_set_vars url $variable $form] Index: openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 2 Aug 2003 00:40:01 -0000 1.8 +++ openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 28 Aug 2003 09:41:43 -0000 1.9 @@ -8,7 +8,7 @@ @author Bryan Quinn (bquinn@arsdigita.com) @creation-date 16 June 2000 - @cvs-id $Id$ + @cvs-id tcl-documentation-procs.tcl,v 1.6 2002/09/23 11:25:02 jeffd Exp } #################### @@ -889,7 +889,15 @@ } } - # Remember that we've found the spec so we don't complain that argument is missing + if { [info exists apc_internal_filter($formal_name:multiple)] && [empty_string_p $actual_value] } { + # LARS: + # If you lappend an emptry_string, it'll actually add the empty string to the list as an element + # which is not what we want + continue + } + + + # Remember that we've found the spec so we don't complain that this argument is missing ad_page_contract_set_validation_passed $formal_name # @@ -937,7 +945,7 @@ upvar 1 $formal_name var if { [info exists apc_internal_filter($formal_name:multiple)] } { - lappend $variable_to_set $actual_value + lappend $variable_to_set $actual_value } else { if { [info exists $variable_to_set] } { ad_complain -key $formal_name:-doublevalue "You've supplied two values for '$formal_name'" @@ -1566,7 +1574,7 @@ # check to make sure path is to an authorized directory set tmpdir_list [ad_parameter_all_values_as_list TmpDir] - if [empty_string_p $tmpdir_list] { + if { [empty_string_p $tmpdir_list] } { set tmpdir_list [list "/var/tmp" "/tmp"] } @@ -1837,7 +1845,7 @@ @creation-date August 2000 } { if { ![empty_string_p [string trim $value]] } { - if ![regexp {^\(?([1-9][0-9]{2})\)?(-|\.|\ )?([0-9]{3})(-|\.|\ )?([0-9]{4})} $value] { + if { ![regexp {^\(?([1-9][0-9]{2})\)?(-|\.|\ )?([0-9]{3})(-|\.|\ )?([0-9]{4})} $value] } { ad_complain "$value does not appear to be a valid U.S. phone number." return 0 Index: openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 17 May 2003 10:04:18 -0000 1.16 +++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 28 Aug 2003 09:41:43 -0000 1.17 @@ -1391,6 +1391,7 @@ {-len 200} {-format html} {-no_format:boolean} + {-ellipsis "..."} string } { Truncates a string to len characters (defaults to the @@ -1410,7 +1411,7 @@ @creation-date September 8, 2002 } { if { [string length $string] > $len } { - set string "[string range $string 0 $len]..." + set string "[string range $string 0 [expr $len-[string length $ellipsis]-1]]$ellipsis" } if { [string equal $format "html"] && !$no_format_p } { Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v diff -u -r1.33 -r1.34 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 2 Aug 2003 00:40:01 -0000 1.33 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 28 Aug 2003 09:41:43 -0000 1.34 @@ -4,15 +4,15 @@ @author Various (acs@arsdigita.com) @creation-date 13 April 2000 - @cvs-id $Id$ + @cvs-id utilities-procs.tcl,v 1.19.2.18 2003/06/06 21:40:37 donb Exp } # Let's define the nsv arrays out here, so we can call nsv_exists # on their keys without checking to see if it already exists. # we create the array by setting a bogus key. proc proc_source_file_full_path {proc_name} { - if ![nsv_exists proc_source_file $proc_name] { + if { ![nsv_exists proc_source_file $proc_name] } { return "" } else { set tentative_path [nsv_get proc_source_file $proc_name] @@ -99,7 +99,7 @@ # check to make sure path is to an authorized directory set tmpdir_list [ad_parameter_all_values_as_list TmpDir] - if [empty_string_p $tmpdir_list] { + if { [empty_string_p $tmpdir_list] } { set tmpdir_list [list "/var/tmp" "/tmp"] } @@ -122,27 +122,27 @@ # see if this is one of the typed variables global ad_typed_form_variables - if [info exists ad_typed_form_variables] { + if { [info exists ad_typed_form_variables] } { foreach typed_var_spec $ad_typed_form_variables { set typed_var_name [lindex $typed_var_spec 0] - if ![string match $typed_var_name $name] { + if { ![string match $typed_var_name $name] } { # no match. Go to the next variable in the list continue } # the variable matched the pattern set typed_var_type [lindex $typed_var_spec 1] - if [string match "" $typed_var_type] { + if { [string match "" $typed_var_type] } { # if they don't specify a type, the default is 'integer' set typed_var_type integer } set variable_safe_p [ad_var_type_check_${typed_var_type}_p $value] - if !$variable_safe_p { + if { !$variable_safe_p } { ns_returnerror 500 "variable $name failed '$typed_var_type' type check" ns_log Error "[ad_conn url] called with \$$name = $value" error "variable $name failed '$typed_var_type' type check" @@ -361,13 +361,13 @@ return_url. if database insert fails, this procedure will return a sensible error message to the user. } { - if [catch { + if { [catch { if { ![empty_string_p $bind] } { db_dml $statement_name $insert_dml -bind $bind } else { db_dml $statement_name $insert_dml } - } errmsg] { + } errmsg] } { # Oracle choked on the insert # detect double click @@ -408,7 +408,7 @@ Converts 1998-09-05 to September 5, 1998 } { set sql_date [string range $sql_date 0 9] - if ![regexp {(.*)-(.*)-(.*)$} $sql_date match year month day] { + if { ![regexp {(.*)-(.*)-(.*)$} $sql_date match year month day] } { return "" } else { set allthemonths {January February March April May June July August September October November December} @@ -613,6 +613,8 @@ -url:boolean -quotehtml:boolean -entire_form:boolean + -no_empty:boolean + {-base} {-exclude {}} {-override {}} {vars {}} @@ -746,6 +748,13 @@ @param entire_form Export the entire form from the GET query string or the POST. + @option no_empty If specified, variables with an empty string value will be suppressed from being exported. + This avoids cluttering up the URLs with lots of unnecessary variables. + + @option base The base URL to make a link to. This will be prepended to the query string + along with a question mark (?), if the query is non-empty. so the returned + string can be used directly in a link. This is only relevant to URL export. + @author Lars Pind (lars@pinds.com) @creation-date December 7, 2000 } { @@ -825,18 +834,50 @@ } if { [llength $var_spec] > 1 } { - set exp_value($name) [uplevel subst \{[lindex $var_spec 1]\}] + set value [uplevel subst \{[lindex $var_spec 1]\}] + if { !$no_empty_p || ![empty_string_p $value] } { + set exp_value($name) $value + } } else { upvar 1 $name upvar_variable if { [info exists upvar_variable] } { if { [array exists upvar_variable] } { - set exp_value($name) [array get upvar_variable] + if { $no_empty_p } { + # If the no_empty_p flag is set, remove empty string values first + set exp_value($name) [list] + foreach { key value } [array get upvar_variable] { + if { ![empty_string_p $value] } { + lappend exp_value($name) $key $value + } + } + } else { + # If no_empty_p isn't set, just do an array get + set exp_value($name) [array get upvar_variable] + } set exp_flag($name:array) 1 } else { - set exp_value($name) $upvar_variable if { [info exists exp_flag($name:array)] } { return -code error "Variable \"$name\" is not an array" } + if { !$no_empty_p } { + set exp_value($name) $upvar_variable + } else { + # no_empty_p flag set, remove empty strings + if { [info exists exp_flag($name:multiple)] } { + # This is a list, remove empty entries + set exp_value($name) [list] + foreach elm $upvar_variable { + if { ![empty_string_p $elm] } { + lappend exp_value($name) $elm + } + } + } else { + # Simple value, this is easy + if { ![empty_string_p $upvar_variable] } { + set exp_value($name) $upvar_variable + } + } + } } } } @@ -920,6 +961,15 @@ if { $quotehtml_p } { set export_string [ad_quotehtml $export_string] } + + # Prepend with the base URL + if { [exists_and_not_null base] } { + if { ![empty_string_p $export_string] } { + set export_string "$base?$export_string" + } else { + set export_string $base + } + } return $export_string } @@ -1165,12 +1215,12 @@ @see export_vars } { - if [empty_string_p $setid] { + if { [empty_string_p $setid] } { set setid [ns_getform] } set return_list [list] - if ![empty_string_p $setid] { + if { ![empty_string_p $setid] } { set set_size [ns_set size $setid] set set_counter_i 0 while { $set_counter_i<$set_size } { @@ -1321,7 +1371,7 @@ proc with_catch {error_var body on_error} { upvar 1 $error_var $error_var global errorInfo errorCode - if [catch { uplevel $body } $error_var] { + if { [catch { uplevel $body } $error_var] } { set code [catch {uplevel $on_error} string] # Return out of the caller appropriately. if { $code == 1 } { @@ -1407,7 +1457,7 @@ @see util_get_http_status } { - if [catch { set status [util_get_http_status $url] } errmsg] { + if { [catch { set status [util_get_http_status $url] } errmsg] } { # got an error; definitely not valid return 0 } else { @@ -1433,19 +1483,19 @@ Like ns_httpopen but works for POST as well; called by util_httppost } { - if ![string match http://* $url] { + if { ![string match http://* $url] } { return -code error "Invalid url \"$url\": _httpopen only supports HTTP" } set url [split $url /] set hp [split [lindex $url 2] :] set host [lindex $hp 0] set port [lindex $hp 1] - if [string match $port ""] {set port 80} + if { [string match $port ""] } {set port 80} set uri /[join [lrange $url 3 end] /] set fds [ns_sockopen -nonblock $host $port] set rfd [lindex $fds 0] set wfd [lindex $fds 1] - if [catch { + if { [catch { _ns_http_puts $timeout $wfd "$method $uri HTTP/1.0\r" if {$rqset != ""} { for {set i 0} {$i < [ns_set size $rqset]} {incr i} { @@ -1460,11 +1510,11 @@ _ns_http_puts $timeout $wfd "Referer: $http_referer \r" } - } errMsg] { + } errMsg] } { global errorInfo #close $wfd #close $rfd - if [info exists rpset] {ns_set free $rpset} + if { [info exists rpset] } {ns_set free $rpset} return -1 } return [list $rfd $wfd ""] @@ -1487,7 +1537,7 @@ <p> @see util_http_file_upload } { - if [catch { + if { [catch { if {[incr depth] > 10} { return -code error "util_httppost: Recursive redirection: $url" } @@ -1507,7 +1557,7 @@ set rpset [ns_set new [_ns_http_gets $timeout $rfd]] while 1 { set line [_ns_http_gets $timeout $rfd] - if ![string length $line] break + if { ![string length $line] } break ns_parseheader $rpset $line } @@ -1523,12 +1573,12 @@ } } set length [ns_set iget $headers content-length] - if [string match "" $length] {set length -1} + if { [string match "" $length] } {set length -1} set err [catch { while 1 { set buf [_ns_http_read $timeout $rfd $length] append page $buf - if [string match "" $buf] break + if { [string match "" $buf] } break if {$length > 0} { incr length -[string length $buf] if {$length <= 0} break @@ -1541,7 +1591,7 @@ global errorInfo return -code error -errorinfo $errorInfo $errMsg } - } errmgs ] {return -1} + } errmgs ] } {return -1} return $page } @@ -1625,13 +1675,13 @@ close $rfd } else { set length [ns_set iget $headers content-length] - if [string match "" $length] {set length -1} + if { [string match "" $length] } {set length -1} set err [catch { while 1 { set buf [_ns_http_read $timeout $rfd $length] append page $buf - if [string match "" $buf] break + if { [string match "" $buf] } break if {$length > 0} { incr length -[string length $buf] if {$length <= 0} break @@ -2087,7 +2137,7 @@ ns_startcontent -type $content_type - if ![empty_string_p $first_part_of_page] { + if { ![empty_string_p $first_part_of_page] } { ns_write $first_part_of_page } } @@ -2519,6 +2569,7 @@ if {$use_metarefresh_p != 0} { util_ReturnMetaRefresh $url } else { + ns_log Notice "Huh? redirecting: $url" ns_returnredirect $url } } @@ -3061,7 +3112,7 @@ empty_string. } { upvar $var_name $var_name - if [info exists $var_name] { + if { [info exists $var_name] } { return [set $var_name] } } @@ -3115,7 +3166,7 @@ set tag_names [list div font] # look for a less than sign, zero or more spaces, then the tag if { ! [empty_string_p $tag_names]} { - if [regexp "< *([join $tag_names "\[ \n\t\r\f\]|"]\[ \n\t\r\f\])" [string tolower $user_submitted_html]] { + if { [regexp "< *([join $tag_names "\[ \n\t\r\f\]|"]\[ \n\t\r\f\])" [string tolower $user_submitted_html]] } { return "<p>For security reasons we do not accept the submission of any HTML containing the following tags:</p> <code>[join $tag_names " "]</code>" } @@ -3406,7 +3457,7 @@ append payload --$boundary-- \r\n - if [catch { + if { [catch { if {[incr depth -1] <= 0} { return -code error "util_http_file_upload:\ Recursive redirection: $url" @@ -3427,20 +3478,20 @@ set rpset [ns_set new [_ns_http_gets $timeout $rfd]] while 1 { set line [_ns_http_gets $timeout $rfd] - if ![string length $line] break + if { ![string length $line] } break ns_parseheader $rpset $line } set headers $rpset set response [ns_set name $headers] set status [lindex $response 1] set length [ns_set iget $headers content-length] - if [string match "" $length] { set length -1 } + if { [string match "" $length] } { set length -1 } set err [catch { while 1 { set buf [_ns_http_read $timeout $rfd $length] append page $buf - if [string match "" $buf] break + if { [string match "" $buf] } break if {$length > 0} { incr length -[string length $buf] if {$length <= 0} break @@ -3455,7 +3506,7 @@ global errorInfo return -code error -errorinfo $errorInfo $errMsg } - } errmsg] {return -1} + } errmsg] } {return -1} return $page } @@ -3471,7 +3522,6 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # - # Version 1.0 implemented Base64_Encode, Bae64_Decode # Version 2.0 uses the base64 namespace # Version 2.1 fixes various decode bugs and adds options to encode Index: openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl 17 May 2003 10:04:18 -0000 1.5 +++ openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl 28 Aug 2003 09:41:43 -0000 1.6 @@ -1,7 +1,7 @@ ad_library { UI widgets for use in forms, etc. - @cvs-id $Id$ + @cvs-id widgets-procs.tcl,v 1.4.2.1 2003/04/28 23:48:00 jong Exp } proc_doc state_widget { {default ""} {select_name "usps_abbrev"}} "Returns a state selection box" { @@ -28,7 +28,7 @@ set widget_value "<select name=\"$select_name\" $size_subtag>\n" if { $default == "" } { - if [ad_parameter SomeAmericanReadersP] { + if { [ad_parameter SomeAmericanReadersP] } { append widget_value "<option value=\"\">Choose a Country</option> <option value=\"us\" selected=\"selected\">United States</option>\n" } else { @@ -260,7 +260,7 @@ set widget_value "<select name=\"$select_name\" $size_subtag>\n" if { $default == "" } { - if [ad_parameter SomeAmericanReadersP] { + if { [ad_parameter SomeAmericanReadersP] } { append widget_value "<option value=\"\">Currency</option> <option value=\"USD\" selected=\"selected\">United States Dollar</option>\n" } else { Index: openacs-4/packages/acs-templating/acs-templating.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/acs-templating.info,v diff -u -r1.13 -r1.14 --- openacs-4/packages/acs-templating/acs-templating.info 17 May 2003 10:04:33 -0000 1.13 +++ openacs-4/packages/acs-templating/acs-templating.info 28 Aug 2003 09:41:44 -0000 1.14 @@ -7,7 +7,7 @@ <initial-install-p>t</initial-install-p> <singleton-p>t</singleton-p> - <version name="4.6.2" url="http://www.openacs.org/repository/download/apm/acs-templating-4.6.2.apm"> + <version name="4.6.4" url="http://www.openacs.org/repository/download/apm/acs-templating-4.6.4.apm"> <database-support> </database-support> <owner>Karl Goldstein</owner> @@ -19,13 +19,15 @@ template system provides a way to use a single layout specification for many physical pages, so the overall layout of a site can be more easily administered.</description> - <provides url="acs-templating" version="4.6.2"/> + <provides url="acs-templating" version="4.6.4"/> <requires url="acs-kernel" version="4.6.2"/> <callbacks> </callbacks> <parameters> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultFormStyle" default="standard" description="The default form template to use if none is defined"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultFormStyle" default="standard-lars" description="The default form template to use if a particular form does not explicitly specify the form style to use."/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultListStyle" default="table" description="The default list template to use if a particular list does not explicitly specify the list style to use."/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultListFilterStyle" default="filters" description="The default list filter template to use if a particular listfilter tag does not explicitly specify the list filter style to use."/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="ShowDataDictionariesP" default="0" description="Offer data dictionaries on .dat/.fmt URL."/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="ShowCompiledTemplatesP" default="0" description="Show thecompiled template (for debugging) at .cmp URL"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="RefreshCache" default="as needed" description="When to re-translate templates. Speical values: "/> Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-templating/resources/forms/configuration.adp'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-templating/resources/forms/standard-lars.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/resources/forms/Attic/standard-lars.adp,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-templating/resources/forms/standard-lars.adp 23 Aug 2003 00:25:27 -0000 1.12 +++ openacs-4/packages/acs-templating/resources/forms/standard-lars.adp 28 Aug 2003 09:41:45 -0000 1.13 @@ -38,18 +38,18 @@ <if @elements.label@ not nil> <noparse> <if \@formerror.@elements.id@\@ not nil> - <td bgcolor="#ffaaaa" width="120"> + <td bgcolor="#ffaaaa" width="120" align="right" style="padding-left: 4px; padding-right: 12px;"> </if> <else> - <td bgcolor="#ddddff" width="120"> + <td bgcolor="#e0e0f9" width="120" align="right" style="padding-left: 4px; padding-right: 12px;"> </else> </noparse> - <b> - <font face="tahoma,verdana,arial,helvetica,sans-serif" size="-1"> - @elements.label;noquote@ - </font> - </b> - + <font face="tahoma,verdana,arial,helvetica,sans-serif" size="-1"> + @elements.label;noquote@ + <if @form_properties.show_required_p@ true> + <if @elements.optional@ nil and @elements.mode@ ne "display" and @elements.widget@ ne "inform" and @elements.widget@ ne "select"><font color="red">*</font></if> + </if> + </font> </td> </if> <else> @@ -60,7 +60,7 @@ <noparse> <if \@formerror.@elements.id@\@ not nil> - <td style="border: 2px solid red;"> + <td style="border: 1px dotted red;"> </if> <else> <td> @@ -97,19 +97,16 @@ <noparse> <formerror id="@elements.id@"> <br> - <font face="tahoma,verdana,arial,helvetica,sans-serif" color="red"> - <b>\@formerror.@elements.id@;noquote\@<b> - </font> + <span style="font-family: tahoma,verdana,arial,helvetica,sans-serif; color: red; font-size: 100%;"> + \@formerror.@elements.id@;noquote\@ + </span> </formerror> </noparse> <if @elements.help_text@ not nil> - <p style="margin-top: 4px; margin-bottom: 2px;"> - <font face="tahoma,verdana,arial,helvetica,sans-serif" size="-1"> - <noparse> - <i><formhelp id="@elements.id@"></i> - </noparse> - </font> + <p style="margin-top: 4px; margin-bottom: 2px; color: #666666; font-family: tahoma,verdana,arial,helvetica,sans-serif; font-size: 75%;"> + <img src="/shared/images/info.gif" width="12" height="9" alt="[i]" title="Help text" border="0"> + <noparse><formhelp id="@elements.id@"></noparse> </p> </if> Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-templating/resources/lists/filters.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-templating/resources/lists/inline-filters.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-templating/resources/lists/list.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-templating/resources/lists/table.adp'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-templating/tcl/0-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/Attic/0-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-templating/tcl/0-procs.tcl 17 May 2003 10:05:27 -0000 1.11 +++ openacs-4/packages/acs-templating/tcl/0-procs.tcl 28 Aug 2003 09:41:45 -0000 1.12 @@ -53,7 +53,7 @@ # default settings variable defaults - set defaults [list method post section {} mode edit edit_buttons { { "OK" ok } } display_buttons { { "Edit" edit } }] + set defaults [list method post section {} mode edit edit_buttons { { "OK" ok } } display_buttons { { "Edit" edit } } show_required_p t] } namespace eval wizard { Index: openacs-4/packages/acs-templating/tcl/date-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/date-procs.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/acs-templating/tcl/date-procs.tcl 17 May 2003 10:05:27 -0000 1.18 +++ openacs-4/packages/acs-templating/tcl/date-procs.tcl 28 Aug 2003 09:41:45 -0000 1.19 @@ -716,10 +716,11 @@ # Create an html fragment to display a numeric range widget # interval_def is in form { start stop interval } -ad_proc -public template::widget::numericRange { name interval_def size {value ""} } { +ad_proc -public template::widget::numericRange { name interval_def size {value ""} {tag_attributes {}} } { Create an html fragment to display a numeric range widget interval_def is in form { start stop interval } } { + array set attributes $tag_attributes set options [list [list "--" {}]] @@ -729,11 +730,11 @@ lappend options [list [template::util::leadingPad $i $size] $i] } - return [template::widget::menu $name $options [list $value] {}] + return [template::widget::menu $name $options [list $value] attributes] } ad_proc -public template::widget::dateFragment { - element_reference fragment size type value {mode edit} } { + element_reference fragment size type value {mode edit} {tag_attributes {}} } { Create an input widget for the given date fragment If type is "t", uses a text widget for the fragment, with the given size. @@ -758,24 +759,35 @@ # Display text entry for some elements, or if the type is text if { [string equal $type t] || [regexp "year|short_year" $fragment] } { - return "<input type=\"text\" name=\"$element(name).$fragment\" size=\"$size\" - maxlength=\"$size\" value=\"[template::util::leadingPad $value $size]\"/>\n" + set output "<input type=\"text\" name=\"$element(name).$fragment\" size=\"$size\"" + append output " maxlength=\"$size\" value=\"[template::util::leadingPad $value $size]\"" + array set attributes $tag_attributes + foreach attribute_name [array names attributes] { + if { [string equal $attributes($attribute_name) {}] } { + append output " $attribute_name" + } else { + append output " $attribute_name=\"$attributes($attribute_name)\"" + } + } + append output "/>\n" + return $output } else { - # Use a default range for others + # Use a default range for others set interval [template::util::date::defaultInterval $fragment] } - } + } return [template::widget::numericRange "$element(name).$fragment" \ - $interval $size $value] + $interval $size $value $tag_attributes] } } ad_proc -public template::widget::ampmFragment { - element_reference fragment size type value {mode edit} } { + element_reference fragment size type value {mode edit} {tag_attributes {}} } { Create a widget that shows the am/pm selection } { upvar $element_reference element + array set attributes $tag_attributes set value [template::util::date::get_property $fragment $value] @@ -786,18 +798,19 @@ return $output } else { return [template::widget::menu \ - "$element(name).$fragment" { {A.M. am} {P.M. pm}} $value {}] + "$element(name).$fragment" { {A.M. am} {P.M. pm}} $value attributes] } } ad_proc -public template::widget::monthFragment { - element_reference fragment size type value {mode edit} } { + element_reference fragment size type value {mode edit} {tag_attributes {}} } { Create a month entry widget with short or long month names } { variable ::template::util::date::month_data upvar $element_reference element + array set attributes $tag_attributes set value [template::util::date::get_property $fragment $value] @@ -815,7 +828,7 @@ } return [template::widget::menu \ - "$element(name).$fragment" $options $value {} ] + "$element(name).$fragment" $options $value attributes] } } @@ -916,14 +929,15 @@ # Output the widget set fragment_def $template::util::date::fragment_widgets([string toupper $token]) set fragment [lindex $fragment_def 1] - + append output [template::widget::[lindex $fragment_def 0] \ element \ $fragment \ [lindex $fragment_def 2] \ $type \ $value \ - $element(mode)] + $element(mode) \ + [array get attributes]] # Output the separator if { [string equal $sep " "] } { Index: openacs-4/packages/acs-templating/tcl/form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/form-procs.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/acs-templating/tcl/form-procs.tcl 22 Aug 2003 10:11:34 -0000 1.13 +++ openacs-4/packages/acs-templating/tcl/form-procs.tcl 28 Aug 2003 09:41:45 -0000 1.14 @@ -105,6 +105,9 @@ @option elements A block of element specifications. + @option show_required_p Should the form template show which elements are required. + Use 1 or t for true, 0 or f for false. Defaults to true. + @see template::form::get_button @see template::form::get_action @@ -350,9 +353,12 @@ if { [string equal $style {}] } { set style [parameter::get \ - -package_id [apm_package_id_from_key "acs-templating"] \ + -package_id [ad_conn subsite_id] \ -parameter DefaultFormStyle \ - -default "standard"] + -default [parameter::get \ + -package_id [apm_package_id_from_key "acs-templating"] \ + -parameter DefaultFormStyle \ + -default "standard-lars"]] } set file_stub [template::get_resource_path]/forms/$style @@ -440,19 +446,17 @@ # make a reference to the formerror array with any validation messages upvar #$level $id:error $id:error + # Clear the formerror array if it has + # been set by another form on the same page + upvar #$level formerror formerror + if { [info exists formerror] } { unset formerror } + if { [info exists $id:error] } { uplevel #$level "upvar 0 $id:error formerror" # There were errors on the form, force edit mode set properties(mode) edit - - } else { - - # no errors on this form. Clear the formerror array if it has - # been set by another form on the same page - upvar #$level formerror formerror - if { [info exists formerror] } { unset formerror } } # Propagate form mode to all form elements @@ -468,6 +472,17 @@ } } + # Check for errors in hidden elements + foreach element_ref $elements { + + # get a reference by element ID + upvar #$level $element_ref element + + if { [string equal $element(widget) "hidden"] && [exists_and_not_null $id:error($element(id))] } { + error "Validation error in hidden form element: '[set $id:error($element(id))]' on element '$element(id)'." + } + } + # get any additional attributes developer specified to include in form tag if { [info exists properties(html)] } { array set attributes $properties(html) Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-templating/tcl/list-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-templating/tcl/paginator-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/paginator-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-templating/tcl/paginator-procs.tcl 17 May 2003 10:05:27 -0000 1.11 +++ openacs-4/packages/acs-templating/tcl/paginator-procs.tcl 28 Aug 2003 09:41:45 -0000 1.12 @@ -16,19 +16,21 @@ @see template::paginator @see template::paginator::create @see template::paginator::get_context - @see template::paginator::get_data + @see template::paginator::get_data + @see template::paginator::get_query @see template::paginator::get_display_info @see template::paginator::get_group @see template::paginator::get_group_count @see template::paginator::get_groups @see template::paginator::get_page @see template::paginator::get_page_count @see template::paginator::get_pages - @see template::paginator::get_pages_info + @see template::paginator::get_pages_info @see template::paginator::get_row @see template::paginator::get_row_count @see template::paginator::get_row_ids @see template::paginator::get_row_last + @see template::paginator::reset } { eval paginator::$command $args } @@ -46,7 +48,7 @@ the results. Bind variables may be used. @option timeout The lifetime of a query result in seconds, after which - the query must be refreshed. + the query must be refreshed (if not reset). @option pagesize The number of rows to display on a single page. @@ -80,8 +82,57 @@ set cache_key $name:$query set row_ids [cache get $cache_key:row_ids] - if { [string equal $row_ids {}] } { - init $statement_name $name $query + if { ([string equal $row_ids {}] && ![nsv_exists __template_cache_timeout $cache_key]) || ([info exists opts(flush_p)] && [string equal $opts(flush_p) "t"]) } { + if { [info exists opts(printing_prefs)] && ![empty_string_p $opts(printing_prefs)] } { + ReturnHeadersNoCache "text/html" + ns_write " +<html> +<head>" + set title [lindex $opts(printing_prefs) 0] + ns_write "<title>$title</title> + <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">" + set stylesheet [lindex $opts(printing_prefs) 1] + if { ![empty_string_p $stylesheet] } { + ns_write "<link rel=\"stylesheet\" href=\"$stylesheet\" type=\"text/css\">" + } + ns_write "</head>" + ns_write "<body " + set background [lindex $opts(printing_prefs) 2] + if { ![empty_string_p $background] } { + ns_write "background=\"$background\"" + } + ns_write ">" + set header_file [lindex $opts(printing_prefs) 3] + if { ![empty_string_p $header_file] } { + ns_write [ns_adp_parse -file $header_file] + } + ns_write [lindex $opts(printing_prefs) 6] + init $statement_name $name $query 1 + ns_write [lindex $opts(printing_prefs) 7] + set footer_file [lindex $opts(printing_prefs) 4] + if { ![empty_string_p $footer_file] } { + ns_write [ns_adp_parse -file $footer_file] + } + set return_url [lindex $opts(printing_prefs) 5] + if { ![empty_string_p $return_url] } { + if { [llength $opts(row_ids)]==0 } { + nsv_set __template_cache_timeout $cache_key $opts(timeout) + } + ns_write " + <SCRIPT LANGUAGE=\"JavaScript\"> + <!-- Begin + document.location.href=\"$return_url\"; + // End --> + </script> + <noscript> + <a href=\"$return_url\">Click here to Continue</a> + </noscript>" + } + ns_write [ad_footer] + ad_script_abort + } else { + init $statement_name $name $query + } } else { set opts(row_ids) $row_ids set opts(context_ids) [cache get $cache_key:context_ids] @@ -92,21 +143,55 @@ set opts(group_count) [get_group $name $opts(page_count)] } -ad_proc -private template::paginator::init { statement_name name query } { +ad_proc -private template::paginator::init { statement_name name query {print_p 0} } { Initialize a paginated query. Only called by create. } { get_reference # query for an ordered list of all row identifiers to cache # perform the query in the calling scope so bind variables have effect - upvar 3 __paginator_ids ids + upvar 2 __paginator_ids ids + set ids [list] if { [info exists properties(contextual)] } { # query contains two columns, one for ID and one for context cue - uplevel 3 "set __paginator_ids \[db_list_of_lists $statement_name \"$query\"\]" + uplevel 2 " + set full_statement_name \[db_qd_get_fullname $statement_name\] + + # Can't use db_foreach here, since we need to use the ns_set directly. + db_with_handle db { + set selection \[db_exec select \$db \$full_statement_name {$query}\] + + set __paginator_ids \[list\] + set total_so_far 1 + + while { \[db_getrow \$db \$selection\] } { + set this_result \[list\] + for { set i 0 } { \$i < \[ns_set size \$selection\] } { incr i } { + lappend this_result \[ns_set value \$selection \$i\] + } + if { $print_p } { + if { \$total_so_far % 250 == 0 } { + ns_write \"…\$total_so_far \" + } + if { \$total_so_far % 3000 == 0 } { + ns_write \"<br>\" + } + } + incr total_so_far + lappend __paginator_ids \$this_result + } + + if { $print_p } { + ns_write \"…\[expr \$total_so_far - 1\]\" + } + + } + " + set i 0 set page_size $properties(pagesize) set context_ids [list] @@ -120,7 +205,7 @@ } incr i } - + set properties(context_ids) $context_ids cache set $name:$query:context_ids $context_ids $properties(timeout) @@ -130,14 +215,41 @@ } set properties(row_ids) $row_ids + cache set $name:$query:row_ids $row_ids $properties(timeout) - } else { - # no extra column specified for paging by contextual cues - uplevel 3 "set __paginator_ids \[db_list $statement_name \"$query\"\]" + uplevel 2 " + # Can't use db_foreach here, since we need to use the ns_set directly. + db_with_handle db { + set selection \[db_exec select \$db $statement_name \"$query\"\] + set __paginator_ids \[list\] + set total_so_far 1 + + while { \[db_getrow \$db \$selection\] } { + set this_result \[list\] + for { set i 0 } { \$i < \[ns_set size \$selection\] } { incr i } { + lappend this_result \[ns_set value \$selection \$i\] + } + if { $print_p } { + if { \$total_so_far % 250 == 0 } { + ns_write \"...\$total_so_far \" + } + if { \$total_so_far % 3000 == 0 } { + ns_write \"<br>\" + } + } + incr total_so_far + lappend __paginator_ids \$this_result + } + if { $print_p } { + ns_write \"...\[expr \$total_so_far - 1\]\" + } + } + " + set properties(row_ids) $ids cache set $name:$query:row_ids $ids $properties(timeout) } @@ -243,6 +355,19 @@ return $ids } +ad_proc -public template::paginator::get_all_row_ids { name } { + Gets a list of IDs in the master ID list + generated by the initial query submitted for pagination. IDs are + typically primary key values. + + @param name The reference to the paginator object. + + @return A Tcl list of row identifiers. +} { + get_reference + return $properties(row_ids) +} + ad_proc -public template::paginator::get_pages { name group } { Gets a list of pages in a group, truncating if appropriate at the end. @@ -268,7 +393,7 @@ set start [expr ($group - 1) * $group_size + 1] set end [expr $start + $group_size] - if { $end > $page_count } { set end $page_count } + if { $end > $page_count } { set end [expr $page_count] } set pages [list] @@ -344,6 +469,9 @@ upvar 2 $datasource:rowcount rowcount set rowcount 0 + upvar 2 $datasource:columns columns + set columns { page context } + foreach page $pages { incr rowcount @@ -376,6 +504,9 @@ upvar 2 $datasource:rowcount rowcount set rowcount 0 + upvar 2 $datasource:columns columns + set columns { page } + foreach page $pages { incr rowcount @@ -458,10 +589,28 @@ get_reference upvar 2 $datasource info + if { $page > $properties(page_count) } { + set page $properties(page_count) + } + + set group [get_group $name $page] + set groupsize $properties(groupsize) + set info(page_count) $properties(page_count) + set info(group_count) $properties(group_count) + set info(current_page) $page + set info(current_group) $group - array set info [list next_page {} previous_page {} \ - next_group {} previous_group {}] + array set info { + next_page {} + previous_page {} + next_group {} + previous_group {} + next_page_context {} + previous_page_context {} + next_group_context {} + previous_group_context {} + } if { $page > 1 } { set info(previous_page) [expr $page - 1] @@ -471,8 +620,6 @@ set info(next_page) [expr $page + 1] } - set group [get_group $name $page] - set groupsize $properties(groupsize) if { $group > 1 } { set info(previous_group) [expr ($group - 2) * $groupsize + 1] @@ -481,6 +628,15 @@ if { $group < $properties(group_count) } { set info(next_group) [expr $group * $groupsize + 1] } + + # If the paginator is contextual, set the context + if { [info exists properties(context_ids)] } { + foreach elm { next_page previous_page next_group previous_group } { + if { [exists_and_not_null info($elm)] } { + set info(${elm}_context) [lindex $properties(context_ids) [expr $info($elm) -1]] + } + } + } } ad_proc -public template::paginator::get_data { statement_name name datasource query id_column page } { @@ -505,7 +661,9 @@ template::util::list_to_lookup $ids row_order # substitute the current page set - set query [uplevel 2 "db_map ${statement_name}_partial"] + if { [empty_string_p $query] } { + set query [uplevel 2 "db_map ${statement_name}_partial"] + } # DEDS: quote the ids so that we are not # necessarily limited to integer keys @@ -558,6 +716,57 @@ } +ad_proc -public template::paginator::get_query { name id_column page } { + Returns a query with the data for the rows on the current page. + + @param name The reference to the paginator object. + @param query The query to execute, containing IN (CURRENT_PAGE_SET). + @param id_column The name of the ID column in the display query (required + to order rows properly). +} { + set ids [get_row_ids $name $page] + + if { ![empty_string_p $ids] } { + # calculate the base row number for the page + upvar 2 __page_firstrow firstrow + set firstrow [get_row $name $page] + + # build a hash of row order to order the rows on the page + upvar 2 __page_order row_order + template::util::list_to_lookup $ids row_order + + set query "CURRENT_PAGE_SET" + + # DEDS: quote the ids so that we are not + # necessarily limited to integer keys + set quoted_ids [list] + foreach one_id $ids { + lappend quoted_ids "'[DoubleApos $one_id]'" + } + set in_list [join $quoted_ids ","] + if { ! [regsub CURRENT_PAGE_SET $query $in_list query] } { + error "Token CURRENT_PAGE_SET not found." + } + + if { [llength $in_list] == 0 } { + uplevel 2 "set $datasource:rowcount 0" + return + } + + # Return the query with CURRENT_PAGE_SET slugged + return $query + } else { + return "null" + } +} + +ad_proc -public template::paginator::reset { name query } { + Resets the cache for a query. +} { + cache flush $name:$query:context_ids + cache flush $name:$query:row_ids +} + ad_proc -private template::paginator::get_reference {} { Get a reference to the paginator properties (internal helper) } { Index: openacs-4/packages/acs-templating/tcl/query-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/query-procs.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/acs-templating/tcl/query-procs.tcl 17 May 2003 10:05:27 -0000 1.13 +++ openacs-4/packages/acs-templating/tcl/query-procs.tcl 28 Aug 2003 09:41:45 -0000 1.14 @@ -673,7 +673,7 @@ } extend { - upvar $name:columns columns + upvar $multirow_level_up $name:columns columns foreach column_name $args { lappend columns $column_name } Index: openacs-4/packages/acs-templating/tcl/tag-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/tag-init.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/acs-templating/tcl/tag-init.tcl 17 May 2003 10:05:27 -0000 1.10 +++ openacs-4/packages/acs-templating/tcl/tag-init.tcl 28 Aug 2003 09:41:45 -0000 1.11 @@ -218,7 +218,7 @@ set ${name}(groupnum_last_p) 1 } else { upvar 0 ${name}:\[expr \$$i + 1\] $name:next - set ${name}(groupnum_last_p) \[expr !\[string equal \${${name}:next($column)} \$${name}($column)\]\] + set ${name}(groupnum_last_p) \[expr !\[string equal \[set \"${name}:next(${column})\"\] \$${name}($column)\]\] } " @@ -231,7 +231,7 @@ break } upvar 0 ${name}:\[expr \$$i + 1\] $name:next - if { !\[string equal \${${name}:next($column)} \$${name}($column)\] } { + if { !\[string equal \[set \"${name}:next(${column})\"\] \$${name}(${column})\] } { break } incr $i Index: openacs-4/packages/acs-templating/tcl/tag-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/tag-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-templating/tcl/tag-procs.tcl 23 Aug 2003 00:26:26 -0000 1.8 +++ openacs-4/packages/acs-templating/tcl/tag-procs.tcl 28 Aug 2003 09:41:45 -0000 1.9 @@ -156,11 +156,16 @@ } nil { - # substitute array variables - regsub {^"@([a-zA-z0-9_]+)\.([a-zA-z0-9_]+)@"$} $arg1 {\1(\2)} arg1 - # substitute regular variables - regsub {^"@([a-zA-z0-9_:]+)@"$} $arg1 {\1} arg1 - append condition "\[template::util::is_nil $arg1\]" + if { [string first @ $arg1] == -1 } { + # We're assuming this is a static string, not a variable + append condition "\[empty_string_p $arg1\]" + } else { + # substitute array variables + regsub {^"@([a-zA-z0-9_]+)\.([a-zA-z0-9_]+)@"$} $arg1 {\1(\2)} arg1 + # substitute regular variables + regsub {^"@([a-zA-z0-9_:]+)@"$} $arg1 {\1} arg1 + append condition "\[template::util::is_nil $arg1\]" + } set next $i } Index: openacs-4/packages/acs-templating/tcl/widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/widget-procs.tcl,v diff -u -r1.20 -r1.21 --- openacs-4/packages/acs-templating/tcl/widget-procs.tcl 19 May 2003 12:30:32 -0000 1.20 +++ openacs-4/packages/acs-templating/tcl/widget-procs.tcl 28 Aug 2003 09:41:45 -0000 1.21 @@ -30,6 +30,7 @@ @see template::widget::numericRange @see template::widget::password @see template::widget::radio + @see template::util::richtext @see template::widget::search @see template::widget::select @see template::widget::submit @@ -239,6 +240,21 @@ return [input submit element $tag_attributes] } +ad_proc -public template::widget::attachment { element_reference tag_attributes } { + + upvar $element_reference element + + set output [input file element $tag_attributes] + + set element(name) $element(attach_name) + set element(label) $element(attach_label) + set element(html) $element(attach_html) + + append output [submit element $tag_attributes] + + return $output +} + ad_proc -public template::widget::checkbox { element_reference tag_attributes } { upvar $element_reference element @@ -378,7 +394,9 @@ if { [string equal $value {}] } { return [list] } if { [string equal $value ":search:"] } { - unset element(options) + if { [info exists element(options)] } { + unset element(options) + } template::element::set_error $element(form_id) $element_id " Please enter a search string." return [list] @@ -402,7 +420,9 @@ # no search results so return text entry back to the user - unset element(options) + if { [info exists element(options)] } { + unset element(options) + } template::element::set_error $element(form_id) $element_id " No matches were found for \"$value\".<br>Please Index: openacs-4/packages/attachments/catalog/attachments.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/catalog/attachments.en_US.ISO-8859-1.xml,v diff -u -r1.8 -r1.9 --- openacs-4/packages/attachments/catalog/attachments.en_US.ISO-8859-1.xml 24 Jun 2003 12:01:29 -0000 1.8 +++ openacs-4/packages/attachments/catalog/attachments.en_US.ISO-8859-1.xml 28 Aug 2003 09:41:45 -0000 1.9 @@ -19,7 +19,7 @@ <msg key="lt_contentscontent_size__1">%contents.content_size% byte</msg> <msg key="lt_Created_by_the_attach">Created by the attachments packge</msg> <msg key="lt_document_to_pretty_ob">document to %pretty_object_name%.</msg> - <msg key="lt_dont_know_how_to_deal">don't know how to deal with this attachment type</msg> + <msg key="lt_dont_know_how_to_deal">Don't know how to deal with attachment type %content_type%</msg> <msg key="lt_Error_Attachment_root">Error: Attachment root folder and fs root folder different!</msg> <msg key="lt_Error_empty_folder_id">Error: empty folder_id!</msg> <msg key="lt_Folder_folder_name_is">Folder %folder_name% is empty</msg> Index: openacs-4/packages/attachments/tcl/attachments-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/tcl/Attic/attachments-procs-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/attachments/tcl/attachments-procs-oracle.xql 30 Aug 2002 14:44:08 -0000 1.2 +++ openacs-4/packages/attachments/tcl/attachments-procs-oracle.xql 28 Aug 2003 09:41:46 -0000 1.3 @@ -4,8 +4,7 @@ <fullquery name="attachments::get_attachments.select_attachments"> <querytext> - select item_id, - acs_object.name(item_id) + select item_id from attachments where object_id = :object_id and approved_p = 't' @@ -15,7 +14,6 @@ <fullquery name="attachments::get_all_attachments.select_attachments"> <querytext> select item_id, - acs_object.name(item_id), approved_p from attachments where object_id = :object_id Index: openacs-4/packages/attachments/tcl/attachments-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/tcl/attachments-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/attachments/tcl/attachments-procs.tcl 7 Nov 2002 15:11:49 -0000 1.10 +++ openacs-4/packages/attachments/tcl/attachments-procs.tcl 28 Aug 2003 09:41:46 -0000 1.11 @@ -144,9 +144,14 @@ set lst [db_list_of_lists select_attachments {}] set lst_with_urls [list] - foreach el $lst { - set append_lst [list [goto_attachment_url -object_id $object_id -attachment_id [lindex $el 0] -base_url $base_url]] - lappend lst_with_urls [concat $el $append_lst] + foreach item_id $lst { + if { [content_extlink::extlink_p -item_id $item_id] } { + set label [content_extlink::extlink_name -item_id $item_id] + } else { + set label [fs::get_object_name -object_id $item_id] + } + set append_lst [list [goto_attachment_url -object_id $object_id -attachment_id $item_id -base_url $base_url]] + lappend lst_with_urls [concat [list $item_id $label] $append_lst] } return $lst_with_urls @@ -161,9 +166,14 @@ set lst [db_list_of_lists select_attachments {}] set lst_with_urls [list] - foreach el $lst { - set append_lst [list [goto_attachment_url -object_id $object_id -attachment_id [lindex $el 0] -base_url $base_url]] - lappend lst_with_urls [concat $el $append_lst] + foreach item_id $lst { + if { [content_extlink::extlink_p -item_id $item_id] } { + set label [content_extlink::extlink_name -item_id $item_id] + } else { + set label [fs::get_object_name -object_id $item_id] + } + set append_lst [list [goto_attachment_url -object_id $object_id -attachment_id $item_id -base_url $base_url]] + lappend lst_with_urls [concat [list $item_id $label] $append_lst] } return $lst_with_urls Index: openacs-4/packages/attachments/www/go-to-attachment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/go-to-attachment.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/attachments/www/go-to-attachment.tcl 17 May 2003 10:13:01 -0000 1.5 +++ openacs-4/packages/attachments/www/go-to-attachment.tcl 28 Aug 2003 09:41:46 -0000 1.6 @@ -12,27 +12,28 @@ permission::require_permission -object_id $object_id -privilege read # Get information about attachment -if {![db_0or1row select_attachment_data {}]} { - ad_return_complaint "[_ attachments.lt_No_such_attachment_fo]" +set content_type [item::get_type $attachment_id] +if { [string length $content_type] == 0 } { + ad_return_complaint 1 [_ attachments.lt_No_such_attachment_fo] return } -switch $object_type { +switch $content_type { content_extlink { ad_returnredirect [db_string select_url {}] ad_script_abort return } - content_item { + file_storage_object { set title [db_string select_attachment_title {}] ad_returnredirect "download/[ad_urlencode $title]?object_id=$object_id&attachment_id=$attachment_id" ad_script_abort return } default { - ad_return_complaint "[_ attachments.lt_dont_know_how_to_deal]" + ad_return_complaint 1 [_ attachments.lt_dont_know_how_to_deal [list content_type $content_type]] return } } Index: openacs-4/packages/attachments/www/go-to-attachment.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/go-to-attachment.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/attachments/www/go-to-attachment.xql 17 May 2003 10:13:02 -0000 1.3 +++ openacs-4/packages/attachments/www/go-to-attachment.xql 28 Aug 2003 09:41:46 -0000 1.4 @@ -1,17 +1,6 @@ <?xml version="1.0"?> <queryset> -<fullquery name="select_attachment_data"> - <querytext> - select object_type - from attachments, acs_objects - where - attachments.object_id = :object_id and - attachments.item_id = :attachment_id and - attachments.item_id = acs_objects.object_id - </querytext> -</fullquery> - <fullquery name="select_url"> <querytext> select url Index: openacs-4/packages/attachments/www/simple-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/simple-add-2.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/attachments/www/simple-add-2.tcl 17 May 2003 10:13:02 -0000 1.3 +++ openacs-4/packages/attachments/www/simple-add-2.tcl 28 Aug 2003 09:41:46 -0000 1.4 @@ -24,11 +24,13 @@ ad_require_permission $folder_id write db_transaction { - - # Create and attach the URL - attachments::attach -object_id $object_id \ - -attachment_id [content_simple::new -url $url -label $title -description $description -parent_id $folder_id] + # Create the URL (for now) + set url_id [content_extlink::new -url $url -label $title -description $description -parent_id $folder_id] + + # Attach the URL + attachments::attach -object_id $object_id -attachment_id $url_id + } ad_returnredirect "$return_url" Index: openacs-4/packages/bug-tracker/bug-tracker.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/bug-tracker.info,v diff -u -r1.12 -r1.13 --- openacs-4/packages/bug-tracker/bug-tracker.info 14 Apr 2003 13:33:29 -0000 1.12 +++ openacs-4/packages/bug-tracker/bug-tracker.info 28 Aug 2003 09:45:29 -0000 1.13 @@ -7,18 +7,22 @@ <initial-install-p>f</initial-install-p> <singleton-p>f</singleton-p> - <version name="1.2d6" url="http://openacs.org/repository/download/apm/bug-tracker-1.2d6.apm"> + <version name="1.2d11" url="http://openacs.org/repository/download/apm/bug-tracker-1.2d11.apm"> + <database-support> + <database>postgresql</database> + <database>oracle</database> + </database-support> <owner url="mailto:lars@collaboraid.biz">Lars Pind</owner> <summary>Tracks bugs and features, versions and maintainers, in software projects. Contains the best of SDM, Bugzilla, FogBUGZ, and bughost.com.</summary> <release-date>2003-02-28</release-date> <vendor url="http://www.museatech.net">Musea Technologies</vendor> - <provides url="bug-tracker" version="1.2d6"/> + <provides url="bug-tracker" version="1.2d11"/> <requires url="acs-content-repository" version="4.6d1"/> - <requires url="acs-kernel" version="4.6.2d"/> + <requires url="acs-kernel" version="4.6.2"/> <requires url="acs-tcl" version="4.6.2d"/> <requires url="notifications" version="0.2d"/> - <requires url="workflow" version="0.2d2"/> + <requires url="workflow" version="1.0d4"/> <callbacks> <callback type="after-install" proc="bug_tracker::install::package_install"/> @@ -27,6 +31,7 @@ <callback type="before-uninstantiate" proc="bug_tracker::install::package_uninstantiate"/> <callback type="before-upgrade" proc="bug_tracker::install::package_upgrade"/> </callbacks> + <parameters> <parameter datatype="string" min_n_values="1" max_n_values="1" name="ComponentPrettyName" default="component" description="Pretty name of a component/area/module, e.g. 'area'. Use the capitalization that you would use in the middle of a sentence."/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="ComponentPrettyPlural" default="components" description="Plural pretty name of a component/area/module, e.g. 'area'. Use the capitalization that you would use in the middle of a sentence."/> Index: openacs-4/packages/bug-tracker/lib/master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/lib/master.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/bug-tracker/lib/master.adp 22 May 2003 14:23:42 -0000 1.5 +++ openacs-4/packages/bug-tracker/lib/master.adp 28 Aug 2003 09:45:29 -0000 1.6 @@ -1,10 +1,13 @@ <master> -<property name="title">@title;noquote@</property> +<property name="title">@title@</property> <property name="header_stuff"> <style> a.bt_navbar { color: white; } + a.bt_navbar:visited { + color: white; + } a.bt_navbar:hover { color: white; text-decoration: underline; @@ -102,23 +105,23 @@ } </style> </property> -<if @signatory;noquote@ not nil><property name="signatory">@signatory;noquote@</property></if> -<if @focus;noquote@ not nil><property name="focus">@focus;noquote@</property></if> +<if @signatory@ not nil><property name="signatory">@signatory@</property></if> +<if @focus@ not nil><property name="focus">@focus@</property></if> <property name="body_start_include">/packages/bug-tracker/lib/version-bar</property> <if @context_bar@ not nil> - <property name="context_bar">@context_bar;noquote@</property> + <property name="context_bar">@context_bar@</property> </if> <if @context@ not nil> - <property name="context">@context;noquote@</property> + <property name="context">@context@</property> </if> -<include src="nav-bar" notification_link="@notification_link;noquote@"> +<include src="nav-bar" notification_link="@notification_link@"> <p> <slave> <p> -<include src="nav-bar" notification_link="@notification_link;noquote@"> +<include src="nav-bar" notification_link="@notification_link@"> Index: openacs-4/packages/bug-tracker/lib/nav-bar.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/lib/nav-bar.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bug-tracker/lib/nav-bar.adp 11 Sep 2002 14:03:20 -0000 1.2 +++ openacs-4/packages/bug-tracker/lib/nav-bar.adp 28 Aug 2003 09:45:29 -0000 1.3 @@ -17,7 +17,7 @@ <multiple name="links"> <a href="@links.url@" class="bt_navbar">@links.name@</a><span class="bt_navbar"> | </span> </multiple> - <input name="bug_number" type="text" size="5" class="bt_navbar" value="Bug #" + <input name="bug_number" type="text" size="5" class="bt_navbar" value="@pretty_names.Bug@ #" onFocus="javascript:document.navbar_form_@bt_nav_bar_count@.bug_number.value='';"> <input type="submit" value="Go" class="bt_navbar"> </td> Index: openacs-4/packages/bug-tracker/lib/nav-bar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/lib/nav-bar.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/bug-tracker/lib/nav-bar.tcl 5 Mar 2003 17:39:52 -0000 1.6 +++ openacs-4/packages/bug-tracker/lib/nav-bar.tcl 28 Aug 2003 09:45:29 -0000 1.7 @@ -14,6 +14,8 @@ set admin_p [permission::permission_p -object_id $package_id -privilege admin] set create_p [expr { [ad_conn user_id] == 0 || [permission::permission_p -object_id [ad_conn package_id] -privilege create] }] +bug_tracker::get_pretty_names -array pretty_names + set notification_url [lindex $notification_link 0] set notification_label [lindex $notification_link 1] set notification_title [lindex $notification_link 2] Index: openacs-4/packages/bug-tracker/lib/version-bar.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/lib/version-bar.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bug-tracker/lib/version-bar.adp 5 Mar 2003 17:39:52 -0000 1.2 +++ openacs-4/packages/bug-tracker/lib/version-bar.adp 28 Aug 2003 09:45:29 -0000 1.3 @@ -1,29 +1,20 @@ -<table border=0" cellspacing="0" cellpadding="4" bgcolor="#41329c" align="right"> - <tr> - <td align="center"> - <if @user_id@ ne 0><span class="bt_navbar">@user_first_names@ @user_last_name@</span></if> - <else><span class="bt_navbar">Not logged in (</span><a href="@login_url@" class="bt_navbar">log in</a><span class="bt_navbar">)</span></else> - </td> - </tr> - <if @versions_p@ true> - <tr> - <td align="center"> - <span class="bt_navbar"> - <if @user_id@ ne 0> - Your version: </span><a href="@user_version_url@" class="bt_navbar">@user_version_name@</a><span class="bt_navbar"> - <if @user_version_id@ ne @current_version_id@> - | Current: @current_version_name@ - </if> - <else> - (current) - </else> - </if> - <else> - Current version: @current_version_name@ - </else> - </span> - </td> - </tr> - </if> -</table> +<if @versions_p@ true> + <div class="bt_navbar" style="clear: right; float: right; padding: 4px; background-color: #41329c; text-align: center;"> + <if @user_id@ ne 0> + Your version: <a href="@user_version_url@" class="bt_navbar" style="font-size: 100%;">@user_version_name@</a> + <if @user_version_id@ ne @current_version_id@> + | Current: @current_version_name@ + </if> + <else> + (current) + </else> + </if> + + <else> + Current version: @current_version_name@ + </else> + + </div> +</if> + Index: openacs-4/packages/bug-tracker/lib/version-bar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/lib/version-bar.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/bug-tracker/lib/version-bar.tcl 5 Mar 2003 17:39:52 -0000 1.4 +++ openacs-4/packages/bug-tracker/lib/version-bar.tcl 28 Aug 2003 09:45:29 -0000 1.5 @@ -1,5 +1,12 @@ # Version bar, to be included on all pages +# Is this project using multiple versions? +set versions_p [bug_tracker::versions_p] + +if { !$versions_p } { + return +} + # Project info set current_version_id [bug_tracker::conn current_version_id] @@ -14,12 +21,7 @@ set user_version_id [bug_tracker::conn user_version_id] set user_version_name [bug_tracker::conn user_version_name] -set user_first_names [bug_tracker::conn user_first_names] -set user_last_name [bug_tracker::conn user_last_name] -# Is this project using multiple versions? -set versions_p [bug_tracker::versions_p] - set package_url [ad_conn package_url] set user_version_url "[ad_conn package_url]prefs?[export_vars -url { return_url }]" Index: openacs-4/packages/bug-tracker/sql/oracle/bug-tracker-create-packages.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/sql/oracle/bug-tracker-create-packages.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bug-tracker/sql/oracle/bug-tracker-create-packages.sql 14 Apr 2003 13:34:03 -0000 1.2 +++ openacs-4/packages/bug-tracker/sql/oracle/bug-tracker-create-packages.sql 28 Aug 2003 09:45:29 -0000 1.3 @@ -56,6 +56,10 @@ bug_id in integer ); + function name ( + bug_id in integer + ) return varchar2; + end bt_bug; / show errors @@ -148,9 +152,15 @@ name => 'bug_tracker_' || bt_project.new.package_id, label => v_instance_name, description => null, - parent_id => v_root_folder_id + parent_id => v_root_folder_id, + context_id => bt_project.new.package_id, + creation_user => v_creation_user, + creation_ip => v_creation_ip ); + -- Set package_id column. Oddly enoguh, there is no API to set it + update cr_folders set package_id = bt_project.new.package_id where folder_id = v_folder_id; + -- register our content type content_folder.register_content_type ( folder_id => v_folder_id, @@ -212,6 +222,9 @@ bt_patch.delete(rec.patch_id); end loop; + -- delete the content folder + content_folder.delete(v_folder_id); + -- delete the projects keywords bt_project.keywords_delete( project_id => project_id, @@ -224,10 +237,6 @@ delete from bt_user_prefs where project_id = bt_project.delete.project_id; delete from bt_projects where project_id = bt_project.delete.project_id; - - -- delete the content folder - content_folder.delete(v_folder_id); - end delete; procedure keywords_delete ( @@ -415,7 +424,7 @@ from workflow_cases where object_id = bt_bug.delete.bug_id; - foo := workflow_case.delete(v_case_id); + foo := workflow_case_pkg.delete(v_case_id); -- Every bug may have notifications attached to it -- and there is one column in the notificaitons datamodel that doesn't @@ -430,6 +439,20 @@ return; end delete; + function name ( + bug_id in integer + ) return varchar2 + is + v_name bt_bugs.summary%TYPE; + begin + select summary + into v_name + from bt_bugs + where bug_id = name.bug_id; + + return v_name; + end name; + end bt_bug; / show errors Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/bug-tracker/sql/oracle/upgrade-1.2d10-1.2d11.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/bug-tracker/sql/oracle/upgrade/upgrade-1.2d8-1.2d9.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/bug-tracker/sql/oracle/upgrade/upgrade-1.2d9-1.2d10.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/bug-tracker/sql/postgresql/bug-tracker-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/sql/postgresql/bug-tracker-create.sql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/bug-tracker/sql/postgresql/bug-tracker-create.sql 14 Apr 2003 13:34:44 -0000 1.8 +++ openacs-4/packages/bug-tracker/sql/postgresql/bug-tracker-create.sql 28 Aug 2003 09:45:29 -0000 1.9 @@ -56,9 +56,18 @@ ''bug_tracker_''||p_package_id, -- name v_instance_name, -- label null, -- description - content_item_globals.c_root_folder_id -- parent_bi + content_item_globals.c_root_folder_id, -- parent_id + p_package_id, -- context_id + null, -- folder_id + now(), -- creation_date + v_creation_user, -- creation_user + v_creation_ip, -- creation_ip, + ''t'' -- security_inherit_p ); + -- Set package_id column. Oddly enoguh, there is no API to set it + update cr_folders set package_id = p_package_id where folder_id = v_folder_id; + -- register our content type PERFORM content_folder__register_content_type ( v_folder_id, -- folder_id @@ -122,8 +131,12 @@ perform bt_patch__delete(rec.patch_id); end loop; + -- delete the content folder + raise notice ''about to delete content_folder.''; + perform content_folder__delete(v_folder_id); + -- delete the projects keywords - perform bt_projects__keywords_delete(p_project_id, ''t''); + perform bt_project__keywords_delete(p_project_id, ''t''); -- These tables should really be set up to cascade delete from bt_versions where project_id = p_project_id; @@ -132,10 +145,6 @@ delete from bt_projects where project_id = p_project_id; - -- delete the content folder - raise notice ''about to delete content_folder.''; - perform content_folder__delete(v_folder_id); - return 0; end; ' language 'plpgsql'; @@ -305,7 +314,7 @@ fix_for_version integer, fixed_in_version integer, -- denormalized from acs_objects - creation_date timestamp, + creation_date timestamptz, creation_user integer, -- constraint constraint bt_bug_parent_id_bug_number_un @@ -391,7 +400,7 @@ varchar, -- user_agent text, -- comment_content varchar, -- comment_format - timestamp, -- creation_date + timestamptz, -- creation_date integer, -- creation_user varchar, -- creation_ip varchar, -- item_subtype @@ -437,7 +446,7 @@ -- create the content item v_bug_id := content_item__new( - v_bug_number, -- name + v_bug_number::varchar, -- name v_folder_id, -- parent_id p_bug_id, -- item_id null, -- locale @@ -496,7 +505,7 @@ from workflow_cases where object_id = p_bug_id; - perform workflow_case__delete(v_case_id); + perform workflow_case_pkg__delete(v_case_id); -- Every bug may have notifications attached to it -- and there is one column in the notificaitons datamodel that doesn''t @@ -532,7 +541,7 @@ varchar, -- resolution varchar, -- user_agent varchar, -- summary - timestamp, -- creation_date + timestamptz, -- creation_date integer, -- creation_user varchar -- creation_ip ) returns int @@ -557,7 +566,7 @@ v_revision_id := content_revision__new( p_summary, -- title null, -- description - now(), -- publish_date + current_timestamp, -- publish_date null, -- mime_type null, -- nls_language null, -- new_data @@ -659,8 +668,8 @@ actor integer not null constraint bt_patch_actions_actor_fk references users(user_id), - action_date timestamp not null - default now(), + action_date timestamptz not null + default current_timestamp, comment_text text, comment_format varchar(30) default 'plain' not null constraint bt_patch_actions_comment_format_ck @@ -715,7 +724,7 @@ v_patch_id := acs_object__new( p_patch_id, -- object_id ''bt_patch'', -- object_type - now(), -- creation_date + current_timestamp, -- creation_date p_creation_user, -- creation_user p_creation_ip, -- creation_ip p_project_id, -- context_id @@ -802,3 +811,4 @@ create index bt_patch_bug_map_patch_id_idx on bt_patch_bug_map(patch_id); create index bt_patch_bug_map_bug_id_idx on bt_patch_bug_map(bug_id); + Index: openacs-4/packages/bug-tracker/sql/postgresql/bug-tracker-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/sql/postgresql/bug-tracker-drop.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/bug-tracker/sql/postgresql/bug-tracker-drop.sql 5 Mar 2003 17:40:28 -0000 1.5 +++ openacs-4/packages/bug-tracker/sql/postgresql/bug-tracker-drop.sql 28 Aug 2003 09:45:29 -0000 1.6 @@ -56,5 +56,9 @@ drop function bt_patch__new(integer,integer,integer,text,text,text,text,integer,integer,varchar); drop table bt_patch_actions; drop table bt_patches; +drop sequence t_bt_patch_number_seq; +drop view bt_patch_number_seq; +delete from acs_objects where object_type = 'bt_patch'; + select acs_object_type__drop_type('bt_patch', 't'); Index: openacs-4/packages/bug-tracker/sql/postgresql/upgrade-0.7d3-0.7d4.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/sql/postgresql/upgrade-0.7d3-0.7d4.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bug-tracker/sql/postgresql/upgrade-0.7d3-0.7d4.sql 29 Aug 2002 17:13:06 -0000 1.2 +++ openacs-4/packages/bug-tracker/sql/postgresql/upgrade-0.7d3-0.7d4.sql 28 Aug 2003 09:45:29 -0000 1.3 @@ -101,8 +101,8 @@ actor integer not null constraint bt_bug_actions_actor_fk references users(user_id), - action_date timestamp not null - default now(), + action_date timestamptz not null + default current_timestamp, comment text, comment_format varchar(30) default 'plain' not null constraint bt_bug_actions_comment_format_ck Index: openacs-4/packages/bug-tracker/sql/postgresql/upgrade-0.7d5-0.8.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/sql/postgresql/upgrade-0.7d5-0.8.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bug-tracker/sql/postgresql/upgrade-0.7d5-0.8.sql 5 Mar 2003 17:40:28 -0000 1.2 +++ openacs-4/packages/bug-tracker/sql/postgresql/upgrade-0.7d5-0.8.sql 28 Aug 2003 09:45:29 -0000 1.3 @@ -52,8 +52,8 @@ actor integer not null constraint bt_patch_actions_actor_fk references users(user_id), - action_date timestamp not null - default now(), + action_date timestamptz not null + default current_timestamp, comment text, comment_format varchar(30) default 'plain' not null constraint bt_patch_actions_comment_format_ck Index: openacs-4/packages/bug-tracker/sql/postgresql/upgrade-0.9d1-1.2d2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/sql/postgresql/upgrade-0.9d1-1.2d2.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bug-tracker/sql/postgresql/upgrade-0.9d1-1.2d2.sql 5 Mar 2003 17:40:28 -0000 1.1 +++ openacs-4/packages/bug-tracker/sql/postgresql/upgrade-0.9d1-1.2d2.sql 28 Aug 2003 09:45:29 -0000 1.2 @@ -384,11 +384,12 @@ from bt_projects where project_id = p_project_id; - -- Delete the bugs - for rec in select item_id from cr_items where parent_id = v_folder_id - loop - perform bt_bug__delete(rec.item_id); - end loop; + -- This gets done in tcl before we are called ... for now + -- Delete the bugs + -- for rec in select item_id from cr_items where parent_id = v_folder_id + -- loop + -- perform bt_bug__delete(rec.item_id); + -- end loop; -- Delete the patches for rec in select patch_id from bt_patches where project_id = p_project_id @@ -401,7 +402,7 @@ perform content_folder__delete(v_folder_id); -- delete the projects keywords - perform bt_projects__keywords_delete(p_project_id, ''t''); + perform bt_project__keywords_delete(p_project_id, ''t''); -- These tables should really be set up to cascade delete from bt_versions where project_id = p_project_id; @@ -1476,6 +1477,7 @@ -- ******* Drop temporary upgrade tables drop table code_keyword_map_temp; +drop table bug_type_keyword_map_temp; drop table bt_bugs_temp; drop table project_temp; Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/bug-tracker/sql/postgresql/upgrade-1.2d10-1.2d11.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/bug-tracker/sql/postgresql/upgrade-1.2d5-1.2d6.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/bug-tracker/sql/postgresql/upgrade-1.2d6-1.2d7.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/bug-tracker/sql/postgresql/upgrade-1.2d8-1.2d9.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/bug-tracker/sql/postgresql/upgrade-1.2d9-1.2d10.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/bug-tracker/tcl/bug-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/tcl/bug-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bug-tracker/tcl/bug-procs.tcl 5 Mar 2003 17:40:50 -0000 1.2 +++ openacs-4/packages/bug-tracker/tcl/bug-procs.tcl 28 Aug 2003 09:45:29 -0000 1.3 @@ -42,20 +42,20 @@ upvar $array row db_1row select_bug_data {} -column_array row - + # Get the case ID, so we can get state information set case_id [workflow::case::get_id \ - -object_id $bug_id \ - -workflow_short_name [bug_tracker::bug::workflow_short_name]] - + -object_id $bug_id \ + -workflow_short_name [bug_tracker::bug::workflow_short_name]] + # Derived fields set row(bug_number_display) "#$row(bug_number)" set row(component_name) [bug_tracker::component_get_name -component_id $row(component_id)] set row(found_in_version_name) [bug_tracker::version_get_name -version_id $row(found_in_version)] set row(fix_for_version_name) [bug_tracker::version_get_name -version_id $row(fix_for_version)] set row(fixed_in_version_name) [bug_tracker::version_get_name -version_id $row(fixed_in_version)] - - + + # Get state information workflow::case::fsm::get -case_id $case_id -array case -action_id $action_id set row(pretty_state) $case(pretty_state) @@ -65,7 +65,6 @@ set row(state_short_name) $case(state_short_name) set row(hide_fields) $case(state_hide_fields) set row(entry_id) $case(entry_id) - } ad_proc -public bug_tracker::bug::insert { @@ -129,6 +128,7 @@ {-ip_address ""} {-item_subtype "bt_bug"} {-content_type "bt_bug_revision"} + {-keyword_ids {}} } { Create a new bug, then send out notifications, starts workflow, etc. @@ -155,6 +155,10 @@ -content_type $content_type \ ] + foreach keyword_id $keyword_ids { + cr::keyword::item_assign -item_id $bug_id -keyword_id $keyword_id + } + workflow::case::new \ -workflow_id [workflow::get_id -object_id $package_id -short_name [workflow_short_name]] \ -object_id $bug_id \ @@ -240,7 +244,7 @@ # Update the keywords foreach {category_id category_name} [bug_tracker::category_types] { - if { [info exists row($category_id)] } { + if { [exists_and_not_null row($category_id)] } { cr::keyword::item_assign -singular -item_id $bug_id -keyword_id $row($category_id) } # LARS: @@ -278,7 +282,7 @@ @return 3-tuple of url, label and title. } { set user_id [ad_conn user_id] - set return_url [util_get_current_url] + set return_url [ad_return_url] # Get the type id set type "workflow_case" @@ -299,12 +303,12 @@ -url $return_url \ -user_id $user_id \ -pretty_name "this bug"] - set label "Watch this bug" - set title "Request notifications for all activity on this bug" + set label "Watch this [bug_tracker::conn bug]" + set title "Request notifications for all activity on this [bug_tracker::conn bug]" } else { set url [notification::display::unsubscribe_url -request_id $request_id -url $return_url] - set label "Stop watching this bug" - set title "Unsubscribe to notifications for activity on this bug" + set label "Stop watching this [bug_tracker::conn bug]" + set title "Unsubscribe to notifications for activity on this [bug_tracker::conn bug]" } return [list $url $label $title] } @@ -420,115 +424,6 @@ } } -# set spec { -# bug { -# pretty_name "Bug" -# package_key "bug-tracker" -# object_type "bt_bug" -# callbacks { -# bug-tracker.FormatLogTitle -# bug-tracker.BugNotificationInfo -# } -# roles { -# submitter { -# pretty_name "Submitter" -# callbacks { -# workflow.Role_DefaultAssignees_CreationUser -# } -# } -# assignee { -# pretty_name Assignee -# callbacks { -# bug-tracker.ComponentMaintainer -# bug-tracker.ProjectMaintainer -# workflow.Role_PickList_CurrentAssignees -# workflow.Role_AssigneeSubquery_RegisteredUsers -# } -# } -# } -# states { -# open { -# pretty_name "Open" -# hide_fields { resolution fixed_in_version } -# } -# resolved { -# pretty_name "Resolved" -# } -# closed { -# pretty_name "Closed" -# } -# } -# actions { -# open { -# pretty_name Open -# pretty_past_tense Opened -# new_state "open" -# initial_action_p t -# } -# comment { -# pretty_name Comment -# pretty_past_tense Commented -# allowed_roles { submitter assignee } -# privileges { read write } -# always_enabled_p t -# } -# edit { -# pretty_name Edit -# pretty_past_tense Edited -# allowed_roles { submitter assignee } -# privileges { write } -# always_enabled_p t -# edit_fields { -# component_id -# bug_type -# summary -# severity -# priority -# found_in_version -# role_assignee -# fix_for_version -# resolution -# fixed_in_version -# } -# } -# reassign { -# pretty_name Reassign -# pretty_past_tense Reassigned -# allowed_role { submitter assignee } -# privileges { write } -# enabled_states { open resolved } -# edit_fields { role_assignee } -# } -# resolve { -# pretty_name Resolve -# pretty_past_tense Resolved -# assigned_role "assignee" -# enabled_states { resolved } -# assigned_states { open } -# new_state "resolved" -# privileges { write } -# edit_fields { resolution fixed_in_version } -# callbacks { bug-tracker.CaptureResolutionCode } -# } -# close { -# pretty_name Close -# pretty_past_tense Closed -# assigned_role "submitter" -# assigned_states { resolved } -# new_state "closed" -# privileges { write } -# } -# reopen { -# pretty_name Reopen -# pretty_past_tense Reopened -# allowed_roles { submitter } -# enabled_states { resolved closed } -# new_state "open" -# privileges { write } -# } -# } -# } -# } set workflow_id [workflow::fsm::new_from_spec -spec $spec] return $workflow_id @@ -607,7 +502,10 @@ action_id entry_id } { - db_dml insert_resolution_code {} + workflow::case::add_log_data \ + -entry_id $entry_id \ + -key "resolution" \ + -value [db_string select_resolution_code {}] } ##### Index: openacs-4/packages/bug-tracker/tcl/bug-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/tcl/bug-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bug-tracker/tcl/bug-procs.xql 5 Mar 2003 17:40:50 -0000 1.1 +++ openacs-4/packages/bug-tracker/tcl/bug-procs.xql 28 Aug 2003 09:45:29 -0000 1.2 @@ -22,25 +22,14 @@ </querytext> </fullquery> - <fullquery name="bug_tracker::bug::capture_resolution_code::do_side_effect.insert_resolution_code"> + <fullquery name="bug_tracker::bug::capture_resolution_code::do_side_effect.select_resolution_code"> <querytext> - insert into workflow_case_log_data - (entry_id, key, value) - select :entry_id, 'resolution', resolution + select resolution from bt_bugs where bug_id = :object_id </querytext> </fullquery> - <fullquery name="bug_tracker::bug::format_log_title::format_log_title.select_resolution"> - <querytext> - select value - from workflow_case_log_data - where entry_id = :entry_id - and key = 'resolution' - </querytext> - </fullquery> - <fullquery name="bug_tracker::bug::get_component_maintainer::get_assignees.select_component_maintainer"> <querytext> select c.maintainer Index: openacs-4/packages/bug-tracker/tcl/bug-tracker-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/tcl/bug-tracker-procs-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bug-tracker/tcl/bug-tracker-procs-oracle.xql 5 Mar 2003 17:40:50 -0000 1.1 +++ openacs-4/packages/bug-tracker/tcl/bug-tracker-procs-oracle.xql 28 Aug 2003 09:45:29 -0000 1.2 @@ -151,7 +151,7 @@ <fullquery name="bug_tracker::bug_delete.delete_bug_case"> <querytext> begin - workflow_case.delete(:case_id); + workflow_case_pkg.delete(:case_id); end; </querytext> </fullquery> Index: openacs-4/packages/bug-tracker/tcl/bug-tracker-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/tcl/bug-tracker-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bug-tracker/tcl/bug-tracker-procs-postgresql.xql 5 Mar 2003 17:40:50 -0000 1.1 +++ openacs-4/packages/bug-tracker/tcl/bug-tracker-procs-postgresql.xql 28 Aug 2003 09:45:29 -0000 1.2 @@ -145,7 +145,7 @@ <fullquery name="bug_tracker::bug_delete.delete_bug_case"> <querytext> - select workflow_case__delete(:case_id); + select workflow_case_pkg__delete(:case_id); </querytext> </fullquery> Index: openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl 5 Mar 2003 17:40:50 -0000 1.18 +++ openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl 28 Aug 2003 09:45:29 -0000 1.19 @@ -4,7 +4,7 @@ @creation-date 2002-05-03 @author Lars Pind <lars@collaboraid.biz> - @cvs-id $Id$ + @cvs-id bug-tracker-procs.tcl,v 1.13.2.7 2003/03/05 18:13:39 lars Exp } @@ -959,7 +959,6 @@ {-comment:required} {-format:required} } { - ns_log Notice "LARS: Format=$format, comment=$comment, formatted = [ad_html_text_convert -from $format -to text/html -- $comment]" return [ad_html_text_convert -from $format -to text/html -- $comment] } @@ -1276,6 +1275,7 @@ {action_id} fix_for_version:integer assignee:integer + enabled_action_assignee:integer action_id:integer component_id:integer keyword:integer,multiple @@ -1382,6 +1382,38 @@ } append human_readable_filter " where [join $keyword_human " and "]" } + + if { [info exists filter_enabled_action_assignee] } { + lappend where_clauses { + exists ( + select 1 + from workflow_cases cas2, + workflow_case_fsm cfsm2, + workflow_actions a2, + workflow_case_role_party_map crpm2 + where cas2.object_id = b.bug_id + and (a2.always_enabled_p = 't' + or exists (select 1 + from workflow_fsm_action_en_in_st aeis + where aeis.state_id = cfsm.current_state + and aeis.action_id = a2.action_id + and aeis.assigned_p = 't' + ) + ) + and cfsm2.case_id = cas2.case_id + and crpm2.case_id = cas2.case_id + and crpm2.role_id = a2.assigned_role + and crpm2.party_id = :filter_enabled_action_assignee + ) + } + if { $filter_enabled_action_assignee == [ad_conn user_id] } { + append human_readable_filter " awaiting action by me" + } else { + array set person [person::get -person_id $filter_enabled_action_assignee] + + append human_readable_filter " awaiting action by $person(first_names) $person(last_name)" + } + } if { ![empty_string_p [conn component_id]] } { set filter_component_id [conn component_id] Index: openacs-4/packages/bug-tracker/www/bug-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/bug-add.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/bug-tracker/www/bug-add.adp 22 May 2003 14:24:00 -0000 1.5 +++ openacs-4/packages/bug-tracker/www/bug-add.adp 28 Aug 2003 09:45:29 -0000 1.6 @@ -1,6 +1,6 @@ <master src="../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@page_title@</property> +<property name="context_bar">@context_bar@</property> <property name="focus">bug.component_id</property> <table align="right"> @@ -11,6 +11,6 @@ </tr> </table> -<formtemplate id="bug" style="standard-lars"></formtemplate> +<formtemplate id="bug"></formtemplate> Index: openacs-4/packages/bug-tracker/www/bug-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/bug-add.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/bug-tracker/www/bug-add.tcl 5 Mar 2003 17:41:04 -0000 1.9 +++ openacs-4/packages/bug-tracker/www/bug-add.tcl 28 Aug 2003 09:45:29 -0000 1.10 @@ -44,11 +44,10 @@ {label "Summary"} {html {size 50}} } - {found_in_version:text(select) + {found_in_version:text(select),optional {label "Version"} {options {[bug_tracker::version_get_options -include_unknown]}} {value {[bug_tracker::conn user_version_id]}} - optional } {return_url:text(hidden) {value $return_url}} @@ -64,28 +63,30 @@ } ad_form -extend -name bug -form { - {description:richtext(richtext) + {description:richtext(richtext),optional {label "Description"} {html {cols 60 rows 13}} - optional } } ad_form -extend -name bug -new_data { + + set keyword_ids [list] + foreach {category_id category_name} [bug_tracker::category_types] { + # -singular not required here since it's a new bug + lappend keyword_ids [element get_value bug $category_id] + } + bug_tracker::bug::new \ -bug_id $bug_id \ -package_id $package_id \ -component_id $component_id \ -found_in_version $found_in_version \ -summary $summary \ -description [template::util::richtext::get_property contents $description] \ - -desc_format [template::util::richtext::get_property format $description] - - foreach {category_id category_name} [bug_tracker::category_types] { - # -singular not required here since it's a new bug - cr::keyword::item_assign -item_id $bug_id -keyword_id [element get_value bug $category_id] - } + -desc_format [template::util::richtext::get_property format $description] \ + -keyword_ids $keyword_ids } -after_submit { bug_tracker::bugs_exist_p_set_true Index: openacs-4/packages/bug-tracker/www/bug.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/bug.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/bug-tracker/www/bug.adp 22 May 2003 14:24:00 -0000 1.6 +++ openacs-4/packages/bug-tracker/www/bug.adp 28 Aug 2003 09:45:29 -0000 1.7 @@ -1,7 +1,7 @@ <master src="../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> -<if @notification_link;noquote@ not nil><property name="notification_link">@notification_link;noquote@</property></if> +<property name="title">@page_title@</property> +<property name="context_bar">@context_bar@</property> +<if @notification_link@ not nil><property name="notification_link">@notification_link@</property></if> <if @action_id@ nil> <table align="right"> @@ -18,7 +18,7 @@ </if> <p> - <formtemplate id="bug" style="standard-lars"></formtemplate> + <formtemplate id="bug"></formtemplate> </p> <if @user_id@ eq 0> Index: openacs-4/packages/bug-tracker/www/bug.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/bug.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/bug-tracker/www/bug.tcl 5 Mar 2003 17:41:04 -0000 1.19 +++ openacs-4/packages/bug-tracker/www/bug.tcl 28 Aug 2003 09:45:29 -0000 1.20 @@ -53,9 +53,7 @@ set workflow_id [bug_tracker::bug::get_instance_workflow_id] -set role_ids [workflow::get_roles -workflow_id $workflow_id] - ##### # # Action @@ -64,12 +62,6 @@ set action_id [form get_action bug] -if { ![empty_string_p $action_id] } { - set action_short_name [workflow::action::get_element -action_id $action_id -element short_name] -} else { - set action_short_name {} -} - # Registration required for all actions if { ![empty_string_p $action_id] } { ad_maybe_redirect_for_registration @@ -104,15 +96,14 @@ set patch_label [ad_decode $show_patch_status "open" "Open Patches (<a href=\"$return_url&show_patch_status=all\">show all</a>)" "all" "All Patches (<a href=\"$return_url&show_patch_status=open\">show only open)" "Patches"] ad_form -name bug -cancel_url $return_url -mode display -has_edit 1 -actions $actions -form { - {bug_number_display:integer(inform) + {bug_number_display:text(inform) {label "[bug_tracker::conn Bug] \#"} {mode display} } - {component_id:integer(select) + {component_id:integer(select),optional {label "[bug_tracker::conn Component]"} {options {[bug_tracker::components_get_options]}} {mode display} - optional } {summary:text(text) {label "Summary"} @@ -131,11 +122,10 @@ {after_html "</b>"} {mode display} } - {resolution:text(select) + {resolution:text(select),optional {label "Resolution"} {options {[bug_tracker::resolution_get_options]}} {mode display} - optional } } @@ -151,11 +141,10 @@ ad_form -extend -name bug -form { - {found_in_version:text(select) + {found_in_version:text(select),optional {label "Found in Version"} {options {[bug_tracker::version_get_options -include_unknown]}} {mode display} - optional } } @@ -171,30 +160,25 @@ {label "User Agent"} {mode display} } - {fix_for_version:text(select) + {fix_for_version:text(select),optional {label "Fix for Version"} {options {[bug_tracker::version_get_options -include_undecided]}} {mode display} - optional } - {fixed_in_version:text(select) + {fixed_in_version:text(select),optional {label "Fixed in Version"} {options {[bug_tracker::version_get_options -include_undecided]}} {mode display} - optional } - {description:richtext(richtext) + {description:richtext(richtext),optional {label "Description"} {html {cols 60 rows 13}} - optional } {return_url:text(hidden) {value $return_url} } {bug_number:key} - {entry_id:integer(hidden) - optional - } + {entry_id:integer(hidden),optional} } # Export filters @@ -211,8 +195,10 @@ foreach field [workflow::action::get_element -action_id $action_id -element edit_fields] { element set_properties bug $field -mode edit } - if {[string compare $action_short_name "edit"] == 0} { - foreach {category_id category_name} [bug_tracker::category_types] { + + # LARS: Hack! How do we set editing of dynamic fields? + if { [string equal [workflow::action::get_element -action_id $action_id -element short_name] "edit"] } { + foreach { category_id category_name } [bug_tracker::category_types] { element set_properties bug $category_id -mode edit } } @@ -253,7 +239,7 @@ # whenever the form is displayed, whether initially or because of a validation error. } -# Not-valid block (request, error) +# Not-valid block (request or submit error) if { ![form is_valid bug] } { # Get the bug data @@ -305,7 +291,6 @@ element set_properties bug user_agent -widget hidden } - # Set regular element values foreach element $element_names { @@ -316,7 +301,7 @@ } } } - + # Add empty option to resolution code if { ![empty_string_p $action_id] } { if { [lsearch [workflow::action::get_element -action_id $action_id -element edit_fields] "resolution"] == -1 } { @@ -341,17 +326,17 @@ # Set values for description field element set_properties bug description \ - -before_html "[workflow::case::get_activity_html -case_id $case_id][ad_decode $action_id "" "" "<p><b>$bug(now_pretty) [bug_tracker::bug_action_pretty $action_short_name] by [bug_tracker::conn user_first_names] [bug_tracker::conn user_last_name]</b></p>"]" + -before_html [workflow::case::get_activity_html -case_id $case_id -action_id $action_id] # Set page title set page_title "[bug_tracker::conn Bug] #$bug_number: $bug(summary)" # Context bar if { [info exists filter] } { - if { [array names filter] == [list "actionby"] && $filter(actionby) == $user_id } { - set context_bar [bug_tracker::context_bar [list ".?[export_vars { filter:array }]" "My bugs"] $page_title] + if { [array names filter] == [list "assignee"] && $filter(assignee) == $user_id } { + set context_bar [bug_tracker::context_bar [list ".?[export_vars { filter:array }]" "My [bug_tracker::conn bugs]"] $page_title] } else { - set context_bar [bug_tracker::context_bar [list ".?[export_vars { filter:array }]" "Filtered bug list"] $page_title] + set context_bar [bug_tracker::context_bar [list ".?[export_vars { filter:array }]" "Filtered [bug_tracker::conn bug] list"] $page_title] } } else { set context_bar [bug_tracker::context_bar $page_title] @@ -413,4 +398,3 @@ } ad_return_template - Index: openacs-4/packages/bug-tracker/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/Attic/index-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bug-tracker/www/index-oracle.xql 5 Mar 2003 17:41:04 -0000 1.1 +++ openacs-4/packages/bug-tracker/www/index-oracle.xql 28 Aug 2003 09:45:29 -0000 1.2 @@ -117,7 +117,8 @@ workflow_actions a, workflow_case_role_party_map crpm, parties p - where cas.object_id = b.bug_id + where b.project_id = :package_id + and cas.object_id = b.bug_id and (a.always_enabled_p = 't' or exists (select 1 from workflow_fsm_action_en_in_st aeis Index: openacs-4/packages/bug-tracker/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/Attic/index-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bug-tracker/www/index-postgresql.xql 5 Mar 2003 17:41:04 -0000 1.1 +++ openacs-4/packages/bug-tracker/www/index-postgresql.xql 28 Aug 2003 09:45:29 -0000 1.2 @@ -111,7 +111,8 @@ workflow_actions a, workflow_case_role_party_map crpm, parties p - where cas.object_id = b.bug_id + where b.project_id = :package_id + and cas.object_id = b.bug_id and (a.always_enabled_p = 't' or exists (select 1 from workflow_fsm_action_en_in_st aeis Index: openacs-4/packages/bug-tracker/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/index.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/bug-tracker/www/index.adp 22 May 2003 14:24:00 -0000 1.6 +++ openacs-4/packages/bug-tracker/www/index.adp 28 Aug 2003 09:45:29 -0000 1.7 @@ -1,6 +1,6 @@ <master src="../lib/master"> -<property name="title">@project_name;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@project_name@</property> +<property name="context_bar">@context_bar@</property> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> @@ -53,7 +53,7 @@ <div style="background-color: #eeeeff; padding: 4px; margin-top: 8px; margin-bottom: 16px; border: solid 1px #cccccc;"> - <div style="float: right; margin-left: 16px;"> + <div style="float: right;"> Order by: <select name="filter.orderby" onchange="document.displaymode_form.submit();"> @@ -77,7 +77,7 @@ <else><a href="@options_n_days.url@">@options_n_days.label@</a></else> </multiple> ] days - </span> + </span> </div> Index: openacs-4/packages/bug-tracker/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/index.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/bug-tracker/www/index.tcl 5 Mar 2003 17:41:04 -0000 1.15 +++ openacs-4/packages/bug-tracker/www/index.tcl 28 Aug 2003 09:45:29 -0000 1.16 @@ -22,7 +22,7 @@ set versions_p [bug_tracker::versions_p] if { [info exists filter] } { - if { [array names filter] == [list "actionby"] && $filter(actionby) == [ad_conn user_id] } { + if { [array names filter] == [list "assignee"] && $filter(assignee) == [ad_conn user_id] } { set context_bar [bug_tracker::context_bar "My [bug_tracker::conn bugs]"] } else { set context_bar [bug_tracker::context_bar "Filtered [bug_tracker::conn bug] list"] @@ -223,8 +223,8 @@ regexp {^([0-9]+)\.([0-9]+)\.([0-9]+)$} $unique_id match action_id state_id assignee_id - set name_url "?[bug_tracker::filter_url_vars -array filter -override [list assignee $assignee_id status $state_id]]" - set selected_p [expr { [exists_and_equal filter(assignee) $assignee_id] && \ + set name_url "?[bug_tracker::filter_url_vars -array filter -override [list enabled_action_assignee $assignee_id status $state_id]]" + set selected_p [expr { [exists_and_equal filter(enabled_action_assignee) $assignee_id] && \ [exists_and_equal filter(status) $state_id] } ] } Index: openacs-4/packages/bug-tracker/www/map-patch-to-bugs.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/map-patch-to-bugs.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/www/map-patch-to-bugs.adp 22 May 2003 14:24:00 -0000 1.3 +++ openacs-4/packages/bug-tracker/www/map-patch-to-bugs.adp 28 Aug 2003 09:45:29 -0000 1.4 @@ -1,6 +1,6 @@ <master src="../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@page_title@</property> +<property name="context">@context@</property> <if @open_bugs:rowcount@ not eq 0> Select one or more of the following @pretty_names.bugs@ for patch "@patch_summary@" (you may select more @pretty_names.bugs@ later): @@ -15,7 +15,7 @@ </p> <p> -<include src="../lib/pagination" row_count="@bug_count;noquote@" offset="@offset;noquote@" interval_size="@interval_size;noquote@" variable_set_to_export="@pagination_export_var_set;noquote@" pretty_plural="@pretty_names.bugs;noquote@"> +<include src="../lib/pagination" row_count="@bug_count@" offset="@offset@" interval_size="@interval_size@" variable_set_to_export="@pagination_export_var_set@" pretty_plural="@pretty_names.bugs@"> </p> <blockquote> Index: openacs-4/packages/bug-tracker/www/map-patch-to-bugs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/map-patch-to-bugs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/www/map-patch-to-bugs.tcl 5 Mar 2003 17:41:04 -0000 1.3 +++ openacs-4/packages/bug-tracker/www/map-patch-to-bugs.tcl 28 Aug 2003 09:45:29 -0000 1.4 @@ -52,7 +52,7 @@ set patch_summary [db_string get_patch_summary {}] set page_title "Mapping Patch #$patch_number \"$patch_summary\" to a Bug" -set context_bar [ad_context_bar "$page_title"] +set context [list "$page_title"] # Build the component filter if { ![exists_and_not_null component_id] } { Index: openacs-4/packages/bug-tracker/www/no-bugs.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/no-bugs.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/bug-tracker/www/no-bugs.adp 22 May 2003 14:24:00 -0000 1.4 +++ openacs-4/packages/bug-tracker/www/no-bugs.adp 28 Aug 2003 09:45:29 -0000 1.5 @@ -1,6 +1,6 @@ <master src="../lib/master"> -<property name="title">@project_name;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@project_name@</property> +<property name="context_bar">@context_bar@</property> <p> <i>This project is empty.</i> Index: openacs-4/packages/bug-tracker/www/no-components.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/no-components.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/www/no-components.adp 22 May 2003 14:24:00 -0000 1.3 +++ openacs-4/packages/bug-tracker/www/no-components.adp 28 Aug 2003 09:45:29 -0000 1.4 @@ -1,6 +1,6 @@ <master src="../lib/master"> -<property name="title">@project_name;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@project_name@</property> +<property name="context_bar">@context_bar@</property> Before you can get started using the bug-tracker, you need to create at least one component. Index: openacs-4/packages/bug-tracker/www/notifications.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/notifications.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bug-tracker/www/notifications.adp 22 May 2003 14:24:00 -0000 1.2 +++ openacs-4/packages/bug-tracker/www/notifications.adp 28 Aug 2003 09:45:29 -0000 1.3 @@ -1,6 +1,6 @@ <master src="../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context">@context;noquote@</property> +<property name="title">@page_title@</property> +<property name="context">@context@</property> <table cellspacing="1" cellpadding="3" class="bt_listing"> <tr class="bt_listing_header"> Index: openacs-4/packages/bug-tracker/www/notifications.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/notifications.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bug-tracker/www/notifications.tcl 5 Mar 2003 17:41:04 -0000 1.1 +++ openacs-4/packages/bug-tracker/www/notifications.tcl 28 Aug 2003 09:45:29 -0000 1.2 @@ -21,7 +21,7 @@ } set user_id [ad_conn user_id] -set return_url [util_get_current_url] +set return_url [ad_return_url] multirow create notifications url label title subscribed_p Index: openacs-4/packages/bug-tracker/www/patch-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/patch-add.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/bug-tracker/www/patch-add.adp 22 May 2003 14:24:00 -0000 1.4 +++ openacs-4/packages/bug-tracker/www/patch-add.adp 28 Aug 2003 09:45:29 -0000 1.5 @@ -1,6 +1,6 @@ <master src="../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@page_title@</property> +<property name="context">@context@</property> <property name="focus">patch.summary</property> <table align="right"> @@ -11,4 +11,4 @@ </tr> </table> -<formtemplate id="patch" style="standard-lars"></formtemplate> +<formtemplate id="patch"></formtemplate> Index: openacs-4/packages/bug-tracker/www/patch-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/patch-add.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/bug-tracker/www/patch-add.tcl 5 Mar 2003 17:41:04 -0000 1.7 +++ openacs-4/packages/bug-tracker/www/patch-add.tcl 28 Aug 2003 09:45:29 -0000 1.8 @@ -31,7 +31,7 @@ set package_id [ad_conn package_id] set package_key [ad_conn package_key] set page_title "New Patch" -set context_bar [ad_context_bar $page_title] +set context [list $page_title] set user_id [ad_conn user_id] # Is this project using multiple versions? Index: openacs-4/packages/bug-tracker/www/patch-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/patch-list.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/bug-tracker/www/patch-list.adp 22 May 2003 14:24:00 -0000 1.4 +++ openacs-4/packages/bug-tracker/www/patch-list.adp 28 Aug 2003 09:45:29 -0000 1.5 @@ -1,6 +1,6 @@ <master src="../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@page_title@</property> +<property name="context">@context@</property> <p> Component: [ Index: openacs-4/packages/bug-tracker/www/patch-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/patch-list.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/www/patch-list.tcl 16 Jan 2003 13:43:58 -0000 1.3 +++ openacs-4/packages/bug-tracker/www/patch-list.tcl 28 Aug 2003 09:45:29 -0000 1.4 @@ -15,7 +15,7 @@ set user_id [ad_conn user_id] set page_title "Patches" -set context_bar [ad_context_bar $page_title] +set context [list $page_title] # Create the component filter set component_filter_list [list] Index: openacs-4/packages/bug-tracker/www/patch.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/patch.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/www/patch.adp 22 May 2003 14:24:00 -0000 1.3 +++ openacs-4/packages/bug-tracker/www/patch.adp 28 Aug 2003 09:45:29 -0000 1.4 @@ -1,8 +1,8 @@ <master src="../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@page_title@</property> +<property name="context">@context@</property> -<formtemplate id="patch" style="standard-lars"></formtemplate> +<formtemplate id="patch"></formtemplate> <p> <if @button_form_export_vars@ not nil> @@ -17,8 +17,7 @@ </if> </p> - -<if @mode@ eq "view"> +<if @mode@ eq "view" and @deleted_p@ eq 0> <center> <p> <a href="patch?patch_number=@patch_number@&download=1">Download patch content</a> Index: openacs-4/packages/bug-tracker/www/patch.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/patch.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bug-tracker/www/patch.tcl 5 Mar 2003 17:41:04 -0000 1.2 +++ openacs-4/packages/bug-tracker/www/patch.tcl 28 Aug 2003 09:45:29 -0000 1.3 @@ -154,7 +154,7 @@ -label "Patch #" element create patch component_id \ - -datatype integer \ + -datatype text \ -widget [ad_decode [info exists field_editable_p(component_id)] 1 select inform] \ -label "Component" \ -options [bug_tracker::components_get_options] @@ -255,7 +255,7 @@ -value $mode set page_title "Patch #$patch_number" -set context_bar [ad_context_bar $page_title] +set context [list $page_title] if { [form is_request patch] } { # The form was requested @@ -311,6 +311,8 @@ element set_properties patch applied_to_version \ -value [ad_decode [info exists field_editable_p(applied_to_version)] 1 $patch(applied_to_version) $patch(applied_to_version_name)] + set deleted_p [string equal $patch(status) deleted] + if { ( [string equal $patch(status) open] && ![string equal $mode "accept"]) || [string equal $patch(status) "refused"] } { element set_properties patch applied_to_version -widget hidden } Index: openacs-4/packages/bug-tracker/www/prefs.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/prefs.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/www/prefs.adp 22 May 2003 14:24:00 -0000 1.3 +++ openacs-4/packages/bug-tracker/www/prefs.adp 28 Aug 2003 09:45:29 -0000 1.4 @@ -1,6 +1,6 @@ <master src="../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@page_title@</property> +<property name="context">@context@</property> <property name="focus">prefs.user_version</property> -<formtemplate id="prefs" style="standard-lars"></formtemplate> +<formtemplate id="prefs"></formtemplate> Index: openacs-4/packages/bug-tracker/www/prefs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/prefs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/bug-tracker/www/prefs.tcl 5 Mar 2003 17:41:04 -0000 1.8 +++ openacs-4/packages/bug-tracker/www/prefs.tcl 28 Aug 2003 09:45:29 -0000 1.9 @@ -21,24 +21,25 @@ set page_title "Your Preferences" -set context_bar [ad_context_bar $page_title] +set context [list $page_title] set user_id [ad_conn user_id] ad_form -name prefs -cancel_url $return_url -form { - {user_version:integer(select) + {user_version:integer(select),optional {label "Your version"} {options {[bug_tracker::version_get_options -include_unknown]}} - optional } {return_url:text(hidden) {value $return_url} } -} -select_query { - select user_version - from prefs - where user_id = :user_id - and project_id = :package_id +} -on_request { + db_0or1row select_data { + select user_version + from bt_user_prefs + where user_id = :user_id + and project_id = :package_id + } } -after_submit { set user_version [element get_value prefs user_version] db_dml update_row { Index: openacs-4/packages/bug-tracker/www/admin/categories.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/categories.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bug-tracker/www/admin/categories.adp 22 May 2003 14:24:26 -0000 1.2 +++ openacs-4/packages/bug-tracker/www/admin/categories.adp 28 Aug 2003 09:45:30 -0000 1.3 @@ -1,6 +1,6 @@ <master src="../../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@page_title@</property> +<property name="context_bar">@context_bar@</property> <blockquote> Index: openacs-4/packages/bug-tracker/www/admin/category-defaults.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/category-defaults.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bug-tracker/www/admin/category-defaults.adp 22 May 2003 14:24:26 -0000 1.2 +++ openacs-4/packages/bug-tracker/www/admin/category-defaults.adp 28 Aug 2003 09:45:30 -0000 1.3 @@ -1,5 +1,5 @@ <master src="../../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@page_title@</property> +<property name="context_bar">@context_bar@</property> <formtemplate id="setup" style="standard-lars"></formtemplate> Index: openacs-4/packages/bug-tracker/www/admin/category-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/category-delete.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bug-tracker/www/admin/category-delete.tcl 5 Mar 2003 17:41:17 -0000 1.1 +++ openacs-4/packages/bug-tracker/www/admin/category-delete.tcl 28 Aug 2003 09:45:30 -0000 1.2 @@ -4,6 +4,9 @@ keyword_id:integer } -db_exec_plsql delete_keyword { } +cr::keyword::delete \ + -keyword_id $keyword_id +bug_tracker::get_keywords_flush + ad_returnredirect categories Index: openacs-4/packages/bug-tracker/www/admin/category-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/category-edit.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bug-tracker/www/admin/category-edit.adp 22 May 2003 14:24:26 -0000 1.2 +++ openacs-4/packages/bug-tracker/www/admin/category-edit.adp 28 Aug 2003 09:45:30 -0000 1.3 @@ -1,6 +1,6 @@ <master src="../../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@page_title@</property> +<property name="context_bar">@context_bar@</property> <property name="focus">keyword.heading</property> <formtemplate id="keyword" style="standard-lars"></formtemplate> Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/bug-tracker/www/admin/component-ae-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/bug-tracker/www/admin/component-ae-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/bug-tracker/www/admin/component-ae.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/component-ae.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/www/admin/component-ae.adp 22 May 2003 14:24:26 -0000 1.3 +++ openacs-4/packages/bug-tracker/www/admin/component-ae.adp 28 Aug 2003 09:45:30 -0000 1.4 @@ -1,6 +1,6 @@ <master src="../../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context">@context;noquote@</property> +<property name="title">@page_title@</property> +<property name="context">@context@</property> <property name="focus">component.name</property> <formtemplate id="component" style="standard-lars"></formtemplate> Index: openacs-4/packages/bug-tracker/www/admin/component-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/component-ae.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/bug-tracker/www/admin/component-ae.tcl 5 Mar 2003 17:41:17 -0000 1.8 +++ openacs-4/packages/bug-tracker/www/admin/component-ae.tcl 28 Aug 2003 09:45:30 -0000 1.9 @@ -23,23 +23,15 @@ {component_id:key(acs_object_id_seq)} {return_url:text(hidden) {value $return_url}} {name:text {html { size 50 }} {label "[bug_tracker::conn Component] Name"}} - {description:text(hidden) {label {Description}} optional {html { cols 50 rows 8 }}} - {url_name:text {html { size 50 }} {label {Name in shortcut URL}} optional + {description:text(hidden),optional {label {Description}} {html { cols 50 rows 8 }}} + {url_name:text,optional {html { size 50 }} {label {Name in shortcut URL}} {help_text "You can filter by this [bug_tracker::conn component] by viisting [ad_conn package_url]com/this-name/"} } - {maintainer:search + {maintainer:search,optional {result_datatype integer} {label "Maintainer"} {options [bug_tracker::users_get_options]} - optional - {search_query - { - select distinct u.first_names || ' ' || u.last_name || ' (' || u.email || ')' as name, u.user_id - from cc_users u - where upper(coalesce(u.first_names || ' ', '') || coalesce(u.last_name || ' ', '') || u.email || ' ' || coalesce(u.screen_name, '')) like upper('%'||:value||'%') - order by name - } - } + {search_query {[db_map user_search]}} } } -select_query { select component_id, Index: openacs-4/packages/bug-tracker/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/index.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/bug-tracker/www/admin/index.adp 22 May 2003 14:24:26 -0000 1.4 +++ openacs-4/packages/bug-tracker/www/admin/index.adp 28 Aug 2003 09:45:30 -0000 1.5 @@ -1,6 +1,6 @@ <master src="../../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@page_title@</property> +<property name="context_bar">@context_bar@</property> <blockquote> Index: openacs-4/packages/bug-tracker/www/admin/initial-setup.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/initial-setup.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bug-tracker/www/admin/initial-setup.adp 22 May 2003 14:24:26 -0000 1.2 +++ openacs-4/packages/bug-tracker/www/admin/initial-setup.adp 28 Aug 2003 09:45:30 -0000 1.3 @@ -1,6 +1,6 @@ <master src="../../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@page_title@</property> +<property name="context_bar">@context_bar@</property> <p> Choose your project's initial configuration. Index: openacs-4/packages/bug-tracker/www/admin/project-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/project-edit.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/www/admin/project-edit.adp 22 May 2003 14:24:26 -0000 1.3 +++ openacs-4/packages/bug-tracker/www/admin/project-edit.adp 28 Aug 2003 09:45:30 -0000 1.4 @@ -1,6 +1,6 @@ <master src="../../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context">@context;noquote@</property> +<property name="title">@page_title@</property> +<property name="context">@context@</property> <property name="focus">project.name</property> <formtemplate id="project" style="standard-lars"></formtemplate> Index: openacs-4/packages/bug-tracker/www/admin/project-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/project-edit.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/bug-tracker/www/admin/project-edit.tcl 5 Mar 2003 17:41:17 -0000 1.7 +++ openacs-4/packages/bug-tracker/www/admin/project-edit.tcl 28 Aug 2003 09:45:30 -0000 1.8 @@ -20,18 +20,17 @@ {name:text {html { size 50 }} {label "Project Name"} {help_text {This is also the name of this package in the site map}} } - {description:text(hidden) {label "Description"} optional {html { cols 50 rows 8 }} + {description:text(hidden),optional {label "Description"} {html { cols 50 rows 8 }} {help_text {This isn't actually used anywhere at this point. Sorry.}} } - {email_subject_name:text {html { size 50 }} {label "Notification tag"} optional + {email_subject_name:text,optional {html { size 50 }} {label "Notification tag"} {help_text {This text will be included in square brackets at the beginning of all notifications, for example \[OpenACS Bugs\]}} } - {maintainer:search + {maintainer:search,optional {result_datatype integer} {label {Project Maintainer}} {options [bug_tracker::users_get_options]} - optional - {search_query_name project_search} + {search_query {[db_map dbqd.acs-tcl.tcl.community-core-procs.user_search]}} } } -select_query_name project_select -edit_data { db_transaction { Index: openacs-4/packages/bug-tracker/www/admin/project-maintainer-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/project-maintainer-edit.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/www/admin/project-maintainer-edit.adp 22 May 2003 14:24:26 -0000 1.3 +++ openacs-4/packages/bug-tracker/www/admin/project-maintainer-edit.adp 28 Aug 2003 09:45:30 -0000 1.4 @@ -1,6 +1,6 @@ <master src="../../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context">@context;noquote@</property> +<property name="title">@page_title@</property> +<property name="context">@context@</property> <property name="focus">project_maintainer.maintainer</property> <formtemplate id="project_maintainer" style="standard-lars"></formtemplate> Index: openacs-4/packages/bug-tracker/www/admin/project-maintainer-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/project-maintainer-edit.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/bug-tracker/www/admin/project-maintainer-edit.tcl 5 Mar 2003 17:41:17 -0000 1.7 +++ openacs-4/packages/bug-tracker/www/admin/project-maintainer-edit.tcl 28 Aug 2003 09:45:30 -0000 1.8 @@ -16,11 +16,10 @@ ad_form -name project_maintainer -cancel_url $return_url -form { {return_url:text(hidden) {value $return_url}} - {maintainer:search + {maintainer:search,optional {result_datatype integer} {label {Project Maintainer}} {options [bug_tracker::users_get_options]} - optional {search_query { select distinct u.first_names || ' ' || u.last_name || ' (' || u.email || ')' as name, u.user_id Index: openacs-4/packages/bug-tracker/www/admin/version-ae-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/Attic/version-ae-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bug-tracker/www/admin/version-ae-oracle.xql 28 Mar 2003 15:15:16 -0000 1.2 +++ openacs-4/packages/bug-tracker/www/admin/version-ae-oracle.xql 28 Aug 2003 09:45:30 -0000 1.3 @@ -3,17 +3,16 @@ <queryset> <rdbms><type>oracle</type><version>8.1.6</version></rdbms> -<fullquery name="version_search"> +<fullquery name="user_search"> <querytext> select distinct u.first_names || ' ' || u.last_name || ' (' || u.email || ')' as name, u.user_id from cc_users u - where upper(coalesce(u.first_names || ' ', '') || + where upper(nvl(u.first_names || ' ', '') || nvl(u.last_name || ' ', '') || u.email || ' ' || nvl(u.screen_name, '')) like upper('%'||:value||'%') order by name </querytext> </fullquery> - </queryset> Index: openacs-4/packages/bug-tracker/www/admin/version-ae-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/Attic/version-ae-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bug-tracker/www/admin/version-ae-postgresql.xql 5 Mar 2003 17:41:17 -0000 1.1 +++ openacs-4/packages/bug-tracker/www/admin/version-ae-postgresql.xql 28 Aug 2003 09:45:30 -0000 1.2 @@ -3,7 +3,7 @@ <queryset> <rdbms><type>postgresql</type><version>7.1</version></rdbms> -<fullquery name="version_search"> +<fullquery name="user_search"> <querytext> select distinct u.first_names || ' ' || u.last_name || ' (' || u.email || ')' as name, u.user_id from cc_users u Index: openacs-4/packages/bug-tracker/www/admin/version-ae.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/version-ae.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/www/admin/version-ae.adp 22 May 2003 14:24:26 -0000 1.3 +++ openacs-4/packages/bug-tracker/www/admin/version-ae.adp 28 Aug 2003 09:45:30 -0000 1.4 @@ -1,6 +1,6 @@ <master src="../../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context">@context;noquote@</property> +<property name="title">@page_title@</property> +<property name="context">@context@</property> <property name="focus">version.version_name</property> <formtemplate id="version" style="standard-lars"></formtemplate> Index: openacs-4/packages/bug-tracker/www/admin/version-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/version-ae.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/bug-tracker/www/admin/version-ae.tcl 5 Mar 2003 17:41:17 -0000 1.6 +++ openacs-4/packages/bug-tracker/www/admin/version-ae.tcl 28 Aug 2003 09:45:30 -0000 1.7 @@ -20,14 +20,13 @@ ad_form -name version -cancel_url $return_url -form { {version_id:key(acs_object_id_seq)} {version_name:text {label "Version name"} {html { size 50 }}} - {description:text(textarea) {label "Description"} optional {html { cols 50 rows 8 }}} - {supported_platforms:text {label "Supported platforms"} {html { size 50 }} optional} - {maintainer:search + {description:text(textarea),optional {label "Description"} {html { cols 50 rows 8 }}} + {supported_platforms:text,optional {label "Supported platforms"} {html { size 50 }}} + {maintainer:search,optional {result_datatype integer} {label "Maintainer"} {options {[bug_tracker::users_get_options]}} - optional - {search_query_name version_search} + {search_query {[db_map user_search]}} } {anticipated_freeze_date:date,to_sql(sql_date),to_html(sql_date),optional {label "Anticipated freeze"} optional @@ -41,7 +40,7 @@ {actual_release_date:date,to_sql(sql_date),to_html(sql_date),optional {label "Actual release"} optional } - {assignable_p:text(radio) {label "Assignable?"} optional {options {{Yes t} {No f}}}} + {assignable_p:text(radio),optional {label "Assignable?"} {options {{Yes t} {No f}}}} {return_url:text(hidden) {value $return_url}} } -select_query_name version_select -new_request { set assignable_p "t" Index: openacs-4/packages/bug-tracker/www/admin/version-release.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/version-release.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bug-tracker/www/admin/version-release.adp 22 May 2003 14:24:26 -0000 1.2 +++ openacs-4/packages/bug-tracker/www/admin/version-release.adp 28 Aug 2003 09:45:30 -0000 1.3 @@ -1,6 +1,6 @@ <master src="../../lib/master"> -<property name="title">@page_title;noquote@</property> -<property name="context">@context;noquote@</property> +<property name="title">@page_title@</property> +<property name="context">@context@</property> <property name="focus">version.actual_release_date</property> <formtemplate id="version" style="standard-lars"></formtemplate> Index: openacs-4/packages/bug-tracker/www/admin/version-release.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/version-release.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bug-tracker/www/admin/version-release.tcl 5 Mar 2003 17:41:17 -0000 1.1 +++ openacs-4/packages/bug-tracker/www/admin/version-release.tcl 28 Aug 2003 09:45:30 -0000 1.2 @@ -11,9 +11,8 @@ ad_form -name version -cancel_url versions -form { version_id:key {version_name:text {mode display} {label "Version Name"}} - {anticipated_release_date:date,to_sql(sql_date),to_html(sql_date) + {anticipated_release_date:date,to_sql(sql_date),to_html(sql_date),optional {mode display} {label "Anticipated release date"} - optional } {actual_release_date:date,to_sql(sql_date),to_html(sql_date) {label "Actual release date"} Index: openacs-4/packages/bug-tracker/www/admin/versions.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/versions.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/www/admin/versions.adp 22 May 2003 14:24:26 -0000 1.3 +++ openacs-4/packages/bug-tracker/www/admin/versions.adp 28 Aug 2003 09:45:30 -0000 1.4 @@ -1,8 +1,8 @@ <master src="../../lib/master"> -<property name="title">@ Versions</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@project_name@ Versions</property> +<property name="context_bar">@context_bar@</property> -<h3>Current Version</h3> +<h3>In Development</h3> <if @current_version:rowcount@ eq 0> <i>None</i> @@ -61,9 +61,6 @@ </table> </else> -<p> - The current version is the currently being developed on. -</p> <h3>Future Versions</h3> @@ -129,7 +126,7 @@ <a href="@version_add_url@">Add new version</a> -<h3>Past Versions</h3> +<h3>Already Released Versions</h3> <if @past_version:rowcount@ eq 0> <i>None</i> Index: openacs-4/packages/bug-tracker/www/doc/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/doc/index.html,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bug-tracker/www/doc/index.html 24 Sep 2002 08:38:28 -0000 1.1 +++ openacs-4/packages/bug-tracker/www/doc/index.html 28 Aug 2003 09:45:30 -0000 1.2 @@ -11,8 +11,20 @@ <li><a href="bug-tracker-spec">Specification</a></li> </ul> +<h3>Version History</h3> + +<ul> + <li> + <b>1.2d10</b> Upgraded to work with updated 'workflow' package, where we've renamed workflow_case__delete to + workflow_case_pkg__delete to avoid conflict with old 'acs-workflow' package. + </li> + <li> + <b>1.2</b> Updated to use new 'workflow' package, and to also be configurable as a ticket-tracker. + </li> +</ul> + <hr> <address><a href="mailto:lars@pinds.com">lars@pinds.com</a></address> </body> -</html> \ No newline at end of file +</html> Index: openacs-4/packages/bulk-mail/bulk-mail.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/bulk-mail.info,v diff -u -r1.4 -r1.5 --- openacs-4/packages/bulk-mail/bulk-mail.info 17 May 2003 10:19:06 -0000 1.4 +++ openacs-4/packages/bulk-mail/bulk-mail.info 28 Aug 2003 09:41:52 -0000 1.5 @@ -6,17 +6,16 @@ <pretty-plural>Bulk Mail</pretty-plural> <initial-install-p>f</initial-install-p> <singleton-p>f</singleton-p> + + <version name="0.3" url="http://openacs.org/repository/download/apm/bulk-mail-0.3.apm"> + <owner url="mailto:yon@milliped.com">Yonatan Feldman</owner> + <release-date>2003-06-12</release-date> - <version name="0.1a" url="http://openacs.org/repository/download/apm/bulk-mail-0.1a.apm"> - <database-support> - <database>oracle</database> - <database>postgresql</database> - </database-support> - <owner url="mailto:yon@openforce.net">Yonatan Feldman</owner> - - <provides url="bulk-mail" version="0.1a"/> + <provides url="bulk-mail" version="0.3"/> <requires url="acs-mail-lite" version="0.1d"/> + <callbacks> + </callbacks> <parameters> <parameter datatype="string" min_n_values="1" max_n_values="1" name="pretty_name" default="#bulk-mail.pretty_name#" description="Name of the package to display everywhere"/> </parameters> Index: openacs-4/packages/bulk-mail/sql/oracle/bulk-mail-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/sql/oracle/bulk-mail-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bulk-mail/sql/oracle/bulk-mail-create.sql 15 May 2002 22:07:52 -0000 1.1 +++ openacs-4/packages/bulk-mail/sql/oracle/bulk-mail-create.sql 28 Aug 2003 09:41:52 -0000 1.2 @@ -18,12 +18,6 @@ default sysdate constraint bm_messages_send_date_nn not null, - sent_p char(1) - default 'f' - constraint bm_messages_sent_p_ck - check (sent_p in ('t', 'f')) - constraint bm_messages_sent_p_nn - not null, from_addr varchar(4000) constraint bm_messages_from_addr_nn not null, @@ -33,8 +27,14 @@ message clob constraint bm_messages_message_nn not null, - query varchar(4000) + query clob constraint bm_messages_query_nn + not null, + status varchar2(100) + default 'pending' + constraint bm_messages_status_ck + check (status in ('pending', 'sent')) + constraint bm_messages_status_nn not null ); Index: openacs-4/packages/bulk-mail/sql/oracle/bulk-mail-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/sql/oracle/bulk-mail-package-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bulk-mail/sql/oracle/bulk-mail-package-create.sql 15 May 2002 22:07:52 -0000 1.1 +++ openacs-4/packages/bulk-mail/sql/oracle/bulk-mail-package-create.sql 28 Aug 2003 09:41:52 -0000 1.2 @@ -13,7 +13,7 @@ package_id in bulk_mail_messages.package_id%TYPE, send_date in varchar default null, date_format in varchar default 'YYYY MM DD HH24 MI SS', - sent_p in bulk_mail_messages.sent_p%TYPE default 'f', + status in bulk_mail_messages.status%TYPE default 'pending', from_addr in bulk_mail_messages.from_addr%TYPE, subject in bulk_mail_messages.subject%TYPE default null, reply_to in bulk_mail_messages.reply_to%TYPE default null, @@ -42,7 +42,7 @@ package_id in bulk_mail_messages.package_id%TYPE, send_date in varchar default null, date_format in varchar default 'YYYY MM DD HH24 MI SS', - sent_p in bulk_mail_messages.sent_p%TYPE default 'f', + status in bulk_mail_messages.status%TYPE default 'pending', from_addr in bulk_mail_messages.from_addr%TYPE, subject in bulk_mail_messages.subject%TYPE default null, reply_to in bulk_mail_messages.reply_to%TYPE default null, @@ -78,12 +78,12 @@ insert into bulk_mail_messages (bulk_mail_id, package_id, - send_date, sent_p, + send_date, status, from_addr, subject, reply_to, extra_headers, message, query) values (v_bulk_mail_id, bulk_mail.new.package_id, - to_date(bulk_mail.new.send_date, bulk_mail.new.date_format), bulk_mail.new.sent_p, + to_date(bulk_mail.new.send_date, bulk_mail.new.date_format), bulk_mail.new.status, bulk_mail.new.from_addr, bulk_mail.new.subject, bulk_mail.new.reply_to, bulk_mail.new.extra_headers, bulk_mail.new.message, bulk_mail.new.query); Index: openacs-4/packages/bulk-mail/sql/oracle/bulk-mail-views-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/sql/oracle/bulk-mail-views-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bulk-mail/sql/oracle/bulk-mail-views-create.sql 15 May 2002 22:07:52 -0000 1.1 +++ openacs-4/packages/bulk-mail/sql/oracle/bulk-mail-views-create.sql 28 Aug 2003 09:41:52 -0000 1.2 @@ -9,10 +9,11 @@ as select bulk_mail_messages.* from bulk_mail_messages - where sent_p = 'f'; + where status = 'pending'; create or replace view bulk_mail_messages_sent as select bulk_mail_messages.* from bulk_mail_messages - where sent_p = 't'; + where status = 'sent'; + Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/bulk-mail/sql/oracle/upgrade/upgrade-0.1a-0.2.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/bulk-mail/sql/oracle/upgrade/upgrade-0.3-0.4.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-create.sql 12 Jun 2002 13:53:13 -0000 1.2 +++ openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-create.sql 28 Aug 2003 09:41:52 -0000 1.3 @@ -16,7 +16,7 @@ references apm_packages (package_id) constraint bm_messages_package_id_nn not null, - send_date date + send_date timestamptz default now() constraint bm_messages_send_date_nn not null, @@ -33,9 +33,14 @@ message text constraint bm_messages_message_nn not null, - query varchar(4000) + query text constraint bm_messages_query_nn + not null, + status varchar(100) + default 'pending' + constraint bm_messages_status_nn not null + ); -- create a new object type Index: openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-package-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-package-create.sql 17 May 2003 10:19:23 -0000 1.4 +++ openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-package-create.sql 28 Aug 2003 09:41:52 -0000 1.5 @@ -5,7 +5,7 @@ -- @version $Id$ -- -select define_function_args('bulk_mail__new','bulk_mail_id,package_id,send_date,date_format,sent_p;f,from_addr,subject,reply_to,extra_headers,message,query,creation_date;now(),creation_user,creation_ip,context_id'); +select define_function_args('bulk_mail__new','bulk_mail_id,package_id,send_date,date_format,status;pending,from_addr,subject,reply_to,extra_headers,message,query,creation_date;now(),creation_user,creation_ip,context_id'); create function bulk_mail__new (integer, integer, varchar, varchar, varchar, varchar, varchar, varchar, varchar, text, varchar, timestamptz, integer, varchar, integer) returns integer as ' @@ -14,7 +14,7 @@ bulk_mail__new__package_id alias for $2; bulk_mail__new__send_date alias for $3; -- default to null bulk_mail__new__date_format alias for $4; -- default to "YYYY MM DD HH24 MI SS" - bulk_mail__new__sent_p alias for $5; -- default to "f" + bulk_mail__new__status alias for $5; -- default to "pending" bulk_mail__new__from_addr alias for $6; bulk_mail__new__subject alias for $7; -- default to null bulk_mail__new__reply_to alias for $8; -- default to null @@ -28,7 +28,7 @@ v_bulk_mail_id integer; v_send_date varchar(4000); v_date_format varchar(4000); - v_sent_p boolean; + v_status varchar(100); begin v_bulk_mail_id := acs_object__new( @@ -51,20 +51,20 @@ into v_send_date; end if; - v_sent_p := bulk_mail__new__sent_p; - if v_sent_p is null then - v_sent_p := ''f''; + v_status := bulk_mail__new__status; + if v_status is null then + v_status := ''pending''; end if; insert into bulk_mail_messages (bulk_mail_id, package_id, - send_date, sent_p, + send_date, status, from_addr, subject, reply_to, extra_headers, message, query) values (v_bulk_mail_id, bulk_mail__new__package_id, - to_date(v_send_date, v_date_format), v_sent_p, + to_date(v_send_date, v_date_format), v_status, bulk_mail__new__from_addr, bulk_mail__new__subject, bulk_mail__new__reply_to, bulk_mail__new__extra_headers, bulk_mail__new__message, bulk_mail__new__query); Index: openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-views-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-views-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-views-create.sql 15 May 2002 22:07:52 -0000 1.1 +++ openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-views-create.sql 28 Aug 2003 09:41:52 -0000 1.2 @@ -9,10 +9,10 @@ as select bulk_mail_messages.* from bulk_mail_messages - where sent_p = 'f'; + where status = 'pending'; create view bulk_mail_messages_sent as select bulk_mail_messages.* from bulk_mail_messages - where sent_p = 't'; + where status = 'sent'; Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/bulk-mail/sql/postgresql/upgrade/upgrade-0.1a-0.2.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/bulk-mail/sql/postgresql/upgrade/upgrade-0.2-0.3.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/bulk-mail/sql/postgresql/upgrade/upgrade-0.3-0.4.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-oracle.xql 16 Jan 2003 13:44:51 -0000 1.2 +++ openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-oracle.xql 28 Aug 2003 09:41:53 -0000 1.3 @@ -22,8 +22,9 @@ <querytext> select bulk_mail_messages.* from bulk_mail_messages - where bulk_mail_messages.sent_p = 'f' + where bulk_mail_messages.status = 'pending' and bulk_mail_messages.send_date <= sysdate + for update </querytext> </fullquery> Index: openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-postgresql.xql 16 Jan 2003 13:44:51 -0000 1.2 +++ openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-postgresql.xql 28 Aug 2003 09:41:53 -0000 1.3 @@ -21,8 +21,9 @@ <querytext> select bulk_mail_messages.* from bulk_mail_messages - where bulk_mail_messages.sent_p = 'f' + where bulk_mail_messages.status = 'pending' and bulk_mail_messages.send_date <= now() + for update </querytext> </fullquery> Index: openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.tcl 16 Jan 2003 13:44:51 -0000 1.5 +++ openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.tcl 28 Aug 2003 09:41:53 -0000 1.6 @@ -1,10 +1,10 @@ ad_library { - bulk mail procedure library + bulk_mail procedure library @author yon (yon@openforce.net) @creation-date 2002-05-07 - @cvs-id $Id$ + @version $Id$ } @@ -84,6 +84,7 @@ {-reply_to ""} {-extra_headers ""} {-message:required} + {-message_type ""} {-query:required} } { create a new bulk_mail message @@ -107,6 +108,7 @@ @param message the body of the email, can be overridden by a value selected in the query. will be interpolated with values from the query. + @param message_type - "text" or "html" (added by mohan) @param query a query that must select the email address to send to as 'email' and can select any other values that will be interpolated into the subject and message of the bulk_mail for @@ -155,8 +157,9 @@ ns_set put $extra_vars from_addr $from_addr ns_set put $extra_vars subject $subject ns_set put $extra_vars reply_to $reply_to - ns_set put $extra_vars extra_headers $extra_headers + ns_set put $extra_vars extra_headers "$extra_headers bulk-mail-type $message_type" ns_set put $extra_vars message $message + ns_set put $extra_vars message_type $message_type ns_set put $extra_vars query $query ns_set put $extra_vars context_id $package_id @@ -171,15 +174,17 @@ ns_log notice "bulk_mail::sweep starting" ## JCD: this transaction is misguided since any code - ## errors in any procs below would cause the messages + ## errors in any procs below would cause the messages ## already sent to be marked unsent. Also, it seems to - ## cause locking problems on oracle + ## cause locking problems on oracle ## (per Caroline Meeks ## http://openacs.org/bugtracker/openacs/bug?bug_number=93 #db_transaction { - foreach bulk_mail [db_list_of_ns_sets select_bulk_mails_to_send {}] { + #Although the message may change for each recipiant, it usually doesn't. We check by looking to see if message_old = the current messag. This is inicialized here for each bulk_mail. + set message_old "" + foreach recipient [db_list_of_ns_sets select_bulk_mail_recipients [ns_set get $bulk_mail query]] { # create a list of key, value pairs that will be used to @@ -225,18 +230,52 @@ set message [ns_set get $recipient message] } + # mohan's hack to fix the passing of message type for the + # mail. + # Comment: I have to ask Caroline or Andrew if itis ok to + # change bulk-mail datamodel to accomodate message_type. + + set extra_headers [util_list_to_ns_set [ns_set get $bulk_mail extra_headers]] + set message_type [ns_set get $extra_headers bulk-mail-type] + + # don't need this anymore and don't want to send it along + ns_set delkey $extra_headers bulk-mail-type + # interpolate the key, value pairs (as described above) # into the message body set message [interpolate -values $pairs -text $message] - # send the message reliably - acs_mail_lite::send \ - -to_addr [ns_set get $recipient email] \ - -from_addr $from_addr \ - -subject $subject \ - -body $message \ - -extraheaders [util_list_to_ns_set [ns_set get $bulk_mail extra_headers]] + if {$message_type == "html"} { + if {[string compare $message_old $message] != 0} { + # If this message is different then the last loop + # we set up the html and text messages. Note that + # ad_html_text_convert can get quite expensive, + # if you start sending different long html + # messages created by microsoft word to each of + # over 100 users, expect performance problems. + # the from to html closes any open tags. + set message_html [ad_html_text_convert -from html -to html $message] + # some mailers are chopping off the last few characters. + append message_html " " + set message_text [ad_html_text_convert -from html -to text $message] + set message_old $message + } + + set message_data [build_mime_message $message_text $message_html] + ns_set put $extra_headers MIME-Version [ns_set get $message_data MIME-Version] + ns_set put $extra_headers Content-ID [ns_set get $message_data Content-ID] + ns_set put $extra_headers Content-Type [ns_set get $message_data Content-Type] + set message [ns_set get $message_data body] + } + + # both html and plain messages can now be sent the same way + acs_mail_lite::send \ + -to_addr [ns_set get $recipient email] \ + -from_addr $from_addr \ + -subject $subject \ + -body $message \ + -extraheaders $extra_headers } # mark the bulk_mail as sent so that we don't process it again Index: openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.xql 15 May 2002 22:07:52 -0000 1.1 +++ openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.xql 28 Aug 2003 09:41:53 -0000 1.2 @@ -12,7 +12,7 @@ <fullquery name="bulk_mail::sweep.mark_message_sent"> <querytext> update bulk_mail_messages - set sent_p = 't' + set status = 'sent' where bulk_mail_id = :bulk_mail_id </querytext> </fullquery> Index: openacs-4/packages/bulk-mail/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/www/index.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/bulk-mail/www/index.tcl 18 Nov 2002 18:01:15 -0000 1.9 +++ openacs-4/packages/bulk-mail/www/index.tcl 28 Aug 2003 09:41:53 -0000 1.10 @@ -20,11 +20,11 @@ set context [list All] set table_def [list \ - [list send_date "[_ bulk-mail.Send_Date]" {bulk_mail_messages.send_date $order} {<td width="10%">[lc_time_fmt $send_date "%q"]</td>}] \ - [list from_addr "[_ bulk-mail.From]" {bulk_mail_messages.from_addr $order} {<td width="15%">$from_addr</td>}] \ - [list subject "[_ bulk-mail.Subject]" {bulk_mail_messages.subject $order} {<td><a href="[lindex [site_node::get_url_from_object_id -object_id $package_id] 0]one?bulk_mail_id=$bulk_mail_id">$subject</a></td>}] \ - [list sent_p "[_ bulk-mail.Sent]" {bulk_mail_messages.sent_p $order} {<td width="10%" align="center">[ad_decode $sent_p t [_ bulk-mail.Yes] [_ bulk-mail.No]]</td>}] \ -] + [list send_date [_ bulk-mail.Send_Date] {bulk_mail_messages.send_date $order} {<td width="10%">[lc_time_fmt $send_date "%q"]</td>}] \ + [list from_addr [_ bulk-mail.From] {bulk_mail_messages.from_addr $order} {<td width="15%">$from_addr</td>}] \ + [list subject [_ bulk-mail.Subject] {bulk_mail_messages.subject $order} {<td><a href="[lindex [site_node::get_url_from_object_id -object_id $package_id] 0]one?bulk_mail_id=$bulk_mail_id">$subject</a></td>}] \ + [list status [_ bulk-mail.Sent] {bulk_mail_messages.status $order} {<td width="10%" align="center">[ad_decode $status sent [_ bulk-mail.Yes] [_ bulk-mail.No]]</td>}] \ + ] set sql " select bulk_mail_messages.* Index: openacs-4/packages/bulk-mail/www/one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/www/one.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/bulk-mail/www/one.adp 22 May 2003 14:25:02 -0000 1.8 +++ openacs-4/packages/bulk-mail/www/one.adp 28 Aug 2003 09:41:53 -0000 1.9 @@ -33,7 +33,7 @@ </tr> <tr> <td>#bulk-mail.Sent#</td> - <td><if @sent_p@>#bulk-mail.Yes#</if><else>#bulk-mail.No#</else></td> + <td><if @status@ eq sent>#bulk-mail.Yes#</if><else>#bulk-mail.No#</else></td> </tr> </table> Index: openacs-4/packages/bulk-mail/www/one.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/www/one.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bulk-mail/www/one.xql 15 May 2002 22:07:52 -0000 1.1 +++ openacs-4/packages/bulk-mail/www/one.xql 28 Aug 2003 09:41:53 -0000 1.2 @@ -6,7 +6,7 @@ <querytext> select bulk_mail_messages.bulk_mail_id, to_char(bulk_mail_messages.send_date, 'Mon DD YYYY HH24:MI') as send_date, - bulk_mail_messages.sent_p, + bulk_mail_messages.status, bulk_mail_messages.from_addr, bulk_mail_messages.subject, bulk_mail_messages.reply_to, Index: openacs-4/packages/ecommerce/tcl/ecommerce-email-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-email-procs.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ecommerce/tcl/ecommerce-email-procs.xql 26 May 2002 04:36:49 -0000 1.4 +++ openacs-4/packages/ecommerce/tcl/ecommerce-email-procs.xql 28 Aug 2003 09:41:53 -0000 1.5 @@ -2,25 +2,26 @@ <queryset> - <fullquery name="template_select_1"> + <fullquery name="ec_email_new_order.template_select_1"> <querytext> select subject as email_subject, message as email_body, issue_type_list from ec_email_templates where email_template_id = 1 </querytext> </fullquery> - <fullquery name="notification_select"> + <fullquery name="ec_email_product_notification.notification_select"> <querytext> select ep.email_on_purchase_list, ep.product_name from ec_items ei, ec_products ep where ei.product_id = ep.product_id and ei.order_id = :order_id + and email_on_purchase_list is not null group by ep.email_on_purchase_list, ep.product_name </querytext> </fullquery> - <fullquery name="user_select"> + <fullquery name="ec_email_delayed_credit_denied.user_select"> <querytext> select u.email, u.user_id from ec_orders, cc_users u @@ -29,15 +30,15 @@ </querytext> </fullquery> - <fullquery name="template_select_3"> + <fullquery name="ec_email_delayed_credit_denied.template_select_3"> <querytext> select subject as email_subject, message as email_body, issue_type_list from ec_email_templates where email_template_id = 3 </querytext> </fullquery> - <fullquery name="shipment_select"> + <fullquery name="ec_email_order_shipped.shipment_select"> <querytext> select u.email, u.user_id, s.shipment_date, s.address_id, o.order_state, o.order_id from ec_orders o, cc_users u, ec_shipments s @@ -47,7 +48,7 @@ </querytext> </fullquery> - <fullquery name="item_summary_select"> + <fullquery name="ec_email_order_shipped.item_summary_select"> <querytext> select p.product_name, p.one_line_description, p.product_id, i.price_charged, i.price_name, count(*) as quantity from ec_items i, ec_products p @@ -57,15 +58,15 @@ </querytext> </fullquery> - <fullquery name="template_select_2"> + <fullquery name="ec_email_order_shipped.template_select_2"> <querytext> select subject as email_subject, message as email_body, issue_type_list from ec_email_templates where email_template_id = 2 </querytext> </fullquery> - <fullquery name="gift_certificate_select"> + <fullquery name="ec_email_new_gift_certificate_order.gift_certificate_select"> <querytext> select g.purchased_by as user_id, u.email, g.recipient_email, g.amount from ec_gift_certificates g, cc_users u @@ -74,15 +75,15 @@ </querytext> </fullquery> - <fullquery name="template_select_4"> + <fullquery name="ec_email_new_gift_certificate_order.template_select_4"> <querytext> select subject as email_subject, message as email_body, issue_type_list from ec_email_templates where email_template_id = 4 </querytext> </fullquery> - <fullquery name="gift_certificate_select_2"> + <fullquery name="ec_email_gift_certificate_order_failure.gift_certificate_select_2"> <querytext> select g.purchased_by as user_id, u.email, g.recipient_email, g.amount, g.certificate_to, g.certificate_from, g.certificate_message from ec_gift_certificates g, cc_users u @@ -91,43 +92,43 @@ </querytext> </fullquery> - <fullquery name="template_select_6"> + <fullquery name="ec_email_gift_certificate_order_failure.template_select_6"> <querytext> select subject as email_subject, message as email_body, issue_type_list from ec_email_templates where email_template_id = 6 </querytext> </fullquery> - <fullquery name="gift_certificate_select_3"> + <fullquery name="ec_email_gift_certificate_recipient.gift_certificate_select_3"> <querytext> select g.recipient_email as email, g.amount, g.certificate_to, g.certificate_from, g.certificate_message, g.claim_check from ec_gift_certificates g where g.gift_certificate_id=:gift_certificate_id </querytext> </fullquery> - <fullquery name="template_select_5"> + <fullquery name="ec_email_gift_certificate_recipient.template_select_5"> <querytext> select subject as email_subject, message as email_body, issue_type_list from ec_email_templates where email_template_id=5 </querytext> </fullquery> - <fullquery name="user_id_select"> + <fullquery name="ec_email_gift_certificate_recipient.user_id_select"> <querytext> select user_id from cc_users where email=lower(:email) </querytext> </fullquery> - <fullquery name="user_identification_id_select"> + <fullquery name="ec_email_gift_certificate_recipient.user_identification_id_select"> <querytext> select user_identification_id from ec_user_identification where email=lower(:email) </querytext> </fullquery> - <fullquery name="user_identification_id_insert"> + <fullquery name="ec_email_gift_certificate_recipient.user_identification_id_insert"> <querytext> insert into ec_user_identification (user_identification_id, email) Index: openacs-4/packages/ecommerce/tcl/ecommerce-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-procs-oracle.xql,v diff -u -r1.10 -r1.11 --- openacs-4/packages/ecommerce/tcl/ecommerce-procs-oracle.xql 23 Sep 2002 20:43:26 -0000 1.10 +++ openacs-4/packages/ecommerce/tcl/ecommerce-procs-oracle.xql 28 Aug 2003 09:41:53 -0000 1.11 @@ -40,6 +40,14 @@ </querytext> </fullquery> + <fullquery name="ec_mailing_list_link_for_a_product.mailing_categories"> + <querytext> + select category_id, subcategory_id, subsubcategory_id, product_id + from ($common_sql) as dummy + where rownum < 2 + </querytext> + </fullquery> + <fullquery name="ec_add_to_cart_link.get_product_info_1"> <querytext> select decode(sign(sysdate-available_date),1,1,null,1,0) as available_p, Index: openacs-4/packages/ecommerce/tcl/ecommerce-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-procs-postgresql.xql,v diff -u -r1.11 -r1.12 --- openacs-4/packages/ecommerce/tcl/ecommerce-procs-postgresql.xql 16 Jan 2003 13:46:35 -0000 1.11 +++ openacs-4/packages/ecommerce/tcl/ecommerce-procs-postgresql.xql 28 Aug 2003 09:41:53 -0000 1.12 @@ -40,6 +40,14 @@ </querytext> </fullquery> + <fullquery name="ec_mailing_list_link_for_a_product.mailing_categories"> + <querytext> + select category_id, subcategory_id, subsubcategory_id, product_id + from ($common_sql) as dummy + limit 1 + </querytext> + </fullquery> + <fullquery name="ec_add_to_cart_link.get_product_info_1"> <querytext> select case when current_timestamp > available_date then 1 when current_timestamp-available_date is NULL then 1 else 0 end as available_p, Index: openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 3 Oct 2002 17:31:35 -0000 1.19 +++ openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 28 Aug 2003 09:41:53 -0000 1.20 @@ -367,46 +367,25 @@ } } -# returns a link for the user to add him/herself to the mailing list for whatever category/ -# subcategory/subsubcategory a product is in. -# If the product is multiply categorized, this will just use the first categorization that -# Oracle finds for this product. ad_proc ec_mailing_list_link_for_a_product { product_id } { -returns a link for the user to add him/herself to the mailing list for whatever category/subcategory/subsubcategory a product is in. -If the product is multiply categorized, this will just use the first categorization that Oracle finds for this product. + + Returns a link for the user to add him/herself to the mailing + list for whatever category/subcategory/subsubcategory a product + is in. If the product is multiply categorized, this will just + use the first categorization that the DB finds for this product. + } { set category_id "" set subcategory_id "" set subsubcategory_id "" - db_foreach category_id_select { - select category_id from ec_category_product_map where product_id = :product_id - } { - - db_foreach subcategory_id_select { - select s.subcategory_id - from ec_subcategory_product_map m, - ec_subcategories s - where m.subcategory_id = s.subcategory_id - and s.category_id = :category_id - and m.product_id = :product_id - } { - - db_foreach subsubcategory_id_select { - select ss.subsubcategory_id - from ec_subsubcategory_product_map m, - ec_subsubcategories ss - where m.subsubcategory_id = ss.subsubcategory_id - and ss.subcategory_id = :subcategory_id - and m.product_id = :product_id - } { } - } - } + set common_sql [db_map mailing_categories_common] + db_0or1row mailing_categories {} if { ![empty_string_p $category_id] || ![empty_string_p $subcategory_id] || ![empty_string_p $subsubcategory_id] } { - return "<a href=\"[ec_url]mailing-list-add?[export_url_vars category_id subcategory_id subsubcategory_id]\">Add yourself to the [ec_full_categorization_display $category_id $subcategory_id $subsubcategory_id] mailing list!</a>" + return "<a href=\"[ec_url]mailing-list-add?[export_url_vars category_id subcategory_id subsubcategory_id]\">Add yourself to the [ec_full_categorization_display $category_id $subcategory_id $subsubcategory_id] mailing list!</a>" } else { - return "" + return "" } } @@ -563,7 +542,8 @@ $end_of_comment_query " { - append comments_to_print "<b><a href=\"/shared/community-member?[export_url_vars user_id]\">$email</a></b> rated this product [ec_display_rating $rating] on <i>$last_modified_pretty</i> and wrote:<br> + array set person [person::get -person_id $user_id] + append comments_to_print "<b><a href=\"/shared/community-member?[export_url_vars user_id]\">$person(first_names) $person(last_name)</a></b> rated this product [ec_display_rating $rating] on <i>$last_modified_pretty</i> and wrote:<br> <b>$one_line_summary</b><br> $user_comment <p> Index: openacs-4/packages/ecommerce/tcl/ecommerce-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-procs.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/ecommerce/tcl/ecommerce-procs.xql 26 May 2002 04:36:49 -0000 1.6 +++ openacs-4/packages/ecommerce/tcl/ecommerce-procs.xql 28 Aug 2003 09:41:53 -0000 1.7 @@ -151,15 +151,24 @@ </querytext> </fullquery> - <fullquery name="ec_mailing_list_link_for_a_product.subsubcategory_id_select"> + <partialquery name="ec_mailing_list_link_for_a_product.mailing_categories_common"> <querytext> - select ss.subsubcategory_id - from ec_subsubcategory_product_map m, ec_subsubcategories ss - where m.subsubcategory_id = ss.subsubcategory_id - and ss.subcategory_id = :subcategory_id - and m.product_id = :product_id + (select cpm.category_id, bla.subcategory_id, cpm.product_id + from ec_category_product_map cpm + left join (select sc.category_id, spm.subcategory_id, spm.product_id + from ec_subcategory_product_map spm, ec_subcategories sc + where sc.subcategory_id = spm.subcategory_id) as bla + using (category_id, product_id) + where cpm.product_id = :product_id + ) as bogus + left join (select sc.category_id, ssc.subcategory_id, sspm.subsubcategory_id, sspm.product_id + from ec_subsubcategory_product_map sspm, ec_subcategories sc, ec_subsubcategories ssc + where sspm.subsubcategory_id = ssc.subsubcategory_id + and ssc.subcategory_id = sc.subcategory_id + ) as boring + using (category_id, subcategory_id, product_id) </querytext> - </fullquery> + </partialquery> <fullquery name="ec_product_links_if_they_exist.product_link_info_select"> <querytext> Index: openacs-4/packages/ecommerce/www/admin/products/edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/edit-2.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/products/edit-2.tcl 10 Sep 2002 22:22:45 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/products/edit-2.tcl 28 Aug 2003 09:41:53 -0000 1.4 @@ -451,7 +451,7 @@ " # also need to export custom field values -db_foreach custom_fields_select "select field_identifier from ec_custom_product_fields where active_p='t'" { +db_foreach custom_fields_export "select field_identifier from ec_custom_product_fields where active_p='t'" { if { [info exists ec_custom_fields($field_identifier)] } { doc_body_append "<input type=hidden name=\"ec_custom_fields.$field_identifier\" value=\"[ad_quotehtml $ec_custom_fields($field_identifier)]\">\n" } Index: openacs-4/packages/ecommerce/www/admin/products/edit-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/edit-2.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/products/edit-2.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/products/edit-2.xql 28 Aug 2003 09:41:53 -0000 1.2 @@ -45,7 +45,7 @@ </fullquery> -<fullquery name="custom_fields_select"> +<fullquery name="custom_fields_export"> <querytext> select field_identifier from ec_custom_product_fields where active_p='t' </querytext> Index: openacs-4/packages/edit-this-page/sql/oracle/edit-this-page-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/sql/oracle/edit-this-page-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/edit-this-page/sql/oracle/edit-this-page-create.sql 17 May 2003 10:30:52 -0000 1.7 +++ openacs-4/packages/edit-this-page/sql/oracle/edit-this-page-create.sql 28 Aug 2003 09:41:53 -0000 1.8 @@ -442,3 +442,19 @@ end; / show errors; + + +-- create a default content_type etp_page_revision +-- DaveB +-- this references a non-existant table +-- which I might have to change... + +select content_type__create_type ( + content_type => 'etp_page_revision', -- content_type + supertype => 'content_revision', -- supertype + pretty_name => 'ETP managed page', -- pretty_name + pretty_plural => 'ETP managed pages', -- pretty_plural + table_name => 'etp_page_revisions', -- table_name + id_column => 'etp_page_revision_id', -- id_column + name_method => 'content_revision__revision_name' -- name_method +); Index: openacs-4/packages/edit-this-page/tcl/etp-sc-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/tcl/etp-sc-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/edit-this-page/tcl/etp-sc-procs-postgresql.xql 4 Apr 2003 15:20:28 -0000 1.2 +++ openacs-4/packages/edit-this-page/tcl/etp-sc-procs-postgresql.xql 28 Aug 2003 09:41:53 -0000 1.3 @@ -24,7 +24,7 @@ 'FtsContentProvider', -- impl_contract_name :content_type, -- impl_name 'datasource', -- impl_operation_name - 'etp_page_revision__datasource', -- impl_alias + 'etp::revision_datasource', -- impl_alias 'TCL' -- impl_pl ) </querytext> @@ -36,7 +36,7 @@ 'FtsContentProvider', -- impl_contract_name :content_type, -- impl_name 'url', -- impl_operation_name - 'etp_page_revision__url', -- impl_alias + 'etp::revision_url', -- impl_alias 'TCL' -- impl_pl ); </querytext> Index: openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql 17 May 2003 10:37:05 -0000 1.5 +++ openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql 28 Aug 2003 09:41:53 -0000 1.6 @@ -75,7 +75,9 @@ -- Move a file, and all its versions, to a new folder -- file_id in cr_items.item_id%TYPE, - target_folder_id in cr_items.parent_id%TYPE + target_folder_id in cr_items.parent_id%TYPE, + creation_user in acs_objects.creation_user%TYPE, + creation_ip in acs_objects.creation_ip%TYPE ); function get_title( @@ -305,7 +307,7 @@ ); end if; - acs_object.update_last_modified(file_storage.new_file.folder_id); + acs_object.update_last_modified(file_storage.new_file.folder_id,new_file.creation_user,new_file.creation_ip); return v_item_id; end new_file; @@ -400,7 +402,7 @@ content_length = v_content_length where revision_id = v_new_version_id; - acs_object.update_last_modified(file_storage.copy_file.target_folder_id); + acs_object.update_last_modified(file_storage.copy_file.target_folder_id,file_storage.copy_file.creation_user,file_storage.copy_file.creation_ip); return v_new_version_id; end copy_file; @@ -410,7 +412,9 @@ -- Move a file, and all its versions, to a new folder -- file_id in cr_items.item_id%TYPE, - target_folder_id in cr_items.parent_id%TYPE + target_folder_id in cr_items.parent_id%TYPE, + creation_user in acs_objects.creation_user%TYPE, + creation_ip in acs_objects.creation_ip%TYPE ) is begin @@ -419,7 +423,7 @@ target_folder_id => file_storage.move_file.target_folder_id ); - acs_object.update_last_modified(file_storage.move_file.target_folder_id); + acs_object.update_last_modified(file_storage.move_file.target_folder_id,file_storage.move_file.creation_user,file_storage.move_file.creation_ip); end; @@ -457,7 +461,7 @@ from cr_items where cr_items.item_id = file_storage.new_version.item_id; - acs_object.update_last_modified(v_folder_id); + acs_object.update_last_modified(v_folder_id,new_version.creation_user,new_version.creation_ip); return v_revision_id; Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/sql/oracle/upgrade/upgrade-4.6.2-4.6.3.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql 17 May 2003 10:38:11 -0000 1.9 +++ openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql 28 Aug 2003 09:41:53 -0000 1.10 @@ -225,7 +225,7 @@ end if; - perform acs_object__update_last_modified(new_file__folder_id); + perform acs_object__update_last_modified(new_file__folder_id,new_file__user_id,new_file__creation_ip); return v_item_id; @@ -392,7 +392,7 @@ end if; - perform acs_object__update_last_modified(copy_file__target_folder_id); + perform acs_object__update_last_modified(copy_file__target_folder_id,copy_file__creation_user,copy_file__creation_ip); return v_new_version_id; @@ -410,14 +410,16 @@ declare move_file__file_id alias for $1; move_file__target_folder_id alias for $2; + move_file__creation_user alias for $3; + move_file__creation_ip alias for $4; begin perform content_item__move( move_file__file_id, -- item_id move_file__target_folder_id -- target_folder_id ); - perform acs_object__update_last_modified(move_file__target_folder_id); + perform acs_object__update_last_modified(move_file__target_folder_id,move_file__creation_user,move_file__creation_ip); return 0; end;' language 'plpgsql'; @@ -554,7 +556,7 @@ from cr_items where cr_items.item_id = new_version__item_id; - perform acs_object__update_last_modified(v_folder_id); + perform acs_object__update_last_modified(v_folder_id,new_version__creation_user,new_version__creation_ip); return v_revision_id; Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/sql/postgresql/upgrade/upgrade-4.6.2-4.6.3.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/file-storage/www/file-move-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-move-2-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/file-storage/www/file-move-2-oracle.xql 25 Sep 2001 16:52:03 -0000 1.2 +++ openacs-4/packages/file-storage/www/file-move-2-oracle.xql 28 Aug 2003 09:41:54 -0000 1.3 @@ -9,7 +9,9 @@ begin file_storage.move_file ( file_id => :file_id, - target_folder_id => :parent_id + target_folder_id => :parent_id, + creation_user => :user_id, + creation_ip => :address ); end; Index: openacs-4/packages/file-storage/www/file-move-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-move-2-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/file-storage/www/file-move-2-postgresql.xql 25 Sep 2001 16:52:16 -0000 1.2 +++ openacs-4/packages/file-storage/www/file-move-2-postgresql.xql 28 Aug 2003 09:41:54 -0000 1.3 @@ -8,7 +8,9 @@ select file_storage__move_file ( :file_id, -- file_id - :parent_id -- target_folder_id + :parent_id, -- target_folder_id + :user_id, -- creation_user + :address -- creation_ip ); </querytext> Index: openacs-4/packages/file-storage/www/file-move-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-move-2.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/file-storage/www/file-move-2.tcl 5 Nov 2002 17:19:59 -0000 1.7 +++ openacs-4/packages/file-storage/www/file-move-2.tcl 28 Aug 2003 09:41:54 -0000 1.8 @@ -26,13 +26,18 @@ ad_require_permission $file_id write ad_require_permission $parent_id write +set user_id [ad_conn user_id] +set address [ad_conn peeraddr] + db_transaction { db_exec_plsql file_move " begin file_storage.move_file ( file_id => :file_id, - target_folder_id => :parent_id + target_folder_id => :parent_id, + creation_user => :user_id, + creation_ip => :address: ); end;" Index: openacs-4/packages/file-storage/www/file.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file.adp,v diff -u -r1.13 -r1.14 --- openacs-4/packages/file-storage/www/file.adp 13 Aug 2003 13:30:53 -0000 1.13 +++ openacs-4/packages/file-storage/www/file.adp 28 Aug 2003 09:41:54 -0000 1.14 @@ -38,7 +38,8 @@ </if> </ul> - +<a href="index?folder_id=@folder_id@">Back</a> to folder view +<p> <table border=1 cellspacing=2 cellpadding=2> <tr> <td colspan=7> @@ -59,7 +60,7 @@ <multiple name=version> <tr> <td><img src="graphics/file.gif"> - <a href="download/index?version_id=@version.version_id@">@version.title@</a> + <a href="download/@version.title@?version_id=@version.version_id@">@version.title@</a> </td> <td>@version.author@</td> <td align=right>@version.content_size_pretty@</td> Index: openacs-4/packages/file-storage/www/file.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/file-storage/www/file.tcl 13 Aug 2003 11:14:35 -0000 1.12 +++ openacs-4/packages/file-storage/www/file.tcl 28 Aug 2003 09:41:54 -0000 1.13 @@ -63,11 +63,15 @@ set content_size_pretty [lc_numeric $content_size] } -if { [apm_package_installed_p "general-comments"] && [ad_parameter "GeneralCommentsP" -default 0] } { - set return_url "[ad_conn url]?file_id=$file_id" +set return_url "[ad_conn url]?file_id=$file_id" + +if { [apm_package_installed_p "general-comments"] && [ad_parameter "GeneralCommentsP" -package_id [ad_conn package_id]] } { set gc_link [general_comments_create_link $file_id $return_url] set gc_comments [general_comments_get_comments $file_id $return_url] } else { set gc_link "" set gc_comments "" } + +# get folder id so we can implement a back link +set folder_id [db_string get_folder ""] Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/www/file.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/forums/sql/postgresql/forums-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/sql/postgresql/forums-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/forums/sql/postgresql/forums-create.sql 1 Jun 2002 19:02:29 -0000 1.1 +++ openacs-4/packages/forums/sql/postgresql/forums-create.sql 28 Aug 2003 09:41:54 -0000 1.2 @@ -22,3 +22,6 @@ -- notifications \i forums-notifications-init.sql + +-- Search +\i forums-sc-create.sql Index: openacs-4/packages/forums/sql/postgresql/forums-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/sql/postgresql/forums-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/forums/sql/postgresql/forums-drop.sql 12 Jun 2002 15:24:02 -0000 1.1 +++ openacs-4/packages/forums/sql/postgresql/forums-drop.sql 28 Aug 2003 09:41:54 -0000 1.2 @@ -21,3 +21,6 @@ -- The basic forum constructs \i forums-forums-package-drop.sql \i forums-forums-drop.sql + +-- Search +\i forums-sc-drop.sql Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/forums/sql/postgresql/forums-sc-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/forums/sql/postgresql/forums-sc-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/forums/www/forum-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/forum-view.adp,v diff -u -r1.20 -r1.21 --- openacs-4/packages/forums/www/forum-view.adp 22 May 2003 14:56:35 -0000 1.20 +++ openacs-4/packages/forums/www/forum-view.adp 28 Aug 2003 09:41:54 -0000 1.21 @@ -62,7 +62,7 @@ <tr style="color: black; background-color: @table_other_bgcolor@;"> </else> - <td style="padding: 4px;"> + <td align="left" style="padding: 4px;"> <if @messages.new_p@> <strong> </if> @@ -74,7 +74,7 @@ <small>(@messages.state@)</small> </if> </td> - <td style="padding: 4px;"><a href="user-history?user_id=@messages.user_id@">@messages.user_name@</a></td> + <td align="left" style="padding: 4px;"><a href="user-history?user_id=@messages.user_id@">@messages.user_name@</a></td> <td align="center" style="padding: 4px;">@messages.n_messages@</td> <td align="center" style="padding: 4px;">@messages.last_child_post_pretty@</td> Index: openacs-4/packages/forums/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/index.adp,v diff -u -r1.19 -r1.20 --- openacs-4/packages/forums/www/index.adp 20 Jun 2003 15:24:24 -0000 1.19 +++ openacs-4/packages/forums/www/index.adp 28 Aug 2003 09:41:54 -0000 1.20 @@ -43,7 +43,7 @@ <tr style="color: black; background-color: @table_other_bgcolor@;"> </else> - <td> + <td align="left"> <if @forums.new_p@ and @forums.n_threads@ gt 0> <strong> </if> @@ -68,7 +68,7 @@ </if> <else> <tr style="color: black; background-color: @table_bgcolor@"> - <td colspan="3"> + <td colspan="3" align="left"> <em>#forums.No_Forums#</em> </td> </tr> Index: openacs-4/packages/forums/www/message-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/Attic/message-chunk.adp,v diff -u -r1.17 -r1.18 --- openacs-4/packages/forums/www/message-chunk.adp 20 Jun 2003 15:24:24 -0000 1.17 +++ openacs-4/packages/forums/www/message-chunk.adp 28 Aug 2003 09:41:54 -0000 1.18 @@ -12,9 +12,9 @@ </strong> </td> </if> - <td align=center> + <td align="left"> <a href="user-history?user_id=@message.user_id@">@message.user_name@</a></td> - <td align=center>@message.posting_date_pretty@</td> + <td align="left">@message.posting_date_pretty@</td> <if @preview@ nil> @@ -47,10 +47,10 @@ <tr style="color: black; background-color: @table_bgcolor@"> <if @preview@ nil> - <td colspan="4" style="padding: 1em"> + <td align="left" colspan="4" style="padding: 1em"> </if> <else> - <td colspan="3" align="left" style="padding: 1em"> + <td align="left" colspan="3" style="padding: 1em"> </else> <if @message.html_p@ false> Index: openacs-4/packages/forums/www/message-email.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-email.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/forums/www/message-email.tcl 20 Jun 2003 15:24:24 -0000 1.7 +++ openacs-4/packages/forums/www/message-email.tcl 28 Aug 2003 09:41:54 -0000 1.8 @@ -44,10 +44,10 @@ # Get the data forum::message::get -message_id $message_id -array message - set new_body "$pre_body" + set new_body "[ad_html_to_text $pre_body]" append new_body "\n\n===================================\n\n" append new_body "[_ forums.On] $message(posting_date), $message(user_name) [_ forums.wrote]\n\n" - append new_body "$message(content)\n" + append new_body "[ad_html_to_text $message(content)]\n" # Send the email acs_mail_lite::send -to_addr $to_email \ Index: openacs-4/packages/forums/www/message-post-confirm.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-post-confirm.adp,v diff -u -r1.9 -r1.10 --- openacs-4/packages/forums/www/message-post-confirm.adp 22 May 2003 14:56:35 -0000 1.9 +++ openacs-4/packages/forums/www/message-post-confirm.adp 28 Aug 2003 09:41:54 -0000 1.10 @@ -37,7 +37,7 @@ <br> </if> - <input type="submit" value="confirm"> + <input type="submit" value="Confirm"> </form> Index: openacs-4/packages/forums/www/message-view-flat.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/Attic/message-view-flat.adp,v diff -u -r1.10 -r1.11 --- openacs-4/packages/forums/www/message-view-flat.adp 22 May 2003 14:56:35 -0000 1.10 +++ openacs-4/packages/forums/www/message-view-flat.adp 28 Aug 2003 09:41:54 -0000 1.11 @@ -6,6 +6,14 @@ <table cellpadding="5" width="95%"> <tr> + <td align=left colspan="4"> + <a href="forum-view?forum_id=@message.forum_id@">Back</a> to @forum.name@ + </td> + <td> + + </td> + </tr> + <tr> <td colspan="4"> <nobr>@notification_chunk;noquote@</nobr> </td> Index: openacs-4/packages/forums/www/message-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-view.adp,v diff -u -r1.15 -r1.16 --- openacs-4/packages/forums/www/message-view.adp 22 May 2003 14:56:35 -0000 1.15 +++ openacs-4/packages/forums/www/message-view.adp 28 Aug 2003 09:41:54 -0000 1.16 @@ -9,6 +9,14 @@ <table width="95%"> <tr style="white-space: normal"> <td align=left> + <a href="forum-view?forum_id=@message.forum_id@">Back</a> to @forum.name@ + </td> + <td> + + </td> + </tr> + <tr style="white-space: normal"> + <td align=left> @notification_chunk;noquote@ </td> <td align=right> @@ -39,7 +47,7 @@ <% set width [expr 100 - [expr $responses(tree_level) - 1] * 3] %> <tr style="padding-top: 1em"> - <td> + <td alighn="left"> <table align="right" bgcolor="@table_border_color@" width="@width@%"> <if @responses.rownum@ odd> <include src="message-chunk" Index: openacs-4/packages/forums/www/message-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-view.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/forums/www/message-view.tcl 20 Jun 2003 15:24:24 -0000 1.19 +++ openacs-4/packages/forums/www/message-view.tcl 28 Aug 2003 09:41:54 -0000 1.20 @@ -83,7 +83,7 @@ # More Tcl vars (we might as well use them - Ben) if {[string equal $forum(presentation_type) flat]} { - set order_by "posting_date, tree_sortkey" + set order_by "$table_name.posting_date, tree_sortkey" } else { set order_by "tree_sortkey" } Index: openacs-4/packages/general-comments/tcl/general-comments-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/tcl/general-comments-procs-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/general-comments/tcl/general-comments-procs-oracle.xql 8 Feb 2003 02:18:01 -0000 1.2 +++ openacs-4/packages/general-comments/tcl/general-comments-procs-oracle.xql 28 Aug 2003 09:41:54 -0000 1.3 @@ -20,6 +20,7 @@ where g.object_id = :object_id and r.revision_id = content_item.get_live_revision(g.comment_id) and o.object_id = g.comment_id + $context_clause order by o.creation_date </querytext> </fullquery> Index: openacs-4/packages/general-comments/tcl/general-comments-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/tcl/general-comments-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/general-comments/tcl/general-comments-procs-postgresql.xql 8 Feb 2003 02:18:01 -0000 1.2 +++ openacs-4/packages/general-comments/tcl/general-comments-procs-postgresql.xql 28 Aug 2003 09:41:54 -0000 1.3 @@ -20,6 +20,7 @@ where g.object_id = :object_id and r.revision_id = content_item__get_live_revision(g.comment_id) and o.object_id = g.comment_id + $context_clause order by o.creation_date </querytext> </fullquery> Index: openacs-4/packages/general-comments/tcl/general-comments-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/tcl/general-comments-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/general-comments/tcl/general-comments-procs.tcl 8 Feb 2003 02:18:01 -0000 1.8 +++ openacs-4/packages/general-comments/tcl/general-comments-procs.tcl 28 Aug 2003 09:41:54 -0000 1.9 @@ -18,6 +18,7 @@ ad_proc -public general_comments_get_comments { { -print_content_p 0 } { -print_attachments_p 0 } + {-context_id ""} object_id {return_url {}} } { @@ -26,6 +27,7 @@ @param print_content_p Pass in 1 to print out content of comments. @param print_attachments_p Pass in 1 to print out attachments of comments, only works if print_content_p is 1. + @param context_id Show only comments with given context_id @param object_id The object_id to retrieve the comments for. @param return_url A url for the user to return to after viewing a comment. } { @@ -44,24 +46,15 @@ set content_select [db_map content_select] ;# ", r.content" } # ns_log notice "content_select: $content_select" + + if { ![empty_string_p $context_id] } { + set context_clause "and o.context_id = :context_id" + } else { + set context_clause "" + } set html "" - db_foreach get_comments " - select g.comment_id, - r.title, - r.mime_type, - o.creation_user, - acs_object.name(o.creation_user) as author, - to_char(o.creation_date, 'MM-DD-YYYY') as pretty_date, - to_char(o.creation_date, 'Month DD, YYYY HH12:MI PM') as pretty_date2 - $content_select - from general_comments g, - cr_revisions r, - acs_objects o - where g.object_id = :object_id and - r.revision_id = content_item.get_live_revision(g.comment_id) and - o.object_id = g.comment_id - order by o.creation_date" { + db_foreach get_comments {} { # call on helper proc to print out comment append html [general_comments_print_comment $comment_id $title $mime_type \ $creation_user $author $pretty_date $pretty_date2 $content \ @@ -136,8 +129,6 @@ } if { ![empty_string_p $attachments_html] } { append html "<h5>[_ general-comments.Attachments]</h5>\n<ul>\n$attachments_html</ul>\n" - } else { - append html "<br><br>" } } append html "<p>-- <a href=\"/shared/community-member?user_id=$creation_user\">$author</a> [_ general-comments.on] $pretty_date2 (<a href=\"${package_url}view-comment?[export_url_vars comment_id return_url]\">[_ general-comments.view_details]</a>)</p>\n" Index: openacs-4/packages/lars-blogger/lars-blogger.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/lars-blogger.info,v diff -u -r1.14 -r1.15 --- openacs-4/packages/lars-blogger/lars-blogger.info 30 Jan 2003 16:54:44 -0000 1.14 +++ openacs-4/packages/lars-blogger/lars-blogger.info 28 Aug 2003 09:41:54 -0000 1.15 @@ -2,128 +2,43 @@ <!-- Generated by the OpenACS Package Manager --> <package key="lars-blogger" url="http://openacs.org/repository/apm/packages/lars-blogger" type="apm_application"> - <package-name>Lars Blogger</package-name> - <pretty-plural>Lars Bloggers</pretty-plural> + <package-name>Weblogger</package-name> + <pretty-plural>Webloggers</pretty-plural> <initial-install-p>f</initial-install-p> <singleton-p>f</singleton-p> - - <version name="0.8.4" url="http://openacs.org/repository/download/apm/lars-blogger-0.8.4.apm"> - <database-support> - <database>oracle</database> - <database>postgresql</database> - </database-support> + + <version name="0.9.2" url="http://openacs.org/repository/download/apm/lars-blogger-0.9.2.apm"> <owner url="mailto:lars@pinds.com">Lars Pind</owner> + <owner url="mailto:simon@bcuni.net">Simon Carstensen</owner> <summary>Write your own web log</summary> - <release-date>2003-01-30</release-date> + <release-date>2003-06-10</release-date> <vendor url="http://www.collaboraid.biz">Collaboraid</vendor> - <description format="text/html">Manages multiple web logs for your site. Just mount multiple instances, and you can do all the blogging you want.</description> + <description format="text/html">Manages multiple weblogs for your wbsite.</description> - <provides url="lars-blogger" version="0.8.4"/> + <provides url="lars-blogger" version="0.9.2"/> <requires url="acs-datetime" version="4.0"/> <requires url="general-comments" version="4.0"/> <requires url="notifications" version="0.1"/> <requires url="rss-support" version="0.2d1"/> - <files> - <file type="package_spec" path="lars-blogger.info"/> - <file type="data_model_create" db_type="oracle" path="sql/oracle/lars-blogger-create.sql"/> - <file type="data_model_drop" db_type="oracle" path="sql/oracle/lars-blogger-drop.sql"/> - <file type="data_model" db_type="oracle" path="sql/oracle/lars-blogger-package-create.sql"/> - <file type="data_model" db_type="oracle" path="sql/oracle/lars-blogger-package-drop.sql"/> - <file type="data_model" db_type="oracle" path="sql/oracle/notifications-drop.sql"/> - <file type="data_model" db_type="oracle" path="sql/oracle/notifications-init.sql"/> - <file type="data_model" db_type="oracle" path="sql/oracle/rss-register.sql"/> - <file type="data_model" db_type="oracle" path="sql/oracle/rss-unregister.sql"/> - <file type="data_model_upgrade" db_type="oracle" path="sql/oracle/upgrade/upgrade-0.7d-0.8.sql"/> - <file type="data_model_upgrade" db_type="oracle" path="sql/oracle/upgrade/upgrade-0.8.2-0.8.3.sql"/> - <file type="data_model_upgrade" db_type="oracle" path="sql/oracle/upgrade/upgrade-0.8.3-0.8.4.sql"/> - <file type="data_model_create" db_type="postgresql" path="sql/postgresql/lars-blogger-create.sql"/> - <file type="data_model_drop" db_type="postgresql" path="sql/postgresql/lars-blogger-drop.sql"/> - <file type="data_model" db_type="postgresql" path="sql/postgresql/lars-blogger-sc-create.sql"/> - <file type="data_model" db_type="postgresql" path="sql/postgresql/lars-blogger-sc-drop.sql"/> - <file type="data_model" db_type="postgresql" path="sql/postgresql/notifications-drop.sql"/> - <file type="data_model" db_type="postgresql" path="sql/postgresql/notifications-init.sql"/> - <file type="data_model" db_type="postgresql" path="sql/postgresql/rss-register.sql"/> - <file type="data_model" db_type="postgresql" path="sql/postgresql/rss-unregister.sql"/> - <file type="data_model" db_type="postgresql" path="sql/postgresql/upgrade/lars-blogger-sc-index.sql"/> - <file type="data_model_upgrade" db_type="postgresql" path="sql/postgresql/upgrade/upgrade-0.6.4d-0.7d.sql"/> - <file type="data_model_upgrade" db_type="postgresql" path="sql/postgresql/upgrade/upgrade-0.7d-0.8.sql"/> - <file type="data_model_upgrade" db_type="postgresql" path="sql/postgresql/upgrade/upgrade-0.8.2-0.8.3.sql"/> - <file type="data_model_upgrade" db_type="postgresql" path="sql/postgresql/upgrade/upgrade-0.8.3-0.8.4.sql"/> - <file type="query_file" db_type="oracle" path="tcl/entry-procs-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="tcl/entry-procs-postgresql.xql"/> - <file type="tcl_procs" path="tcl/entry-procs.tcl"/> - <file type="query_file" db_type="oracle" path="tcl/lars-blogger-procs-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="tcl/lars-blogger-procs-postgresql.xql"/> - <file type="tcl_procs" path="tcl/lars-blogger-procs.tcl"/> - <file type="tcl_procs" path="tcl/pinds-blog-entry-sc-procs.tcl"/> - <file type="query_file" db_type="oracle" path="tcl/rss-procs-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="tcl/rss-procs-postgresql.xql"/> - <file type="tcl_procs" path="tcl/rss-procs.tcl"/> - <file type="query_file" path="tcl/rss-procs.xql"/> - <file type="tcl_procs" path="tcl/weblogs-procs.tcl"/> - <file type="query_file" path="tcl/weblogs-procs.xql"/> - <file type="content_page" path="www/admin/drafts.adp"/> - <file type="content_page" path="www/admin/drafts.tcl"/> - <file type="query_file" path="www/admin/drafts.xql"/> - <file type="content_page" path="www/admin/entry-delete.tcl"/> - <file type="query_file" path="www/admin/entry-delete.xql"/> - <file type="query_file" db_type="oracle" path="www/admin/entry-edit-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/admin/entry-edit-postgresql.xql"/> - <file type="content_page" path="www/admin/entry-edit.adp"/> - <file type="content_page" path="www/admin/entry-edit.tcl"/> - <file type="content_page" path="www/admin/entry-edit.tcl.orig"/> - <file type="content_page" path="www/admin/entry-edit.tcl.rej"/> - <file type="query_file" path="www/admin/entry-edit.xql"/> - <file type="query_file" db_type="oracle" path="www/admin/entry-publish-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/admin/entry-publish-postgresql.xql"/> - <file type="content_page" path="www/admin/entry-publish.tcl"/> - <file type="content_page" path="www/admin/entry-revoke.tcl"/> - <file type="query_file" path="www/admin/entry-revoke.xql"/> - <file type="content_page" path="www/admin/index.adp"/> - <file type="content_page" path="www/admin/index.tcl"/> - <file type="query_file" path="www/admin/index.xql"/> - <file type="content_page" path="www/admin/rss-setup.tcl"/> - <file type="query_file" path="www/admin/rss-setup.xql"/> - <file type="content_page" path="www/admin/subscribers.adp"/> - <file type="content_page" path="www/admin/subscribers.tcl"/> - <file type="content_page" path="www/archive/index.vuh"/> - <file type="query_file" db_type="oracle" path="www/blog-months-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/blog-months-postgresql.xql"/> - <file type="content_page" path="www/blog-months.adp"/> - <file type="content_page" path="www/blog-months.tcl"/> - <file type="query_file" db_type="oracle" path="www/blog-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/blog-postgresql.xql"/> - <file type="content_page" path="www/blog.adp"/> - <file type="content_page" path="www/blog.tcl"/> - <file type="query_file" db_type="oracle" path="www/calendar-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/calendar-postgresql.xql"/> - <file type="content_page" path="www/calendar.adp"/> - <file type="content_page" path="www/calendar.tcl"/> - <file type="documentation" path="www/doc/index.html"/> - <file type="content_page" path="www/entry-chunk.adp"/> - <file type="content_page" path="www/entry-chunk.tcl"/> - <file type="content_page" path="www/flush-cache.tcl"/> - <file type="content_page" path="www/graphics/arrow-box.gif"/> - <file type="content_page" path="www/index.adp"/> - <file type="content_page" path="www/index.tcl"/> - <file type="query_file" path="www/index.xql"/> - <file type="content_page" path="www/one-entry.adp"/> - <file type="content_page" path="www/one-entry.tcl"/> - <file type="content_page" path="www/rss/index.vuh"/> - </files> <callbacks> </callbacks> <parameters> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="HeaderBackgroundColor" default="#dcdcdc" description="Background color for the header bars, those with the entry date, calendar, etc."/> - <parameter datatype="number" min_n_values="1" max_n_values="1" name="ShowPosterP" default="1" description="Show who posted the entry and when"/> - <parameter datatype="number" min_n_values="1" max_n_values="1" name="channel_image_height" description="Height in pixels of the image to be used for this blog as an RSS channel" section_name="rss"/> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="channel_image_url" description="The URL, relative to this server, to the image that corresponds to this blog in the rss channel" section_name="rss"/> - <parameter datatype="number" min_n_values="1" max_n_values="1" name="channel_image_width" description="Width in pixels of the image to be used for this blog as an RSS channel" section_name="rss"/> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="public_url" description="The public URL for this blog (in case you've put the blog on your front page, for example)" section_name="lars-blogger"/> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="rss_file_url" description="What URL should we advertise the RSS feed under, relative to the blog mount point. Leave blank if no RSS feed." section_name="rss"/> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="weblogs_ping_url" default="http://rpc.weblogs.com/RPC2" description="The URL to post the update ping message to" section_name="weblogs-com"/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="MaxNumEntriesOnFrontPage" default="" description="Maximum number of entries to show on the weblog front page. 0 or empty string for no maximum."/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="MinNumEntriesOnFrontPage" default="3" description="Minimum number of entries to show on the weblog front page. 0 or empty string for no minimum."/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="NumDaysOnFrontPage" default="30" description="Number of days worth of entries on the weblog front page. Default is 30. Set to 0 or empty string for no date limit."/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="package_rss_feed_p" default="1" description="Should we build an RSS feed for this instance." section_name="rss"/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="user_rss_feed_p" default="0" description="Should we build an RSS feed for each user." section_name="rss"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="rss_file_name" default="rss.xml" description="What name should we advertise the RSS feed under, relative to the blog mount point. Leave blank if no RSS feed." section_name="rss"/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="weblogs_update_ping_p" default="1" description="Should we ping weblogs.com on updates to this blog?" section_name="weblogs-com"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="weblogs_ping_url" default="http://rpc.weblogs.com/RPC2" description="The URL to post the update ping message to" section_name="weblogs-com"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="public_url" description="The public URL for this blog (in case you've put the blog on your front page, for example)"/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="channel_image_width" description="Width in pixels of the image to be used for this blog as an RSS channel" section_name="rss"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="channel_image_url" description="The URL, relative to this server, to the image that corresponds to this blog in the rss channel" section_name="rss"/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="channel_image_height" description="Height in pixels of the image to be used for this blog as an RSS channel" section_name="rss"/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="ShowPosterP" default="1" description="Show who posted the entry and when"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="HeaderBackgroundColor" default="#dcdcdc" description="Background color for the header bars, those with the entry date, calendar, etc."/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="DisplayUsersP" default="0" description="Should we display a list of bloggers on the index page."/> </parameters> </version> Index: openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-create.sql 27 Jan 2003 16:17:55 -0000 1.3 +++ openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-create.sql 28 Aug 2003 09:41:54 -0000 1.4 @@ -33,6 +33,7 @@ package_id constraint pinds_blog_entry_package_id_fk references apm_packages(package_id), title varchar(500), + title_url varchar(500), content clob, content_format varchar(50) default 'text/html' @@ -48,7 +49,37 @@ check (deleted_p in ('t','f')) ); +declare +begin + acs_object_type.create_type( + object_type => 'weblogger_channel', + pretty_name => 'Weblogger Channel', + pretty_plural => 'Weblogger Channels', + supertype => 'acs_object', + table_name => 'weblogger_channel', + id_column => 'channel_id', + package_name => null, + abstract_p => 'f', + type_extension_table => null, + name_method => null + ); +end; +/ +show errors +create table weblogger_channels ( + channel_id constraint weblogger_channels_cid_fk + references acs_objects(object_id) + constraint weblogger_channels_cid_pk + primary key, + package_id constraint weblogger_channels_pid_kf + references apm_packages(package_id), + user_id integer, + constraint weblogger_chnls_pck_user_un + unique (package_id, user_id) +); + + @@ lars-blogger-package-create @@ rss-register @@ notifications-init Index: openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-drop.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-drop.sql 14 Sep 2002 21:43:33 -0000 1.2 +++ openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-drop.sql 28 Aug 2003 09:41:54 -0000 1.3 @@ -12,7 +12,15 @@ @@ rss-unregister begin + acs_object_type.drop_type('weblogger_channel', 't'); +end; +/ +show errors +drop table weblogger_channels; + +begin + for blog_entry in (select entry_id from pinds_blog_entries) loop -- delete comments (which are acs_message's) for comment in (select comment_id from general_comments @@ -23,15 +31,13 @@ pinds_blog_entry.delete(blog_entry.entry_id); end loop; - acs_object_type.drop_type( - object_type => 'pinds_blog_entry', - cascade_p => 't' - ); + acs_object_type.drop_type('pinds_blog_entry', 't'); end; / show errors + @@ lars-blogger-package-drop drop table pinds_blog_entries; Index: openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-package-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-package-create.sql 27 Jan 2003 16:17:55 -0000 1.2 +++ openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-package-create.sql 28 Aug 2003 09:41:54 -0000 1.3 @@ -14,6 +14,7 @@ entry_id in pinds_blog_entries.entry_id%TYPE default null, package_id in pinds_blog_entries.package_id%TYPE, title in pinds_blog_entries.title%TYPE default null, + title_url in pinds_blog_entries.title_url%TYPE default null, content in varchar default null, content_format in varchar default 'text/html', entry_date in pinds_blog_entries.entry_date%TYPE default null, @@ -41,6 +42,7 @@ entry_id in pinds_blog_entries.entry_id%TYPE default null, package_id in pinds_blog_entries.package_id%TYPE, title in pinds_blog_entries.title%TYPE default null, + title_url in pinds_blog_entries.title_url%TYPE default null, content in varchar default null, content_format in varchar default 'text/html', entry_date in pinds_blog_entries.entry_date%TYPE default null, @@ -65,6 +67,7 @@ entry_id, package_id, title, + title_url, content, content_format, entry_date, @@ -75,6 +78,7 @@ v_entry_id, pinds_blog_entry.new.package_id, pinds_blog_entry.new.title, + pinds_blog_entry.new.title_url, pinds_blog_entry.new.content, pinds_blog_entry.new.content_format, pinds_blog_entry.new.entry_date, @@ -123,3 +127,78 @@ end pinds_blog_entry; / show errors + +create or replace package weblogger_channel +as + + function new ( + channel_id in weblogger_channels.channel_id%TYPE default null, + package_id in weblogger_channels.package_id%TYPE, + user_id in weblogger_channels.user_id%TYPE default null, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return weblogger_channels.channel_id%TYPE; + + procedure delete ( + channel_id in weblogger_channels.channel_id%TYPE + ); + +end weblogger_channel; +/ +show errors + + +create or replace package body weblogger_channel +as + + function new ( + channel_id in weblogger_channels.channel_id%TYPE default null, + package_id in weblogger_channels.package_id%TYPE, + user_id in weblogger_channels.user_id%TYPE default null, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return weblogger_channels.channel_id%TYPE + is + v_channel_id weblogger_channels.channel_id%TYPE; + begin + + v_channel_id := acs_object.new( + object_id => weblogger_channel.new.channel_id, + object_type => 'weblogger_channel', + creation_date => sysdate, + creation_user => weblogger_channel.new.creation_user, + creation_ip => weblogger_channel.new.creation_ip, + context_id => weblogger_channel.new.package_id + ); + + insert into weblogger_channels ( + channel_id, + package_id, + user_id + ) values ( + v_channel_id, + weblogger_channel.new.package_id, + weblogger_channel.new.user_id + ); + + return v_channel_id; + + end new; + + procedure delete ( + channel_id in weblogger_channels.channel_id%TYPE + ) + is + begin + + delete + from weblogger_channels + where channel_id = weblogger_channel.delete.channel_id; + + acs_object.delete(weblogger_channel.delete.channel_id); + + end delete; + +end weblogger_channel; +/ +show errors Index: openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-package-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-package-drop.sql 19 Aug 2002 21:52:59 -0000 1.1 +++ openacs-4/packages/lars-blogger/sql/oracle/lars-blogger-package-drop.sql 28 Aug 2003 09:41:54 -0000 1.2 @@ -7,5 +7,9 @@ -- @cvs-id $Id$ -- + +drop package body weblogger_channel; +drop package weblogger_channel; + drop package body pinds_blog_entry; drop package pinds_blog_entry; Index: openacs-4/packages/lars-blogger/sql/oracle/notifications-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/sql/oracle/notifications-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lars-blogger/sql/oracle/notifications-drop.sql 14 Sep 2002 21:43:33 -0000 1.1 +++ openacs-4/packages/lars-blogger/sql/oracle/notifications-drop.sql 28 Aug 2003 09:41:54 -0000 1.2 @@ -17,3 +17,5 @@ notification_type.delete(row.type_id); end loop; end; +/ +show errors Index: openacs-4/packages/lars-blogger/sql/oracle/rss-register.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/sql/oracle/rss-register.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lars-blogger/sql/oracle/rss-register.sql 30 Jan 2003 16:55:03 -0000 1.2 +++ openacs-4/packages/lars-blogger/sql/oracle/rss-register.sql 28 Aug 2003 09:41:54 -0000 1.3 @@ -36,7 +36,7 @@ acs_sc_binding.new ( contract_name => 'RssGenerationSubscriber', impl_name => 'pinds_blog_entries' - ); + ); end; / Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/sql/oracle/upgrade/upgrade-0.8.4-0.8.5.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/sql/oracle/upgrade/upgrade-0.8.5-0.9.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lars-blogger/sql/postgresql/lars-blogger-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/sql/postgresql/lars-blogger-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/lars-blogger/sql/postgresql/lars-blogger-create.sql 27 Jan 2003 16:18:25 -0000 1.5 +++ openacs-4/packages/lars-blogger/sql/postgresql/lars-blogger-create.sql 28 Aug 2003 09:41:55 -0000 1.6 @@ -29,13 +29,14 @@ constraint pinds_blog_entry_package_id_kf references apm_packages(package_id), title varchar(500), + title_url varchar(500), content varchar(32000), content_format varchar(50) default 'text/html' constraint pinds_blog_entr_cnt_format_nn not null, - entry_date timestamp, - posted_date timestamp, + entry_date timestamptz, + posted_date timestamptz, draft_p char(1) default 'f' constraint pinds_blog_entries_draft_ck check (draft_p in ('t','f')), @@ -61,26 +62,28 @@ create or replace function pinds_blog_entry__new ( - integer, -- entry_id - integer, -- package_id - varchar, -- title - varchar, -- content - varchar, -- content_format - timestamp, -- entry_date - char, -- draft_p - integer, -- creation_user - varchar -- creation_ip + integer, -- entry_id + integer, -- package_id + varchar, -- title + varchar, -- title_url + varchar, -- content + varchar, -- content_format + timestamptz, -- entry_date + char, -- draft_p + integer, -- creation_user + varchar -- creation_ip ) returns integer as ' declare p_entry_id alias for $1; p_package_id alias for $2; p_title alias for $3; - p_content alias for $4; - p_content_format alias for $5; - p_entry_date alias for $6; - p_draft_p alias for $7; - p_creation_user alias for $8; - p_creation_ip alias for $9; + p_title_url alias for $4; + p_content alias for $5; + p_content_format alias for $6; + p_entry_date alias for $7; + p_draft_p alias for $8; + p_creation_user alias for $9; + p_creation_ip alias for $10; v_entry_id integer; begin v_entry_id := acs_object__new ( @@ -96,6 +99,7 @@ entry_id, package_id, title, + title_url, content, content_format, entry_date, @@ -106,6 +110,7 @@ v_entry_id, p_package_id, p_title, + p_title_url, p_content, p_content_format, p_entry_date, @@ -114,6 +119,12 @@ ''f'' ); + PERFORM acs_permission__grant_permission( + v_entry_id, + p_creation_user, + ''admin'' + ); + return v_entry_id; end; ' language 'plpgsql'; @@ -132,5 +143,84 @@ ' language 'plpgsql'; +select acs_object_type__create_type ( + 'weblogger_channel', -- object_type + 'Weblogger Channel', -- pretty_name + 'Weblogger Channels', -- pretty_plural + 'acs_object', -- supertype + 'weblogger_channels', -- table_name + 'channel_id', -- id_column + null, -- package_name + 'f', -- abstract_p + null, -- type_extension_table + null -- name_method +); + +create table weblogger_channels ( + channel_id integer + constraint channel_id_fk + references acs_objects(object_id) + constraint weblogger_channels_pk + primary key, + package_id integer + constraint weblogger_channels_package_id_kf + references apm_packages(package_id), + user_id integer, + constraint weblogger_chnls_package_user_un + unique (package_id, user_id) +); + + + +create or replace function weblogger_channel__new ( + integer, -- channel_id + integer, -- package_id + integer, -- user_id + integer, -- creation_user + varchar -- creation_ip +) returns integer as ' +declare + p_channel_id alias for $1; + p_package_id alias for $2; + p_user_id alias for $3; + p_creation_user alias for $4; + p_creation_ip alias for $5; + v_channel_id integer; +begin + v_channel_id := acs_object__new ( + p_channel_id, + ''weblogger_channel'', + current_timestamp, + p_creation_user, + p_creation_ip, + p_package_id + ); + + insert into weblogger_channels ( + channel_id, + package_id, + user_id + ) values ( + v_channel_id, + p_package_id, + p_user_id + ); + + return v_channel_id; +end; +' language 'plpgsql'; + +create or replace function weblogger_channel__delete (integer) +returns integer as ' +declare + p_channel_id alias for $1; +begin + delete from weblogger_channels + where channel_id = p_channel_id; + PERFORM acs_object__delete(p_channel_id); + return 0; +end; +' language 'plpgsql'; + \i rss-register.sql \i notifications-init.sql Index: openacs-4/packages/lars-blogger/sql/postgresql/lars-blogger-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/sql/postgresql/lars-blogger-drop.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lars-blogger/sql/postgresql/lars-blogger-drop.sql 21 Dec 2002 22:27:58 -0000 1.3 +++ openacs-4/packages/lars-blogger/sql/postgresql/lars-blogger-drop.sql 28 Aug 2003 09:41:55 -0000 1.4 @@ -34,17 +34,31 @@ select inline_0(); drop function inline_0(); +drop function weblogger_channel__new( + integer, -- channel_id + integer, -- package_id + integer, -- user_id + integer, -- creation_user + varchar -- creation_ip +); +drop function weblogger_channel__delete (integer); + +drop table weblogger_channels; +select acs_object_type__drop_type ('weblogger_channel', true); + drop function pinds_blog_entry__title (integer); drop function pinds_blog_entry__new( - integer, -- entry_id - integer, -- package_id - varchar, -- title - varchar, -- content - timestamp, -- entry_date - char, -- draft_p - integer, -- creation_user - varchar -- creation_ip + integer, -- entry_id + integer, -- package_id + varchar, -- title + varchar, -- title_url + varchar, -- content + varchar, -- content_format + timestamptz, -- entry_date + char, -- draft_p + integer, -- creation_user + varchar -- creation_ip ); drop function pinds_blog_entry__delete (integer); Index: openacs-4/packages/lars-blogger/sql/postgresql/rss-register.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/sql/postgresql/rss-register.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lars-blogger/sql/postgresql/rss-register.sql 30 Jan 2003 16:55:50 -0000 1.2 +++ openacs-4/packages/lars-blogger/sql/postgresql/rss-register.sql 28 Aug 2003 09:41:55 -0000 1.3 @@ -6,45 +6,29 @@ -- @cvs-id $Id$ -- -create function inline_0() returns integer as ' -declare - impl_id integer; - v_foo integer; -begin - -- the notification type impl - impl_id := acs_sc_impl__new( - ''RssGenerationSubscriber'', -- impl_contract_name - ''pinds_blog_entries'', -- impl_name - ''lars-blogger'' -- impl_owner_name - ); +select acs_sc_impl__new( + 'RssGenerationSubscriber', -- impl_contract_name + 'pinds_blog_entries', -- impl_name + 'lars-blogger' -- impl_owner_name +); - v_foo := acs_sc_impl_alias__new( - ''RssGenerationSubscriber'', -- impl_contract_name - ''pinds_blog_entries'', -- impl_name - ''datasource'', -- impl_operation_name - ''lars_blog__rss_datasource'', -- impl_alias - ''TCL'' -- impl_pl - ); +select acs_sc_impl_alias__new( + 'RssGenerationSubscriber', -- impl_contract_name + 'pinds_blog_entries', -- impl_name + 'datasource', -- impl_operation_name + 'lars_blog__rss_datasource', -- impl_alias + 'TCL' -- impl_pl +); - v_foo := acs_sc_impl_alias__new( - ''RssGenerationSubscriber'', -- impl_contract_name - ''pinds_blog_entries'', -- impl_name - ''lastUpdated'', -- impl_operation_name - ''lars_blog__rss_lastUpdated'', -- impl_alias - ''TCL'' -- impl_pl - ); +select acs_sc_impl_alias__new( + 'RssGenerationSubscriber', -- impl_contract_name + 'pinds_blog_entries', -- impl_name + 'lastUpdated', -- impl_operation_name + 'lars_blog__rss_lastUpdated', -- impl_alias + 'TCL' -- impl_pl +); - PERFORM acs_sc_binding__new ( - ''RssGenerationSubscriber'', - ''pinds_blog_entries'' - ); - - return (0); -end; -' language 'plpgsql'; - -select inline_0(); -drop function inline_0(); - - - +select acs_sc_binding__new ( + 'RssGenerationSubscriber', -- contract_name + 'pinds_blog_entries' -- impl_name +); Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/sql/postgresql/upgrade/upgrade-0.8.4-0.8.5.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/sql/postgresql/upgrade/upgrade-0.8.5-0.9.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lars-blogger/tcl/entry-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/entry-procs-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lars-blogger/tcl/entry-procs-oracle.xql 27 Jan 2003 16:19:15 -0000 1.1 +++ openacs-4/packages/lars-blogger/tcl/entry-procs-oracle.xql 28 Aug 2003 09:41:55 -0000 1.2 @@ -5,29 +5,40 @@ <fullquery name="lars_blogger::entry::get.select_entry"> <querytext> - select entry_id, - to_char(entry_date, 'fmDayfm, Month fmDDfm, YYYY') as entry_date_pretty, - to_char(entry_date, 'YYYY/MM/DD/') as entry_archive_url, - entry_date, - title, - content, - content_format, - draft_p, - 'f' as new_date_p, - p.first_names as poster_first_names, + select b.entry_id, + b.title, + b.title_url, + b.content, + b.content_format, + b.draft_p, + o.creation_user as user_id, + to_char(b.entry_date, 'YYYY-MM-DD') as entry_date, + to_char(b.entry_date, 'fmDayfm, fmMonthfm fmDDfm, YYYY') as entry_date_pretty, + p.first_names as poster_first_names, p.last_name as poster_last_name, - to_char(posted_date , 'HH24:MI') as posted_time_pretty, + to_char(b.posted_date , 'HH24:MI') as posted_time_pretty, + b.package_id, (select count(gc.comment_id) from general_comments gc, cr_revisions cr where gc.object_id = entry_id - and content_item.get_live_revision(gc.comment_id) = cr.revision_id) as num_comments - from pinds_blog_entries e, - acs_objects o, - persons p - where e.entry_id = :entry_id - and o.object_id = e.entry_id - and p.person_id = o.creation_user + and content_item.get_live_revision(gc.comment_id) = cr.revision_id) as num_comments + from pinds_blog_entries b, + acs_objects o, + persons p + where b.entry_id = :entry_id + and o.object_id = b.entry_id + and p.person_id = o.creation_user </querytext> </fullquery> + <fullquery name="lars_blogger::entry::publish.update_entry"> + <querytext> + update pinds_blog_entries + set entry_date = trunc(sysdate), + draft_p = 'f', + posted_date = sysdate + where entry_id = :entry_id + </querytext> + </fullquery> + </queryset> Index: openacs-4/packages/lars-blogger/tcl/entry-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/entry-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lars-blogger/tcl/entry-procs-postgresql.xql 27 Jan 2003 16:19:15 -0000 1.1 +++ openacs-4/packages/lars-blogger/tcl/entry-procs-postgresql.xql 28 Aug 2003 09:41:55 -0000 1.2 @@ -7,11 +7,13 @@ <querytext> select b.entry_id, b.title, + b.title_url, b.content, b.content_format, b.draft_p, + o.creation_user as user_id, to_char(b.entry_date, 'YYYY-MM-DD') as entry_date, - to_char(b.entry_date, 'fmDayfm, Month fmDDfm, YYYY') as entry_date_pretty, + to_char(b.entry_date, 'fmDayfm, fmMonthfm fmDDfm, YYYY') as entry_date_pretty, p.first_names as poster_first_names, p.last_name as poster_last_name, to_char(b.posted_date , 'HH24:MI') as posted_time_pretty, @@ -29,4 +31,14 @@ </querytext> </fullquery> + <fullquery name="lars_blogger::entry::publish.update_entry"> + <querytext> + update pinds_blog_entries + set entry_date = date_trunc('day', current_timestamp), + draft_p = 'f', + posted_date = current_timestamp + where entry_id = :entry_id + </querytext> + </fullquery> + </queryset> Index: openacs-4/packages/lars-blogger/tcl/entry-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/entry-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lars-blogger/tcl/entry-procs.tcl 27 Jan 2003 16:19:15 -0000 1.2 +++ openacs-4/packages/lars-blogger/tcl/entry-procs.tcl 28 Aug 2003 09:41:55 -0000 1.3 @@ -2,7 +2,6 @@ Entry procs for blogger. } - namespace eval lars_blogger::entry {} ad_proc -public lars_blogger::entry::get { @@ -12,13 +11,93 @@ # Select the info into the upvar'ed Tcl Array upvar $array row - db_1row select_entry { *SQL* } -column_array row + db_1row select_entry {} -column_array row } +ad_proc -public lars_blogger::entry::require_write_permission { + {-entry_id:required} +} { + permission::require_permission -object_id $entry_id -privilege write + + set admin_p [permission::permission_p -privilege "admin" -object_id $entry_id] + + if { !$admin_p && [ad_conn user_id] != [db_string creation_user {}] } { + ad_return_forbidden "Security Violation" "<blockquote> + You don't have permission to modify this entry. + <br> + This incident has been logged. + </blockquote>" + ad_script_abort + } +} -ad_proc -public do_notifications { +ad_proc -public lars_blogger::entry::publish { {-entry_id:required} + {-package_id ""} + {-no_update:boolean} + {-redirect_url ""} } { + if { !$no_update_p } { + # Set draft_p = 'f' + db_dml update_entry { *SQL* } + # Flush cache + lars_blog_flush_cache + } + + if { ![empty_string_p $redirect_url] } { + ad_returnredirect $redirect_url + ns_conn close + } + + # Setup instance feed if needed + lars_blog_setup_feed -package_id $package_id + + # Setup user feed if needed + lars_blog_setup_feed -user -package_id $package_id + + # Notifications + lars_blogger::entry::do_notifications -entry_id $entry_id + + # Ping weblogs.com + lars_blog_weblogs_com_update_ping +} + + +ad_proc -public lars_blogger::entry::htmlify { + -array:required +} { + Make the entry displayable in an HTML page +} { + upvar $array row + + set row(title) [ad_quotehtml $row(title)] + + # LARS: + # Not sure we should do the ns_adp_parse thing here, but heck, why not + # It should be safe, given the standard HTML filter security checks, which + # wouldn't let unsafe tags slip through, anyway + + set row(content) [ad_html_text_convert -from $row(content_format) -to "text/html" -- $row(content)] + + # We wrap this in a catch so if it bombs, at least we won't break any pages + catch { + set row(content) [ns_adp_parse -string $row(content)] + } + + # look for the base site name in the url + if {[regexp {^https?://([^ /]+)} $row(title_url) initial base_url] } { + set row(title_url_base) $base_url + } else { + set row(title_url_base) {} + } +} + + + + +ad_proc -public lars_blogger::entry::do_notifications { + {-entry_id:required} +} { # Select all the important information get -entry_id $entry_id -array blog @@ -28,7 +107,11 @@ set new_content "" append new_content "$blog(poster_first_names) $blog(poster_last_name) posted to $blog_name at $blog(posted_time_pretty) on $blog(entry_date_pretty):\n\n" - append new_content "$blog(title)\n\n" + append new_content "$blog(title)\n[string repeat "-" [string length $blog(title)]]\n" + if { ![empty_string_p $blog(title_url)] } { + append new_content "$blog(title_url)\n" + } + append new_content "\n" append new_content "[ad_convert_to_text -- [ns_adp_parse -string $blog(content)]]\n\n" append new_content "This entry: $entry_url\n\n" append new_content "$blog_name: $blog_url\n" Index: openacs-4/packages/lars-blogger/tcl/lars-blogger-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/lars-blogger-procs-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lars-blogger/tcl/lars-blogger-procs-oracle.xql 27 Jan 2003 16:19:15 -0000 1.3 +++ openacs-4/packages/lars-blogger/tcl/lars-blogger-procs-oracle.xql 28 Aug 2003 09:41:55 -0000 1.4 @@ -5,20 +5,69 @@ <fullquery name="lars_blog_entry_add.entry_add"> <querytext> - begin - :1 := pinds_blog_entry.new ( - entry_id => :entry_id, - package_id => :package_id, - title => :title, - content => :content, - content_format => :content_format, - entry_date => to_date(:entry_date, 'YYYY-MM-DD'), - draft_p => :draft_p, - creation_user => :creation_user, - creation_ip => :creation_ip - ); - end; + begin + :1 := pinds_blog_entry.new ( + entry_id => :entry_id, + package_id => :package_id, + title => :title, + title_url => :title_url, + content => :content, + content_format => :content_format, + entry_date => to_date(:entry_date, 'YYYY-MM-DD'), + draft_p => :draft_p, + creation_user => :creation_user, + creation_ip => :creation_ip + ); + end; </querytext> </fullquery> + <fullquery name="lars_blog_setup_feed.create_instance_channel"> + <querytext> + begin + :1 := weblogger_channel.new ( + null, + :package_id, + NULL, + :creation_user, + :creation_ip + ); + end; + </querytext> + </fullquery> + + <fullquery name="lars_blog_setup_feed.create_user_channel"> + <querytext> + begin + :1 := weblogger_channel.new ( + null, + :package_id, + :creation_user, + :creation_user, + :creation_ip + ); + end; + </querytext> + </fullquery> + + <fullquery name="lars_blog_setup_feed.create_subscr"> + <querytext> + begin + :1 := rss_gen_subscr.new ( + null, -- subscr_id + acs_sc_impl.get_id('RssGenerationSubscriber','pinds_blog_entries'), + -- impl_id + :summary_context_id, -- summary_context_id + :timeout, -- timeout + null, -- lastbuild + 'rss_gen_subscr', -- object_type + sysdate, -- creation_date + :creation_user, -- creation_user + :creation_ip, -- creation_ip + :package_id -- context_id + ); + end; + </querytext> + </fullquery> + </queryset> Index: openacs-4/packages/lars-blogger/tcl/lars-blogger-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/lars-blogger-procs-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lars-blogger/tcl/lars-blogger-procs-postgresql.xql 27 Jan 2003 16:19:15 -0000 1.3 +++ openacs-4/packages/lars-blogger/tcl/lars-blogger-procs-postgresql.xql 28 Aug 2003 09:41:55 -0000 1.4 @@ -5,18 +5,61 @@ <fullquery name="lars_blog_entry_add.entry_add"> <querytext> - select pinds_blog_entry__new ( - :entry_id, - :package_id, - :title, - :content, - :content_format, - to_date(:entry_date, 'YYYY-MM-DD'), - :draft_p, - :creation_user, - :creation_ip + select pinds_blog_entry__new ( + :entry_id, + :package_id, + :title, + :title_url, + :content, + :content_format, + to_date(:entry_date, 'YYYY-MM-DD'), + :draft_p, + :creation_user, + :creation_ip ) </querytext> </fullquery> + <fullquery name="lars_blog_setup_feed.create_instance_channel"> + <querytext> + select weblogger_channel__new ( + null, + :package_id, + NULL, + :creation_user, + :creation_ip + ) + </querytext> + </fullquery> + + <fullquery name="lars_blog_setup_feed.create_user_channel"> + <querytext> + select weblogger_channel__new ( + null, + :package_id, + :creation_user, + :creation_user, + :creation_ip + ) + </querytext> + </fullquery> + + <fullquery name="lars_blog_setup_feed.create_subscr"> + <querytext> + select rss_gen_subscr__new ( + null, -- subscr_id + acs_sc_impl__get_id('RssGenerationSubscriber','pinds_blog_entries'), + -- impl_id + :summary_context_id, -- summary_context_id + :timeout, -- timeout + null, -- lastbuild + 'rss_gen_subscr', -- object_type + now(), -- creation_date + :creation_user, -- creation_user + :creation_ip, -- creation_ip + :package_id -- context_id + ) + </querytext> + </fullquery> + </queryset> Index: openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl 27 Jan 2003 16:19:15 -0000 1.8 +++ openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl 28 Aug 2003 09:41:55 -0000 1.9 @@ -9,6 +9,7 @@ {-entry_id:required} {-package_id:required} {-title:required} + {-title_url ""} {-content:required} {-content_format:required} {-entry_date:required} @@ -19,15 +20,91 @@ set creation_user [ad_conn user_id] set creation_ip [ns_conn peeraddr] - set entry_id [db_exec_plsql entry_add { *SQL* }] + db_transaction { + # Create the entry + set entry_id [db_exec_plsql entry_add {}] + lars_blog_flush_cache $package_id + } - lars_blog_flush_cache $package_id + # If publish directly, fire off notifications and ping weblogs.com + if { [string equal $draft_p "f"] } { + lars_blogger::entry::publish \ + -entry_id $entry_id \ + -package_id $package_id \ + -no_update + } return $entry_id } +ad_proc lars_blog_setup_feed { + -user:boolean + {-package_id ""} +} { + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + set timeout [expr 30*60] + set channel_title [lars_blog_name] + set creation_user [ad_conn user_id] + set creation_ip [ns_conn peeraddr] + + if { !$user_p } { + if { [parameter::get -parameter "package_rss_feed_p" -default 1]} { + + # check whether there's been a channel setup for this instance + set summary_context_id [db_string select_instance_channel {} -default {}] + + if { [empty_string_p $summary_context_id] } { + # Setup a channel for this instance + set summary_context_id [db_exec_plsql create_instance_channel {}] + } + + # check whether there's been a feed setup for this instance + set exists_instance_feed_p [db_string exists_instance_feed_p {}] + + if { [string equal $exists_instance_feed_p "0"] } { + # Setup an RSS feed for this instance + set channel_link [lars_blog_public_package_url] + + set subscr_id [db_exec_plsql create_subscr {}] + db_dml update_subscr {} + + # Run it now + rss_gen_report $subscr_id + } + } + } else { + if {[parameter::get -parameter "user_rss_feed_p" -default 0]} { + # check whether there's been a channel setup for this instance + set summary_context_id [db_string select_user_channel {} -default {}] + if { [empty_string_p $summary_context_id] } { + # Setup a channel for this instance + set summary_context_id [db_exec_plsql create_user_channel {}] + } + + # check whether there's been a feed setup for this user + set exists_user_feed_p [db_string exists_user_feed_p {}] + set screen_name [db_string screen_name {}] + + if { [string equal $exists_user_feed_p "0"] && ![empty_string_p $screen_name] } { + # Setup an RSS feed for the user + set channel_link "[lars_blog_public_package_url]user/$screen_name/" + + set subscr_id [db_exec_plsql create_subscr {}] + db_dml update_subscr {} + + # Run it now + rss_gen_report $subscr_id + } + } + } +} + + ad_proc -private lars_blog_get_as_string_mem { package_id admin_p Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/tcl/notification-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lars-blogger/tcl/rss-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/rss-procs-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lars-blogger/tcl/rss-procs-oracle.xql 30 Nov 2002 17:37:17 -0000 1.2 +++ openacs-4/packages/lars-blogger/tcl/rss-procs-oracle.xql 28 Aug 2003 09:41:55 -0000 1.3 @@ -5,7 +5,7 @@ <fullquery name="lars_blog__rss_datasource.now"> <querytext> - select to_char(sysdate,'DD Mon YYYY hh12:MI am') + select to_char(sysdate,'DD Mon YYYY hh12:MI am') from dual </querytext> </fullquery> @@ -23,7 +23,7 @@ 0 as tzoffset_minute, to_char(entry_date, 'DD Mon YYYY hh12:MI am') as entry_date_pretty, to_char(entry_date, 'YYYY/MM/') as entry_archive_url - from pinds_blog_entries + from pinds_blog_entries where package_id = :package_id and draft_p = 'f' and deleted_p = 'f' @@ -32,6 +32,34 @@ </querytext> </fullquery> + <fullquery name="lars_blog__rss_datasource.user_blog_rss_items"> + <querytext> + select * + from (select entry_id, + title, + content, + entry_date, + posted_date, + to_char(posted_date, 'YYYY-MM-DD') as posted_date_string, + to_char(posted_date, 'HH:MI') as posted_time_string, + -6 as tzoffset_hour, + 0 as tzoffset_minute, + to_char(entry_date, 'DD Mon YYYY hh12:MI am') as entry_date_pretty, + to_char(entry_date, 'YYYY/MM/') as entry_archive_url + from pinds_blog_entries e, + acs_objects o, + users u + where e.package_id = :package_id + and o.object_id = e.entry_id + and o.creation_user = :user_id + and u.user_id = o.creation_user + and e.draft_p = 'f' + and e.deleted_p = 'f' + order by e.entry_date desc, e.posted_date desc) + where rownum < 11 + </querytext> + </fullquery> + <fullquery name="lars_blog__rss_lastUpdated.get_last_update"> <querytext> select nvl ((max(posted_date)-to_date('1970-01-01'))*60*60*24,0) as last_update @@ -42,4 +70,16 @@ </querytext> </fullquery> + <fullquery name="lars_blog__rss_lastUpdated.get_last_user_update"> + <querytext> + select nvl ((max(posted_date)-to_date('1970-01-01'))*60*60*24,0) as last_update + from pinds_blog_entries e join + acs_objects o on (o.object_id = e.entry_id) + where e.package_id = :package_id + and o.creation_user = :user_id + and e.draft_p = 'f' + and e.deleted_p = 'f' + </querytext> + </fullquery> + </queryset> Index: openacs-4/packages/lars-blogger/tcl/rss-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/rss-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lars-blogger/tcl/rss-procs-postgresql.xql 30 Nov 2002 17:37:17 -0000 1.2 +++ openacs-4/packages/lars-blogger/tcl/rss-procs-postgresql.xql 28 Aug 2003 09:41:55 -0000 1.3 @@ -32,10 +32,36 @@ </querytext> </fullquery> + <fullquery name="lars_blog__rss_datasource.user_blog_rss_items"> + <querytext> + select entry_id, + title, + content, + entry_date, + posted_date, + to_char(posted_date, 'YYYY-MM-DD') as posted_date_string, + to_char(posted_date, 'HH:MI') as posted_time_string, + extract(timezone_hour from now()) as tzoffset_hour, + extract(timezone_minute from now()) as tzoffset_minute, + to_char(entry_date, 'DD Mon YYYY hh12:MI am') as entry_date_pretty, + to_char(entry_date, 'YYYY/MM/') as entry_archive_url + + from pinds_blog_entries e join + acs_objects o on (o.object_id = e.entry_id) join + users u on (u.user_id = o.creation_user) + where e.package_id = :package_id + and o.creation_user = :user_id + and e.draft_p = 'f' + and e.deleted_p = 'f' + order by e.entry_date desc, e.posted_date desc + limit 10 + </querytext> + </fullquery> + <fullquery name="lars_blog__rss_lastUpdated.get_last_update"> <querytext> select coalesce (date_part('epoch', - max(posted_date::timestamp with time zone) + max(posted_date::timestamptz) ),0) as last_update from pinds_blog_entries where package_id = :package_id @@ -44,4 +70,18 @@ </querytext> </fullquery> + <fullquery name="lars_blog__rss_lastUpdated.get_last_user_update"> + <querytext> + select coalesce (date_part('epoch', + max(e.posted_date::timestamptz) + ),0) as last_update + from pinds_blog_entries e join + acs_objects o on (o.object_id = e.entry_id) + where e.package_id = :package_id + and o.creation_user = :user_id + and e.draft_p = 'f' + and e.deleted_p = 'f' + </querytext> + </fullquery> + </queryset> Index: openacs-4/packages/lars-blogger/tcl/rss-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/rss-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lars-blogger/tcl/rss-procs.tcl 30 Nov 2002 17:37:17 -0000 1.3 +++ openacs-4/packages/lars-blogger/tcl/rss-procs.tcl 28 Aug 2003 09:41:55 -0000 1.4 @@ -6,22 +6,29 @@ } ad_proc -private lars_blog__rss_datasource { - package_id + summary_context_id } { This procedure implements the "datasource" operation of the RssGenerationSubscriber service contract. @author Lars Pind (lars@pinds.com) } { - set package_url [lars_blog_public_package_url -package_id $package_id] - set blog_title [db_string package_name { *SQL* }] + db_transaction { + + db_1row select_package_id_user_id {} + + set package_url [lars_blog_public_package_url -package_id $package_id] + + set blog_title [db_string package_name {}] - set blog_url "[ad_url]$package_url" - + set blog_url "[ad_url]$package_url" + + } + set column_array(channel_title) $blog_title set column_array(channel_description) $blog_title - set column_array(channel_pubDate) [db_string now { *SQL* }] + set column_array(channel_pubDate) [db_string now {}] set column_array(version) 1.00 @@ -42,7 +49,14 @@ set items [list] set counter 0 - db_foreach blog_rss_items { *SQL* } { + + if { [empty_string_p $user_id] } { + set statement "blog_rss_items" + } else { + set statement "user_blog_rss_items" + } + + db_foreach $statement {} { set TZoffset [format "%+03d:%02d" $tzoffset_hour $tzoffset_minute] set entry_url "[ad_url]${package_url}archive/${entry_archive_url}#blog-entry-$entry_id" @@ -77,21 +91,20 @@ } ad_proc -private lars_blog__rss_lastUpdated { - package_id + summary_context_id } { Returns the time that the last blog entry was posted, in Unix time. Returns 0 otherwise. @author Lars Pind (lars@pinds.com) } { - db_0or1row get_last_update { - select coalesce (date_part('epoch', - max(posted_date::timestamp with time zone) - ),0) as last_update - from pinds_blog_entries - where package_id = :package_id - and draft_p = 'f' - and deleted_p = 'f' + + db_1row select_package_id_user_id {} + + if { [empty_string_p $user_id] } { + db_0or1row get_last_update {} + } else { + db_0or1row get_last_user_update {} } return $last_update Index: openacs-4/packages/lars-blogger/tcl/rss-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/rss-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lars-blogger/tcl/rss-procs.xql 19 Aug 2002 21:52:59 -0000 1.1 +++ openacs-4/packages/lars-blogger/tcl/rss-procs.xql 28 Aug 2003 09:41:55 -0000 1.2 @@ -2,10 +2,22 @@ <queryset> + <fullquery name="lars_blog__rss_datasource.select_package_id_user_id"> + <querytext> + select package_id, user_id from weblogger_channels where channel_id = :summary_context_id + </querytext> + </fullquery> + <fullquery name="lars_blog__rss_datasource.package_name"> <querytext> select instance_name from apm_packages where package_id = :package_id </querytext> </fullquery> + <fullquery name="lars_blog__rss_lastUpdated.select_package_id_user_id"> + <querytext> + select package_id, user_id from weblogger_channels where channel_id = :summary_context_id + </querytext> + </fullquery> + </queryset> Index: openacs-4/packages/lars-blogger/tcl/weblogs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/weblogs-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lars-blogger/tcl/weblogs-procs.tcl 14 Sep 2002 16:40:33 -0000 1.3 +++ openacs-4/packages/lars-blogger/tcl/weblogs-procs.tcl 28 Aug 2003 09:41:55 -0000 1.4 @@ -106,7 +106,7 @@ return -code error -errorinfo $errorInfo $errMsg } } errmsg ] { - ns_log error "lars_blog_weblogs_com_update_ping error: $errmsg" + ns_log warning "lars_blog_weblogs_com_update_ping error: $errmsg" return -1 } else { ns_log notice "lars_blog_weblogs_com_update_ping: $page" Index: openacs-4/packages/lars-blogger/www/blog-months-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/blog-months-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lars-blogger/www/blog-months-oracle.xql 14 Sep 2002 18:37:58 -0000 1.2 +++ openacs-4/packages/lars-blogger/www/blog-months-oracle.xql 28 Aug 2003 09:41:55 -0000 1.3 @@ -3,7 +3,7 @@ <queryset> <rdbms><type>oracle</type><version>8.1.6</version></rdbms> - <fullquery name="months"> + <fullquery name="all_blog_months"> <querytext> select trunc(entry_date, 'month') as month_date, to_char(trunc(entry_date, 'month'), 'fmMonthfm YYYY') @@ -18,4 +18,24 @@ </querytext> </fullquery> + <fullquery name="one_blog_months"> + <querytext> + select trunc(entry_date, 'month') as month_date, + to_char(trunc(entry_date, 'month'), 'fmMonthfm YYYY') + as date_pretty, + to_char(trunc(entry_date, 'month'), 'YYYY/MM/') + as month_url_stub + from pinds_blog_entries e, + acs_objects o, + users u + where e.draft_p = 'f' + and e.package_id = :package_id + and u.screen_name = :screen_name + and o.object_id = e.entry_id + and u.user_id = o.creation_user + group by trunc(entry_date, 'month') + order by month_date desc + </querytext> + </fullquery> + </queryset> Index: openacs-4/packages/lars-blogger/www/blog-months-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/blog-months-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lars-blogger/www/blog-months-postgresql.xql 14 Sep 2002 18:37:58 -0000 1.2 +++ openacs-4/packages/lars-blogger/www/blog-months-postgresql.xql 28 Aug 2003 09:41:55 -0000 1.3 @@ -3,7 +3,7 @@ <queryset> <rdbms><type>postgresql</type><version>7.1</version></rdbms> - <fullquery name="months"> + <fullquery name="all_blog_months"> <querytext> select date_trunc('month', entry_date) as month_date, to_char(date_trunc('month', entry_date), 'fmMonthfm YYYY') @@ -18,4 +18,22 @@ </querytext> </fullquery> + <fullquery name="one_blog_months"> + <querytext> + select date_trunc('month', entry_date) as month_date, + to_char(date_trunc('month', entry_date), 'fmMonthfm YYYY') + as date_pretty, + to_char(date_trunc('month', entry_date), 'YYYY/MM/') + as month_url_stub + from pinds_blog_entries e join + acs_objects o on (o.object_id = e.entry_id) join + users u on (u.user_id = o.creation_user) + where package_id = :package_id + and draft_p = 'f' + and screen_name = :screen_name + group by month_date + order by month_date desc + </querytext> + </fullquery> + </queryset> Index: openacs-4/packages/lars-blogger/www/blog-months.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/blog-months.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lars-blogger/www/blog-months.tcl 14 Sep 2002 18:37:58 -0000 1.3 +++ openacs-4/packages/lars-blogger/www/blog-months.tcl 28 Aug 2003 09:41:55 -0000 1.4 @@ -1,7 +1,13 @@ set package_id [ad_conn package_id] -db_multirow -extend { url } months months { *SQL* } { - set url "[ad_conn package_url]archive/$month_url_stub" +if [empty_string_p $screen_name] { + db_multirow -extend { url } months all_blog_months { *SQL* } { + set url "[ad_conn package_url]archive/$month_url_stub" + } +} else { + db_multirow -extend { url } months one_blog_months { *SQL* } { + set url "[ad_conn package_url]user/$screen_name/archive/$month_url_stub" + } } -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/lars-blogger/www/blog-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/blog-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lars-blogger/www/blog-oracle.xql 27 Jan 2003 16:19:27 -0000 1.3 +++ openacs-4/packages/lars-blogger/www/blog-oracle.xql 28 Aug 2003 09:41:55 -0000 1.4 @@ -11,10 +11,43 @@ <partialquery name="date_clause_default"> <querytext> - entry_date > sysdate - 30 + entry_date > sysdate - :num_days </querytext> </partialquery> + <fullquery name="all_blogs"> + <querytext> + select entry_id, + to_char(entry_date, 'fmDayfm, Month fmDDfm, YYYY') as entry_date_pretty, + to_char(entry_date, 'YYYY/MM/DD/') as entry_archive_url, + to_char(entry_date, 'YYYY-MM-DD') as entry_date, + title, + title_url, + content, + content_format, + draft_p, + p.first_names as poster_first_names, + p.last_name as poster_last_name, + o.creation_user as user_id, + to_char(posted_date , 'HH24:MI') as posted_time_pretty, + (select count(gc.comment_id) + from general_comments gc, cr_revisions cr + where gc.object_id = entry_id + and content_item.get_live_revision(gc.comment_id) = cr.revision_id) as num_comments + from pinds_blog_entries e, + acs_objects o, + persons p + where e.entry_id = o.object_id + and p.person_id = o.creation_user + and package_id = :package_id + [ad_decode $date_clause "" "" "and $date_clause"] + and draft_p = 'f' + and deleted_p = 'f' + [ad_decode $limit "" "" "and rownum <= $limit"] + order by entry_date desc, posted_date desc + </querytext> + </fullquery> + <fullquery name="blog"> <querytext> select entry_id, @@ -27,6 +60,7 @@ draft_p, p.first_names as poster_first_names, p.last_name as poster_last_name, + o.creation_user as user_id, to_char(posted_date , 'HH24:MI') as posted_time_pretty, (select count(gc.comment_id) from general_comments gc, cr_revisions cr @@ -37,10 +71,12 @@ persons p where e.entry_id = o.object_id and p.person_id = o.creation_user + and o.creation_user = :blog_user_id and package_id = :package_id - and $date_clause + [ad_decode $date_clause "" "" "and $date_clause"] and draft_p = 'f' and deleted_p = 'f' + [ad_decode $limit "" "" "and rownum <= $limit"] order by entry_date desc, posted_date desc </querytext> </fullquery> Index: openacs-4/packages/lars-blogger/www/blog-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/blog-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/lars-blogger/www/blog-postgresql.xql 27 Jan 2003 16:19:27 -0000 1.5 +++ openacs-4/packages/lars-blogger/www/blog-postgresql.xql 28 Aug 2003 09:41:55 -0000 1.6 @@ -11,22 +11,24 @@ <partialquery name="date_clause_default"> <querytext> - entry_date > current_timestamp - interval '30 days' + entry_date > current_timestamp - interval '$num_days days' </querytext> </partialquery> - <fullquery name="blog"> + <fullquery name="all_blogs"> <querytext> select entry_id, to_char(entry_date, 'fmDayfm, Month fmDDfm, YYYY') as entry_date_pretty, to_char(entry_date, 'YYYY/MM/DD/') as entry_archive_url, to_char(entry_date, 'YYYY-MM-DD') as entry_date, title, + title_url, content, content_format, draft_p, p.first_names as poster_first_names, p.last_name as poster_last_name, + o.creation_user as user_id, to_char(posted_date , 'HH24:MI') as posted_time_pretty, (select count(gc.comment_id) from general_comments gc, cr_revisions cr @@ -36,11 +38,43 @@ acs_objects o on (o.object_id = e.entry_id) join persons p on (p.person_id = o.creation_user) where package_id = :package_id - and $date_clause + [ad_decode $date_clause "" "" "and $date_clause"] and draft_p = 'f' and deleted_p = 'f' order by entry_date desc, posted_date desc + [ad_decode $limit "" "" "limit $limit"] </querytext> </fullquery> + <fullquery name="blog"> + <querytext> + select entry_id, + to_char(entry_date, 'fmDayfm, Month fmDDfm, YYYY') as entry_date_pretty, + to_char(entry_date, 'YYYY/MM/DD/') as entry_archive_url, + to_char(entry_date, 'YYYY-MM-DD') as entry_date, + title, + content, + content_format, + draft_p, + p.first_names as poster_first_names, + p.last_name as poster_last_name, + o.creation_user as user_id, + to_char(posted_date , 'HH24:MI') as posted_time_pretty, + (select count(gc.comment_id) + from general_comments gc, cr_revisions cr + where gc.object_id = entry_id + and content_item__get_live_revision(gc.comment_id) = cr.revision_id) as num_comments + from pinds_blog_entries e join + acs_objects o on (o.object_id = e.entry_id) join + persons p on (p.person_id = o.creation_user) + where package_id = :package_id + and o.creation_user = :blog_user_id + [ad_decode $date_clause "" "" "and $date_clause"] + and draft_p = 'f' + and deleted_p = 'f' + order by entry_date desc, posted_date desc + [ad_decode $limit "" "" "limit $limit"] + </querytext> + </fullquery> + </queryset> Index: openacs-4/packages/lars-blogger/www/blog.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/blog.adp,v diff -u -r1.11 -r1.12 --- openacs-4/packages/lars-blogger/www/blog.adp 22 May 2003 15:01:04 -0000 1.11 +++ openacs-4/packages/lars-blogger/www/blog.adp 28 Aug 2003 09:41:55 -0000 1.12 @@ -7,9 +7,7 @@ <if @blog.rownum@ eq 1> <th bgcolor="@header_background_color@" align="right"> <font size="-1"> - <if @admin_p@ eq 1> - <a href="@entry_add_url@" title="Add an entry to @blog_name@">+</a> - </if> + <a href="@entry_add_url@" title="Add an entry to @blog_name@">+</a> <if @blog_url@ not nil> <a href="@blog_url@" title="Visit @blog_name@ home">@blog_name@</a> </if> @@ -20,23 +18,23 @@ </table> <group column="entry_date"> <div style="border-bottom:1px dashed #3366cc;"> - <include src="entry-chunk" &="blog" package_id="@package_id;noquote@"> + <include src="entry-chunk" &="blog" package_id="@package_id@" write_p="@write_p@" screen_name="@screen_name@"> </div> </group> </multiple> <p> <if @blog_url@ not nil> - <a href="@blog_url@"><img src="@arrow_url@" width="11" height="11" border="0" alt="Visit @blog_name@ home" title="Visit @blog_name@ home" /></a> + <b>»</b> <a href="@blog_url@" title="Visit @blog_name@ home" class="action_link">@blog_name@</a><br /> </if> - <a href="@archive_url@"><img src="@arrow_url@" width="11" height="11" border="0" alt="Visit the archive for @blog_name@" title="Visit the archive for @blog_name@" /></a> + <b>»</b> <a href="@archive_url@" title="Visit the archive for @blog_name@" class="action_link">Archive</a><br /> - <if @admin_p@ eq 1> - <a href="@entry_add_url@"><img src="@arrow_url@" width="11" height="11" border="0" alt="Add an entry to @blog_name@" title="Add an entry to @blog_name@" /></a> + <if @write_p@ gt 0> + <b>»</b> <a href="@entry_add_url@" title="Add an entry to @blog_name@" class="action_link">Add entry</a> </if> -</p> \ No newline at end of file +</p> Index: openacs-4/packages/lars-blogger/www/blog.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/blog.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/lars-blogger/www/blog.tcl 4 Jan 2003 09:46:24 -0000 1.9 +++ openacs-4/packages/lars-blogger/www/blog.tcl 28 Aug 2003 09:41:55 -0000 1.10 @@ -4,7 +4,9 @@ # type:optional (current, archive) # archive_interval:optional # archive_date:optional +# screen_name:optional + # If the caller specified a URL, then we gather the package_id from that URL if { [info exists url] } { array set blog_site_node [site_node $url] @@ -16,16 +18,58 @@ set package_id [ad_conn package_id] } -if { ![info exists type] } { - set type "current" +set write_p [permission::permission_p -object_id $package_id -privilege write] + +if { ![info exists screen_name] } { + set screen_name "" + set blog_user_id {} +} else { + set blog_user_id [cc_screen_name_user $screen_name] } +# TODO: +# - Upgrade the installed package to get the latest parameters +# - Test on PG and Oracle + + +set max_num_entries [parameter::get \ + -package_id $package_id \ + -parameter MaxNumEntriesOnFrontPage \ + -default {}] + +set min_num_entries [parameter::get \ + -package_id $package_id \ + -parameter MinNumEntriesOnFrontPage \ + -default {}] + +set num_days [parameter::get \ + -package_id $package_id \ + -parameter NumDaysOnFrontPage \ + -default {}] + + + switch -exact $type { archive { set date_clause "[db_map date_clause_archive]" + set limit {} } + current { + set date_clause {} + set limit {} + + if { ![empty_string_p $max_num_entries] && $max_num_entries != 0 } { + # MaxNumEntriesOnFrontPage parameter is set, which means we should limit to that + set limit $max_num_entries + } + + if { ![empty_string_p $num_days] && $num_days != 0 } { + # NumDaysOnFrontPage parameter is set, which means we should limit to that + set date_clause [db_map date_clause_default] + } + } default { - set date_clause "[db_map date_clause_default]" + error "Only knows of type 'archive' or 'current'" } } @@ -41,16 +85,35 @@ set blog_url {} } -set admin_p [ad_permission_p $package_id admin] +# Check that the date limit is not limiting us to show less than min_num_entries entries +if { ![string equal $type "archive"] && \ + ![empty_string_p $min_num_entries] && $min_num_entries != 0 && \ + ![empty_string_p $num_days] && $num_days != 0 + } { + if { [empty_string_p $blog_user_id] } { + set num_entries [db_string num_entries_by_date_all {}] + } else { + set num_entries [db_string num_entries_by_date {}] + } + + if { $num_entries < $min_num_entries } { + # Eliminate date clause, and set the limit to the minimum number of entries + set date_clause {} + set limit $min_num_entries + } +} -set count 0 +if { [empty_string_p $blog_user_id] } { + db_multirow blog all_blogs { *SQL* } + set archive_url "${package_url}archive/" +} else { + db_multirow blog blog { *SQL* } + set archive_url "${package_url}user/$screen_name/archive/" +} -db_multirow blog blog { *SQL* } - -set archive_url "${package_url}archive/" set arrow_url "${package_url}graphics/arrow-box.gif" -set entry_add_url "${package_url}admin/entry-edit" +set entry_add_url "${package_url}entry-edit" set header_background_color [lars_blog_header_background_color -package_id $package_id] Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/blog.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lars-blogger/www/calendar-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/calendar-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lars-blogger/www/calendar-oracle.xql 27 Jan 2003 16:19:27 -0000 1.1 +++ openacs-4/packages/lars-blogger/www/calendar-oracle.xql 28 Aug 2003 09:41:55 -0000 1.2 @@ -3,7 +3,7 @@ <queryset> <rdbms><type>oracle</type><version>8.1.6</version></rdbms> - <fullquery name="entry_dates"> + <fullquery name="all_entry_dates"> <querytext> select to_char(entry_date, 'J') as entry_date_julian from pinds_blog_entries @@ -13,4 +13,21 @@ group by to_char(entry_date, 'J') </querytext> </fullquery> + + + <fullquery name="entry_dates"> + <querytext> + select to_char(entry_date, 'J') as entry_date_julian + from pinds_blog_entries e, + acs_objects o, + users u + where package_id = :package_id + and o.object_id = e.entry_id + and u.user_id = o.creation_user + and u.screen_name = :screen_name + and draft_p = 'f' + and deleted_p = 'f' + group by to_char(entry_date, 'J') + </querytext> + </fullquery> </queryset> Index: openacs-4/packages/lars-blogger/www/calendar-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/calendar-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lars-blogger/www/calendar-postgresql.xql 27 Jan 2003 16:19:27 -0000 1.1 +++ openacs-4/packages/lars-blogger/www/calendar-postgresql.xql 28 Aug 2003 09:41:55 -0000 1.2 @@ -3,7 +3,7 @@ <queryset> <rdbms><type>postgresql</type><version>7.1</version></rdbms> - <fullquery name="entry_dates"> + <fullquery name="all_entry_dates"> <querytext> select to_char(entry_date, 'J') as entry_date_julian from pinds_blog_entries @@ -13,4 +13,19 @@ group by entry_date_julian </querytext> </fullquery> + + + <fullquery name="entry_dates"> + <querytext> + select to_char(entry_date, 'J') as entry_date_julian + from pinds_blog_entries e join + acs_objects o on (o.object_id = e.entry_id) join + users u on (u.user_id = o.creation_user) + where package_id = :package_id + and screen_name = :screen_name + and draft_p = 'f' + and deleted_p = 'f' + group by entry_date_julian + </querytext> + </fullquery> </queryset> Index: openacs-4/packages/lars-blogger/www/calendar.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/calendar.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lars-blogger/www/calendar.adp 22 May 2003 15:01:04 -0000 1.3 +++ openacs-4/packages/lars-blogger/www/calendar.adp 28 Aug 2003 09:41:55 -0000 1.4 @@ -1,4 +1,4 @@ -@notification_chunk;noquote@ +@widget@ <p> <a href="@prev_month_url@" title="View archive for @prev_month_name@">@prev_month_name@</a> - <a href="@next_month_url@" title="View archive for @next_month_name@">@next_month_name@</a> Index: openacs-4/packages/lars-blogger/www/calendar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/calendar.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lars-blogger/www/calendar.tcl 16 Sep 2002 15:04:27 -0000 1.3 +++ openacs-4/packages/lars-blogger/www/calendar.tcl 28 Aug 2003 09:41:55 -0000 1.4 @@ -19,18 +19,42 @@ set package_id [ad_conn package_id] -db_foreach entry_dates { * SQL * } { - ns_set put $calendar_details $entry_date_julian "1" +if {[empty_string_p $screen_name]} { + db_foreach all_entry_dates { * SQL * } { + ns_set put $calendar_details $entry_date_julian "1" + } +} else { + db_foreach entry_dates { * SQL * } { + ns_set put $calendar_details $entry_date_julian "1" + } } +if {[empty_string_p $screen_name]} { + + set day_number_template "\[ad_decode \[ns_set get \$calendar_details \$julian_date\] 1 \"<a href=\\\"${package_url}archive/\$year/$month_number/\[format \"%02d\" \$day_number\]/\\\" title=\\\"View the entries for this date\\\"><b>\$day_number</b></a>\" \$day_number\]" + +} else { + + set day_number_template "\[ad_decode \[ns_set get \$calendar_details \$julian_date\] 1 \"<a href=\\\"${package_url}user/$screen_name/archive/\$year/$month_number/\[format \"%02d\" \$day_number\]/\\\" title=\\\"View the entries for this date\\\"><b>\$day_number</b></a>\" \$day_number\]" + +} + set widget [dt_widget_month_small \ -date $date \ -calendar_details $calendar_details \ - -day_number_template "\[ad_decode \[ns_set get \$calendar_details \$julian_date\] 1 \"<a href=\\\"${package_url}archive/\$year/$month_number/\[format \"%02d\" \$day_number\]/\\\" title=\\\"View the entries for this date\\\"><b>\$day_number</b></a>\" \$day_number\]"] + -day_number_template $day_number_template] -set prev_month_url "${package_url}archive/[clock format [clock scan $prev_month] -format %Y/%m]/" -set next_month_url "${package_url}archive/[clock format [clock scan $next_month] -format %Y/%m]/" +if {[empty_string_p $screen_name]} { + set prev_month_url "${package_url}archive/[clock format [clock scan $prev_month] -format %Y/%m]/" + set next_month_url "${package_url}archive/[clock format [clock scan $next_month] -format %Y/%m]/" + +} else { + + set prev_month_url "${package_url}user/$screen_name/archive/[clock format [clock scan $prev_month] -format %Y/%m]/" + set next_month_url "${package_url}user/$screen_name/archive/[clock format [clock scan $next_month] -format %Y/%m]/" + +} # Add year to the link append next_month_name " [string range $next_month 0 3]" append prev_month_name " [string range $prev_month 0 3]" Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/drafts-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/drafts-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/drafts.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/drafts.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/drafts.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lars-blogger/www/entry-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/entry-chunk.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/lars-blogger/www/entry-chunk.adp 22 May 2003 15:01:04 -0000 1.6 +++ openacs-4/packages/lars-blogger/www/entry-chunk.adp 28 Aug 2003 09:41:55 -0000 1.7 @@ -1,7 +1,16 @@ -<if @blog.title@ not nil> - <h4>@blog.title@</h4> +<if @blog.title_url@ not nil> + <p> + <a href="@blog.title_url@"><b><if @blog.title@ not nil>@blog.title@</if><else>@blog.title_url@</else></b></a> + <if @blog.title_url_base@ not nil> + <span style="font-size: 80%; font-style: italic;">[@blog.title_url_base@]</span> + </if> + </p> </if> -<p> +<else> + <if @blog.title@ not nil> + <p><b>@blog.title@</b></p> + </if> +</else> @blog.content@ </p> <br /> @@ -12,7 +21,7 @@ <font size="-2" color="#999999"> <br /> Posted by @blog.poster_first_names@ @blog.poster_last_name@ at @blog.posted_time_pretty@ - <if @admin_p@ eq 1> + <if @user_id@ eq @blog.user_id@ or @write_p@ eq 1> <a href="@blog.edit_url@">Edit</a> - <if @blog.draft_p@ true> @@ -31,7 +40,7 @@ <p> <a href="@blog.entry_archive_url@" title="Permanent URL for this entry">#</a> - <a href="@blog.google_url@" title="Search for @blog.title@ on Google">G</a> - <if @comments_html;noquote@ nil> + <if @comments_html@ nil> <if @blog.comments_view_url@ not nil> <if @blog.num_comments@ gt 0> - <a href="@blog.comments_view_url@" title="View comments on this entry">@blog.num_comments@ <if @blog.num_comments@ eq 1>comment</if><else>comments</else></a> @@ -46,11 +55,11 @@ </tr> </table> -<if @comments_html;noquote@ not nil> +<if @comments_html@ not nil> <table align=center width="50%"><tr><td><hr></td></tr></table> <h4>Comments</h4> <blockquote> - @comments_html;noquote@ + @comments_html@ </blockquote> <center><a href="@blog.comment_add_url@" title="Comment on this entry">Add comment</a></center> </if> Index: openacs-4/packages/lars-blogger/www/entry-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/entry-chunk.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/lars-blogger/www/entry-chunk.tcl 27 Jan 2003 16:19:27 -0000 1.5 +++ openacs-4/packages/lars-blogger/www/entry-chunk.tcl 28 Aug 2003 09:41:55 -0000 1.6 @@ -13,14 +13,14 @@ set package_id [ad_conn package_id] } -set admin_p [ad_permission_p $package_id admin] - if { ![exists_and_not_null return_url] } { set return_url "[ad_conn url]?[ad_conn query]" } set package_url [lars_blog_public_package_url -package_id $package_id] +set user_id [ad_conn user_id] + set general_comments_package_url [general_comments_package_url] set show_poster_p [ad_parameter "ShowPosterP" "" "1"] @@ -34,13 +34,18 @@ set entry_id $blog(entry_id) -set blog(edit_url) "${package_url}admin/entry-edit?[export_vars { entry_id return_url }]" -set blog(delete_url) "${package_url}admin/entry-delete?[export_vars { entry_id return_url }]" +set blog(edit_url) "${package_url}entry-edit?[export_vars { entry_id return_url }]" +set blog(delete_url) "${package_url}entry-delete?[export_vars { entry_id return_url }]" -set blog(publish_url) "${package_url}admin/entry-publish?[export_vars { entry_id return_url }]" -set blog(revoke_url) "${package_url}admin/entry-revoke?[export_vars { entry_id return_url }]" +set blog(publish_url) "${package_url}entry-publish?[export_vars { entry_id return_url }]" +set blog(revoke_url) "${package_url}entry-revoke?[export_vars { entry_id return_url }]" -set blog(entry_archive_url) "${package_url}one-entry?[export_vars { entry_id }]" +if { [empty_string_p $screen_name] } { + set blog(entry_archive_url) "${package_url}one-entry?[export_vars { entry_id }]" +} else { + set blog(entry_archive_url) "${package_url}user/$screen_name/one-entry?[export_vars { entry_id }]" +} + set blog(google_url) "http://www.google.com/search?[export_vars { {q $blog(title) } }]" if { ![empty_string_p $general_comments_package_url] } { @@ -53,4 +58,4 @@ set comments_html [general_comments_get_comments -print_content_p 1 $entry_id] } -ad_return_template \ No newline at end of file +ad_return_template Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/entry-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/entry-delete.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/entry-edit-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/entry-edit-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/entry-edit.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/entry-edit.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/entry-edit.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/entry-publish.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/entry-revoke.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/entry-revoke.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/index-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/index-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lars-blogger/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/index.adp,v diff -u -r1.12 -r1.13 --- openacs-4/packages/lars-blogger/www/index.adp 22 May 2003 15:01:04 -0000 1.12 +++ openacs-4/packages/lars-blogger/www/index.adp 28 Aug 2003 09:41:55 -0000 1.13 @@ -1,14 +1,51 @@ <master> -<property name="title">@page_title;noquote@</property> +<property name="title">@page_title@</property> <if @rss_file_url@ not nil> - <property name="header_stuff"><link rel="alternate" type="application/rss+xml" title="RSS" href="@rss_file_url;noquote@" /></property> + <property name="header_stuff"><link rel="alternate" type="application/rss+xml" title="RSS" href="@rss_file_url@" /></property> </if> -<property name="context_bar">@context_bar;noquote@</property> +<property name="context_bar">@context_bar@</property> +<if @display_bloggers_p@ eq 1> + + + <if @bloggers:rowcount@ gt 0> + <ul> + <multiple name="bloggers"> + <li><a href="@package_url@user/@bloggers.screen_name@">@bloggers.screen_name@</a></li> + </multiple> + </ul> + </if> + <else> + <i>No bloggers here.</i> + </else> + + <if @write_p@ true> + <if @user_has_blog_p@ true> + <p> + <b>»</b> <a href="@package_url@entry-edit" title="Add an entry to your weblog">Add entry</a><br> + </p> + </if> + <else> + <p> + <b>»</b> <a href="@package_url@entry-edit" title="Start your weblog">Start your weblog</a><br> + </p> + </else> + </if> + + <if @admin_p@ true> + <p> + <b>»</b> <a href="@package_url@admin/" title="Visit administration pages">Administer<a/> + </p> + </if> + +</if> + +<else> + <table width="100%"> <tr> <td valign="top"> - <include src="blog" type="@type;noquote@" archive_interval="@interval;noquote@" archive_date="@archive_date;noquote@"> + <include src="blog" type="@type@" archive_interval="@interval@" archive_date="@archive_date@" screen_name="@screen_name@"> </td> <td valign="top"> @@ -20,7 +57,7 @@ </tr> <tr> <td nowrap align="center"> - <include src="calendar" date="@date;noquote@"> + <include src="calendar" date="@date@" screen_name="@screen_name@"> </td> </tr> <tr> @@ -29,35 +66,35 @@ </td> </tr> - <if @admin_p@ true> + <if @write_p@ true> <tr> <th bgcolor="@header_background_color@"> Actions </th> </tr> <tr> <td align="center"> - <a href="admin/entry-edit" title="Add an entry to this blog">Add entry</a><br> - <a href="admin/drafts" title="View draft entries">Draft entries<a/><br> - <a href="admin/" title="Visit administration pages">Administer<a/> + <a href="@package_url@entry-edit" title="Add an entry to this blog">Add entry</a><br> + <a href="@package_url@drafts" title="View draft entries">Draft entries<a/> + <if @admin_p@ true> + <br><a href="@package_url@admin/" title="Visit administration pages">Administer<a/> + </if> </td> </tr> <tr> - <td height="16"> - <table><tr><td></td></tr></table> - </td> + <td height="16"> </td> </tr> - </if> + </if> - <if @notification_chunk;noquote@ not nil> + <if @notification_chunk@ not nil> <tr> <th bgcolor="@header_background_color@"> Notifications </th> </tr> <tr> <td align="center"> - @notification_chunk;noquote@ + @notification_chunk@ </td> </tr> <tr> @@ -67,7 +104,7 @@ </tr> </if> - <include-optional src="blog-months"> + <include-optional src="blog-months" screen_name="@screen_name@"> <tr> <th bgcolor="@header_background_color@"> Archive @@ -92,7 +129,7 @@ </th> </tr> <tr> - <td nowrap> + <td nowrap align="center"> <a href="@rss_file_url@" title="Link to the RSS feed">RSS 1.0/RDF/XML</a> </td> </tr> @@ -103,3 +140,4 @@ </tr> </table> +</else> Index: openacs-4/packages/lars-blogger/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/index.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/lars-blogger/www/index.tcl 30 Jan 2003 16:56:22 -0000 1.7 +++ openacs-4/packages/lars-blogger/www/index.tcl 28 Aug 2003 09:41:55 -0000 1.8 @@ -4,24 +4,62 @@ @author Lars Pind (lars@pinds.com) @creation-date February 2002 } { + screen_name:optional year:optional,string_length_range(4|4) month:optional,string_length_range(2|2) day:optional,string_length_range(2|2) -} -properties { - context_bar - page_title } -set context_bar [ad_context_bar] - set page_title [lars_blog_name] -if { ![empty_string_p [ad_parameter "rss_file_url"]] } { - set rss_file_url "[ad_url][lars_blog_public_package_url][ad_parameter "rss_file_url"]" +if {![exists_and_not_null screen_name]} { + set screen_name "" + set context_bar [ad_context_bar] +} else { + set context_bar [ad_context_bar $screen_name] } -set admin_p [ad_permission_p [ad_conn package_id] admin] +if { ![empty_string_p [parameter::get -parameter "rss_file_name"]] } { + if {[exists_and_not_null screen_name]} { + set rss_file_url "[ad_url][lars_blog_public_package_url]user/$screen_name/rss/[parameter::get -parameter "rss_file_name"]" + } else { + set rss_file_url "[ad_url][lars_blog_public_package_url]rss/[parameter::get -parameter "rss_file_name"]" + } + +} + +set package_id [ad_conn package_id] + +set package_url [ad_conn package_url] + +set write_p [permission::permission_p -object_id $package_id -privilege write] +set admin_p [permission::permission_p -object_id $package_id -privilege admin] + +set display_users_p [parameter::get -parameter "DisplayUsersP" -default 0] + +if {$display_users_p && ![exists_and_not_null screen_name]} { + + set display_bloggers_p 1 + + db_multirow bloggers bloggers { *SQL* } + + set user_has_blog_p 0 + multirow foreach bloggers { + if { $user_id == [ad_conn user_id] } { + set user_has_blog_p 1 + break + } + } + + ad_return_template + +} else { + + set display_bloggers_p 0 + +} + set notification_chunk [notification::display::request_widget \ -type lars_blogger_notif \ -object_id [ad_conn package_id] \ @@ -40,11 +78,19 @@ if { [exists_and_not_null day] } { set interval "day" db_1row archive_date_month_day { *SQL* } - set context_bar [ad_context_bar [list "[ad_conn package_url]archive/" "Archive"] [list "[ad_conn package_url]archive/$year/$month/" $archive_month_pretty] $archive_date_pretty] + if {[empty_string_p $screen_name]} { + set context_bar [ad_context_bar [list "$package_url/archive/" "Archive"] [list "$package_url/archive/$year/$month/" $archive_month_pretty] $archive_date_pretty] + } else { + set context_bar [ad_context_bar [list "$package_url/user/$screen_name/" "$screen_name"] [list "$package_url/user/$screen_name/archive/" "Archive"] [list "$package_url/user/$screen_name/archive/$year/$month/" $archive_month_pretty] $archive_date_pretty] + } } else { set interval "month" db_1row archive_date_month { *SQL* } - set context_bar [ad_context_bar [list "[ad_conn package_url]archive/" "Archive"] $archive_date_pretty] + if {[empty_string_p $screen_name]} { + set context_bar [ad_context_bar [list "$package_url/archive/" "Archive"] $archive_date_pretty] + } else { + set context_bar [ad_context_bar [list "$package_url/user/$screen_name/" "$screen_name"] [list "$package_url/user/$screen_name/archive/" "Archive"] $archive_date_pretty] + } } append page_title " Archive" Index: openacs-4/packages/lars-blogger/www/one-entry.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/one-entry.adp,v diff -u -r1.7 -r1.8 --- openacs-4/packages/lars-blogger/www/one-entry.adp 22 May 2003 15:01:04 -0000 1.7 +++ openacs-4/packages/lars-blogger/www/one-entry.adp 28 Aug 2003 09:41:55 -0000 1.8 @@ -1,6 +1,6 @@ <master> -<property name="title">@page_title;noquote@</property> -<property name="context_bar">@context_bar;noquote@</property> +<property name="title">@page_title@</property> +<property name="context_bar">@context_bar@</property> <table cellspacing="0" cellpadding="2" border="0" width="100%"> <tr> @@ -10,4 +10,4 @@ </tr> </table> -<include src="entry-chunk" &="blog" show_comments_p="t"> \ No newline at end of file +<include src="entry-chunk" &="blog" show_comments_p="t" screen_name="@screen_name@"> Index: openacs-4/packages/lars-blogger/www/one-entry.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/one-entry.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/lars-blogger/www/one-entry.tcl 14 Sep 2002 22:05:25 -0000 1.5 +++ openacs-4/packages/lars-blogger/www/one-entry.tcl 28 Aug 2003 09:41:55 -0000 1.6 @@ -13,8 +13,6 @@ set package_id [ad_conn package_id] -set admin_p [ad_permission_p $package_id admin] - if { [empty_string_p $return_url] } { set return_url "[ad_conn url]?[ad_conn query]" } @@ -25,8 +23,13 @@ set page_title $blog(title) -set context_bar [ad_context_bar $page_title] +if {![exists_and_not_null screen_name]} { + set screen_name "" + set context_bar [ad_context_bar $page_title] +} else { + set context_bar [ad_context_bar $screen_name] +} set header_background_color [lars_blog_header_background_color] -ad_return_template \ No newline at end of file +ad_return_template Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/screen-name-setup.adp'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lars-blogger/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/admin/index.adp,v diff -u -r1.7 -r1.8 --- openacs-4/packages/lars-blogger/www/admin/index.adp 22 May 2003 15:01:34 -0000 1.7 +++ openacs-4/packages/lars-blogger/www/admin/index.adp 28 Aug 2003 09:41:56 -0000 1.8 @@ -1,42 +1,43 @@ <master> -<property name="title">@title;noquote@</property> +<property name="title">@title@</property> <p> These are your administrative options </p> <blockquote> <p> - <a href="entry-edit"><img src="@arrow_url@" width="11" height="11" border="0" alt="Add new blog entry" title="Add new blog entry" /></a> - <a href="entry-edit" title="Add new blog entry" class="action_link">Add new blog entry</a> + <b>»</b> + <a href="../entry-edit" title="Add new blog entry" class="action_link">Add new blog entry</a> </p> <p> - <a href="drafts"><img src="@arrow_url@" width="11" height="11" border="0" alt="View draft entries" title="View draft entries" /></a> - <a href="drafts" title="View draft entries" class="action_link">View draft entries</a> + <b>»</b> + <a href="../drafts" title="View draft entries" class="action_link">View draft entries</a> </p> <p> - <a href="subscribers"><img src="@arrow_url@" width="11" height="11" border="0" alt="Show E-Mail subscribers" title="Show E-Mail subscribers" /></a> + <b>»</b> <a href="subscribers" title="Show E-Mail subscribers" class="action_link">Show E-Mail subscribers</a> </p> <p> - <a href="@parameters_url@"><img src="@arrow_url@" width="11" height="11" border="0" alt="Set parameters" title="Set parameters" /></a> + <b>»</b> <a href="@parameters_url@" title="Set parameters" class="action_link">Set parameters</a> </p> - <if @rss_feed_p@ false> + <if @instance_feed_p@ true> <p> - <a href="@rss_setup_url@"><img src="@arrow_url@" width="11" height="11" border="0" alt="Setup an RSS feed" title="Setup an RSS feed" /></a> - <a href="@rss_setup_url@" title="Setup an RSS feed" class="action_link">Setup an RSS feed</a> + <b>»</b> + <a href="@rss_manage_url@" title="Manage your RSS feeds" class="action_link">Manage your RSS feeds</a> (<a href="@rss_file_url@">View instance feed XML</a>) </p> </if> - <else> + + <if @instance_feed_p@ false> <p> - <a href="@rss_manage_url@"><img src="@arrow_url@" width="11" height="11" border="0" alt="Manage your RSS feed" title="Manage your RSS feed" /></a> - <a href="@rss_manage_url@" title="Manage your RSS feed" class="action_link">Manage your RSS feed</a> + <b>»</b> + <a href="@rss_setup_url@" title="Setup instance RSS feed" class="action_link">Setup instance RSS feed</a> </p> - </else> + </if> -</blockquote> \ No newline at end of file +</blockquote> Index: openacs-4/packages/lars-blogger/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/admin/index.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lars-blogger/www/admin/index.tcl 30 Jan 2003 16:56:39 -0000 1.3 +++ openacs-4/packages/lars-blogger/www/admin/index.tcl 28 Aug 2003 09:41:56 -0000 1.4 @@ -15,11 +15,12 @@ set arrow_url "[lars_blog_public_package_url -package_id $package_id]graphics/arrow-box.gif" -set rss_feed_p [db_string rss_feed_p {}] +set instance_feed_p [db_string rss_feed_p {}] set rss_setup_url "rss-setup" set rss_manage_url "[apm_package_url_from_key "rss-support"]my-subscrs" -ad_return_template - +if { ![empty_string_p [parameter::get -parameter "rss_file_name"]] } { + set rss_file_url "[ad_url][lars_blog_public_package_url]rss/[parameter::get -parameter "rss_file_name"]" +} Index: openacs-4/packages/lars-blogger/www/admin/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/admin/index.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lars-blogger/www/admin/index.xql 30 Jan 2003 16:56:39 -0000 1.2 +++ openacs-4/packages/lars-blogger/www/admin/index.xql 28 Aug 2003 09:41:56 -0000 1.3 @@ -13,8 +13,9 @@ <querytext> select count(*) from rss_gen_subscrs s, - acs_sc_impls i - where s.summary_context_id = :package_id + acs_sc_impls i, weblogger_channels w + where w.package_id = :package_id + and s.summary_context_id = w.channel_id and s.impl_id = i.impl_id and i.impl_name = 'pinds_blog_entries' and i.impl_owner_name = 'lars-blogger' Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/admin/rss-setup-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/admin/rss-setup-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lars-blogger/www/admin/rss-setup.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/admin/rss-setup.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lars-blogger/www/admin/rss-setup.tcl 30 Jan 2003 16:56:39 -0000 1.1 +++ openacs-4/packages/lars-blogger/www/admin/rss-setup.tcl 28 Aug 2003 09:41:56 -0000 1.2 @@ -2,23 +2,7 @@ Setup an RSS feed for this blogger. } -set creation_user [ad_conn user_id] -set creation_ip [ns_conn peeraddr] +# Setup instance feed if needed +lars_blog_setup_feed -# by default, we timout in 30 minutes -set timeout [expr 30*60] - -set package_id [ad_conn package_id] - -set channel_title [lars_blog_name] -set channel_link [lars_blog_public_package_url] - -db_transaction { - - set subscr_id [db_string create_subscr {}] - - db_dml update_subscr {} - -} - -ad_returnredirect . \ No newline at end of file +ad_returnredirect . Index: openacs-4/packages/lars-blogger/www/admin/rss-setup.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/admin/rss-setup.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lars-blogger/www/admin/rss-setup.xql 30 Jan 2003 16:56:39 -0000 1.1 +++ openacs-4/packages/lars-blogger/www/admin/rss-setup.xql 28 Aug 2003 09:41:56 -0000 1.2 @@ -2,24 +2,6 @@ <queryset> - <fullquery name="create_subscr"> - <querytext> - select rss_gen_subscr__new ( - null, -- subscr_id - acs_sc_impl__get_id('RssGenerationSubscriber','pinds_blog_entries'), - -- impl_id - :package_id, -- summary_context_id - :timeout, -- timeout - null, -- lastbuild - 'rss_gen_subscr', -- object_type - now(), -- creation_date - :creation_user, -- creation_user - :creation_ip, -- creation_ip - :package_id -- context_id - ) - </querytext> - </fullquery> - <fullquery name="update_subscr"> <querytext> update rss_gen_subscrs Index: openacs-4/packages/lars-blogger/www/doc/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/doc/index.html,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lars-blogger/www/doc/index.html 6 Feb 2003 08:59:15 -0000 1.3 +++ openacs-4/packages/lars-blogger/www/doc/index.html 28 Aug 2003 09:41:56 -0000 1.4 @@ -1,20 +1,20 @@ <html> <head> -<title>Lars Pind's Blogger Documentation</title> +<title>Weblogger Documentation</title> </head> <body bgcolor=white> -<h2>Lars Pind's Blogger Documentation</h2> -By <a href="http://www.pinds.com/lars/">Lars Pind</a> +<h2>Weblogger Documentation</h2> +By <a href="http://www.pinds.com/lars/">Lars Pind</a> and <a href="http://bcuni.net">Simon Carstensen</a> <hr> -<h3>Why</h3> +<!--<h3>Why</h3> <p> I wrote this blogger package for my own web site at <a href="http://www.pinds.com/">pinds.com</a>. For background information, please visit <a href="http://www.pinds.com/download/">http://www.pinds.com/download</a>. -</p> +</p>--> <h3>Download</h3> @@ -27,8 +27,8 @@ <p> Install the package on your system, mount a new instance somewhere - on the site map, make sure you have admin permission on the - instance, and then visit /admin under the URL where you mounted + on the site map, make sure you have write permission on the + instance, and then visit the URL where you mounted it. Now you can add your first blog entry. </p> @@ -88,18 +88,21 @@ <h3>Technical Info</h3> <p> - The package fully supports multiple instances, i.e., you can mount + The package fully supports multiple instances. You can mount several instances in your site map, and they'll stay properly isolated - from each other. + from each other. Alternatively you can let multiple users post to one + instance by granting write permissions. Mounting Weblogger under, say, + /blog, you will have /blog/user/screenname displaying the entries of one + user and /blog displaying either a list of all bloggers (this is done by + setting the parameter DisplayUsersP to 1) or all entries posted to the + instance (the default). </p> <p> Contents in your blog entries are assumed to be full-blooded - ADP-ified HTML, so don't give people access to post a blog unless - you trust them. I guess it should be made configurable whether to - allow this or not, but since I'm developing this for my own site - primarily, I haven't done so. This also means that if you've added - custom ADP tags, those are also available to you in your blog. + ADP-ified HTML, so don't give people access to post a blog (i.e. grant + write permissions on the instance) unless you trust them. This also means + that if you've added custom ADP tags, those are also available to you in your blog. </p> <h3>weblogs.com update ping</h3> @@ -124,7 +127,7 @@ <p> Then you'll need to set the parameters and say that your - rss_file_url is at + rss_file_name is at /where-your-blogger-instnace-sists/rss/rss.xml. If you leave this blank, we won't advertise your RSS feed URL anywhere. </p> @@ -137,39 +140,54 @@ <h3>Road Map</h3> <ul> + <li>Categorize and full-text-search-index blog entries so the archives + are more useful.</li> <li> - Categorize and full-text-search-index blog entries so the archives - are more useful. + Use content repository. </li> + <li>Ability to modify templates for each instance individually through + the UI. </li> + <li>Support for Trackback</li> + <li>Support for the Blogger and MetaWeblog APIs</li> + <li>WYISIYG editor</li> + <li>Improved RSS feed</li> + <li>Improved Configuration Settings.</li> + <li>Make it safe to use in a not-so-protected environment, e.g., + disable <% ... %> ADP notation.</li> + <li>Better documentation.</li> <li> - Use content repository. + Moderation-feature: Entries posted by non-admins must go through a + workflow-administered approval process. </li> <li> - Community-maintained blog ... everybody with 'write' can post entries. + Nicer interface (MovableType) </li> +</ul> + +<h3>Version History</h3> + +<ul> <li> - Moderation-feature: Entries posted by non-admins must go through a - workflow-administered approval process. + <b>0.9.2</b> Added parameters to control the number of entries shown + on the front page (July 10, 2003) </li> <li> - Ability to modify templates for each instance individually through - the UI. + <b>0.9</b> Added support for multiple users. (June 10, 2003) </li> <li> - Nicer interface (MovableType) + <b>0.8.7</b> Fixed notifications to include the title_url, and + to not have extra spaces in the month name. (May 11, 2003) </li> <li> - Make it safe to use in a not-so-protected environment, e.g., - disable <% ... %> ADP notation. + <b>0.8.6</b> Cleaned up RSS-support even more and made it work + under Oracle. Also made a slight style change, using the + &raquo; (») style for action links, which I've adopted + for other packages. It's less intrusive than the harshly-colored + arrow-box.gif I used to use. (May 9, 2003) </li> <li> - More thorough documentation and some setup/config pages. + <b>0.8.5</b> Added title URL, cleanup (March 28, 2003) </li> -</ul> - -<h3>Version History</h3> - -<ul> <li> <b>0.8.4</b> Oops, getting behind on the version history. In the last few releases, I've rearranged a bunch of templates to make it @@ -232,4 +250,4 @@ <address><a href="mailto:lars@pinds.com">lars@pinds.com</a></address> </body> -</html> \ No newline at end of file +</html> Index: openacs-4/packages/lars-blogger/www/rss/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/rss/index.vuh,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lars-blogger/www/rss/index.vuh 30 Nov 2002 17:38:04 -0000 1.2 +++ openacs-4/packages/lars-blogger/www/rss/index.vuh 28 Aug 2003 09:41:56 -0000 1.3 @@ -1 +1,12 @@ -ns_returnfile 200 text/xml [rss_gen_report_file -summary_context_id [ad_conn package_id] -impl_name pinds_blog_entries] +set extra_url_list [split [ad_conn extra_url] "/"] + +set package_id [ad_conn package_id] + +set summary_context_id [db_string package_id { + select channel_id as summary_context_id + from weblogger_channels w + where w.package_id = :package_id + and w.user_id is null +}] + +ns_returnfile 200 text/xml [rss_gen_report_file -summary_context_id $summary_context_id -impl_name pinds_blog_entries] Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/user/index.vuh'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lars-blogger/www/user/archive/index.vuh'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/logger/logger.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/logger.info,v diff -u -r1.6 -r1.7 --- openacs-4/packages/logger/logger.info 9 May 2003 15:07:00 -0000 1.6 +++ openacs-4/packages/logger/logger.info 28 Aug 2003 09:45:30 -0000 1.7 @@ -15,6 +15,7 @@ <vendor url="http://collaboraid.biz">Collaboraid</vendor> <provides url="logger" version="1.0b1"/> + <requires url="acs-tcl" version="4.6.2"/> <callbacks> <callback type="after-install" proc="logger::apm::after_install"/> Index: openacs-4/packages/logger/tcl/project-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/tcl/project-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/logger/tcl/project-procs.tcl 1 May 2003 14:14:33 -0000 1.6 +++ openacs-4/packages/logger/tcl/project-procs.tcl 28 Aug 2003 09:45:30 -0000 1.7 @@ -100,6 +100,24 @@ db_dml update_project {} } +ad_proc -public logger::project::set_active_p { + {-project_id:required} + {-active_p:required} +} { + Set a Logger project active/inactive. + + @param project_id The id of the project to edit + @param active_p The new value for active_p, must be t (true) or f (false) + + @return The return value from db_dml + + @author Lars Pind (lars@collaboraid.biz) +} { + ad_assert_arg_value_in_list active_p {t f} + + db_dml update_project {} +} + ad_proc -public logger::project::delete { {-project_id:required} } { @@ -258,4 +276,16 @@ @author Peter Marklund } { return [db_string select_primary_variable {} -default ""] -} \ No newline at end of file +} + +ad_proc -private logger::project::users_get_options {} { + Get the list of users to display in a drop-down to pick project lead. +} { + set package_id [ad_conn package_id] + + set users_list [db_list_of_lists select_project_leads {}] + + lappend users_list { "Search..." ":search:"} + + return $users_list +} Index: openacs-4/packages/logger/tcl/project-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/tcl/project-procs.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/logger/tcl/project-procs.xql 1 May 2003 14:14:33 -0000 1.5 +++ openacs-4/packages/logger/tcl/project-procs.xql 28 Aug 2003 09:45:30 -0000 1.6 @@ -83,4 +83,23 @@ </querytext> </fullquery> + <fullquery name="logger::project::set_active_p.update_project"> + <querytext> + update logger_projects + set active_p = :active_p + where project_id = :project_id + </querytext> + </fullquery> + + + <fullquery name="logger::project::users_get_options.select_project_leads"> + <querytext> + select acs_object__name(p.project_lead), project_lead + from logger_projects p, + logger_project_pkg_map ppm + where ppm.project_id = p.project_id + and ppm.package_id = :package_id + </querytext> + </fullquery> + </queryset> Index: openacs-4/packages/logger/tcl/projection-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/tcl/projection-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/logger/tcl/projection-procs.tcl 2 May 2003 08:34:43 -0000 1.3 +++ openacs-4/packages/logger/tcl/projection-procs.tcl 28 Aug 2003 09:45:30 -0000 1.4 @@ -17,7 +17,7 @@ {-end_time:required} {-value:required} {-name:required} - {-description:required} + {-description ""} } { Create a new projection for a certain variable and project. @@ -31,6 +31,8 @@ @param value The anticipated or targeted value (a sum for additive variables, an average for non-additive variables). + @param name Used when listing or displaying the projection in the UI. + @param description Describes the projection. Optional. @return The id of the created projection. Will throw an error if a projection_id is provided and a projection with that id already exists in the database. Index: openacs-4/packages/logger/tcl/ui-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/tcl/ui-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/logger/tcl/ui-procs.tcl 9 May 2003 15:07:27 -0000 1.7 +++ openacs-4/packages/logger/tcl/ui-procs.tcl 28 Aug 2003 09:45:30 -0000 1.8 @@ -101,18 +101,5 @@ @author Peter Marklund } { set package_id [ad_conn package_id] - - set project_options [list] - db_foreach project_options { - select lp.project_id, - lp.name - from logger_projects lp, - logger_project_pkg_map lppm - where lp.project_id = lppm.project_id - and lppm.package_id = :package_id - } { - lappend project_options [list $name $project_id] - } - - return $project_options + return [db_list_of_lists project_options {}] } Index: openacs-4/packages/logger/tcl/ui-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/tcl/ui-procs.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/logger/tcl/ui-procs.xql 9 May 2003 15:07:27 -0000 1.2 +++ openacs-4/packages/logger/tcl/ui-procs.xql 28 Aug 2003 09:45:30 -0000 1.3 @@ -13,5 +13,16 @@ </querytext> </fullquery> + <fullquery name="logger::ui::project_options.project_options"> + <querytext> + select lp.name, + lp.project_id + from logger_projects lp, + logger_project_pkg_map lppm + where lp.project_id = lppm.project_id + and lppm.package_id = :package_id + order by name + </querytext> + </fullquery> </queryset> Index: openacs-4/packages/logger/tcl/test/logger-test-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/tcl/test/logger-test-init.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/logger/tcl/test/logger-test-init.tcl 1 May 2003 14:15:28 -0000 1.7 +++ openacs-4/packages/logger/tcl/test/logger-test-init.tcl 28 Aug 2003 09:45:30 -0000 1.8 @@ -41,6 +41,7 @@ set projection_start_time "2003-04-10" set projection_end_time "2003-04-20" set projection_value "10" + set projection_name "Test Projection" array set hour_entry_1 { value 11 time_stamp "2003-04-15" @@ -116,7 +117,8 @@ -variable_id $hours_var_id \ -start_time $projection_start_time \ -end_time $projection_end_time \ - -value $projection_value] + -value $projection_value \ + -name $projection_name] # Assert that projection values can be retrieved logger::projection::get -projection_id $projection_id -array projection Index: openacs-4/packages/logger/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/index.adp,v diff -u -r1.9 -r1.10 --- openacs-4/packages/logger/www/index.adp 22 May 2003 15:01:52 -0000 1.9 +++ openacs-4/packages/logger/www/index.adp 28 Aug 2003 09:45:30 -0000 1.10 @@ -1,5 +1,5 @@ <master src="lib/master"> -<property name="title">Logger Application</property> +<property name="title">@instance_name@</property> <table cellpadding="3" cellspacing="3"> <tr> @@ -69,7 +69,8 @@ projection_value="@selected_projection_value;noquote@" selected_user_id="@selected_user_id;noquote@" start_date_ansi="@selected_start_date;noquote@" - end_date_ansi="@selected_end_date;noquote@"/> + end_date_ansi="@selected_end_date;noquote@" + group_by="@selected_group_by;noquote@" /> <!-- End log entries body --> </td> Index: openacs-4/packages/logger/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/index.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/logger/www/index.tcl 9 May 2003 15:07:48 -0000 1.10 +++ openacs-4/packages/logger/www/index.tcl 28 Aug 2003 09:45:30 -0000 1.11 @@ -11,10 +11,20 @@ {selected_user_id:integer ""} {selected_start_date ""} {selected_end_date ""} + {selected_group_by ""} } +if { [empty_string_p [ad_conn query]] } { + set weekdayno [clock format [clock seconds] -format %w] + set new_start_date [clock format [clock scan "-$weekdayno days"] -format "%Y-%m-%d"] + set new_end_date [clock format [clock scan "[expr 6-$weekdayno] days"] -format "%Y-%m-%d"] + ad_returnredirect ".?[export_vars { { selected_start_date $new_start_date } { selected_end_date $new_end_date } { selected_group_by "time_stamp" } }]" + ad_script_abort +} + set package_id [ad_conn package_id] set current_user_id [ad_conn user_id] +set instance_name [ad_conn instance_name] set admin_p [permission::permission_p -object_id $package_id -privilege admin] set filter_var_list { @@ -24,6 +34,7 @@ selected_user_id selected_start_date selected_end_date + selected_group_by } @@ -136,7 +147,7 @@ } } # Redirect so we get the dates in pretty mode - ad_returnredirect ".?[export_vars $filter_var_list]" + ad_returnredirect ".?[export_vars -no_empty $filter_var_list]" ad_script_abort } @@ -150,7 +161,7 @@ ########### if { [exists_and_not_null selected_project_id] } { - set all_projects_url ".?[export_vars -exclude { selected_project_id } $filter_var_list]" + set all_projects_url ".?[export_vars -no_empty -exclude { selected_project_id } $filter_var_list]" } else { set all_projects_url {} } @@ -161,8 +172,8 @@ db_multirow -extend { filter_name url entry_add_url selected_p clear_url start_date end_date } filters select_projects {} { set filter_name "Projects" - set url ".?[export_vars -override { { selected_project_id $unique_id } } $filter_var_list]" - set entry_add_url "log?[export_vars { { project_id $unique_id } {variable_id $selected_variable_id}}]" + set url ".?[export_vars -no_empty -override { { selected_project_id $unique_id } } $filter_var_list]" + set entry_add_url "log?[export_vars -no_empty { { project_id $unique_id } {variable_id $selected_variable_id}}]" set selected_p [string equal $selected_project_id $unique_id] set name [string_truncate -len 25 $name] set clear_url $all_projects_url @@ -207,10 +218,10 @@ db_multirow -append -extend { filter_name url entry_add_url selected_p clear_url start_date end_date } filters select_variables {} { set filter_name "Variables" - set url ".?[export_vars -override { {selected_variable_id $unique_id} } $filter_var_list]" + set url ".?[export_vars -no_empty -override { {selected_variable_id $unique_id} } $filter_var_list]" if { ![empty_string_p $selected_project_id] } { # A project is selected - enable logging - set entry_add_url "log?[export_vars { { variable_id $unique_id } {project_id $selected_project_id}}]" + set entry_add_url "log?[export_vars -no_empty { { variable_id $unique_id } {project_id $selected_project_id}}]" } else { # No project selected - we wont enable those url:s set entry_add_url "" @@ -226,7 +237,7 @@ ########### if { [exists_and_not_null selected_user_id] } { - set all_users_url ".?[export_vars -exclude { selected_user_id } $filter_var_list]" + set all_users_url ".?[export_vars -no_empty -exclude { selected_user_id } $filter_var_list]" } else { set all_users_url {} } @@ -248,7 +259,7 @@ db_multirow -append -extend { filter_name url entry_add_url selected_p clear_url start_date end_date } filters select_users {} { set filter_name "Users" - set url ".?[export_vars -override { {selected_user_id $unique_id} } $filter_var_list]" + set url ".?[export_vars -no_empty -override { {selected_user_id $unique_id} } $filter_var_list]" set entry_add_url {} set selected_p [string equal $selected_user_id $unique_id] set clear_url $all_users_url @@ -264,15 +275,15 @@ if { ![empty_string_p $selected_project_id] && ![empty_string_p $selected_variable_id] } { if { [exists_and_not_null selected_projection_id] } { - set clear_projections_url ".?[export_vars -exclude { selected_projection_id } $filter_var_list]" + set clear_projections_url ".?[export_vars -no_empty -exclude { selected_projection_id } $filter_var_list]" } else { set clear_projections_url {} } db_multirow -append -extend { filter_name url entry_add_url selected_p clear_url } filters select_projections {} { set filter_name "Projections" set name [string_truncate -len 25 $name] - set url ".?[export_vars -override { {selected_projection_id $unique_id} { selected_start_date $start_date } { selected_end_date $end_date } } $filter_var_list]" + set url ".?[export_vars -no_empty -override { {selected_projection_id $unique_id} { selected_start_date $start_date } { selected_end_date $end_date } } $filter_var_list]" set entry_add_url {} set selected_p [string equal $selected_projection_id $unique_id] set clear_url $clear_projections_url @@ -287,7 +298,7 @@ ##### if { [exists_and_not_null selected_start_date] || [exists_and_not_null selected_end_date] } { - set date_clear_url ".?[export_vars -exclude { selected_start_date selected_end_date } $filter_var_list]" + set date_clear_url ".?[export_vars -no_empty -exclude { selected_start_date selected_end_date } $filter_var_list]" } else { set date_clear_url {} } @@ -299,8 +310,18 @@ set weekdayno [clock format [clock seconds] -format %w] set monthdayno [string trimleft [clock format [clock seconds] -format %d] 0] -foreach type { this_week last_week past_7 this_month last_month past_30 } { +foreach type { today yesterday this_week last_week past_7 this_month last_month past_30 } { switch $type { + today { + set name "Today" + set new_start_date [clock format [clock seconds] -format "%Y-%m-%d"] + set new_end_date [clock format [clock seconds] -format "%Y-%m-%d"] + } + yesterday { + set name "Yesterday" + set new_start_date [clock format [clock scan "-1 days"] -format "%Y-%m-%d"] + set new_end_date [clock format [clock scan "-1 days"] -format "%Y-%m-%d"] + } this_week { set name "This week" set new_start_date [clock format [clock scan "-$weekdayno days"] -format "%Y-%m-%d"] @@ -333,7 +354,7 @@ } } - set url ".?[export_vars -override { { selected_start_date $new_start_date } { selected_end_date $new_end_date }} $filter_var_list]" + set url ".?[export_vars -no_empty -override { { selected_start_date $new_start_date } { selected_end_date $new_end_date }} $filter_var_list]" set selected_p [expr [string equal $selected_start_date $new_start_date] && [string equal $selected_end_date $new_end_date]] @@ -346,5 +367,37 @@ # Custom if { $custom_p } { + # unique_id name filter_name url entry_add_url selected_p clear_url multirow append filters "" "Custom range" $filter_name "" "" $custom_p $date_clear_url {} {} } + +##### +# +# Group by filter +# +##### + +# TODO: +# Flag to export_vars -no_empty which doesn't export empty strings + +if { [exists_and_not_null selected_group_by] } { + set group_clear_url ".?[export_vars -no_empty -exclude { selected_group_by } $filter_var_list]" +} else { + set group_clear_url {} +} + +array set group_label { + time_stamp "Day" + time_stamp_week "Week" + project_name "Project" + user_id "User" +} + +foreach unique_id { time_stamp_week time_stamp project_name user_id } { + set url ".?[export_vars -no_empty -override { { selected_group_by $unique_id } } $filter_var_list]" + + set selected_p [string equal $selected_group_by $unique_id] + + # unique_id name filter_name url entry_add_url selected_p clear_url + multirow append filters $unique_id $group_label($unique_id) "Group by" $url "" $selected_p $group_clear_url +} Index: openacs-4/packages/logger/www/log.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/log.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/logger/www/log.adp 22 May 2003 15:01:52 -0000 1.8 +++ openacs-4/packages/logger/www/log.adp 28 Aug 2003 09:45:30 -0000 1.9 @@ -53,12 +53,19 @@ </if> <if @show_log_history_p@> - <h3 class="logger" style="clear: left;">Log history for the past @log_history_n_days@ days</h3> + <h3 class="logger" style="clear: left;">Log history (@start_date_ansi@ to @end_date_ansi@)</h3> + <p> + The log history is + shown @log_history_n_days@ days back from your last logged entry, or @log_history_n_days@ days back from + today if you have no previously logged entries. + </p> + <include src="lib/entries-table" selected_user_id="@current_user_id;noquote@" selected_project_id="@project_id;noquote@" selected_variable_id="@variable_id;noquote@" start_date_ansi="@start_date_ansi;noquote@" + end_date_ansi="@end_date_ansi;noquote@" selected_entry_id="@entry_id_or_blank;noquote@" /> </if> Index: openacs-4/packages/logger/www/log.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/log.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/logger/www/log.tcl 9 May 2003 15:07:48 -0000 1.9 +++ openacs-4/packages/logger/www/log.tcl 28 Aug 2003 09:45:30 -0000 1.10 @@ -8,6 +8,8 @@ entry_id:integer,optional project_id:integer,optional variable_id:integer,optional + {edit:boolean "f"} + {return_url "."} } -validate { project_id_required_in_add_mode { # For the sake of simplicity of the form @@ -29,41 +31,10 @@ if { [string equal [form get_action log_entry_form] "done"] } { # User is done editing - redirect back to index page - ad_returnredirect . + ad_returnredirect $return_url ad_script_abort } -# Different page title and form mode when adding a log entry -# versus displaying/editing one -if { [exists_and_not_null entry_id] } { - # Initial request in display or edit mode or a submit of the form - set page_title "Edit Log Entry" - set ad_form_mode edit -} else { - # Initial request in add mode - set page_title "Add Log Entry" - set ad_form_mode edit -} - -set context [list $page_title] - -# Build the log entry form elements -set actions [list] -if { $entry_exists_p && [permission::permission_p -object_id $entry_id -privilege write] } { - lappend actions { Edit formbuilder::edit } -} -lappend actions { Done done } - -ad_form -name log_entry_form -cancel_url index -mode $ad_form_mode \ - -actions $actions -form { - entry_id:key(acs_object_id_seq) -} - -# On various occasions we need to know if we are dealing with a submit with the -# form or an initial request (could also be with error message after unaccepted submit) -set submit_p [form is_valid log_entry_form] - - ########### # # Get project and variable info @@ -102,6 +73,49 @@ # ########### +# The creator of a log entry can always edit it +if { $entry_exists_p } { + set edit_p [expr [permission::permission_p -object_id $entry_id -privilege write] || \ + $current_user_id == $entry_array(creation_user)] +} else { + set edit_p 0 +} + +# Different page title and form mode when adding a log entry +# versus displaying/editing one +if { [exists_and_not_null entry_id] } { + # Initial request in display or edit mode or a submit of the form + set page_title "Edit Log Entry" + if { [string equal $edit "t"] && $edit_p } { + set ad_form_mode edit + } else { + set ad_form_mode display + } +} else { + # Initial request in add mode + set page_title "Add Log Entry" + set ad_form_mode edit +} + +set context [list $page_title] + + +# Build the log entry form elements +set actions [list] +if { $edit_p } { + lappend actions { Edit formbuilder::edit } +} +lappend actions { Done done } + +ad_form -name log_entry_form -cancel_url $return_url -mode $ad_form_mode \ + -actions $actions -form { + entry_id:key(acs_object_id_seq) +} + +# On various occasions we need to know if we are dealing with a submit with the +# form or an initial request (could also be with error message after unaccepted submit) +set submit_p [form is_valid log_entry_form] + ad_form -extend -name log_entry_form -form { {project:text(inform) {label Project} @@ -115,6 +129,8 @@ {variable_id:integer(hidden) {value $variable_id} } + + {return_url:text(hidden) {value $return_url}} } # Add form elements common to all modes @@ -194,8 +210,7 @@ -time_stamp $time_stamp_ansi \ -description $description } -after_submit { - - ad_returnredirect "[ad_conn url]?[export_vars { project_id variable_id }]" + ad_returnredirect "[ad_conn url]?[export_vars { project_id variable_id return_url }]" ad_script_abort } @@ -215,12 +230,41 @@ set show_log_history_p [expr $entry_edited_by_owner_p || ! $entry_exists_p] -set log_history_n_days 31 -set seconds_per_day [expr 60*60*24] -set start_date_seconds [expr [clock seconds] - $log_history_n_days * $seconds_per_day] -set start_date_ansi [clock format $start_date_seconds \ - -format "%Y-%m-%d"] +if { $show_log_history_p } { + # Show N number of days previous to the last logged entry by the user + set ansi_format_string "%Y-%m-%d" + set last_logged_date [db_string last_logged_date { + select to_char(le.time_stamp, 'YYYY-MM-DD') + from logger_entries le, + acs_objects ao + where le.entry_id = ao.object_id + and le.variable_id = :variable_id + and le.project_id = :project_id + and ao.creation_user = :current_user_id + and ao.creation_date = (select max(ao.creation_date) + from logger_entries le, + acs_objects ao + where le.entry_id = ao.object_id + and le.variable_id = :variable_id + and le.project_id = :project_id + and ao.creation_user = :current_user_id + ) + } -default ""] + if { ![empty_string_p $last_logged_date] } { + set end_date_ansi $last_logged_date + set end_date_seconds [clock scan $end_date_ansi] + } else { + # Default end date to now + set end_date_seconds [clock seconds] + set end_date_ansi [clock format $end_date_seconds -format $ansi_format_string] + } + set log_history_n_days 31 + set seconds_per_day [expr 60*60*24] + set start_date_seconds [expr $end_date_seconds - $log_history_n_days * $seconds_per_day] + set start_date_ansi [clock format $start_date_seconds \ + -format $ansi_format_string] +} set add_entry_url "log?[export_vars { project_id variable_id }]" Index: openacs-4/packages/logger/www/admin/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/admin/index-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/logger/www/admin/index-oracle.xql 8 May 2003 13:56:04 -0000 1.2 +++ openacs-4/packages/logger/www/admin/index-oracle.xql 28 Aug 2003 09:45:31 -0000 1.3 @@ -39,6 +39,7 @@ ) or lv.package_id = :package_id or lv.package_id is null) + order by lv.name </querytext> </fullquery> @@ -52,6 +53,7 @@ where ppm.project_id = p.project_id and ppm.package_id = :package_id) and acs_permission.permission_p(p.project_id, :user_id, 'read') = 't' + order by p.name </querytext> </fullquery> Index: openacs-4/packages/logger/www/admin/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/admin/index-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/logger/www/admin/index-postgresql.xql 8 May 2003 13:56:04 -0000 1.2 +++ openacs-4/packages/logger/www/admin/index-postgresql.xql 28 Aug 2003 09:45:31 -0000 1.3 @@ -39,6 +39,7 @@ ) or lv.package_id = :package_id or lv.package_id is null) + order by lv.name </querytext> </fullquery> @@ -52,6 +53,7 @@ where ppm.project_id = p.project_id and ppm.package_id = :package_id) and acs_permission__permission_p(p.project_id, :user_id, 'read') = 't' + order by p.name </querytext> </fullquery> Index: openacs-4/packages/logger/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/admin/index.adp,v diff -u -r1.9 -r1.10 --- openacs-4/packages/logger/www/admin/index.adp 22 May 2003 15:02:07 -0000 1.9 +++ openacs-4/packages/logger/www/admin/index.adp 28 Aug 2003 09:45:31 -0000 1.10 @@ -33,7 +33,7 @@ <td class="logger_listing"> <a href="@projects.display_url@" title="Display project info">@projects.name@</a> </td> - <td class="logger_listing"><if @projects.active_p@ eq t>Yes</if><else>No</else> </td> + <td class="logger_listing"><if @projects.active_p@ eq t>Yes (<a href="@projects.make_inactive_url@" title="Make this project inactive">toggle</a>)</if><else>No (<a href="@projects.make_active_url@" title="Make this project active">toggle</a>)</else> </td> <td class="logger_listing">@projects.project_lead_chunk@</td> <td class="logger_listing_narrow" align="center"> <if @projects.admin_p@> Index: openacs-4/packages/logger/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/admin/index.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/logger/www/admin/index.tcl 8 May 2003 13:56:04 -0000 1.6 +++ openacs-4/packages/logger/www/admin/index.tcl 28 Aug 2003 09:45:31 -0000 1.7 @@ -21,14 +21,19 @@ # ########### -db_multirow -extend { edit_url display_url permissions_url delete_url unmap_url project_lead_chunk } projects select_projects {} { +db_multirow -extend { + edit_url display_url permissions_url delete_url unmap_url project_lead_chunk + make_active_url make_inactive_url +} projects select_projects {} { set description [string_truncate -len 50 $description] set edit_url "project?[export_vars { project_id {formbutton\:formbuilder\:\:edit Edit} {form\:id project_form} {form\:mode display}}]" set display_url "project?[export_vars { project_id }]" set unmap_url "project-instance-map?[export_vars { project_id {unmap "t"} }]" set permissions_url "${permissions_uri}?[export_vars {{object_id $project_id} application_url}]" set delete_url "project-delete?[export_vars { project_id }]" + set make_active_url "project-make-active?[export_vars { project_id }]" + set make_inactive_url "project-make-inactive?[export_vars { project_id }]" set project_lead_chunk [ad_present_user $project_lead_id $project_lead_name] } Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/logger/www/admin/project-make-active.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/logger/www/admin/project-make-inactive.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/logger/www/admin/project.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/admin/project.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/logger/www/admin/project.tcl 8 May 2003 13:56:04 -0000 1.9 +++ openacs-4/packages/logger/www/admin/project.tcl 28 Aug 2003 09:45:31 -0000 1.10 @@ -57,11 +57,31 @@ {html {cols 60 rows 13}} {label "Description"} } -} -select_query { - select name, - description - from logger_projects - where project_id = :project_id + + {project_lead:search + {result_datatype integer} + {label {Project Lead}} + {options [logger::project::users_get_options]} + {search_query {[db_map dbqd.acs-tcl.tcl.community-core-procs.user_search]}} + } +} + +if { ![ad_form_new_p -key project_id] } { + ad_form -extend -name project_form -form { + {active_p:text(radio) + {label "Active"} + {options {{Yes t} {No f}}} + } + } +} + +ad_form -extend -name project_form -select_query { + select name, + description, + project_lead, + active_p + from logger_projects + where project_id = :project_id } -validate { { name @@ -71,19 +91,24 @@ } -new_data { - logger::project::new -project_id $project_id \ - -name $name \ - -description $description \ + logger::project::new \ + -project_id $project_id \ + -name $name \ + -description $description \ + -project_lead $project_lead + } -edit_data { # The edit proc requires all attributes to be provided # so use the old values for project_lead and active_p - logger::project::get -project_id $project_id -array old_project - logger::project::edit -project_id $project_id \ - -name $name \ - -description $description \ - -project_lead $old_project(project_lead) \ - -active_p $old_project(active_p) + + logger::project::edit \ + -project_id $project_id \ + -name $name \ + -description $description \ + -project_lead $project_lead \ + -active_p $active_p + } -after_submit { ad_returnredirect "[ad_conn url]?project_id=$project_id" Index: openacs-4/packages/logger/www/admin/projection.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/admin/projection.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/logger/www/admin/projection.tcl 9 May 2003 15:08:03 -0000 1.4 +++ openacs-4/packages/logger/www/admin/projection.tcl 28 Aug 2003 09:45:31 -0000 1.5 @@ -60,7 +60,6 @@ {variable_id:integer(select) {label Variable} {options {[logger::ui::variable_options -project_id $project_id]}} - {mode display} } {value:text Index: openacs-4/packages/logger/www/lib/entries-table-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/lib/Attic/entries-table-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/logger/www/lib/entries-table-oracle.xql 8 May 2003 13:56:20 -0000 1.1 +++ openacs-4/packages/logger/www/lib/entries-table-oracle.xql 28 Aug 2003 09:45:31 -0000 1.2 @@ -6,9 +6,11 @@ <fullquery name="select_entries"> <querytext> select le.entry_id as id, - acs_permission.permission_p(le.entry_id, :user_id, 'delete') as delete_p, + acs_permission.permission_p(le.entry_id, :current_user_id, 'delete') as delete_p, + acs_permission.permission_p(le.entry_id, :current_user_id, 'write') as edit_p, le.time_stamp, - to_char(le.time_stamp, 'fmMMfm-fmDDfm-YYYY') as time_stamp_pretty, + to_char(le.time_stamp, 'fmDyfm fmMMfm-fmDDfm-YYYY') as time_stamp_pretty, + to_char(le.time_stamp, 'IW-YYYY') as time_stamp_week, le.value, le.description, lp.name as project_name, @@ -22,7 +24,7 @@ and ao.object_id = le.entry_id and ao.creation_user = submitter.user_id [ad_decode $where_clauses "" "" "and [join $where_clauses "\n and "]"] - order by le.time_stamp desc, ao.creation_date desc + order by $order_by </querytext> </fullquery> Index: openacs-4/packages/logger/www/lib/entries-table-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/lib/Attic/entries-table-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/logger/www/lib/entries-table-postgresql.xql 8 May 2003 13:56:20 -0000 1.1 +++ openacs-4/packages/logger/www/lib/entries-table-postgresql.xql 28 Aug 2003 09:45:31 -0000 1.2 @@ -6,9 +6,11 @@ <fullquery name="select_entries"> <querytext> select le.entry_id as id, - acs_permission__permission_p(le.entry_id, :user_id, 'delete') as delete_p, + acs_permission__permission_p(le.entry_id, :current_user_id, 'delete') as delete_p, + acs_permission__permission_p(le.entry_id, :current_user_id, 'write') as edit_p, le.time_stamp, - to_char(le.time_stamp, 'fmMMfm-fmDDfm-YYYY') as time_stamp_pretty, + to_char(le.time_stamp, 'fmDyfm fmMMfm-fmDDfm-YYYY') as time_stamp_pretty, + to_char(le.time_stamp, 'IW-YYYY') as time_stamp_week, le.value, le.description, lp.name as project_name, @@ -22,7 +24,7 @@ and ao.object_id = le.entry_id and ao.creation_user = submitter.user_id [ad_decode $where_clauses "" "" "and [join $where_clauses "\n and "]"] - order by le.time_stamp desc, ao.creation_date desc + order by $order_by </querytext> </fullquery> Index: openacs-4/packages/logger/www/lib/entries-table.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/lib/Attic/entries-table.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/logger/www/lib/entries-table.adp 8 May 2003 13:56:20 -0000 1.4 +++ openacs-4/packages/logger/www/lib/entries-table.adp 28 Aug 2003 09:45:31 -0000 1.5 @@ -14,37 +14,140 @@ <th class="logger_listing_narrow">Description</th> <th class="logger_listing_narrow"> </th> </tr> - <multiple name="entries"> - <if @entries.selected_p@ true> + + <if @group_by@ not nil> + <multiple name="entries"> + <tr class="logger_listing_spacer"> + <td colspan="7"> + + </td> + </tr> <tr class="logger_listing_subheader"> + <td colspan="7"> + <switch @group_by@> + <case value="user_id"> + User: @entries.user_chunk@ + </case> + <case value="project_name"> + Project: @entries.project_name@ + </case> + <case value="time_stamp"> + Date: @entries.time_stamp_pretty@ + </case> + <case value="time_stamp_week"> + Week: @entries.time_stamp_week@ + </case> + <default> + Unknown group by column @group_by@ + </default> + </switch> + </td> + </tr> + <group column="@group_by@"> + <if @entries.selected_p@ true> + <tr class="logger_listing_subheader"> + </if> + <else> + <if @entries.rownum@ odd> + <tr class="logger_listing_odd"> + </if> + <else> + <tr class="logger_listing_even"> + </else> + </else> + <td class="logger_listing_narrow"> + <if @entries.edit_p@ or @current_user_id@ eq @entries.user_id@> + <a href="@entries.edit_url@" title="Edit this log entry"><img src="/shared/images/Edit16.gif" height="16" width="16" alt="Edit" border="0"></a> + </if> + </td> + <td class="logger_listing_narrow">@entries.project_name@</td> + <td class="logger_listing_narrow">@entries.user_chunk@</td> + <td class="logger_listing_narrow" align="left">@entries.time_stamp_pretty@</td> + <td class="logger_listing_narrow" align="right" nowrap> + <a href="@entries.view_url@" title="View this log entry">@entries.value@</a> + </td> + <td class="logger_listing_narrow"> + <a href="@entries.view_url@" title="View this log entry">@entries.description@</a> + </td> + <td class="logger_listing_narrow"> + <if @entries.delete_url@ not nil> + <a href="@entries.delete_url@" onclick="@entries.delete_onclick@" title="Delete this log entry"><img src="/shared/images/Delete16.gif" height="16" width="16" alt="Delete" border="0"></a> + </if> + </td> + </tr> + <if @entries.groupnum_last_p@ true> + <tr class="logger_listing_subheader"> + <td class="logger_listing_narrow" align="center"> </td> + <td class="logger_listing_narrow" colspan="3"> + <if @variable.type@ eq "additive"> + <b>Subtotal</b> + </if> + <else> + <b>Subtotal Average</b> + </else> + </td> + <td class="logger_listing_narrow" align="right" nowrap> + <if @variable.type@ eq "additive"> + <b>@entries.subtotal@</b> + </if> + <else> + <b>@entries.subaverage@</b> + </else> + </td> + <td class="logger_listing_narrow"> </td> + <td class="logger_listing_narrow" align="center"> </td> + </tr> + </if> + </group> + </multiple> </if> - <else> - <if @entries.rownum@ odd> - <tr class="logger_listing_odd"> + <else> + <multiple name="entries"> + <if @entries.selected_p@ true> + <tr class="logger_listing_subheader"> </if> <else> - <tr class="logger_listing_even"> - </else> - </else> - <td class="logger_listing_narrow"> - <a href="@entries.edit_url@" title="Edit this log entry"><img src="/shared/images/Edit16.gif" height="16" width="16" alt="Edit" border="0"></a> - </td> - <td class="logger_listing_narrow">@entries.project_name@</td> - <td class="logger_listing_narrow">@entries.user_chunk@</td> - <td class="logger_listing_narrow" align="left">@entries.time_stamp_pretty@</td> - <td class="logger_listing_narrow" align="right" nowrap> - <a href="@entries.edit_url@" title="Edit this log entry">@entries.value@</a> - </td> - <td class="logger_listing_narrow">@entries.description@</td> - <td class="logger_listing_narrow"> - <if @entries.delete_url@ not nil> - <a href="@entries.delete_url@" onclick="@entries.delete_onclick@" title="Delete this log entry"><img src="/shared/images/Delete16.gif" height="16" width="16" alt="Delete" border="0"></a> + <if @entries.rownum@ odd> + <tr class="logger_listing_odd"> </if> - </td> - </tr> - </multiple> + <else> + <tr class="logger_listing_even"> + </else> + </else> + <td class="logger_listing_narrow"> + <if @entries.edit_p@ or @current_user_id@ eq @entries.user_id@> + <a href="@entries.edit_url@" title="Edit this log entry"><img src="/shared/images/Edit16.gif" height="16" width="16" alt="Edit" border="0"></a> + </if> + </td> + <td class="logger_listing_narrow">@entries.project_name@</td> + <td class="logger_listing_narrow">@entries.user_chunk@</td> + <td class="logger_listing_narrow" align="left">@entries.time_stamp_pretty@</td> + <td class="logger_listing_narrow" align="right" nowrap> + <if @entries.edit_p@ or @current_user_id@ eq @entries.user_id@> + <a href="@entries.view_url@" title="View this log entry">@entries.value@</a> + </if> + <else> + <a href="@entries.view_url@" title="View this log entry">@entries.value@</a> + </else> + </td> + <td class="logger_listing_narrow"> + <a href="@entries.view_url@" title="View this log entry">@entries.description@</a> + </td> + <td class="logger_listing_narrow"> + <if @entries.delete_url@ not nil> + <a href="@entries.delete_url@" onclick="@entries.delete_onclick@" title="Delete this log entry"><img src="/shared/images/Delete16.gif" height="16" width="16" alt="Delete" border="0"></a> + </if> + </td> + </tr> + </multiple> + </else> <!-- Row for the grand total --> + <tr class="logger_listing_spacer"> + <td colspan="7"> + + </td> + </tr> <tr class="logger_listing_subheader"> <td class="logger_listing_narrow" align="center"> </td> <td class="logger_listing_narrow" colspan="3"> @@ -79,6 +182,11 @@ <!-- Row for projected value --> <if @projection_value@ not nil> + <tr class="logger_listing_spacer"> + <td colspan="7"> + + </td> + </tr> <tr class="logger_listing_odd"> <td class="logger_listing_narrow" align="center"> </td> <td class="logger_listing_narrow" colspan="3"><b>Projection</b></td> @@ -88,15 +196,16 @@ </tr> </if> - <tr class="logger_listing_even"> - <th class="logger_listing_narrow"> </th> - <th class="logger_listing_narrow"> </th> - <th class="logger_listing_narrow"> </th> - <th class="logger_listing_narrow"> </th> - <th class="logger_listing_narrow">@variable.unit@</th> - <th class="logger_listing_narrow"> </th> - <th class="logger_listing_narrow"> </th> - </tr> + <!-- Unit --> + <tr class="logger_listing_even"> + <th class="logger_listing_narrow"> </th> + <th class="logger_listing_narrow"> </th> + <th class="logger_listing_narrow"> </th> + <th class="logger_listing_narrow"> </th> + <th class="logger_listing_narrow">@variable.unit@</th> + <th class="logger_listing_narrow"> </th> + <th class="logger_listing_narrow"> </th> + </tr> </table> </else> Index: openacs-4/packages/logger/www/lib/entries-table.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/lib/Attic/entries-table.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/logger/www/lib/entries-table.tcl 9 May 2003 11:05:02 -0000 1.5 +++ openacs-4/packages/logger/www/lib/entries-table.tcl 28 Aug 2003 09:45:31 -0000 1.6 @@ -8,8 +8,9 @@ # start_date_ansi # end_date_ansi # projection_value +# group_by:optional -set user_id [ad_conn user_id] +set current_user_id [ad_conn user_id] set package_id [ad_conn package_id] set where_clauses [list] @@ -48,15 +49,34 @@ set selected_entry_id {} } +set order_by "le.time_stamp desc, ao.creation_date desc" + +# If we're grouping by, we should sort by that column first +if { [exists_and_not_null group_by] } { + switch -exact $group_by { + user_id { + set order_by "user_name asc, $order_by" + } + project_name { + set order_by "project_name asc, $order_by" + } + } +} + set value_total 0 set value_count 0 -db_multirow -extend { edit_url delete_url delete_onclick user_chunk selected_p } entries select_entries {} { +set last_group_by_value {} +set value_subcount 0 +set value_subtotal 0 + +db_multirow -extend { subtotal subaverage view_url edit_url delete_url delete_onclick user_chunk selected_p } entries select_entries {} { set description [string_truncate -len 50 $description] set project_name [string_truncate -len 20 $project_name] set selected_p [string equal $id $selected_entry_id] set action_links_list [list] - set edit_url "log?[export_vars { { entry_id $id } }]" + set view_url "log?[export_vars { { entry_id $id } }]" + set edit_url "log?[export_vars { { entry_id $id } { edit "t" } }]" if { $delete_p } { set delete_onclick "return confirm('Are you sure you want to delete log entry with $value $variable(unit) $variable(name) on $time_stamp?');" set delete_url "log-delete?[export_vars { { entry_id $id } }]" @@ -66,6 +86,24 @@ set user_chunk [ad_present_user $user_id $user_name] + if { [exists_and_not_null group_by] } { + # Should we reset the subtotal? + if { ![string equal $last_group_by_value [set $group_by]] } { + set value_subtotal 0 + set value_subcount 0 + } + + # Calculate new subtotal/average + set value_subtotal [expr $value_subtotal + $value] + incr value_subcount + + # and store it in the column + set subtotal $value_subtotal + set subaverage [expr round(100.0 * $value_subtotal / $value_subcount) / 100.0] + + set last_group_by_value [set $group_by] + } + set value_total [expr $value_total + $value] incr value_count } Index: openacs-4/packages/monitoring/monitoring.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/monitoring.info,v diff -u -r1.6 -r1.7 --- openacs-4/packages/monitoring/monitoring.info 17 May 2003 10:46:40 -0000 1.6 +++ openacs-4/packages/monitoring/monitoring.info 28 Aug 2003 09:41:57 -0000 1.7 @@ -88,13 +88,13 @@ <parameters> <parameter datatype="string" min_n_values="1" max_n_values="1" name="TopOptions" default="-bn1" description="Options to use with top on your OS" section_name="monitoring"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="PersontoNotify" description="Person to notify about watchdog (default to system owner if blank)" section_name="monitoring"/> - <parameter datatype="number" min_n_values="1" max_n_values="1" name="WatchDogFrequency" default="300" description="Frequency to run watchdog in minutes." section_name="monitoring"/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="WatchDogFrequency" default="300" description="Frequency to run watchdog (in minutes)" section_name="monitoring"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="WatchDogParser" description="Program to parse errors for watchdog (leave blank to use default program)" section_name="monitoring"/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="NumDaysToEstAllRows" default="7" description="Number of Days to Estimate all rows." section_name="monitoring"/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="AutoAnalyzeP" default="0" description="Automatically analyze database tables" section_name="monitoring"/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="LoadAverageAlertThreshold" default="3.0" description="Load Average to start alerting on for Top" section_name="monitoring"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="TopLocation" default="/usr/local/bin/top" description="Location of Top Program" section_name="monitoring"/> - <parameter datatype="number" min_n_values="1" max_n_values="1" name="TopFrequency" default="0" description="Frequency To Run Top" section_name="monitoring"/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="TopFrequency" default="0" description="Frequency To Run Top (in minutes)" section_name="monitoring"/> </parameters> </version> Index: openacs-4/packages/monitoring/www/top/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/top/index-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/www/top/index-postgresql.xql 19 Aug 2002 23:10:29 -0000 1.1 +++ openacs-4/packages/monitoring/www/top/index-postgresql.xql 28 Aug 2003 09:41:57 -0000 1.2 @@ -14,15 +14,15 @@ <partialquery name="hour_correction"> <querytext> - + (24 - (:end_time ::integer - $current_hour ::integer)) / 24 + + (interval '24 hours' - (interval '$end_time hours' - interval '$current_hour hours')) </querytext> </partialquery> <partialquery name="time_clause_2"> <querytext> - and (timestamp + :n_days ::integer $hour_correction) > current_timestamp + and (timestamp + interval '$n_days days' $hour_correction) > current_timestamp </querytext> </partialquery> Index: openacs-4/packages/news/sql/oracle/news-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/sql/oracle/news-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/news/sql/oracle/news-create.sql 12 Mar 2003 15:43:08 -0000 1.5 +++ openacs-4/packages/news/sql/oracle/news-create.sql 28 Aug 2003 09:41:57 -0000 1.6 @@ -368,14 +368,15 @@ item_id => v_id, name => v_name, parent_id => v_parent_id, + context_id => package_id, locale => locale, item_subtype => item_subtype, content_type => content_type, mime_type => mime_type, nls_language => nls_language, relation_tag => relation_tag, creation_date => creation_date, - creation_ip => creation_ip, + creation_ip => creation_ip, creation_user => creation_user ); v_revision_id := content_revision.new( Index: openacs-4/packages/news/sql/postgresql/news-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/sql/postgresql/news-create.sql,v diff -u -r1.13 -r1.14 --- openacs-4/packages/news/sql/postgresql/news-create.sql 23 Aug 2003 19:20:32 -0000 1.13 +++ openacs-4/packages/news/sql/postgresql/news-create.sql 28 Aug 2003 09:41:57 -0000 1.14 @@ -270,7 +270,7 @@ p_locale, -- locale current_timestamp, -- creation_date p_creation_user, -- creation_user - null, -- context_id + p_package_id, -- context_id p_creation_ip, -- creation_ip ''content_item'', -- item_subtype ''news'', -- content_type Index: openacs-4/packages/news/tcl/news-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/news/tcl/news-procs.tcl 13 May 2003 08:11:52 -0000 1.8 +++ openacs-4/packages/news/tcl/news-procs.tcl 28 Aug 2003 09:41:57 -0000 1.9 @@ -108,7 +108,7 @@ @author Robert Locke } { - set package_id [db_string get_package_id {*SQL*}] + set package_id [db_string get_package_id {}] set url_stub [news_util_get_url $package_id] db_1row get_item_id " Index: openacs-4/packages/news/www/item.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/item.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/news/www/item.adp 3 Jul 2003 19:39:34 -0000 1.6 +++ openacs-4/packages/news/www/item.adp 28 Aug 2003 09:41:57 -0000 1.7 @@ -19,12 +19,10 @@ @comments@ </if> -<if @comment_link@ ne ""> <ul> <li> @comment_link;noquote@ </ul> -</if> </else> Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/news-aggregator.info'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/sql/oracle/news-aggregator-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/sql/oracle/news-aggregator-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/sql/oracle/news-aggregator-package-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/sql/oracle/news-aggregator-package-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/sql/postgresql/news-aggregator-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/sql/postgresql/news-aggregator-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/tcl/news-aggregator-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/tcl/news-aggregator-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/www/index-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/www/index-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/www/index.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/www/index.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/www/index.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/www/source-update.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/www/subscriptions-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/www/subscriptions-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/www/subscriptions.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/www/subscriptions.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/www/subscriptions.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/www/update.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator-portlet/news-aggregator-portlet.info'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator-portlet/tcl/apm-callback-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator-portlet/tcl/news-aggregator-admin-portlet-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator-portlet/tcl/news-aggregator-portlet-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator-portlet/www/news-aggregator-admin-portlet.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator-portlet/www/news-aggregator-admin-portlet.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator-portlet/www/news-aggregator-portlet-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator-portlet/www/news-aggregator-portlet-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator-portlet/www/news-aggregator-portlet.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator-portlet/www/news-aggregator-portlet.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator-portlet/www/news-aggregator-portlet.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/notifications/notifications.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/notifications.info,v diff -u -r1.19 -r1.20 --- openacs-4/packages/notifications/notifications.info 19 May 2003 17:22:26 -0000 1.19 +++ openacs-4/packages/notifications/notifications.info 28 Aug 2003 09:41:58 -0000 1.20 @@ -8,7 +8,7 @@ <singleton-p>t</singleton-p> <auto-mount>notifications</auto-mount> - <version name="4.6.2" url="http://openacs.org/repository/download/apm/notifications-4.6.2.apm"> + <version name="4.6.4" url="http://openacs.org/repository/download/apm/notifications-4.6.4.apm"> <database-support> <database>oracle</database> <database>postgresql</database> @@ -17,10 +17,13 @@ <summary>Notification Management</summary> <release-date>2003-02-17</release-date> - <provides url="notifications" version="4.6.2"/> + <provides url="notifications" version="4.6.4"/> <requires url="acs-mail-lite" version="0.1d"/> <callbacks> + <callback type="after-install" proc="notification::apm::after_install"/> + <callback type="before-uninstall" proc="notification::apm::before_uninstall"/> + <callback type="after-upgrade" proc="notification::apm::after_upgrade"/> </callbacks> <parameters> <parameter datatype="string" min_n_values="1" max_n_values="1" name="EmailDomain" description="The domain for the notification email address" section_name="email"/> Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/notifications/sql/oracle/delivery-method-sc-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/notifications/sql/oracle/email-sc-impl-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/notifications/sql/oracle/notification-type-sc-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/notifications/sql/oracle/notifications-core-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/oracle/notifications-core-create.sql,v diff -u -r1.11 -r1.12 --- openacs-4/packages/notifications/sql/oracle/notifications-core-create.sql 17 May 2003 10:52:25 -0000 1.11 +++ openacs-4/packages/notifications/sql/oracle/notifications-core-create.sql 28 Aug 2003 09:41:58 -0000 1.12 @@ -1,5 +1,5 @@ -- --- The Notifications Package +-- The Notifications -- -- @author Ben Adida (ben@openforce.net) -- @version $Id$ @@ -155,6 +155,9 @@ -- this is to allow responses to notifications response_id constraint notif_reponse_id_fk references acs_objects (object_id), + notif_user integer + constraint notif_user_id_fk + references users(user_id), notif_subject varchar(1000), notif_text clob, notif_html clob Index: openacs-4/packages/notifications/sql/oracle/notifications-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/oracle/notifications-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/notifications/sql/oracle/notifications-create.sql 9 Aug 2002 20:51:49 -0000 1.7 +++ openacs-4/packages/notifications/sql/oracle/notifications-create.sql 28 Aug 2003 09:41:58 -0000 1.8 @@ -16,11 +16,5 @@ @ notifications-replies-create.sql @ notifications-replies-package-create.sql --- the service contracts will eventually be created --- @ notifications-interval-sc-create.sql --- @ notifications-delivery-sc-create.sql - -@ notification-type-sc-create.sql -@ delivery-method-sc-create.sql @ notifications-init.sql -@ email-sc-impl-create.sql + Index: openacs-4/packages/notifications/sql/oracle/notifications-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/oracle/notifications-init.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/notifications/sql/oracle/notifications-init.sql 9 Aug 2002 20:51:49 -0000 1.4 +++ openacs-4/packages/notifications/sql/oracle/notifications-init.sql 28 Aug 2003 09:41:58 -0000 1.5 @@ -35,15 +35,6 @@ creation_ip => null ); --- This now done by email-sc-impl-create.sql --- --- v_foo:= notification_delivery_method.new( --- short_name => 'email', --- pretty_name => 'Email', --- creation_user => null, --- creation_ip => null --- ); - end; / show errors Index: openacs-4/packages/notifications/sql/oracle/notifications-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/oracle/notifications-package-create.sql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/notifications/sql/oracle/notifications-package-create.sql 17 May 2003 10:52:25 -0000 1.8 +++ openacs-4/packages/notifications/sql/oracle/notifications-package-create.sql 28 Aug 2003 09:41:58 -0000 1.9 @@ -330,6 +330,7 @@ object_id in notifications.object_id%TYPE, notif_date in notifications.notif_date%TYPE default sysdate, response_id in notifications.response_id%TYPE default null, + notif_user in notifications.notif_user%TYPE default null, notif_subject in notifications.notif_subject%TYPE default null, notif_text in varchar default null, notif_html in varchar default null, @@ -358,6 +359,7 @@ object_id in notifications.object_id%TYPE, notif_date in notifications.notif_date%TYPE default sysdate, response_id in notifications.response_id%TYPE default null, + notif_user in notifications.notif_user%TYPE default null, notif_subject in notifications.notif_subject%TYPE default null, notif_text in varchar default null, notif_html in varchar default null, @@ -379,9 +381,9 @@ ); insert into notifications - (notification_id, type_id, object_id, notif_date, response_id, notif_subject, notif_text, notif_html) + (notification_id, type_id, object_id, notif_date, response_id, notif_user, notif_subject, notif_text, notif_html) values - (v_notification_id, type_id, object_id, notif_date, response_id, notif_subject, notif_text, notif_html); + (v_notification_id, type_id, object_id, notif_date, response_id, notif_user, notif_subject, notif_text, notif_html); return v_notification_id; end new; Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/notifications/sql/oracle/upgrade/upgrade-4.6.2-4.6.4.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/notifications/sql/postgresql/delivery-method-sc-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/notifications/sql/postgresql/email-sc-impl-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/notifications/sql/postgresql/notification-type-sc-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/notifications/sql/postgresql/notifications-core-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/postgresql/notifications-core-create.sql,v diff -u -r1.10 -r1.11 --- openacs-4/packages/notifications/sql/postgresql/notifications-core-create.sql 17 May 2003 10:53:27 -0000 1.10 +++ openacs-4/packages/notifications/sql/postgresql/notifications-core-create.sql 28 Aug 2003 09:41:58 -0000 1.11 @@ -167,6 +167,10 @@ response_id integer constraint notif_reponse_id_fk references acs_objects (object_id), + -- this is the user that caused the notification to go out + notif_user integer + constraint notif_user_id_fk + references users(user_id), notif_subject varchar(1000), notif_text text, notif_html text @@ -199,78 +203,68 @@ -- -- Object Types -- -create function inline_0 () -returns integer as ' -begin +select acs_object_type__create_type( + 'notification_interval', + 'Notification Interval', + 'Notification Intervals', + 'acs_object', + 'notification_intervals', + 'interval_id', + 'notification_interval', + 'f', + null, + null +); - perform acs_object_type__create_type( - ''notification_interval'', - ''Notification Interval'', - ''Notification Intervals'', - ''acs_object'', - ''notification_intervals'', - ''interval_id'', - ''notification_interval'', - ''f'', - null, - null - ); +select acs_object_type__create_type( + 'notification_delivery_method', + 'Notification Delivery Method', + 'Notification Delivery Methods', + 'acs_object', + 'notification_delivery_methods', + 'delivery_method_id', + 'notification_delivery_method', + 'f', + null, + null +); - perform acs_object_type__create_type( - ''notification_delivery_method'', - ''Notification Delivery Method'', - ''Notification Delivery Methods'', - ''acs_object'', - ''notification_delivery_methods'', - ''delivery_method_id'', - ''notification_delivery_method'', - ''f'', - null, - null - ); +select acs_object_type__create_type( + 'notification_type', + 'Notification Type', + 'Notification Types', + 'acs_object', + 'notification_types', + 'type_id', + 'notification_type', + 'f', + null, + null +); - perform acs_object_type__create_type( - ''notification_type'', - ''Notification Type'', - ''Notification Types'', - ''acs_object'', - ''notification_types'', - ''type_id'', - ''notification_type'', - ''f'', - null, - null - ); +select acs_object_type__create_type( + 'notification_request', + 'Notification Request', + 'Notification Requests', + 'acs_object', + 'notification_requests', + 'request_id', + 'notification_request', + 'f', + null, + null +); - perform acs_object_type__create_type( - ''notification_request'', - ''Notification Request'', - ''Notification Requests'', - ''acs_object'', - ''notification_requests'', - ''request_id'', - ''notification_request'', - ''f'', - null, - null - ); +select acs_object_type__create_type( + 'notification', + 'Notification', + 'Notifications', + 'acs_object', + 'notifications', + 'notification_id', + 'notification', + 'f', + null, + null +); - perform acs_object_type__create_type( - ''notification'', - ''Notification'', - ''Notifications'', - ''acs_object'', - ''notifications'', - ''notification_id'', - ''notification'', - ''f'', - null, - null - ); - - return null; - -end;' language 'plpgsql'; - -select inline_0(); -drop function inline_0(); Index: openacs-4/packages/notifications/sql/postgresql/notifications-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/postgresql/notifications-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/notifications/sql/postgresql/notifications-create.sql 9 Aug 2002 20:51:50 -0000 1.5 +++ openacs-4/packages/notifications/sql/postgresql/notifications-create.sql 28 Aug 2003 09:41:58 -0000 1.6 @@ -14,12 +14,4 @@ \i notifications-replies-create.sql \i notifications-replies-package-create.sql --- the service contracts will eventually be created --- @ notifications-interval-sc-create.sql --- @ notifications-delivery-sc-create.sql - -\i notification-type-sc-create.sql - -\i delivery-method-sc-create.sql \i notifications-init.sql -\i email-sc-impl-create.sql Index: openacs-4/packages/notifications/sql/postgresql/notifications-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/postgresql/notifications-init.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/notifications/sql/postgresql/notifications-init.sql 9 Aug 2002 20:51:50 -0000 1.4 +++ openacs-4/packages/notifications/sql/postgresql/notifications-init.sql 28 Aug 2003 09:41:58 -0000 1.5 @@ -8,56 +8,32 @@ -- GNU GPL v2 -- --- initialize some stuff -create function inline_0 () -returns integer as ' -begin +select notification_interval__new ( + null, + 'daily', + 3600 * 24, + now(), + null, + null, + null +); - perform notification_interval__new ( - null, - ''daily'', - 3600 * 24, - now(), - null, - null, - null - ); +select notification_interval__new ( + null, + 'hourly', + 3600, + now(), + null, + null, + null +); - perform notification_interval__new ( - null, - ''hourly'', - 3600, - now(), - null, - null, - null - ); - - perform notification_interval__new ( - null, - ''instant'', - 0, - now(), - null, - null, - null - ); - --- This is now done by email-sc-impl-create.sql --- --- perform notification_delivery_method__new ( --- null, --- ''email'', --- ''Email'', --- now(), --- null, --- null, --- null --- ); - - return null; - -end;' language 'plpgsql'; - -select inline_0(); -drop function inline_0 (); +select notification_interval__new ( + null, + 'instant', + 0, + now(), + null, + null, + null +); Index: openacs-4/packages/notifications/sql/postgresql/notifications-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/postgresql/notifications-package-create.sql,v diff -u -r1.11 -r1.12 --- openacs-4/packages/notifications/sql/postgresql/notifications-package-create.sql 17 May 2003 10:53:27 -0000 1.11 +++ openacs-4/packages/notifications/sql/postgresql/notifications-package-create.sql 28 Aug 2003 09:41:58 -0000 1.12 @@ -236,23 +236,24 @@ end; ' language 'plpgsql'; -select define_function_args ('notification__new','notification_id,type_id,object_id,notif_date,response_id,notif_subject,notif_text,notif_html,creation_date,creation_user,creation_ip,context_id'); +select define_function_args ('notification__new','notification_id,type_id,object_id,notif_date,response_id,notif_user,notif_subject,notif_text,notif_html,creation_date,creation_user,creation_ip,context_id'); -create function notification__new(integer,integer,integer,timestamptz,integer,varchar,text,text,timestamptz,integer,varchar,integer) +create or replace function notification__new(integer,integer,integer,timestamptz,integer,integer,varchar,text,text,timestamptz,integer,varchar,integer) returns integer as ' declare p_notification_id alias for $1; p_type_id alias for $2; p_object_id alias for $3; p_notif_date alias for $4; p_response_id alias for $5; - p_notif_subject alias for $6; - p_notif_text alias for $7; - p_notif_html alias for $8; - p_creation_date alias for $9; - p_creation_user alias for $10; - p_creation_ip alias for $11; - p_context_id alias for $12; + p_notif_user alias for $6; + p_notif_subject alias for $7; + p_notif_text alias for $8; + p_notif_html alias for $9; + p_creation_date alias for $10; + p_creation_user alias for $11; + p_creation_ip alias for $12; + p_context_id alias for $13; v_notification_id integer; v_notif_date notifications.notif_date%TYPE; begin @@ -273,9 +274,9 @@ insert into notifications - (notification_id, type_id, object_id, notif_date, response_id, notif_subject, notif_text, notif_html) + (notification_id, type_id, object_id, notif_date, response_id, notif_user, notif_subject, notif_text, notif_html) values - (v_notification_id, p_type_id, p_object_id, v_notif_date, p_response_id, p_notif_subject, p_notif_text, p_notif_html); + (v_notification_id, p_type_id, p_object_id, v_notif_date, p_response_id, p_notif_user, p_notif_subject, p_notif_text, p_notif_html); return v_notification_id; end; Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/notifications/sql/postgresql/upgrade/upgrade-4.6.2-4.6.4.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/notifications/tcl/apm-callback-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/notifications/tcl/delivery-method-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/notifications/tcl/delivery-method-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/notifications/tcl/delivery-method-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/delivery-method-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/notifications/tcl/delivery-method-procs.tcl 17 Jun 2003 01:04:46 -0000 1.7 +++ openacs-4/packages/notifications/tcl/delivery-method-procs.tcl 28 Aug 2003 09:41:58 -0000 1.8 @@ -14,79 +14,108 @@ } -namespace eval notification::delivery { +namespace eval notification::delivery {} - ad_proc -private get_impl_key { - {-delivery_method_id:required} - } { - Return the service contract implementation key for notification delivery methods - } { - return [db_string select_impl_key {}] - } - ad_proc -public send { - {-delivery_method_id:required} - {-reply_object_id ""} - {-notification_type_id:required} - {-to_user_id:required} - {-subject:required} - {-content:required} - } { - do the delivery of certain content to a particular user using a particular delivery method. - This is just a wrapper proc that sets up the call to the service contract implementation for - a given delivery method. - } { - #need to check if its ok to notify this user in this way. For now just checks if they are an approved user. - if { ![notification::security::can_notify_user -user_id $to_user_id -delivery_method_id $delivery_method_id] } { - ns_log notice "Blocked notification to $to_user_id subject:$subject" - return "Blocked" - } +ad_proc -private notification::delivery::get_impl_key { + {-delivery_method_id:required} +} { + Return the service contract implementation key for notification delivery methods +} { + return [db_string select_impl_key {}] +} - # Get the implementation key - set impl_key [get_impl_key -delivery_method_id $delivery_method_id] - - # Prepare the arguments - set args [list $to_user_id $reply_object_id $notification_type_id $subject $content] - - # Make the generic call - return [acs_sc_call NotificationDeliveryMethod Send $args $impl_key] +ad_proc -public notification::delivery::send { + {-delivery_method_id:required} + {-reply_object_id ""} + {-notification_type_id:required} + {-from_user_id ""} + {-to_user_id:required} + {-subject:required} + {-content:required} +} { + do the delivery of certain content to a particular user using a particular delivery method. + This is just a wrapper proc that sets up the call to the service contract implementation for + a given delivery method. +} { + #need to check if its ok to notify this user in this way. For now just checks if they are an approved user. + if { ![notification::security::can_notify_user -user_id $to_user_id -delivery_method_id $delivery_method_id] } { + ns_log notice "Blocked notification to $to_user_id subject:$subject" + return "Blocked" } - ad_proc -public scan_replies { - {-delivery_method_id:required} - } { - scan for replies. - - Every delivery method allows for replies. This is the wrapper proc that - indicates to the delivery method service contract implementation that it's time to - scan for replies. - } { - # Get the implementation key - set impl_key [get_impl_key -delivery_method_id $delivery_method_id] + # Get the implementation key + set impl_key [get_impl_key -delivery_method_id $delivery_method_id] - # Prepare the arguments - set args [list] + # Prepare the arguments + set args [list $from_user_id $to_user_id $reply_object_id $notification_type_id $subject $content] - # ns_log Notice "NOTIF-DELIV-METHOD: about to call acs_sc on $impl_key" + # Make the generic call + return [acs_sc_call NotificationDeliveryMethod Send $args $impl_key] +} - # Make the generic call - return [acs_sc_call NotificationDeliveryMethod ScanReplies $args $impl_key] - } +ad_proc -public notification::delivery::scan_replies { + {-delivery_method_id:required} +} { + scan for replies. + + Every delivery method allows for replies. This is the wrapper proc that + indicates to the delivery method service contract implementation that it's time to + scan for replies. +} { + # Get the implementation key + set impl_key [get_impl_key -delivery_method_id $delivery_method_id] - ad_proc -public get_id_from_name { - -name:required - } { + # Prepare the arguments + set args [list] - Return the delivery_method_id for the given name + # ns_log Notice "NOTIF-DELIV-METHOD: about to call acs_sc on $impl_key" - @param name A delivery type name (email etc) + # Make the generic call + return [acs_sc_call NotificationDeliveryMethod ScanReplies $args $impl_key] +} - @author Don Baccus (dhogaza@pacifier.com) +ad_proc -public notification::delivery::new { + {-delivery_method_id ""} + {-sc_impl_id:required} + {-short_name:required} + {-pretty_name:required} +} { + Register a new delivery method with the notification service. +} { + set extra_vars [ns_set create] - } { + oacs_util::vars_to_ns_set \ + -ns_set $extra_vars \ + -var_list {delivery_method_id sc_impl_id short_name pretty_name} + + return [package_instantiate_object \ + -extra_vars $extra_vars \ + "notification_delivery_method"] +} - return [db_string get_delivery_method_id {}] +ad_proc -public notification::delivery::delete { + {-delivery_method_id:required} +} { + Unregister a delivery method with the notification service. +} { + db_exec_plsql delete {} +} - } +ad_proc -public notification::delivery::update_sc_impl_id { + {-delivery_method_id ""} + {-sc_impl_id:required} +} { + Register a new service contract implementation with an existing delivery method. +} { + db_dml update {} +} +ad_proc -public notification::delivery::get_id { + {-short_name:required} +} { + Return the delivery_method_id from the short_name. +} { + return [db_string select_delivery_method_id {}] } + Index: openacs-4/packages/notifications/tcl/delivery-method-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/delivery-method-procs.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/notifications/tcl/delivery-method-procs.xql 17 Jun 2003 01:04:46 -0000 1.3 +++ openacs-4/packages/notifications/tcl/delivery-method-procs.xql 28 Aug 2003 09:41:58 -0000 1.4 @@ -2,20 +2,28 @@ <queryset> -<fullquery name="notification::delivery::get_impl_key.select_impl_key"> - <querytext> - select impl_name from acs_sc_impls, notification_delivery_methods - where acs_sc_impls.impl_id = notification_delivery_methods.sc_impl_id + <fullquery name="notification::delivery::get_impl_key.select_impl_key"> + <querytext> + select impl_name from acs_sc_impls, notification_delivery_methods + where acs_sc_impls.impl_id = notification_delivery_methods.sc_impl_id and delivery_method_id= :delivery_method_id - </querytext> -</fullquery> + </querytext> + </fullquery> + <fullquery name="notification::delivery::get_id.select_delivery_method_id"> + <querytext> + select delivery_method_id + from notification_delivery_methods + where short_name = :short_name + </querytext> + </fullquery> -<fullquery name="notification::delivery::get_id_from_name.get_delivery_method_id"> - <querytext> - select delivery_method_id - from notification_delivery_methods where short_name = 'email' - </querytext> -</fullquery> + <fullquery name="notification::delivery::update_sc_impl_id.update"> + <querytext> + update notification_delivery_methods + set sc_impl_id = :sc_impl_id + where delivery_method_id = :delivery_method_id + </querytext> + </fullquery> </queryset> Index: openacs-4/packages/notifications/tcl/notification-email-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-email-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/notifications/tcl/notification-email-procs.tcl 17 May 2003 10:54:25 -0000 1.12 +++ openacs-4/packages/notifications/tcl/notification-email-procs.tcl 28 Aug 2003 09:41:58 -0000 1.13 @@ -81,13 +81,16 @@ } ad_proc -public send { + from_user_id to_user_id reply_object_id notification_type_id subject content } { - Send the actual email + Send the actual email. + + @param from_user_id The user_id of the user that the email should be sent as. Leave empty for the standard mailer from address. } { # Get email set email [cc_email_from_party $to_user_id] @@ -96,11 +99,31 @@ set manage_notifications_url [manage_notifications_url] append content "\n[_ notifications.lt_Getting_too_much_emai]" + # Use this to build up extra mail headers + set extra_headers [ns_set new] + + # This should disable most auto-replies. + ns_set put $extra_headers Precedence list + + set reply_to [reply_address -object_id $reply_object_id -type_id $notification_type_id] + + if { ![empty_string_p $from_user_id] && [db_0or1row get_person {}]} { + set from_email "\"$first_names $last_name\" <[cc_email_from_party $from_user_id]>" + + # Set the Reply-To and Mail-Followup-To addresses to the + # address of the notifications handler. + ns_set put $extra_headers Reply-To $reply_to + ns_set put $extra_headers Mail-Followup-To $reply_to + } else { + set from_email $reply_to + } + acs_mail_lite::send \ -to_addr $email \ - -from_addr [reply_address -object_id $reply_object_id -type_id $notification_type_id] \ + -from_addr $from_email \ -subject $subject \ - -body $content + -body $content \ + -extraheaders $extra_headers } ad_proc -private load_qmail_mail_queue { @@ -131,9 +154,9 @@ if [catch {set f [open $msg r]}] { continue } - set file [read $f] + set orig_file [read $f] close $f - set file [split $file "\n"] + set file [split $orig_file "\n"] set new_messages 1 set end_of_headers_p 0 @@ -142,35 +165,63 @@ set headers [list] # walk through the headers and extract each one + set is_auto_reply_p 0 while ![empty_string_p $line] { set next_line [lindex $file [expr $i + 1]] if {[regexp {^[ ]*$} $next_line match] && $i > 0} { set end_of_headers_p 1 } + set multiline_header_p 0 if {[regexp {^([^:]+):[ ]+(.+)$} $line match name value]} { # join headers that span more than one line (e.g. Received) if { ![regexp {^([^:]+):[ ]+(.+)$} $next_line match] && !$end_of_headers_p} { - append line $next_line - incr i + set multiline_header_p 1 + } else { + # we only want messages a person typed in themselves - nothing + # from any sort of auto-responder. + if { [string compare -nocase $name "Auto-Submitted"] == 0 } { + set is_auto_reply_p 1 + break + } elseif { [string compare -nocase $name "Subject"] == 0 && [string first "Out of Office AutoReply:" $value] == 0 } { + # added for BP + set is_auto_reply_p 1 + break + } else { + lappend headers [string tolower $name] $value } - lappend headers [string tolower $name] $value + } if {$end_of_headers_p} { - incr i - break + incr i + break } } else { # The headers and the body are delimited by a null line as specified by RFC822 if {[regexp {^[ ]*$} $line match]} { - incr i - break + incr i + break } } incr i - set line [lindex $file $i] + if { $multiline_header_p } { + append line [lindex $file $i] + } else { + set line [lindex $file $i] + } } - set body "\n[join [lrange $file $i end] "\n"]" + # a break above just exited the while loop; now we need to skip + # the rest of the foreach as well + if { $is_auto_reply_p } { + ns_log Notice "NOTIF-INCOMING-EMAIL: message is from an auto-responder, skipping" + if {[catch {ns_unlink $msg} errmsg]} { + ns_log Notice "NOTIF-INCOMING-EMAIL: couldn't remove message $msg: $errmsg" + } + continue + } + + set body [parse_incoming_email $orig_file] + # okay now we have a list of headers and the body, let's # put it into notifications stuff array set email_headers $headers @@ -192,7 +243,7 @@ if {[empty_string_p $from_user]} { ns_log Notice "NOTIF-INCOMING-EMAIL: no user $from" if {[catch {ns_unlink $msg} errmsg]} { - ns_log Notice "NOTIF-INCOMING-EMAIL: couldn't remove message" + ns_log Notice "NOTIF-INCOMING-EMAIL: couldn't remove message $msg: $errmsg" } continue } @@ -203,7 +254,7 @@ if {[empty_string_p $to_stuff]} { ns_log Notice "NOTIF-INCOMING-EMAIL: bad to address $to" if {[catch {ns_unlink $msg} errmsg]} { - ns_log Notice "NOTIF-INCOMING-EMAIL: couldn't remove message" + ns_log Notice "NOTIF-INCOMING-EMAIL: couldn't remove message $msg: $errmsg" } continue } Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/notifications/tcl/notification-email-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/notifications/tcl/notification-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/notifications/tcl/notification-procs.tcl 17 May 2003 10:54:25 -0000 1.7 +++ openacs-4/packages/notifications/tcl/notification-procs.tcl 28 Aug 2003 09:41:58 -0000 1.8 @@ -83,6 +83,7 @@ {-force:boolean} {-default_request_data {}} {-return_notified:boolean} + {-notif_user {}} } { Create a new notification if any notification requests exist for the object and type. @@ -264,6 +265,10 @@ } } + if { [empty_string_p $notif_user] && [ad_conn isconnected] } { + set notif_user [ad_conn user_id] + } + # Actually carry out inserting the notification db_transaction { if { $subset_arg_p || $already_notified_arg_p } { @@ -290,9 +295,14 @@ set object_id $action_id } + # Truncate notif_subject to the max len of 100 + set notif_subject [string_truncate -len 100 $notif_subject] + # Set up the vars set extra_vars [ns_set create] - oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {notification_id type_id object_id response_id notif_subject notif_text notif_html} + oacs_util::vars_to_ns_set \ + -ns_set $extra_vars \ + -var_list {notification_id type_id object_id response_id notif_subject notif_text notif_html notif_user} # Create the notification package_instantiate_object -extra_vars $extra_vars notification Index: openacs-4/packages/notifications/tcl/notification-reply-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-reply-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/notifications/tcl/notification-reply-procs.tcl 30 Nov 2002 17:40:18 -0000 1.4 +++ openacs-4/packages/notifications/tcl/notification-reply-procs.tcl 28 Aug 2003 09:41:58 -0000 1.5 @@ -25,6 +25,10 @@ store a new reply } { set extra_vars [ns_set create] + + # Truncate subject to 100 chars, which is the limit in the data model (for some obscure reason) + set subject [string range $subject 0 99] + oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {reply_id object_id type_id from_user subject content reply_date} set reply_id [package_instantiate_object -extra_vars $extra_vars notification_reply] Index: openacs-4/packages/notifications/tcl/sweep-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/Attic/sweep-procs-oracle.xql,v diff -u -r1.13 -r1.14 --- openacs-4/packages/notifications/tcl/sweep-procs-oracle.xql 4 Jul 2003 21:18:32 -0000 1.13 +++ openacs-4/packages/notifications/tcl/sweep-procs-oracle.xql 28 Aug 2003 09:41:58 -0000 1.14 @@ -34,7 +34,8 @@ notification_requests.delivery_method_id, notification_requests.request_id, notifications.response_id, - notifications.notif_date + notifications.notif_date, + notifications.notif_user from notifications, notification_requests where notifications.type_id = notification_requests.type_id and notifications.object_id = notification_requests.object_id Index: openacs-4/packages/notifications/tcl/sweep-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/Attic/sweep-procs-postgresql.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/notifications/tcl/sweep-procs-postgresql.xql 4 Jul 2003 21:18:32 -0000 1.6 +++ openacs-4/packages/notifications/tcl/sweep-procs-postgresql.xql 28 Aug 2003 09:41:58 -0000 1.7 @@ -26,7 +26,8 @@ type_id, delivery_method_id, response_id, - notif_date + notif_date, + notif_user from notifications inner join notification_requests using (type_id, object_id) inner join acs_objects on (notification_requests.request_id = acs_objects.object_id) left outer join notification_user_map using (notification_id, user_id) Index: openacs-4/packages/notifications/tcl/sweep-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/sweep-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/notifications/tcl/sweep-procs.tcl 17 May 2003 10:54:26 -0000 1.14 +++ openacs-4/packages/notifications/tcl/sweep-procs.tcl 28 Aug 2003 09:41:58 -0000 1.15 @@ -128,12 +128,13 @@ db_transaction { # Send it notification::delivery::send \ - -to_user_id [ns_set get $notif user_id] \ - -notification_type_id [ns_set get $notif type_id] \ - -subject [ns_set get $notif notif_subject] \ - -content [ns_set get $notif notif_text] \ - -reply_object_id [ns_set get $notif response_id] \ - -delivery_method_id [ns_set get $notif delivery_method_id] + -from_user_id [ns_set get $notif notif_user] \ + -to_user_id [ns_set get $notif user_id] \ + -notification_type_id [ns_set get $notif type_id] \ + -subject [ns_set get $notif notif_subject] \ + -content [ns_set get $notif notif_text] \ + -reply_object_id [ns_set get $notif response_id] \ + -delivery_method_id [ns_set get $notif delivery_method_id] # Markt it as sent notification::mark_sent \ Index: openacs-4/packages/robot-detection/robot-detection.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/robot-detection/robot-detection.info,v diff -u -r1.4 -r1.5 --- openacs-4/packages/robot-detection/robot-detection.info 17 May 2003 11:14:29 -0000 1.4 +++ openacs-4/packages/robot-detection/robot-detection.info 28 Aug 2003 09:41:58 -0000 1.5 @@ -49,7 +49,7 @@ <parameters> <parameter datatype="number" min_n_values="1" max_n_values="1" name="RefreshIntervalDays" default="30" description="How frequently (in days) the robots table should be refreshed from the Web Robots DB"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="FilterPattern" default="/member-only/*" description="a CSV string containing the URL paths to be filtered"/> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="WebRobotsDB" default="http://info.webcrawler.com/mak/projects/robots/active/all.txt" description="the URL of the Web Robots DB text file"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="WebRobotsDB" default="http://www.robotstxt.org/wc/active/all.txt" description="the URL of the Web Robots DB text file"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="RedirectURL" default="/robot-heaven/" description="the URL where robots should be sent"/> </parameters> Index: openacs-4/packages/robot-detection/tcl/robot-detection-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/robot-detection/tcl/robot-detection-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/robot-detection/tcl/robot-detection-procs.tcl 9 Mar 2002 02:00:02 -0000 1.2 +++ openacs-4/packages/robot-detection/tcl/robot-detection-procs.tcl 28 Aug 2003 09:41:58 -0000 1.3 @@ -4,7 +4,7 @@ @author Michael Yoon (michael@yoon.org) @author Roger Hsueh (rogerh@arsdigita.com) @creation-date 1999-05-27 - @cvs-id $Id$ + @cvs-id robot-detection-procs.tcl,v 1.2 2002/03/09 02:00:02 donb Exp } ad_proc ad_replicate_web_robots_db {} { Replicates data from the Web Robots Database @@ -39,12 +39,17 @@ db_dml delete_old_robots_table { delete from robots } - set robot_id [db_null] - set robot_name [db_null] - set robot_details_url [db_null] - set robot_useragent [db_null] + set robot_id "" + set robot_name "" + set robot_details_url "" + set robot_useragent "" foreach line $page { if {![regexp {\w+} $line]} { + + if { [string equal $robot_name ""] } { + set robot_name $robot_id + } + #detected a blank line, that means we are should try to #insert a row into the robots table, if robot_id and robot_useragent are not null if {[exists_and_not_null robot_id] && [exists_and_not_null robot_useragent]} { @@ -55,16 +60,17 @@ } } # start clean for a new record - set robot_id [db_null] - set robot_name [db_null] - set robot_details_url [db_null] - set robot_useragent [db_null] + set robot_id "" + set robot_name "" + set robot_details_url "" + set robot_useragent "" continue } - if {[regexp {robot-id: *(.+)} $line match robot_id] || - [regexp {robot-name: *(.+)} $line match robot_name] || - [regexp {robot-details-url: *(.+)} $line match robot_details_url] || - [regexp {robot-useragent: *(.+)} $line match robot_useragent] } { + + if {[regexp {robot-id:\s*([^\s]+)\s*} $line match robot_id] || + [regexp {robot-name:\s*([^\s]+)\s*} $line match robot_name] || + [regexp {robot-details-url:\s*([^\s]+)\s*} $line match robot_details_url] || + [regexp {robot-useragent:\s*([\s]+)\s*} $line match robot_useragent] } { continue } } Index: openacs-4/packages/robot-detection/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/robot-detection/www/admin/index.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/robot-detection/www/admin/index.adp 6 Sep 2002 15:36:39 -0000 1.2 +++ openacs-4/packages/robot-detection/www/admin/index.adp 28 Aug 2003 09:41:58 -0000 1.3 @@ -20,7 +20,7 @@ <p> -Courtesy of the <a href="http://info.webcrawler.com/mak/projects/robots/active.html">Web Robots Database</a>, +Courtesy of the <a href="http://www.robotstxt.org/wc/active.html">Web Robots Database</a>, this installation of the ACS can recognize the following robots: <ul> Index: openacs-4/packages/rss-support/tcl/rss-generation-service-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rss-support/tcl/rss-generation-service-procs-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/rss-support/tcl/rss-generation-service-procs-oracle.xql 17 May 2003 11:22:12 -0000 1.2 +++ openacs-4/packages/rss-support/tcl/rss-generation-service-procs-oracle.xql 28 Aug 2003 09:41:58 -0000 1.3 @@ -9,12 +9,12 @@ r.timeout, r.summary_context_id, i.impl_name, - nvl2(r.lastbuild, date_part('epoch',r.lastbuild), 0) as lastbuild + nvl2(r.lastbuild, (r.lastbuild-to_date('1970-01-01'))*60*60*24, 0) as lastbuild from rss_gen_subscrs r, acs_sc_impls i where i.impl_id = r.impl_id and (r.lastbuild is null - or sysdate > r.lastbuild + r.timeout/(60*60*24) + or sysdate > r.lastbuild + r.timeout/(60*60*24)) </querytext> </fullquery> Index: openacs-4/packages/workflow/workflow.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/workflow.info,v diff -u -r1.5 -r1.6 --- openacs-4/packages/workflow/workflow.info 5 Mar 2003 17:17:05 -0000 1.5 +++ openacs-4/packages/workflow/workflow.info 28 Aug 2003 09:41:59 -0000 1.6 @@ -8,7 +8,7 @@ <singleton-p>t</singleton-p> <auto-mount>workflow</auto-mount> - <version name="0.2d2" url="http://openacs.org/repository/download/apm/workflow-0.2d2.apm"> + <version name="1.0d4" url="http://openacs.org/repository/download/apm/workflow-1.0d4.apm"> <database-support> <database>oracle</database> <database>postgresql</database> @@ -22,10 +22,10 @@ <p> For more information, see: <a href="http://www.collaboraid.biz/developer/workflow-spec">the workflow specification</a>.</description> - <provides url="workflow" version="0.2d2"/> + <provides url="workflow" version="1.0d4"/> <requires url="notifications" version="0.3d"/> <requires url="acs-content-repository" version="4.6d1"/> - <requires url="acs-kernel" version="4.6.2d"/> + <requires url="acs-kernel" version="4.6.2"/> <requires url="acs-tcl" version="4.6.2d"/> <files> Index: openacs-4/packages/workflow/sql/oracle/workflow-procedural-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/sql/oracle/workflow-procedural-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/workflow/sql/oracle/workflow-procedural-create.sql 5 Mar 2003 17:17:18 -0000 1.2 +++ openacs-4/packages/workflow/sql/oracle/workflow-procedural-create.sql 28 Aug 2003 09:41:59 -0000 1.3 @@ -10,7 +10,7 @@ --------------------------------- -- Workflow level, Generic Model --------------------------------- -create or replace package workflow_case +create or replace package workflow_case_pkg as function get_pretty_state( workflow_short_name in varchar, @@ -21,11 +21,11 @@ delete_case_id in integer ) return integer; -end workflow_case; +end workflow_case_pkg; / show errors -create or replace package body workflow_case +create or replace package body workflow_case_pkg as function get_pretty_state( workflow_short_name in varchar, @@ -74,7 +74,7 @@ return 0; end delete; -end workflow_case; +end workflow_case_pkg; / show errors @@ -114,7 +114,7 @@ from workflow_cases where workflow_id = delete_workflow_id) loop - foo := workflow_case.delete(rec.case_id); + foo := workflow_case_pkg.delete(rec.case_id); end loop; acs_object.delete(delete_workflow_id); Index: openacs-4/packages/workflow/sql/oracle/workflow-tables-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/sql/oracle/workflow-tables-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/workflow/sql/oracle/workflow-tables-create.sql 5 Mar 2003 17:17:18 -0000 1.2 +++ openacs-4/packages/workflow/sql/oracle/workflow-tables-create.sql 28 Aug 2003 09:41:59 -0000 1.3 @@ -341,7 +341,7 @@ create table workflow_cases ( case_id integer - constraint wf_cases_pk + constraint workflow_cases_pk primary key, workflow_id constraint wf_cases_workflow_id_nn not null Index: openacs-4/packages/workflow/sql/postgresql/workflow-procedural-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/sql/postgresql/workflow-procedural-create.sql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/workflow/sql/postgresql/workflow-procedural-create.sql 5 Mar 2003 17:17:33 -0000 1.6 +++ openacs-4/packages/workflow/sql/postgresql/workflow-procedural-create.sql 28 Aug 2003 09:41:59 -0000 1.7 @@ -22,15 +22,15 @@ from workflow_cases where workflow_id = delete_workflow_id loop - perform workflow_case__delete (rec.case_id); + perform workflow_case_pkg__delete (rec.case_id); end loop; perform acs_object__delete(delete_workflow_id); return 0; end;' language 'plpgsql'; -create or replace function workflow_case__delete (integer) +create or replace function workflow_case_pkg__delete (integer) returns integer as ' declare delete_case_id alias for $1; @@ -48,7 +48,7 @@ -- All workflow data cascades from the case id delete from workflow_cases - where object_id = delete_case_id; + where case_id = delete_case_id; return 0; end;' language 'plpgsql'; @@ -101,7 +101,7 @@ -- Function for getting the pretty state of a case -create or replace function workflow_case__get_pretty_state ( +create or replace function workflow_case_pkg__get_pretty_state ( varchar, -- workflow_short_name integer -- object_id ) Index: openacs-4/packages/workflow/sql/postgresql/workflow-procedural-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/sql/postgresql/workflow-procedural-drop.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/workflow/sql/postgresql/workflow-procedural-drop.sql 12 Feb 2003 14:22:35 -0000 1.4 +++ openacs-4/packages/workflow/sql/postgresql/workflow-procedural-drop.sql 28 Aug 2003 09:41:59 -0000 1.5 @@ -36,5 +36,13 @@ varchar -- creation_ip ); +drop function workflow_case_pkg__delete (integer); + +drop function workflow_case_pkg__get_pretty_state ( + varchar, -- workflow_short_name + integer -- object_id +); + + delete from acs_function_args where function = 'workflow_case_log_entry__new'; Index: openacs-4/packages/workflow/tcl/case-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/case-procs-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/workflow/tcl/case-procs-oracle.xql 5 Mar 2003 17:18:10 -0000 1.2 +++ openacs-4/packages/workflow/tcl/case-procs-oracle.xql 28 Aug 2003 09:41:59 -0000 1.3 @@ -93,5 +93,12 @@ </querytext> </fullquery> + <fullquery name="workflow::case::delete.delete_case"> + <querytext> + begin + :1 := workflow_case.delete(:case_id); + end; + </querytext> + </fullquery> </queryset> Index: openacs-4/packages/workflow/tcl/case-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/case-procs-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/workflow/tcl/case-procs-postgresql.xql 5 Mar 2003 17:18:10 -0000 1.3 +++ openacs-4/packages/workflow/tcl/case-procs-postgresql.xql 28 Aug 2003 09:41:59 -0000 1.4 @@ -85,4 +85,10 @@ </querytext> </fullquery> + <fullquery name="workflow::case::delete.delete_case"> + <querytext> + select workflow_case_pkg__delete(:case_id) + </querytext> + </fullquery> + </queryset> Index: openacs-4/packages/workflow/tcl/case-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/case-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/workflow/tcl/case-procs.tcl 5 Mar 2003 17:18:10 -0000 1.6 +++ openacs-4/packages/workflow/tcl/case-procs.tcl 28 Aug 2003 09:41:59 -0000 1.7 @@ -24,13 +24,13 @@ {-object_id:required} } { Internal procedure that creates a new workflow case in the - database. Should not be used by applications. + database. Should not be used by applications. Use workflow::case::new instead. @param object_id The object_id which the case is about @param workflow_short_name The short_name of the workflow. @return The case_id of the case. Returns the empty string if no case could be found. - @see + @see workflow::case::new @author Lars Pind (lars@collaboraid.biz) } { @@ -147,6 +147,18 @@ return $row($element) } +ad_proc -public workflow::case::delete { + {-case_id:required} +} { + Delete a workflow case. + + @param case_id The case_id you wish to delete + + @author Simon Carstensen (simon@collaboraid.biz) +} { + db_exec_plsql delete_case {} +} + ad_proc -public workflow::case::get_user_roles { {-case_id:required} -user_id @@ -262,11 +274,339 @@ workflow::case::role::flush_cache $case_id } +ad_proc -private workflow::case::get_activity_html { + {-case_id:required} + {-action_id ""} +} { + Get the activity log for a case as an HTML chunk. + If action_id is non-empty, it means that we're in + the progress of executing that action, and the + corresponding line for the current action will be appended. + @param case_id The case for which you want the activity log. + @param action_id optional action which is currently being executed. + @return Activity log as HTML + @author Lars Pind (lars@collaboraid.biz) +} { + set log_html {} + set template { + <b>@creation_date_pretty@ @action_pretty_past_tense@ @log_title@ by @community_member_link@</b> + <blockquote>@comment_html@</blockquote> + } + # Compile and evaluate the template + set code [template::adp_compile -string $template] + foreach entry_arraylist [get_activity_log_info -case_id $case_id] { + foreach { var value } $entry_arraylist { + set $var $value + } + + set comment_html [ad_html_text_convert -from $comment_mime_type -to "text/html" -- $comment] + set community_member_link [acs_community_member_link -user_id $creation_user -label "$user_first_names $user_last_name"] + + append log_html [template::adp_eval code] + } + + if { ![empty_string_p $action_id] } { + set pretty_past_tense [workflow::action::get_element -action_id $action_id -element pretty_past_tense] + + # sets first_names, last_name, email + ad_get_user_info + + set now_pretty [clock format [clock seconds] -format "%m/%d/%Y"] + # Get rid of leading zeros + regsub {^0} $now_pretty {} now_pretty + regsub {/0} $now_pretty {/} now_pretty + + append log_html "<p><b>$now_pretty $pretty_past_tense by $first_names $last_name</b></p>" + } + + return $log_html +} + +ad_proc -private workflow::case::get_activity_text { + {-case_id:required} +} { + Get the activity log for a case as a text chunk + + @author Lars Pind +} { + set log_text {} + + foreach entry_arraylist [get_activity_log_info -case_id $case_id] { + foreach { var value } $entry_arraylist { + set $var $value + } + + set entry_text "$creation_date_pretty $action_pretty_past_tense [ad_decode $log_title "" "" "$log_title "]y $user_first_names $user_last_name ($user_email)" + + if { ![empty_string_p $comment] } { + append entry_text ":\n\n [join [split [ad_html_text_convert -from $comment_mime_type -to "text/plain" -maxlen 66 -- $comment] "\n"] "\n "]" + } + + lappend log_text $entry_text + + + } + return [join $log_text "\n\n"] +} + +ad_proc -private workflow::case::get_activity_log_info { + {-case_id:required} +} { + Get the data for the case activity log. + + @return a list of array-lists with the following entries: + comment comment_mime_type creation_date_pretty action_pretty_past_tense log_title + user_first_names user_last_name user_email creation_user data_arraylist + + @author Lars Pind +} { + global __cache__workflow__case__get_activity_log_info + if { ![info exists __cache__workflow__case__get_activity_log_info] } { + set __cache__workflow__case__get_activity_log_info [get_activity_log_info_not_cached -case_id $case_id] + } + return $__cache__workflow__case__get_activity_log_info +} + +ad_proc -private workflow::case::get_activity_log_info_not_cached { + {-case_id:required} +} { + Get the data for the case activity log. This version is cached for a single thread. + + @return a list of array-lists with the following entries: + comment comment_mime_type creation_date_pretty action_pretty_past_tense log_title + user_first_names user_last_name user_email creation_user data_arraylist + + @author Lars Pind +} { + set workflow_id [workflow::case::get_element -case_id $case_id -element workflow_id] + set object_id [workflow::case::get_element -case_id $case_id -element object_id] + set contract_name [workflow::service_contract::activity_log_format_title] + + # Get the name of any title Tcl callback proc + set impl_names [workflow::get_callbacks \ + -workflow_id $workflow_id \ + -contract_name $contract_name] + + # First, we build up a multirow so we have all the data in memory, which lets us peek ahead at the contents + db_multirow -extend {comment} -local entries select_log {} { set comment $comment_string } + + + set rowcount [template::multirow -local size entries] + set counter 1 + + set last_entry_id {} + set data_arraylist [list] + + # Then iterate over the multirow to build up the activity log HTML + # We need to peek ahead, because this is an outer join to get the rows in workflow_case_log_data + + set entries [list] + template::multirow -local foreach entries { + + if { ![empty_string_p $key] } { + lappend data_arraylist $key $value + } + + if { $counter == $rowcount || "]] } { + + set log_title_elements [list] + foreach impl_name $impl_names { + set result [acs_sc::invoke \ + -contract $contract_name \ + -operation "GetTitle" \ + -impl $impl_name \ + -call_args [list $case_id $object_id $action_id $entry_id $data_arraylist]] + if { ![empty_string_p $result] } { + lappend log_title_elements $result + } + } + set log_title [ad_decode [llength $log_title_elements] 0 "" "([join $log_title_elements ", "])"] + + set row [list] + foreach var { + comment comment_mime_type creation_date_pretty action_pretty_past_tense log_title + user_first_names user_last_name user_email creation_user data_arraylist + } { + lappend row $var [set $var] + } + lappend entries $row + + set data_arraylist [list] + } + set last_entry_id $entry_id + incr counter + } + + return $entries +} + +ad_proc workflow::case::get_notification_object { + {-type:required} + {-workflow_id ""} + {-case_id ""} +} { + Get the relevant object for this notification type. + + @param type Type is one of 'workflow_assignee', 'workflow_my_cases', + 'workflow_case' (requires case_id), and 'workflow' (requires + workflow_id). +} { + switch $type { + workflow_case { + if { ![exists_and_not_null case_id] } { + return {} + } + return [workflow::case::get_element -case_id $case_id -element object_id] + } + default { + if { ![exists_and_not_null workflow_id] } { + return {} + } + return [workflow::get_element -workflow_id $workflow_id -element object_id] + } + } +} + +ad_proc workflow::case::get_notification_request_url { + {-type:required} + {-workflow_id ""} + {-case_id ""} + {-return_url ""} + {-pretty_name ""} +} { + Get the URL to subscribe to notifications + + @param type Type is one of 'workflow_assignee', 'workflow_my_cases', + 'workflow_case' (requires case_id), and 'workflow' (requires + workflow_id). +} { + if { [ad_conn user_id] == 0 } { + return {} + } + + set object_id [get_notification_object \ + -type $type \ + -workflow_id $workflow_id \ + -case_id $case_id] + + if { [empty_string_p $object_id] } { + return {} + } + + if { ![exists_and_not_null return_url] } { + set return_url [ad_return_url] + } + + set url [notification::display::subscribe_url \ + -type $type \ + -object_id $object_id \ + -url $return_url \ + -user_id [ad_conn user_id] \ + -pretty_name $pretty_name] + + return $url +} + +ad_proc workflow::case::get_notification_requests_multirow { + {-multirow_name:required} + {-label ""} + {-workflow_id ""} + {-case_id ""} + {-return_url ""} +} { + Returns a multirow with columns url, label, title, + of the possible workflow notification types. Use this to present the user with a list of + subscription links. +} { + array set pretty { + workflow_assignee {my actions} + workflow_my_cases {my cases} + workflow_case {this case} + workflow {cases in this workflow} + } + + template::multirow create $multirow_name url label title + foreach type { + workflow_assignee workflow_my_cases workflow_case workflow + } { + set url [get_notification_request_url \ + -type $type \ + -workflow_id $workflow_id \ + -case_id $case_id \ + -return_url $return_url] + + if { ![empty_string_p $url] } { + set title "Subscribe to $pretty($type)" + if { ![empty_string_p $label] } { + set row_label $label + } else { + set row_label $title + } + template::multirow append $multirow_name $url $row_label $title + } + } +} + +ad_proc workflow::case::add_log_data { + {-entry_id:required} + {-key:required} + {-value:required} +} { + Adds extra data information to a log entry, which can later + be retrieved using workflow::case::get_log_data_by_key. + Data are stored as simple key/value pairs. + + @param entry_id The ID of the log entry to which you want to attach data. + @param key The data key. + @param value The data value + + @see workflow::case::get_log_data_by_key + @see workflow::case::get_log_data + @author Lars Pind (lars@collaboraid.biz) +} { + db_dml insert_log_data {} +} + +ad_proc workflow::case::get_log_data_by_key { + {-entry_id:required} + {-key:required} +} { + Retrieve extra data for a workflow log entry, previously stored using workflow::case::add_log_data. + + @param entry_id The ID of the log entry to which the data you want are attached. + @param key The key of the data you're looking for. + @return The value, or the empty string if no such key exists for this entry. + + @see workflow::case::add_log_data + @see workflow::case::get_log_data + @author Lars Pind (lars@collaboraid.biz) +} { + db_string select_log_data {} -default {} +} + +ad_proc workflow::case::get_log_data { + {-entry_id:required} +} { + Retrieve extra data for a workflow log entry, previously stored using workflow::case::add_log_data. + + @param entry_id The ID of the log entry to which the data you want are attached. + @return A tcl list of key/value pairs in array-list format, i.e. { key1 value1 key2 value2 ... }. + + @see workflow::case::add_log_data + @see workflow::case::get_log_data_by_key + @author Lars Pind (lars@collaboraid.biz) +} { + db_string select_log_data {} -default {} +} + + + + ##### # # workflow::case::role namespace @@ -394,19 +734,12 @@ -impl $impl_name \ -call_args [list $case_id $object_id $role_id]] - ns_log Notice "LARS: $contract_name, $impl_name = $subquery" - if { ![empty_string_p $subquery] } { # Return after the first non-empty list break } } - ns_log Notice "LARS: subquery = $subquery" - - ns_log Notice "LARS: returning [db_map select_search_results]" - - return [db_map select_search_results] @@ -432,8 +765,8 @@ set query [workflow::case::role::get_search_query -case_id $case_id -role_id $role_id] set picklist [workflow::case::role::get_picklist -case_id $case_id -role_id $role_id] - return [list "${element}:search(search)" [list label $role(pretty_name)] [list mode display] \ - [list search_query $query] [list options $picklist] optional] + return [list "${element}:search(search),optional" [list label $role(pretty_name)] [list mode display] \ + [list search_query $query] [list options $picklist]] } ad_proc -public workflow::case::role::add_assignee_widgets { @@ -610,262 +943,9 @@ } } -ad_proc -private workflow::case::get_activity_html { - {-case_id:required} -} { - Get the activity log for a case as an HTML chunk - @author Lars Pind -} { - set log_html {} - set template { - <b>@creation_date_pretty@ @action_pretty_past_tense@ @log_title@ by @community_member_link@</b> - <blockquote>@comment_html@</blockquote> - } - # Compile and evaluate the template - set code [template::adp_compile -string $template] - - foreach entry_arraylist [get_activity_log_info -case_id $case_id] { - foreach { var value } $entry_arraylist { - set $var $value - } - - set comment_html [ad_html_text_convert -from $comment_mime_type -to "text/html" -- $comment] - set community_member_link [acs_community_member_link -user_id $creation_user -label "$user_first_names $user_last_name"] - - append log_html [template::adp_eval code] - } - - return $log_html -} - -ad_proc -private workflow::case::get_activity_text { - {-case_id:required} -} { - Get the activity log for a case as a text chunk - - @author Lars Pind -} { - set log_text {} - - foreach entry_arraylist [get_activity_log_info -case_id $case_id] { - foreach { var value } $entry_arraylist { - set $var $value - } - - set entry_text "$creation_date_pretty $action_pretty_past_tense $log_title by $user_first_names $user_last_name ($user_email)" - - if { ![empty_string_p $comment] } { - append entry_text ":\n\n [join [split [ad_html_text_convert -from $comment_mime_type -to "text/plain" -maxlen 66 -- $comment] "\n"] "\n "]" - } - - lappend log_text $entry_text - - - } - return [join $log_text "\n\n"] -} - -ad_proc -private workflow::case::get_activity_log_info { - {-case_id:required} -} { - Get the data for the case activity log. - - @return a list of array-lists with the following entries: - comment comment_mime_type creation_date_pretty action_pretty_past_tense log_title - user_first_names user_last_name user_email creation_user data_arraylist - - @author Lars Pind -} { - global __cache__workflow__case__get_activity_log_info - if { ![info exists __cache__workflow__case__get_activity_log_info] } { - set __cache__workflow__case__get_activity_log_info [get_activity_log_info_not_cached -case_id $case_id] - } - return $__cache__workflow__case__get_activity_log_info -} - -ad_proc -private workflow::case::get_activity_log_info_not_cached { - {-case_id:required} -} { - Get the data for the case activity log. This version is cached for a single thread. - - @return a list of array-lists with the following entries: - comment comment_mime_type creation_date_pretty action_pretty_past_tense log_title - user_first_names user_last_name user_email creation_user data_arraylist - - @author Lars Pind -} { - set workflow_id [workflow::case::get_element -case_id $case_id -element workflow_id] - set object_id [workflow::case::get_element -case_id $case_id -element object_id] - set contract_name [workflow::service_contract::activity_log_format_title] - - # Get the name of any title Tcl callback proc - set impl_names [workflow::get_callbacks \ - -workflow_id $workflow_id \ - -contract_name $contract_name] - - # First, we build up a multirow so we have all the data in memory, which lets us peek ahead at the contents - db_multirow -extend {comment} -local entries select_log {} { set comment $comment_string } - - - set rowcount [template::multirow -local size entries] - set counter 1 - - set last_entry_id {} - set data_arraylist [list] - - # Then iterate over the multirow to build up the activity log HTML - # We need to peek ahead, because this is an outer join to get the rows in workflow_case_log_data - - set entries [list] - template::multirow -local foreach entries { - - if { ![empty_string_p $key] } { - lappend data_arraylist $key $value - } - - if { $counter == $rowcount || "]] } { - - set log_title_elements [list] - foreach impl_name $impl_names { - set result [acs_sc::invoke \ - -contract $contract_name \ - -operation "GetTitle" \ - -impl $impl_name \ - -call_args [list $case_id $object_id $action_id $entry_id $data_arraylist]] - if { ![empty_string_p $result] } { - lappend log_title_elements $result - } - } - set log_title [ad_decode [llength $log_title_elements] 0 "" "([join $log_title_elements ", "])"] - - set row [list] - foreach var { - comment comment_mime_type creation_date_pretty action_pretty_past_tense log_title - user_first_names user_last_name user_email creation_user data_arraylist - } { - lappend row $var [set $var] - } - lappend entries $row - - set data_arraylist [list] - } - set last_entry_id $entry_id - incr counter - } - - return $entries -} - -ad_proc workflow::case::get_notification_object { - {-type:required} - {-workflow_id ""} - {-case_id ""} -} { - Get the relevant object for this notification type. - - @param type Type is one of 'workflow_assignee', 'workflow_my_cases', - 'workflow_case' (requires case_id), and 'workflow' (requires - workflow_id). -} { - switch $type { - workflow_case { - if { ![exists_and_not_null case_id] } { - return {} - } - return [workflow::case::get_element -case_id $case_id -element object_id] - } - default { - if { ![exists_and_not_null workflow_id] } { - return {} - } - return [workflow::get_element -workflow_id $workflow_id -element object_id] - } - } -} - -ad_proc workflow::case::get_notification_request_url { - {-type:required} - {-workflow_id ""} - {-case_id ""} - {-return_url ""} - {-pretty_name ""} -} { - Get the URL to subscribe to notifications - - @param type Type is one of 'workflow_assignee', 'workflow_my_cases', - 'workflow_case' (requires case_id), and 'workflow' (requires - workflow_id). -} { - if { [ad_conn user_id] == 0 } { - return {} - } - - set object_id [get_notification_object \ - -type $type \ - -workflow_id $workflow_id \ - -case_id $case_id] - - if { [empty_string_p $object_id] } { - return {} - } - - if { ![exists_and_not_null return_url] } { - set return_url [util_get_current_url] - } - - set url [notification::display::subscribe_url \ - -type $type \ - -object_id $object_id \ - -url $return_url \ - -user_id [ad_conn user_id] \ - -pretty_name $pretty_name] - - return $url -} - -ad_proc workflow::case::get_notification_requests_multirow { - {-multirow_name:required} - {-label ""} - {-workflow_id ""} - {-case_id ""} - {-return_url ""} -} { - -} { - array set pretty { - workflow_assignee {my actions} - workflow_my_cases {my cases} - workflow_case {this case} - workflow {cases in this workflow} - } - - template::multirow create $multirow_name url label title - foreach type { - workflow_assignee workflow_my_cases workflow_case workflow - } { - set url [get_notification_request_url \ - -type $type \ - -workflow_id $workflow_id \ - -case_id $case_id \ - -return_url $return_url] - - if { ![empty_string_p $url] } { - set title "Subscribe to $pretty($type)" - if { ![empty_string_p $label] } { - set row_label $label - } else { - set row_label $title - } - template::multirow append $multirow_name $url $row_label $title - } - } -} - - - ##### # # workflow::case::fsm @@ -1139,17 +1219,18 @@ -case_id $case_id \ -action_id $action_id \ -entry_id $entry_id - - # Notifications - notify \ - -case_id $case_id \ - -action_id $action_id \ - -entry_id $entry_id \ - -comment $comment \ - -comment_mime_type $comment_mime_type + } workflow::case::flush_cache $case_id + + # Notifications + notify \ + -case_id $case_id \ + -action_id $action_id \ + -entry_id $entry_id \ + -comment $comment \ + -comment_mime_type $comment_mime_type return $entry_id } @@ -1206,38 +1287,38 @@ } { # Get workflow_id workflow::case::get \ - -case_id $case_id \ - -array case - + -case_id $case_id \ + -array case + workflow::get \ - -workflow_id $case(workflow_id) \ - -array workflow - + -workflow_id $case(workflow_id) \ + -array workflow + set hr [string repeat "=" 70] - + array set latest_action [lindex [workflow::case::get_activity_log_info -case_id $case_id] end] - set latest_action_chunk "$latest_action(action_pretty_past_tense) $latest_action(log_title) by $latest_action(user_first_names) $latest_action(user_last_name) ($latest_action(user_email))" + set latest_action_chunk "$latest_action(action_pretty_past_tense) [ad_decode $latest_action(log_title) "" "" "$latest_action(log_title) "]by $latest_action(user_first_names) $latest_action(user_last_name) ($latest_action(user_email))" if { ![empty_string_p $latest_action(comment)] } { append latest_action_chunk ":\n\n [join [split [ad_html_text_convert -from $latest_action(comment_mime_type) -to "text/plain" -maxlen 66 -- $latest_action(comment)] "\n"] "\n "]" } - + # Callback to get notification info set contract_name [workflow::service_contract::notification_info] set impl_names [workflow::get_callbacks \ -workflow_id $case(workflow_id) \ -contract_name $contract_name] # We only use the first callback set impl_name [lindex $impl_names 0] - + if { ![empty_string_p $impl_name] } { set notification_info [acs_sc::invoke \ -contract $contract_name \ -operation "GetNotificationInfo" \ -impl $impl_name \ -call_args [list $case_id $case(object_id)]] - + } # Make sure the notification info list has at least 4 elements, so we can do below lindex's safely @@ -1288,7 +1369,7 @@ set activity_log_chunk [workflow::case::get_activity_text -case_id $case_id] - set the_subject "[ad_decode $object_notification_tag "" "" "\[$object_notification_tag\] "]$object_one_line: $latest_action(action_pretty_past_tense) $latest_action(log_title) by $latest_action(user_first_names) $latest_action(user_last_name)" + set the_subject "[ad_decode $object_notification_tag "" "" "\[$object_notification_tag\] "]$object_one_line: $latest_action(action_pretty_past_tense) [ad_decode $latest_action(log_title) "" "" "$latest_action(log_title) "]by $latest_action(user_first_names) $latest_action(user_last_name)" # List of user_id's for people who are in the assigned_role to any enabled actions set assignee_list [db_list enabled_action_assignees {}] @@ -1353,8 +1434,6 @@ if { ![empty_string_p $object_id] } { - ns_log Notice "LARS: $body($type)" - set notified_list [concat $notified_list [notification::new \ -type_id [notification::type::get_type_id -short_name $type] \ -object_id $object_id \ Index: openacs-4/packages/workflow/tcl/case-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/case-procs.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/workflow/tcl/case-procs.xql 5 Mar 2003 17:18:10 -0000 1.6 +++ openacs-4/packages/workflow/tcl/case-procs.xql 28 Aug 2003 09:41:59 -0000 1.7 @@ -84,6 +84,33 @@ </querytext> </fullquery> + <fullquery name="workflow::case::add_log_data.insert_log_data"> + <querytext> + insert into workflow_case_log_data + (entry_id, key, value) + values + (:entry_id, :key, :value) + </querytext> + </fullquery> + + <fullquery name="workflow::case::get_log_data_by_key.select_log_data"> + <querytext> + select value + from workflow_case_log_data + where entry_id = :entry_id + and key = :key + </querytext> + </fullquery> + + <fullquery name="workflow::case::get_log_data.select_log_data"> + <querytext> + select key, value + from workflow_case_log_data + where entry_id = :entry_id + order by key + </querytext> + </fullquery> + <fullquery name="workflow::case::role::get_callbacks.select_callbacks"> <querytext> select impl.impl_name Index: openacs-4/packages/workflow/tcl/implementation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/implementation-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/workflow/tcl/implementation-procs.tcl 5 Mar 2003 17:18:10 -0000 1.3 +++ openacs-4/packages/workflow/tcl/implementation-procs.tcl 28 Aug 2003 09:41:59 -0000 1.4 @@ -115,7 +115,6 @@ } { Return a subquery for all registered users. } { - ns_log Notice "LARS: getsubquery returning [db_map cc_users]" return [db_map cc_users] } Index: openacs-4/packages/workflow/tcl/install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/install-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/workflow/tcl/install-procs.tcl 5 Mar 2003 17:18:10 -0000 1.5 +++ openacs-4/packages/workflow/tcl/install-procs.tcl 28 Aug 2003 09:41:59 -0000 1.6 @@ -103,7 +103,7 @@ iscachable_p "t" } GetPrettyName { - description "Get the pretty name of this implementation. Will be localized, so i may contain #...#." + description "Get the pretty name of this implementation." output { pretty_name:string } iscachable_p "t" } @@ -136,7 +136,7 @@ iscachable_p "t" } GetPrettyName { - description "Get the pretty name of this implementation. Will be localized, so i may contain #...#." + description "Get the pretty name of this implementation." output { pretty_name:string } iscachable_p "t" } @@ -169,7 +169,7 @@ iscachable_p "t" } GetPrettyName { - description "Get the pretty name of this implementation. Will be localized, so it may contain #...#." + description "Get the pretty name of this implementation." output { pretty_name:string } iscachable_p "t" } @@ -202,8 +202,8 @@ iscachable_p "t" } GetPrettyName { - description "Get the pretty name of this implementation. Will be localized, so it may contain #...#." - output { object_type:string } + description "Get the pretty name of this implementation." + output { pretty_name:string } iscachable_p "t" } DoSideEffect { @@ -237,7 +237,7 @@ } GetPrettyName { description "Get the pretty name of this implementation. Will be localized, so it may contain #...#." - output { object_type:string } + output { pretty_name:string } iscachable_p "t" } GetTitle { @@ -275,7 +275,7 @@ } GetPrettyName { description "Get the pretty name of this implementation. Will be localized, so it may contain #...#." - output { object_type:string } + output { pretty_name:string } iscachable_p "t" } GetNotificationInfo { Index: openacs-4/packages/workflow/www/doc/developer-guide.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/www/doc/developer-guide.html,v diff -u -r1.1 -r1.2 --- openacs-4/packages/workflow/www/doc/developer-guide.html 5 Mar 2003 17:19:09 -0000 1.1 +++ openacs-4/packages/workflow/www/doc/developer-guide.html 28 Aug 2003 09:41:59 -0000 1.2 @@ -2,20 +2,67 @@ <title>Package Developer's Guide to Workflow</title> <style> dt { margin-top: 12px; font-weight: bold; } + body { font-family: verdana, helvetica, sans-serif; } + li { margin-top: 12px; } + blockquote.note { + background-color: #ccffcc; + padding: 4px; + border: 1px dashed black; + } + pre.code { + margin-left: 24px; + background-color: #ddddff; + padding: 4px; + border: 1px dashed black; + } + th { + background-color: #ffcccc; + } + th.header { + background-color: #eeeeee; + color: black; + font-size: 125%; + padding: 8px; + } + tr { + background-color: white; + } + table { + font-size: 85%; + margin-left: 24px; + background-color: #999999; + } + td { + padding: 4px; + } </style> <body> <h1>Package Developer's Guide to Workflow</h1> +<a href="index.html">Workflow Documentation</a> : Package Developer's Guide + +<hr> + <p> By <a href="http://www.pinds.com">Lars Pind</a> </p> <h2>Introduction</h2> -<p> Workflow is used to coordinate the actions of multiple people -working together to accomplish something. </p> +<p> + The workflow package manages a collaborative process surrounding + some object. +</p> +<p> + Examples of the object could be a bug in a bug tracker, + a ticket in a ticket tracker, a content item in a content management + system, a user contribution in a moderated forum/comments/whatever + application, a user's request for particpation in a + course/event/whatever. +</p> + <p> For example, when a new bug is submitted, someone's assigned to fix it, and whoever submitted it is assigned to verify the fix and close the bug. Once the bug's fixed, the submitter will get notified, @@ -45,15 +92,1290 @@ <li> Integrate workflow into your application's queries </li> +</ol> + +<p> Let's first look at some concepts before getting into the +technicalities of how you actually do this. For a working example of +building workflow-based applications, we recommend you take a look at +bug-tracker. </p> + +<h2>Workflow Concepts</h2> + +<h3>What's in a workflow</h3> + +<p> + In its broadest, most conceptual sense, a workflow is defined as + (and this does get a little hairy, so feel free to skip if you just + want to start developing your applicaton): +</p> + +<ul> + <li> + A number of <b>actions</b> that can + be executed (open, edit, comment, resolve, edit, publish, approve, + reject, etc.) Whether or not an action is <b>enabled</b>, meaning + it can be executed at this point in time, will depend on the + current <b>state</b> of the workflow. Executing an action may + <b>change the state</b> of the workflow. + </li> + <li> + A definition of the possible <b>states</b> that the + workflow can be in. This could simply be an enumeration of states, + such as "Open", "Resolved", "Closed", in which case we're talking + about a "Finite State Machine" (because there's a finite number of + possible states). Other models, such as petri nets, have an + infinite number of possible states. This makes things a lot more + complicated, and you don't need to bother since this first + implementation of workflow only supports finite state machines. + </li> + <li> + People participate in a workflow through their <b>role</b>. For a + bug tracker, the roles could be "Submitter", "Resolver", and + "Tester". For a publication workflow, they'd be "Author", "Editor", + and "Publisher". Actions will be to roles, which in turn will be + linked to users or groups of users in a particular workflow + case. The reason we link people to actions through the concept of + roles is to allow you to specify that two or more actions should + be done by the same party. In bug-tracker, for example, the same + user who opened the bug should also close it. + </li> </ul> -<p> Let's look at each of these in order. </p> +<h3>Finite State Machines (FSMs)</h3> -<h2>Defining Your Process</h2> +<p> + As mentioned, workflow is designed to support workflows based on any + model, however the only model currently implemented is the finite + state machine. +</p> -<p> Your process +<p> + The workflow API is designed so that whenver you're using features + that are specific to finite state machines, the procedure name will + include the letters "fsm" in the name, as in <code><a + href="/api-doc/proc-view?proc=workflow::case::fsm::get">workflow::case::fsm::get</a></code>. That + way you'll know when you're hard-wiring a dependency on the + particular workflow model. +</p> +<p> + It's considered good practice to only use non-fsm API calls, but in + practice, it can be hard to create good user experiences without. So + feel free. +</p> +<blockquote class="note"> + <b>Notation:</b> + <p style="margin-left: 24px;"> + [Action] (State) {Role} + </p> + <p style="margin-left: 24px;"> + (State1) -> [Action1] -> (State2) -> [Action2] -> (State3) + </p> +</blockquote> + + +<h3>Cases</h3> + +<p> + So much for defining the workflow. When you start "running" your + workflow, that's called a <b>workflow case</b>, or simply a + case. A case is concerned with a particular object, it's always in a + particular state, and it has specific people or groups assigned to + its different roles. +</p> + +<h3>In-flow and out-of-flow</h3> + +<p> + When defining actions, we differentiate between <b>in-flow and + out-of-flow</b>. In-flow refers to the normal idealized flow of the + workflow, out-of-flow are the rest. Concretely what it means is that + if you're assigned to an in-flow action, we'll bug you about it + through notifications, and potentially get mad at you if you don't + come and do something to get the workflow moving along. We don't do + that with out-of-flow actions. So we'll send a notification that + says "Please come back and resolve this bug", whereas we'll not + notify everybody who are allowed to comment saying "Please come back + and comment on this bug". +</p> + +<p> + For bug-tracker, the normal flow (in-flow) is this: +</p> + +<blockquote> + (Open) -> [Resolve] -> (Resolved) -> [Close] -> (Closed) +</blockquote> + +<p> + Other actions not in the normal flow are [Edit] and [Comment], which + are always enabled, but never change the state. And [Reopen] which + throw you back to the (Open) state. And finally [Resolved] is + in-flow when in the (Open) state, but out-of-flow when in the + (Resolved) state, meaning that you can re-resolve a bug if you need + to, but you're not required to. +</p> + +<p> + In-flow and out-of-flow depends on the action, the state, and the + user's role in the case. For example, it might be that users in the + {Submitter} role are allowed to resolve their own bugs, but the + [Resolve] action will still only be considered in-flow to people in + the {Assignee} or {Resolver} role. +</p> + +<h2>The Six Steps Conceptually</h2> + +<p> + The recommended way a workflow is linked to an application is this: + As part of developing your application, you define your <b>default + workflow</b>, which will be used as a template for customization by the + users of your applications. This workflow will be installed using + the APM after-install callback, and will be linked to your + application's package-key. +</p> + +<p> + Then when a new instance of your application is created, your + <b>default workflow will be cloned</b>, and the clone linked to the + new instance, so that your users can customize the workflow for each + instance of your application individually. The default copy + installed along with your package is never actually used except for + cloning when creating a new instance. This means that your users can + customize this deafult workflow, and the modified version will serve + as the boilerplate for all new package instances. +</p> + +<p> + In order to integrate workflow with your application, you'll want to + implement one or more of the <b>callback service + contracts</b>. These can do things like determine default assignees + based on certain data in your application, get information about + your application's object for use when sending out notifications, or + perform side-effects, such as actually changing the publication + state of a content item when you execute the [Publish] action. +</p> + +<p> + When integrating the workflow with your application's user + experience, what workflow will give you is essentially the <b>list of + actions</b> that the given user can perform on the given object at the + given time. In bug-tracker, for example, bug-tracker takes care of + displaying the form displaying and editing a bug, while workflow + takes care of displaying the buttons that say [Comment], [Edit], + [Resolve], [Reopen], [Close], etc., along the bottom of the + form. Workflow also has a place to store which form elements should + be opened for editing depending on the action being executed. +</p> + +<p> + Your application should typically have an API for creating a new + object, editing an object, etc. This <b>application object API will + need to be workflow-aware</b>, so when a new object is created, a + new workflow case will be started as well. And when the object's + edited, that should generally only happen through a workflow action, + so that needs to be taken into account as well. +</p> + +<p> + The final step is integrating workflow into your application's + queries when you want to <b>filter an object listing/count based on + the workflow state</b>. This is the only place where you'll directly + be dependent on the workflow data model. +</p> + + +<h2>Defining Your Process (FSM)</h2> + +<p> + The current version of workflow only supports workflows based on a + finite state machine (FSM). Support for other models, such as petri + nets and directed graphs are possible, but not currently designed or + implemented. +</p> + +<p> + An FSM-based workflow consists of a set of states, actions, and roles. +</p> + +<p> + You define a new workflow like this: +</p> + +<pre class="code"> +set spec { + <i>workflow-short-name</i> { + ... + roles { + <i>role-short-name</i> { + ... + } + ... + } + states { + <i>state-short-name</i> { + ... + } + ... + } + actions { + <i>action-short-name</i> { + ... + } + ... + } + } +} + +set workflow_id [<a href="/api-doc/proc-view?proc=workflow::fsm::new_from_spec">workflow::fsm::new_from_spec</a> -spec $spec] +</pre> + +<p> + All the items (workflow, roles, states, actions) have a short-name, + which should be lowercase and use underbar (_) instead of + spaces. These are mainly used to refer to the items in other parts + of the spec. +</p> + +<p> + The workflow short name can be used to refer to the + workflow in your application, which is useful if you have several + different workflows. The bug-tracker, for example, could have a + workflow for bugs and another one for patches. +</p> + +<p> + Finally, you can also refer states, roles, and actions in your + application using short names, although this creates a dependency in + your application on a particular form of the workflow, and there's + currently no mechanism for ensuring that your workflow contains the + states, roles, and actions you'd refer to. This is on the todo-list. +</p> + +<h3>Workflow</h3> + +<p> + These are the attributes you can specify for the workflow itself: +</p> + +<table cellspacing="1"> + <tr> + <th colspan="2" class="header">Workflow Attributes</th> + </tr> + <tr> + <th>Attribute</th> + <th>Description</th> + </tr> + <tr bgcolor="white"> + <td><code>pretty_name</code></td> + <td> + Name used in the user interface. + </td> + </tr> + <tr> + <td><code>package_key</code></td> + <td> + The package that defined this workflow. + </td> + </tr> + <tr> + <td><code>object_type</code></td> + <td> + The parent object type which this workflow can be applied + to. If your workflow applies to any object, say 'acs_object'. + This is used in relation to callbacks when we build + the user interface for defining workflows. More on this in the + section on callbacks. + </td> + </tr> + <tr> + <td><code>callbacks</code></td> + <td> + Callbacks that apply to the whole workflow. If you add + side-effect callbacks, these are executed every time any action + is executed. + </td> + </tr> + <tr> + <td><code>roles</code></td> + <td> + Denotes the section of the spec that defines the workflow's roles. + </td> + </tr> + <tr> + <td><code>states</code></td> + <td> + Denotes the section of the spec that defines the workflow's states. + </td> + </tr> + <tr> + <td><code>actions</code></td> + <td> + Denotes the section of the spec that defines the workflow's actions. + </td> + </tr> +</table> + +<blockquote class="note"> + <b>Internationalization Note:</b> + <p style="margin-left: 24px;"> + When we make workflow internationalized for OpenACS 5.0, pretty + names will contain message keys in the form + "#<i>message-key</i>#". More about this in the package developer's + guide to internationalization. + </p> +</blockquote> + +<h3>Roles</h3> + +<p> + Attributes for roles: +</p> + +<table cellspacing="1"> + <tr> + <th colspan="2" class="header">Role Attributes</th> + </tr> + <tr> + <th>Attribute</th> + <th>Description</th> + </tr> + <tr> + <td><code>pretty_name</code></td> + <td> + Name used in the user interface. + </td> + </tr> + <tr> + <td><code>callbacks</code></td> + <td> + Callbacks that define how assignment of this role to users is done. + </td> + </tr> +</table> + + +<h3>States</h3> + +<p> + A few typical examples of states: +</p> + +<table cellspacing="1"> + <tr> + <th colspan="2" class="header">Examples of States</th> + </tr> + <tr> + <th>Application</th> + <th>States</th> + </tr> + <tr> + <td>Ticket Tracker</td> + <td> + (Open),(Completed), and (Closed) + </td> + </tr> + <tr> + <td>Bug Tracker</td> + <td> + (Open), (Triaged), (Resolved), and (Closed) + </td> + </tr> + <tr> + <td>Content Management System Publication</td> + <td> + (Authored), (Edited), and (Published) + </td> + </tr> + <tr> + <td>Simple Approval</td> + <td> + (Requested), (Approved), and (Rejected) + </td> + </tr> +</table> + +<p> + These are the state attributes in the workflow specification: +</p> + +<table cellspacing="1"> + <tr> + <th colspan="2" class="header">State Attributes</th> + </tr> + <tr> + <th>Attribute</th> + <th>Description</th> + </tr> + <tr> + <td><code>pretty_name</code></td> + <td> + Name used in the user interface. + </td> + </tr> + <tr> + <td><code>hide_fields</code></td> + <td> + A tcl list of form elements/object attributes that don't make + sense in this state. In bug-tracker, the element "Fixed in + version" doesn't make sense when the bug is (Open), and thus not + yet fixed. It's currently up to your application to do + incorporate this into your application. + </td> + </tr> +</table> + + +<h3>Actions</h3> + +<p> + Actions are what the workflow allows you to do to your object. +</p> + +<blockquote class="note"> + <b>Terminology:</b> + <dl style="margin-left: 24px;"> + <dt>Enabled</dt> + <dd> + The action is allowed to be executed in the workflow's current state. + </dd> + <dt>Allowed</dt> + <dd> + The given user is allowed to execute the action given his + current relationship to the workflow case and the object. + </dd> + <dt>Assigned</dt> + <dd> + The same as allowed, but the action is in-flow for this user. + </dd> + <dt>Available</dt> + <dd> + The action is both enabled and allowed for this user. + </dd> + </dl> +</blockquote> + +<p> + Some actions will <b>always be enabled</b>. In bug-tracker, for + example, we have [Comment] and [Edit] actions, which are always + allowed, regardless of whether the bug is (Open), (Resolved), or + (Closed). +</p> + +<p> + Other actions, however, will only be <b>enabled in certain + states</b>. In bug-tracker, for example, the [Close] action is only + available in the (Resolved) state. +</p> + +<p> + Another distinction is that <b>some actions change the state, and + others do not</b>. [Comment] and [Edit], for example, do + not. [Resolve], [Close], and [Reopen] do. For an FSM, when an action + changes the state, you simply specify what the new state should be. +</p> + +<p> + There's a special action called the <b>initial action</b>. This is + implicitly executed when a new case is started for this workflow, + and must always specify the "new_state" attribute to define which + state new cases start out in. +</p> + +<p> + Attributes for actions: +</p> + +<table cellspacing="1"> + <tr> + <th colspan="2" class="header">Action Attributes</th> + </tr> + <tr> + <th>Attribute</th> + <th>Description</th> + </tr> + <tr> + <td><code>pretty_name</code></td> + <td> + Name used in the user interface. + </td> + </tr> + <tr> + <td><code>pretty_past_tense</code></td> + <td> + This is used in the case log to say "<pretty_past_teense> + by <user> on <date>", for example "Resolved by Jeff + Davis on April 15, 2003". + </td> + </tr> + <tr> + <td><code>new_state</code></td> + <td> + The short_name of the state this action puts the case + into. Leave out if the action shouldn't change the state. + </td> + </tr> + <tr> + <td><code>initial_action_p</code></td> + <td> + Say 't' if this is the initial action. Leave out or set to 'f' otherwise. + </td> + </tr> + <tr> + <td><code>allowed_roles</code></td> + <td> + A list of roles that are allowed but not assigned to perform this action. + </td> + </tr> + <tr> + <td><code>assigned_role</code></td> + <td> + A single role which is assigned to this action. + </td> + </tr> + <tr> + <td><code>privileges</code></td> + <td> + A list of privileges. Users who have been granted one of these + privileges on the case's object will be allowed to execute this action. + </td> + </tr> + <tr> + <td><code>always_enabled_p</code></td> + <td> + Say 't' if this action should be enabled regardless of the + case's current state. Say 'f' or leave out otherwise. + </td> + </tr> + <tr> + <td><code>enabled_states</code></td> + <td> + If not always enabled, enumerate the states in which this action + is enabled <i>but not</i> assigned. + </td> + </tr> + <tr> + <td><code>assigned_states</code></td> + <td> + Enumerate the states in which this action + is enabled <i>and</i> assigned. + </td> + </tr> + <tr> + <td><code>edit_fields</code></td> + <td> + A tcl list of fields which should be opened for editing when the + user is performing this action. Again, it's up to the application + to act on this. + </td> + </tr> + <tr> + <td><code>callbacks</code></td> + <td> + Side-effect callbacks which are executed when this action is executed. + </td> + </tr> +</table> + +<h3>Putting A Workflow Together</h3> + +<p> + When you put this all together, here's a real live example of what + defining a workflow could look like: +</p> + +<pre class="code"> +ad_proc -private bug_tracker::bug::workflow_create {} { + Create the 'bug' workflow for bug-tracker +} { + set spec { + bug { + pretty_name "Bug" + package_key "bug-tracker" + object_type "bt_bug" + callbacks { + bug-tracker.FormatLogTitle + bug-tracker.BugNotificationInfo + } + roles { + submitter { + pretty_name "Submitter" + callbacks { + workflow.Role_DefaultAssignees_CreationUser + } + } + assignee { + pretty_name "Assignee" + callbacks { + bug-tracker.ComponentMaintainer + bug-tracker.ProjectMaintainer + workflow.Role_PickList_CurrentAssignees + workflow.Role_AssigneeSubquery_RegisteredUsers + } + } + } + states { + open { + pretty_name "Open" + hide_fields { resolution fixed_in_version } + } + resolved { + pretty_name "Resolved" + } + closed { + pretty_name "Closed" + } + } + actions { + open { + pretty_name "Open" + pretty_past_tense "Opened" + new_state "open" + initial_action_p t + } + comment { + pretty_name "Comment" + pretty_past_tense "Commented" + allowed_roles { submitter assignee } + privileges { read write } + always_enabled_p t + } + edit { + pretty_name "Edit" + pretty_past_tense "Edited" + allowed_roles { submitter assignee } + privileges { write } + always_enabled_p t + edit_fields { + component_id + summary + found_in_version + role_assignee + fix_for_version + resolution + fixed_in_version + } + } + reassign { + pretty_name "Reassign" + pretty_past_tense "Reassigned" + allowed_role { submitter assignee } + privileges { write } + enabled_states { resolved } + assigned_states { open } + edit_fields { role_assignee } + } + resolve { + pretty_name "Resolve" + pretty_past_tense "Resolved" + assigned_role "assignee" + enabled_states { resolved } + assigned_states { open } + new_state "resolved" + privileges { write } + edit_fields { resolution fixed_in_version } + callbacks { bug-tracker.CaptureResolutionCode } + } + close { + pretty_name "Close" + pretty_past_tense "Closed" + assigned_role "submitter" + assigned_states { resolved } + new_state "closed" + privileges { write } + } + reopen { + pretty_name "Reopen" + pretty_past_tense "Reopened" + allowed_roles { submitter } + enabled_states { resolved closed } + new_state "open" + privileges { write } + } + } + } + } + + set workflow_id [<a href="/api-doc/proc-view?proc=workflow::fsm::new_from_spec">workflow::fsm::new_from_spec</a> -spec $spec] + + return $workflow_id +} +</pre> + + +<h2>Defining Callbacks</h2> + +<p> + There are a number of different types of callbacks, each of which applies to + different workflow items (workflows, roles, states, actions). They're all + defined as service contracts. +</p> + +<p> + In order to make use of them, your application will need to + implement these service contracts, and register the implementation + with the relevant workflow item through the 'callbacks' attribute in + the spec above. +</p> + +<p> + Here are the types of callbacks defined, how they're used, and the + workflow items they apply to. +</p> + +<table cellspacing="1"> + <tr> + <th colspan="3" class="header">Service contracts</th> + </tr> + <tr> + <th>Service Contract</th> + <th>Applies To</th> + <th>Description</th> + </tr> + <tr> + <td><code>Workflow.Role_DefaultAssignees</code></td> + <td> + Roles + </td> + <td> + Used to get the default assignees for a role. Called for all + roles when a case is started. Also called for roles with no + assignees, when that role is assigned to an action. Should return a + list of party_id's. + </td> + </tr> + <tr> + <td><code>Workflow.Role_AssigneePickList</code></td> + <td> + Roles + </td> + <td> + Used when the users wants to reassign a role to populate a + drop-down list of the most likely users/groups to assign this role + to. Should return less than 25 users/groups. Should return a + list of party_id's. + </td> + </tr> + <tr> + <td><code>Workflow.Role_AssigneeSubQuery</code></td> + <td> + Roles + </td> + <td> + A subquery used to limit the scope of the user's search for a + new assignee for a role. Could typically be used to limit the + search to members of a particular group, organizers of a + particular event, etc. + <p> + Should return a subquery ready to be + included in the from-clause of a query, which will be used when + querying for users, for example '(select * from parties where + ...)', (sub-selects must be in parenthesis), or simply + 'cc_users' or 'parties'. Defaults to 'cc_users'. + </td> + </tr> + <tr> + <td><code>Workflow.Action_SideEffect</code></td> + <td> + Workflows, Actions + </td> + <td> + This is executed whenever the given action is executed. If + specified for the workflow, it will be executed whenever any + action is executed on the workflow. For details about how to use + this in conjunction with log entry data and format log title, + see below. + <p> + Side-effects are executed after the application object has been + updated, after the workflow state has been changed, after the + log entry has been crated, and roles assigned, but before + notifications have been sent out. + </td> + </tr> + <tr> + <td><code>Workflow.ActivityLog_FormatTitle</code></td> + <td> + Workflows + </td> + <td> + Used to format the title of the case log. In bug-tracker, this + is used to get the resolution code displayed in the case log as + "Resolved (Fixed)" or "Resolved (Not Reproducable)". + <p> + The implementation should return the text string that should go + into the parenthesis. The parenthesis are automatically added + if the returned string is non-empty. + </td> + </tr> + <tr> + <td><code>Workflow.NotificationInfo</code></td> + <td> + Workflows + </td> + <td> + Allows the application to supply information about the case + object for the notification. + <p> + + Should return the notification information as a 4-element list + containing: + <ol> + <li>url + <li>one-line summary + <li>details about the object in + the form of an array-list with label/value + <li>tag for the notification subject (optional). If present, + it will be put inside brackets []. + </ol> + </td> + </tr> +</table> + +<p> + All the service contracts have 3 operations each. The first two are + the same for all service contracts, and they really just act like + static variables: +</p> + +<table cellspacing="1"> + <tr> + <th colspan="4" class="header">Common service contract operations</th> + </tr> + <tr> + <th>Operation</th> + <th>Input</th> + <th>Output</th> + <th>Description</th> + </tr> + <tr> + <td>GetObjectType</td> + <td> + <i>None</i> + </td> + <td> + object_type:string + </td> + <td> + Get the object type for which this implementation is valid. If + your implementation is valid for any object, return + 'acs_object', otherwise return the object type. + </td> + </tr> + <tr> + <td>GetPrettyName</td> + <td> + <i>None</i> + </td> + <td> + pretty_name:string + </td> + <td> + Get the pretty name of this implementation. This will be used in + the user interface to let the workflow designer pick which + implementation to use. + </td> + </tr> +</table> + +<p> + The third operation is the one that does the real work. Here are the + inputs and outputs: +</p> + +<table cellspacing="1"> + <tr> + <th colspan="4" class="header">Specific service contract operations</th> + </tr> + <tr> + <th>Contract</th> + <th>Operation</th> + <th>Input</th> + <th>Output</th> + </tr> + <tr> + <td> + Workflow.Role_DefaultAssignees + </td> + <td> + GetAssignees + </td> + <td> + case_id:integer<br> + object_id:integer<br> + role_id:integer + </td> + <td> + party_ids:integer,multiple + </td> + </tr> + <tr> + <td>Workflow.Role_AssigneePickList</td> + <td> + GetPickList + </td> + <td> + case_id:integer<br> + object_id:integer<br> + role_id:integer + </td> + <td> + party_ids:integer,multiple + </td> + </tr> + <tr> + <td>Workflow.Role_AssigneeSubQuery</td> + <td> + GetSubquery + </td> + <td> + case_id:integer<br> + object_id:integer<br> + role_id:integer + </td> + <td> + subquery:string + </td> + </tr> + <tr> + <td>Workflow.Action_SideEffect</td> + <td> + DoSideEffect + </td> + <td> + case_id:integer + object_id:integer + action_id:integer + entry_id:integer + </td> + <td> + <i>None</i> + </td> + </tr> + <tr> + <td>Workflow.ActivityLog_FormatTitle</td> + <td> + GetTitle + </td> + <td> + case_id:integer + object_id:integer + action_id:integer + entry_id:integer + data_arraylist:string,multiple + </td> + <td> + title:string + </td> + </tr> + <tr> + <td>Workflow.NotificationInfo</td> + <td> + GetNotificationInfo + </td> + <td> + case_id:integer + object_id:integer + </td> + <td> + info:string,multiple + </td> + </tr> +</table> + +<p> + For the most up-to-date information about the service contracts, + your safest bet is to refer to the user-visible pages of the + acs-service-contract package itself, which will let you view your + currently installed contracts and implementations. +</p> + +<h3>Log Entry Data and Log Entry Titles</h3> + +<p> + One noteworthy thing that side-effects can be used for, is to + record information about a log entry for use later in displaying a + more detailed log entry title, or can be used to e.g. tie a workflow + log entry to a particular content repository revision, etc. +</p> + +<p> + Using <a href="/api-doc/proc-view?proc=workflow::case::add_log_data">workflow::case::add_log_data</a>, you can add arbitrary key/value + pairs to a log entry. These can the be retrieved later using + <a href="/api-doc/proc-view?proc=workflow::case::get_log_data_by_key">workflow::case::get_log_data_by_key</a>, and <a href="/api-doc/proc-view?proc=workflow::case::get_log_data">workflow::case::get_log_data</a>. +</p> + + +<h2>Installing and Instantiating (APM Tcl Callbacks)</h2> + +<p> + Here are the workflow-related operations that you'll typically want + your application to do from the APM Tcl Callbacks: +</p> + +<dl> + <dt>after-install</dt> + <dd> + <ul> + <li>Register service contract implementations + <li>Create default workflow (<code><a href="/api-doc/proc-view?proc=workflow::fsm::new_from_spec">workflow::fsm::new_from_spec</a></code>) + </ul> + </dd> + + <dt>before-uninstall</dt> + <dd> + <ul> + <li>Delete default workflow (<code><a href="/api-doc/proc-view?proc=workflow::delete">workflow::delete</a></code>) + <li>Unregister service contract implementations + </ul> + </dd> + + <dt>before-upgrade</dt> + <dd> + <ul> + <li>Add new service contract implementations + <li>Add new workflows + <li>Make changes to existing default workflows (if the installed + verison is not modified) (this isn't yet supported on the workflow API) + </ul> + </dd> + + <dt>after-instantiate</dt> + <dd> + <ul> + <li> + Clone default workflow to create a new workflow attached to + the instance (<code><a href="/api-doc/proc-view?proc=workflow::fsm::clone">workflow::fsm::clone</a></code>) + </li> + </ul> + </dd> + + <dt>before-uninstantiate</dt> + <dd> + <ul> + <li> + Delete the workflow attached to the instance (<code><a href="/api-doc/proc-view?proc=workflow::delete">workflow::delete</a></code>) + </li> + </ul> + </dd> +</dl> + +<p> + To see what this could look like in practice, check out + <code>packages/bug-tracker/tcl/install-procs.tcl</code>. +</p> + + +<h2>Integrating With Your Application's API</h2> + +<p> + Newer applications will define a namespace for each of the objects + it defines, which will contain procs like "get", "new", "delete", + etc., to manipulate these objects. +</p> + +<p> + Given such a setup, here are the procs that you want to integrate + workflow into for your workflow-integrated objects. For a real-life + example, see <code>packages/bug-tracker/tcl/bug-procs.tcl</code> and + search for "workflow::". +</p> + +<dl> + <dt>get</dt> + <dd> + In addition to your application's object data, you'll want to call + <code><a href="/api-doc/proc-view?proc=workflow::case::get_id">workflow::case::get_id</a></code> to get the case_id for your + object, and then either <code><a href="/api-doc/proc-view?proc=workflow::case::get">workflow::case::get</a></code> or + <code><a href="/api-doc/proc-view?proc=workflow::case::fsm::get">workflow::case::fsm::get</a></code> in order to get state + information from workflow to include in the data set returned by + your API proc. + </dd> + + <dt>new</dt> + <dd> + When creating a new object, you should also start a new workflow + case for that object using <code><a href="/api-doc/proc-view?proc=workflow::case::new">workflow::case::new</a></code>. + </dd> + + <dt>edit</dt> + <dd> + Editing an object should only happen through a workflow action, if + you want to have a complete audit log (workflow case log). Thus, + your edit proc should take the following arguments, in addition to + the object_id and the array containing the object data: + <pre> + -action_id:required + -comment:required + -comment_format:required + {-entry_id {}} + </pre> + (entry_id is for double-click protection). + <p> + First, you should update your application object data as normal. + Then you'll probably want to use + <code><a href="/api-doc/proc-view?proc=workflow::case::get_id">workflow::case::get_id</a></code> to find the case_id. If you + have assignment integrated in your form, you'll want to call + <code><a href="/api-doc/proc-view?proc=workflow::case::role::assign">workflow::case::role::assign</a></code> to pass these on to + workflow, and finally you'll say + <code><a href="/api-doc/proc-view?proc=workflow::case::action::execute">workflow::case::action::execute</a></code> to execute the + action, including state changes, side-effects, and notifications. + </dd> +</dl> + +<h2>Integrating With Your Application's User Interface</h2> + +<p> + Usually, you'll want one page that lists all the objects in your + package instance, and another that lets the user view/edit one + object, called the object form page. This section is about the + object form page, the next section is about the object listing page. +</p> + +<p> + For a real-life example, look at + <code>packages/bug-tracker/www/bug.tcl</code>. You may want to have + that handy while reading through this. +</p> + +<p> + We're hoping to make some streamlining of both ad_form and workflow + to make this form page integration even easier at some point. But no promises. +</p> + +<p> + Use <code><a href="/api-doc/proc-view?proc=workflow::case::get_id">workflow::case::get_id</a></code> to get the case_id. +</p> + +<p> + If you want buttons along the bottom of the form like bug-tracker, + use the new 'action' feature of the form builder. What you do is + pass a list of possible actions to the form builder as a + list-of-lists with { label value }. These will be + displayed as buttons at the bottom of the form. +</p> + +<p> + When one of these buttons are clicked, the form will be in + edit-mode, and you can use <code>form get_action</code> to get the + value of the action chosen. +</p> + +<p> + So up top, you'll want to ask the form if an action is in progress, + and which one it is, by saying <code>set action_id [form get_action + <i>form-id</i>]</code>. If no action is in progress this will return + the empty string. +</p> + +<p> + Then you should check that this action is currently available to + this user by saying + <code><a href="/api-doc/proc-view?proc=workflow::case::action::available_p">workflow::case::action::available_p</a></code>. +</p> + +<p> + To get the currently available actions so you can offer them to the + user, use <code><a href="/api-doc/proc-view?proc=workflow::case::get_available_actions">workflow::case::get_available_actions</a></code> which + will return the action_id's, then <code><a href="/api-doc/proc-view?proc=workflow::action::get">workflow::action::get</a></code> + to get the details about each of the actions. +</p> + +<p> + If you're using <code>ad_form</code>, and you want only one assignee + per role, and you want assignment integrated with your form, use + <code><a href="/api-doc/proc-view?proc=workflow::case::role::add_assignee_widgets">workflow::case::role::add_assignee_widgets</a></code> to add the + widgets. It'll do an <code>ad_form -extend</code>, so they'll appear + at the point at which you call this proc. +</p> + +<p> + To set the editable fields as defined for the action, do this: +</p> + +<pre> +if { ![empty_string_p $action_id] } { + foreach field [<a href="/api-doc/proc-view?proc=workflow::action::get_element">workflow::action::get_element</a> -action_id $action_id -element edit_fields] { + element set_properties bug $field -mode edit + } +} +</pre> + +<p> + Similarly, on submit, you'll want to set the value of the editable fields. +</p> + +<p> + To populate values of the assignee widgets, use + <code><a href="/api-doc/proc-view?proc=workflow::case::role::set_assignee_values">workflow::case::role::set_assignee_values</a></code> in your + <code>on_request</code> block. +</p> + +<p> + To add the case log to the comment field, use + <code><a href="/api-doc/proc-view?proc=workflow::case::get_activity_html">workflow::case::get_activity_html</a></code> and feed it to the + <code>before_html</code> property of a textarea. +</p> + + +<h2>Integrating With Your Application's Queries</h2> + +<p> + Here's an example of how the bug-tracker integrates with workflow + for nformation about the current state of bugs. +</p> + +<blockquote><pre> +select b.bug_id, + ... + + st.pretty_name as pretty_state, + st.short_name as state_short_name, + st.state_id, + st.hide_fields, + + assignee.party_id as assignee_party_id, + assignee.email as assignee_email, + assignee.name as assignee_name + +from bt_bugs b, + workflow_cases cas left outer join + (select rpm.case_id, + p.party_id, + p.email, + acs_object__name(p.party_id) as name + from workflow_case_role_party_map rpm, + parties p + where rpm.role_id = :action_role + and p.party_id = rpm.party_id + ) assignee on (cas.case_id = assignee.case_id), + workflow_case_fsm cfsm, + workflow_fsm_states st +where cas.workflow_id = :workflow_id +and cas.object_id = b.bug_id +and cfsm.case_id = cas.case_id +and st.state_id = cfsm.current_state +and b.project_id = :package_id +order by $order_by_clause +</pre></blockquote> + +<p> + Note the outer join to get the assignee(s). The joins to get + information about the current state is straight-forward. +</p> + +<h2>Good Luck!</h2> + +<p> + That's all I think you'll need to know to start developing + workflow-enabled applications. +</p> + +<p> + Let me know how it goes, or of something's missing, by posting on + the <a href="http://openacs.org/forums/">OpenACS Forums</a>. +</p> + <hr> <a href="mailto:lars@pinds.com"><address>lars@pinds.com</address></a> Index: openacs-4/packages/workflow/www/doc/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/www/doc/index.html,v diff -u -r1.1 -r1.2 --- openacs-4/packages/workflow/www/doc/index.html 5 Mar 2003 17:19:09 -0000 1.1 +++ openacs-4/packages/workflow/www/doc/index.html 28 Aug 2003 09:41:59 -0000 1.2 @@ -2,17 +2,21 @@ <title>Workflow Documentation</title> <style> dt { margin-top: 12px; font-weight: bold; } + body { font-family: verdana, helvetica, sans-serif; } + li { margin-top: 12px; } </style> <body> <h1>Workflow Documentation</h1> +Workflow Documentation + +<hr> + <p> By <a href="http://www.pinds.com">Lars Pind</a> </p> -<hr> - <p> The workflow package provides a service to keep track of a process involving multiple people around some object. Workflow keeps track @@ -37,10 +41,84 @@ </dt> <dd> This is the document we wrote before implementing workflow specifying - how we intended to implement the package then. + how we intended to implement the package then. It is inaccurate in a + number of places where reality forced us to make changes. </dd> </dl> +<h2>Version History</h2> + +<ul> + <li> + <b>1.0d4</b> Resolved conflicts with old acs-workflow package, so they install side by side. (May 11, 2003) + </li> + <li> + <b>1.0d3</b> Added Tcl API workflow::case::delete ; + fixed bug in PL/SQL implementation of workflow_case.delete/workflow_case__delete ; + added @see to workflow::case::insert. + </li> + <li> + <b>1.0d2</b> Completed package developer's guide. Added -action_id + switch to workflow::case::get_activity_html. </li> + + <li> + <b>1.0d1</b> Bumped up the version number to 1.0 to reflect the + fact that this package is actually at a steady state and fully + useful as is. Also added a little API and cleaned up things a bit, + the kind of things you learn while writing the documentation. + </li> + + <li> + <b>0.2d2</b> First version released along with OpenACS 4.6.2. + </li> +</ul> + +<h2>Todo</h2> + +<ul> + <li> + Internationalization. + </li> + <li> + Add API for modifying live workflows, including ensuring that the modifications are + always safe (i.e. you can't delete a state that's used.) + </li> + <li> + Add a user interface for defining workflows. + </li> + <li> + Add a user interface for monitoring workflows and bulk changing + the state of workflows. + </li> + <li> + Periodically notify people of their outstanding assigned actions. + </li> + <li> + Add a task list user interface, either as part of the Workflow package, or as a separate pacakge. + </li> + <li> + Add support for petri nets and other models. + </li> + <li> + Add timing of actions, deadlines, and integrate those with calendar. + </li> + <li> + Application integration with certain states and actions. For + example, in bug-tracker, we treat the "Open" and "Closed" states + specially. We also treat the "Resolve" action specially. Should be + possible to define this link. + </li> + <li> + Add workflow variants, so you can ship your application with + multiple default implementations of the same workflow and let the + user choose between the available variants (e.g. simple approval + vs. multiple approval variants, choice of triage and Q&A steps in + the bug-tracker, etc.). This should probably be tied to some + concept of an 'application' as in the bullet above. + </li> +</ul> + + <hr> <a href="mailto:lars@pinds.com"><address>lars@pinds.com</address></a> Index: openacs-4/packages/workflow/www/doc/specification.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/www/doc/specification.html,v diff -u -r1.1 -r1.2 --- openacs-4/packages/workflow/www/doc/specification.html 5 Mar 2003 17:19:09 -0000 1.1 +++ openacs-4/packages/workflow/www/doc/specification.html 28 Aug 2003 09:41:59 -0000 1.2 @@ -1,9 +1,18 @@ <html> -<title>Workflow Specification</title> +<title>Workflow Functional Specification</title> +<style> + dt { margin-top: 12px; font-weight: bold; } + body { font-family: verdana, helvetica, sans-serif; } + li { margin-top: 12px; } +</style> <body> -<h1>Workflow Specification</h1> +<h1>Workflow Functional Specification</h1> +<a href="index.html">Workflow Documentation</a> : Functional Specification + +<hr> + <p> By <a href="http://www.pinds.com">Lars Pind</a> </p> @@ -158,7 +167,7 @@ </p> <p> - A workflow is associated with an oject, which would typically be one + A workflow is associated with an object, which would typically be one of the following: </p> Index: openacs-4/packages/wp-slim/wp-slim.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/wp-slim.info,v diff -u -r1.11 -r1.12 --- openacs-4/packages/wp-slim/wp-slim.info 17 May 2003 12:49:05 -0000 1.11 +++ openacs-4/packages/wp-slim/wp-slim.info 28 Aug 2003 09:41:59 -0000 1.12 @@ -6,191 +6,24 @@ <pretty-plural>Wimpy Points</pretty-plural> <initial-install-p>f</initial-install-p> <singleton-p>f</singleton-p> - - <version name="4.0b1" url="http://arsdigita.com/acs-repository/download/apm/wp-slim-4.0b1.apm"> + + <version name="4.1" url="http://arsdigita.com/acs-repository/download/apm/wp-slim-4.1.apm"> <database-support> <database>oracle</database> <database>postgresql</database> </database-support> - <owner url="mailto:purswami@ebt.ee.usyd.edu.au">Jack Purswani -and Sidharth Widge(Porter)</owner> - <owner url="mailto:paulk@arsdigita.com">Paul Konigsberg</owner> - <owner url="mailto:hqin@arsdigita.com">Haolan Qin</owner> + <owner url="mailto:roc@viaro.net">Rocael Hernandez Rizzardini</owner> <summary>Wimpy Point allows users to collaborate and share online presentations.</summary> - <release-date>2001-01-26</release-date> - <vendor url="http://arsdigita.com/">ArsDigita Corporation</vendor> - <description format="text/plain">Ported (Jack). Fixed several bugs. Added new features (e.g. versioning and authorization).</description> + <release-date>2003-08-07</release-date> + <vendor url="http://openacs.org/">Openacs</vendor> + <description format="text/plain">Scalability test, permission revision, enhancements from WPII and other features added (Rocael). Ported (Jack). Fixed several bugs. Added new features (e.g. versioning and authorization).</description> <requires url="acs-content-repository" version="4.6.3"/> - <requires url="acs-kernel" version="4.6.2"/> + <requires url="acs-kernel" version="4.0"/> + <requires url="general-comments" version="4.0"/> - <files> - <file type="java_code" path="java/src/com/arsdigita/acs/wpSlim/test/WPSlimTest.java"/> - <file type="data_model_upgrade" db_type="oracle" path="sql/oracle/upgrade-4.0b-4.0b1.sql"/> - <file type="data_model_create" db_type="oracle" path="sql/oracle/wp-slim-create.sql"/> - <file type="data_model_drop" db_type="oracle" path="sql/oracle/wp-slim-drop.sql"/> - <file type="data_model_create" db_type="postgresql" path="sql/postgresql/wp-slim-create.sql"/> - <file type="data_model_drop" db_type="postgresql" path="sql/postgresql/wp-slim-drop.sql"/> - <file type="package_spec" path="wp-slim.info"/> - <file type="query_file" db_type="oracle" path="www/attach-del-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/attach-del-postgresql.xql"/> - <file type="content_page" path="www/attach-del.tcl"/> - <file type="query_file" db_type="oracle" path="www/attach-detail-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/attach-detail-postgresql.xql"/> - <file type="content_page" path="www/attach-detail.adp"/> - <file type="content_page" path="www/attach-detail.tcl"/> - <file type="query_file" path="www/attach-detail.xql"/> - <file type="content_page" path="www/attach-list.adp"/> - <file type="content_page" path="www/attach-list.tcl"/> - <file type="query_file" path="www/attach-list.xql"/> - <file type="content_page" path="www/attach.tcl"/> - <file type="query_file" path="www/attach.xql"/> - <file type="query_file" db_type="oracle" path="www/create-presentation-2-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/create-presentation-2-postgresql.xql"/> - <file type="content_page" path="www/create-presentation-2.tcl"/> - <file type="content_page" path="www/create-presentation.adp"/> - <file type="content_page" path="www/create-presentation.tcl"/> - <file type="query_file" db_type="oracle" path="www/create-slide-2-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/create-slide-2-postgresql.xql"/> - <file type="content_page" path="www/create-slide-2.tcl"/> - <file type="content_page" path="www/create-slide.adp"/> - <file type="content_page" path="www/create-slide.tcl"/> - <file type="query_file" path="www/create-slide.xql"/> - <file type="query_file" db_type="oracle" path="www/delete-presentation-2-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/delete-presentation-2-postgresql.xql"/> - <file type="content_page" path="www/delete-presentation-2.tcl"/> - <file type="content_page" path="www/delete-presentation.adp"/> - <file type="content_page" path="www/delete-presentation.tcl"/> - <file type="query_file" db_type="oracle" path="www/delete-slide-2-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/delete-slide-2-postgresql.xql"/> - <file type="content_page" path="www/delete-slide-2.tcl"/> - <file type="content_page" path="www/delete-slide.adp"/> - <file type="content_page" path="www/delete-slide.tcl"/> - <file type="content_page" path="www/dev-doc.html"/> - <file type="content_page" path="www/display-change.tcl"/> - <file type="query_file" path="www/display-change.xql"/> - <file type="query_file" db_type="oracle" path="www/edit-presentation-2-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/edit-presentation-2-postgresql.xql"/> - <file type="content_page" path="www/edit-presentation-2.tcl"/> - <file type="content_page" path="www/edit-presentation.adp"/> - <file type="content_page" path="www/edit-presentation.tcl"/> - <file type="query_file" path="www/edit-presentation.xql"/> - <file type="query_file" db_type="oracle" path="www/edit-slide-2-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/edit-slide-2-postgresql.xql"/> - <file type="content_page" path="www/edit-slide-2.tcl"/> - <file type="query_file" path="www/edit-slide-2.xql"/> - <file type="query_file" db_type="oracle" path="www/edit-slide-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/edit-slide-postgresql.xql"/> - <file type="content_page" path="www/edit-slide.adp"/> - <file type="content_page" path="www/edit-slide.tcl"/> - <file type="content_page" path="www/get-binary-data.tcl"/> - <file type="content_page" path="www/help/userops.html"/> - <file type="query_file" db_type="oracle" path="www/index-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/index-postgresql.xql"/> - <file type="content_page" path="www/index-unregistered.adp"/> - <file type="content_page" path="www/index.adp"/> - <file type="content_page" path="www/index.tcl"/> - <file type="content_page" path="www/index.vuh"/> - <file type="content_page" path="www/invite-2.adp"/> - <file type="content_page" path="www/invite-2.tcl"/> - <file type="query_file" path="www/invite-2.xql"/> - <file type="content_page" path="www/invite.adp"/> - <file type="content_page" path="www/invite.tcl"/> - <file type="query_file" db_type="oracle" path="www/live-revision-set-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/live-revision-set-postgresql.xql"/> - <file type="content_page" path="www/live-revision-set.tcl"/> - <file type="content_page" path="www/pics/1white.gif"/> - <file type="content_page" path="www/pics/arrow.gif"/> - <file type="content_page" path="www/pics/down.gif"/> - <file type="content_page" path="www/pics/up.gif"/> - <file type="content_page" path="www/presentation-acl-add-2.adp"/> - <file type="content_page" path="www/presentation-acl-add-2.tcl"/> - <file type="query_file" path="www/presentation-acl-add-2.xql"/> - <file type="query_file" db_type="oracle" path="www/presentation-acl-add-3-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/presentation-acl-add-3-postgresql.xql"/> - <file type="content_page" path="www/presentation-acl-add-3.tcl"/> - <file type="query_file" path="www/presentation-acl-add-3.xql"/> - <file type="content_page" path="www/presentation-acl-add-group-2.adp"/> - <file type="content_page" path="www/presentation-acl-add-group-2.tcl"/> - <file type="query_file" path="www/presentation-acl-add-group-2.xql"/> - <file type="query_file" db_type="oracle" path="www/presentation-acl-add-group-3-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/presentation-acl-add-group-3-postgresql.xql"/> - <file type="content_page" path="www/presentation-acl-add-group-3.tcl"/> - <file type="content_page" path="www/presentation-acl-add-group.adp"/> - <file type="content_page" path="www/presentation-acl-add-group.tcl"/> - <file type="query_file" path="www/presentation-acl-add-group.xql"/> - <file type="content_page" path="www/presentation-acl-add.adp"/> - <file type="content_page" path="www/presentation-acl-add.tcl"/> - <file type="query_file" db_type="oracle" path="www/presentation-acl-delete-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/presentation-acl-delete-postgresql.xql"/> - <file type="content_page" path="www/presentation-acl-delete.tcl"/> - <file type="content_page" path="www/presentation-acl.adp"/> - <file type="content_page" path="www/presentation-acl.tcl"/> - <file type="query_file" path="www/presentation-acl.xql"/> - <file type="query_file" db_type="oracle" path="www/presentation-public-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/presentation-public-postgresql.xql"/> - <file type="content_page" path="www/presentation-public.tcl"/> - <file type="query_file" path="www/presentation-public.xql"/> - <file type="query_file" db_type="oracle" path="www/presentation-publish-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/presentation-publish-postgresql.xql"/> - <file type="content_page" path="www/presentation-publish.tcl"/> - <file type="query_file" db_type="oracle" path="www/presentation-revisions-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/presentation-revisions-postgresql.xql"/> - <file type="content_page" path="www/presentation-revisions.adp"/> - <file type="content_page" path="www/presentation-revisions.tcl"/> - <file type="query_file" db_type="oracle" path="www/presentation-top-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/presentation-top-postgresql.xql"/> - <file type="content_page" path="www/presentation-top.adp"/> - <file type="content_page" path="www/presentation-top.tcl"/> - <file type="query_file" path="www/presentation-top.xql"/> - <file type="content_page" path="www/serve-presentation-revision.adp"/> - <file type="content_page" path="www/serve-presentation-revision.tcl"/> - <file type="query_file" path="www/serve-presentation-revision.xql"/> - <file type="content_page" path="www/serve-presentation.adp"/> - <file type="content_page" path="www/serve-presentation.tcl"/> - <file type="query_file" path="www/serve-presentation.xql"/> - <file type="query_file" db_type="oracle" path="www/serve-slide-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/serve-slide-postgresql.xql"/> - <file type="query_file" db_type="oracle" path="www/serve-slide-revision-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/serve-slide-revision-postgresql.xql"/> - <file type="content_page" path="www/serve-slide-revision.adp"/> - <file type="content_page" path="www/serve-slide-revision.tcl"/> - <file type="query_file" path="www/serve-slide-revision.xql"/> - <file type="content_page" path="www/serve-slide.adp"/> - <file type="content_page" path="www/serve-slide.tcl"/> - <file type="query_file" path="www/serve-slide.xql"/> - <file type="query_file" db_type="oracle" path="www/slide-publish-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/slide-publish-postgresql.xql"/> - <file type="content_page" path="www/slide-publish.tcl"/> - <file type="query_file" db_type="oracle" path="www/slide-revisions-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/slide-revisions-postgresql.xql"/> - <file type="content_page" path="www/slide-revisions.adp"/> - <file type="content_page" path="www/slide-revisions.tcl"/> - <file type="content_page" path="www/slides-reorder-2.tcl"/> - <file type="query_file" path="www/slides-reorder-2.xql"/> - <file type="content_page" path="www/slides-reorder.adp"/> - <file type="content_page" path="www/slides-reorder.tcl"/> - <file type="query_file" path="www/slides-reorder.xql"/> - <file type="content_page" path="www/upload-attachments.adp"/> - <file type="content_page" path="www/user-requirements.html"/> - <file type="content_page" path="www/users.adp"/> - <file type="content_page" path="www/users.tcl"/> - <file type="query_file" path="www/users.xql"/> - <file type="query_file" db_type="oracle" path="www/attach-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/attach-postgresql.xql"/> - <file type="content_page" path="www/developer-doc.html"/> - <file type="query_file" db_type="oracle" path="www/edit-presentation-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/edit-presentation-postgresql.xql"/> - <file type="content_page" path="www/help/user-ops.html"/> - <file type="content_page" path="www/presentation-print-view.adp"/> - <file type="content_page" path="www/presentation-print-view.tcl"/> - <file type="query_file" path="www/presentation-print-view.xql"/> - <file type="content_page" path="www/search.adp"/> - <file type="content_page" path="www/search.tcl"/> - <file type="query_file" path="www/search.xql"/> - <file type="query_file" db_type="oracle" path="www/serve-presentation-revision-oracle.xql"/> - <file type="query_file" db_type="postgresql" path="www/serve-presentation-revision-postgresql.xql"/> - </files> + <callbacks> + </callbacks> <parameters> <!-- No version parameters --> </parameters> Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/sql/oracle/upgrade-4.0b-4.0b1.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/wp-slim/sql/oracle/wp-slim-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/sql/oracle/wp-slim-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/wp-slim/sql/oracle/wp-slim-create.sql 17 May 2003 12:49:23 -0000 1.4 +++ openacs-4/packages/wp-slim/sql/oracle/wp-slim-create.sql 28 Aug 2003 09:41:59 -0000 1.5 @@ -40,30 +40,51 @@ where not exists (select 1 from cr_mime_types where mime_type = 'application/octet-stream'); +create sequence wp_style_seq; + create table wp_styles ( style_id integer constraint wp_styles_style_id_pk primary key, name varchar2(400) constraint wp_styles_name_nn not null, - -- CSS source css varchar(4000), - -- HTML style properties. Colors are in the form '192,192,255'. - text_color varchar2(20) check(text_color like '%,%,%'), - background_color varchar2(20) check(background_color like '%,%,%'), - background_image varchar2(200), - link_color varchar2(20) check(link_color like '%,%,%'), - alink_color varchar2(20) check(alink_color like '%,%,%'), - vlink_color varchar2(20) check(vlink_color like '%,%,%') + text_color varchar(20) check(text_color like '%,%,%'), + background_color varchar(20) check(background_color like '%,%,%'), + background_image integer default 0, + link_color varchar(20) check(link_color like '%,%,%'), + alink_color varchar(20) check(alink_color like '%,%,%'), + vlink_color varchar(20) check(vlink_color like '%,%,%'), + public_p char(1) default 'f' check(public_p in ('t','f')), + owner integer + constraint wp_styles_to_users + references users (user_id) ); --- Insert the magic, "default" style. + insert into wp_styles(style_id, name, css) values(-1, 'Default (Plain)', 'BODY { back-color: white; color: black } P { line-height: 120% } UL { line-height: 140% }'); +-- this is also a new index! roc@ +create index wp_styles_by_owner on wp_styles(owner); +-- new table for supporting background images! +-- Images used for styles. + +create table wp_style_images ( +-- this one references to a cr! + wp_style_images_id integer primary key, + style_id integer references wp_styles(style_id) on delete cascade not null, + file_size integer not null, + file_name varchar(200) not null +); + +create index wp_style_images_style_id on wp_style_images(style_id); + + + create table cr_wp_presentations ( presentation_id integer constraint cr_wp_presentations_id_fk @@ -88,7 +109,10 @@ -- Show last-modified date for slides? show_modified_p char(1) default 'f' constraint cr_wp_show_p_ck - check(show_modified_p in ('t','f')) + check(show_modified_p in ('t','f')), + show_comments_p char(1) default 'f' + constraint cr_wp_pres_show_comments_p + check(show_comments_p in ('t','f')) ); @@ -533,20 +557,7 @@ show errors --- begin - -- bind privileges to global names - - -- acs_privilege.add_child('create','wp_create_presentation'); - -- acs_privilege.add_child('write','wp_edit_presentation'); - -- acs_privilege.add_child('delete','wp_delete_presentation'); - -- acs_privilege.add_child('read','wp_view_presentation'); - -- commit; --- end; --- / --- show errors - - declare default_context acs_objects.object_id%TYPE; registered_users acs_objects.object_id%TYPE; @@ -555,7 +566,7 @@ default_context := acs.magic_object_id('default_context'); registered_users := acs.magic_object_id('registered_users'); - the_public := acs.magic_object_id('the_public'); +-- the_public := acs.magic_object_id('the_public'); -- give registered users the power to create presentations by default @@ -567,11 +578,12 @@ -- give the public the power to view by default - acs_permission.grant_permission ( - object_id => default_context, - grantee_id => the_public, - privilege => 'wp_view_presentation' - ); +-- this commented out because permission, with this any user could see an slide that has not become public! +-- acs_permission.grant_permission ( +-- object_id => default_context, +-- grantee_id => the_public, +-- privilege => 'wp_view_presentation' +-- ); end; / @@ -1672,4 +1684,90 @@ show errors +-- adding some new permissions roc@ + +Begin + + acs_privilege.add_child('wp_edit_presentation', 'wp_view_presentation'); + acs_privilege.add_child('wp_admin_presentation', 'wp_create_presentation'); + acs_privilege.add_child('wp_admin_presentation', 'wp_edit_presentation'); + acs_privilege.add_child('wp_admin_presentation', 'wp_delete_presentation'); + +-- lets give site-wide permissions, wp-permissions! + acs_privilege.add_child('admin', 'wp_admin_presentation'); + +end; +/ + +--style package roc@ + +create or replace package wp_style +as + +procedure delete ( + p_style_id in wp_styles.style_id%TYPE +); + +procedure image_delete( + p_revision_id in wp_style_images.wp_style_images_id%TYPE +); + +end wp_style; +/ +show errors + + + +create or replace package body wp_style +as + +procedure delete ( + p_style_id in wp_styles.style_id%TYPE +) +is + p_item_id integer; +begin + + for one_image in ( + select * from wp_style_images + where wp_style_images_id = (select background_image from wp_styles where style_id = wp_style.delete.p_style_id)) + loop + delete from wp_style_images where wp_style_images_id = one_image.wp_style_images_id; + select item_id into p_item_id from cr_revisions where revision_id = one_image.wp_style_images_id; + + content_item.delete(item_id => p_item_id); + end loop; + + update cr_wp_slides set style = -1 where style = wp_style.delete.p_style_id; + update cr_wp_presentations set style = -1 where style = wp_style.delete.p_style_id; + delete from wp_styles where style_id = wp_style.delete.p_style_id; + +end; + + + +procedure image_delete( + p_revision_id in wp_style_images.wp_style_images_id%TYPE +) +is + p_item_id integer; +begin + + update wp_styles set background_image = 0 where background_image = wp_style.image_delete.p_revision_id; + + delete from wp_style_images + where wp_style_images_id = wp_style.image_delete.p_revision_id; + + select item_id into p_item_id from cr_revisions where revision_id = wp_style.image_delete.p_revision_id; + + content_item.delete(item_id => p_item_id); + +end; + + +end wp_style; +/ +show errors + + commit; Index: openacs-4/packages/wp-slim/sql/oracle/wp-slim-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/sql/oracle/wp-slim-drop.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/wp-slim/sql/oracle/wp-slim-drop.sql 13 Mar 2002 22:50:53 -0000 1.3 +++ openacs-4/packages/wp-slim/sql/oracle/wp-slim-drop.sql 28 Aug 2003 09:41:59 -0000 1.4 @@ -195,25 +195,35 @@ default_context := acs.magic_object_id('default_context'); registered_users := acs.magic_object_id('registered_users'); - the_public := acs.magic_object_id('the_public'); +-- the_public := acs.magic_object_id('the_public'); acs_permission.revoke_permission ( object_id => default_context, grantee_id => registered_users, privilege => 'wp_create_presentation' ); - acs_permission.revoke_permission ( - object_id => default_context, - grantee_id => the_public, - privilege => 'wp_view_presentation' - ); +-- acs_permission.revoke_permission ( +-- object_id => default_context, +-- grantee_id => the_public, +-- privilege => 'wp_view_presentation' +-- ); end; / show errors begin + + + acs_privilege.remove_child('admin', 'wp_admin_presentation'); + + acs_privilege.remove_child('wp_edit_presentation', 'wp_view_presentation'); + acs_privilege.remove_child('wp_admin_presentation', 'wp_create_presentation'); + acs_privilege.remove_child('wp_admin_presentation', 'wp_edit_presentation'); + acs_privilege.remove_child('wp_admin_presentation', 'wp_delete_presentation'); + + delete from acs_permissions where privilege in ('wp_admin_presentation', 'wp_create_presentation', 'wp_edit_presentation', 'wp_delete_presentation', 'wp_view_presentation'); acs_privilege.drop_privilege('wp_admin_presentation'); @@ -253,6 +263,15 @@ drop view cr_wp_presentationsx; drop table cr_wp_presentations; +-- droping style definitions roc@ + +drop package wp_style; + + +drop sequence wp_style_seq; + +drop table wp_style_images; + drop table wp_styles; commit; Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/sql/oracle/upgrade/upgrade-4.0b-4.0b1.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/sql/oracle/upgrade/upgrade-4.0b1-4.6.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/sql/postgresql/wp-packages-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/wp-slim/sql/postgresql/wp-slim-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/sql/postgresql/wp-slim-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/wp-slim/sql/postgresql/wp-slim-create.sql 17 May 2003 12:49:58 -0000 1.7 +++ openacs-4/packages/wp-slim/sql/postgresql/wp-slim-create.sql 28 Aug 2003 09:42:00 -0000 1.8 @@ -38,27 +38,51 @@ from dual where not exists (select 1 from cr_mime_types where mime_type ='application/octet-stream'); ---jackp: Create the different styles + +create sequence wp_style_seq; + create table wp_styles ( style_id integer constraint wp_styles_style_id_pk primary key, name varchar(400) constraint wp_styles_name_nn not null, - css varchar(4000), + css text, text_color varchar(20) check(text_color like '%,%,%'), background_color varchar(20) check(background_color like '%,%,%'), - background_image varchar(200), + background_image integer default 0, link_color varchar(20) check(link_color like '%,%,%'), alink_color varchar(20) check(alink_color like '%,%,%'), - vlink_color varchar(20) check(vlink_color like '%,%,%') + vlink_color varchar(20) check(vlink_color like '%,%,%'), + public_p char(1) default 'f' check(public_p in ('t','f')), + owner integer + constraint wp_styles_to_users + references users (user_id) ); + insert into wp_styles(style_id, name, css) values(-1, 'Default (Plain)', 'BODY { back-color: white; color: black } P { line-height: 120% } UL { line-height: 140% }'); +-- this is also a new index! roc@ +create index wp_styles_by_owner on wp_styles(owner); + +-- new table for supporting background images! +-- Images used for styles. + +create table wp_style_images ( +-- this one references to a cr! + wp_style_images_id integer primary key, + style_id integer references wp_styles(style_id) on delete cascade not null, + file_size integer not null, + file_name varchar(200) not null +); + +create index wp_style_images_style_id on wp_style_images(style_id); + + --jackp: p_create the presentation table create table cr_wp_presentations ( presentation_id integer @@ -84,7 +108,10 @@ -- Show last-modified date for slide? show_modified_p boolean constraint cr_wp_show_p_ck - check(show_modified_p in ('t','f')) + check(show_modified_p in ('t','f')), + show_comments_p char(1) default 'f' + constraint cr_wp_comments_p + check(show_comments_p in ('t','f')) ); @@ -684,6 +711,7 @@ select inline_10 (); drop function inline_10 (); + --jackp: set the permissions applicable to the package create function inline_11 () returns integer as' @@ -694,1132 +722,32 @@ begin default_context := acs__magic_object_id(''default_context''); registered_users := acs__magic_object_id(''registered_users''); - the_public := acs__magic_object_id(''the_public''); +-- the_public := acs__magic_object_id(''the_public''); PERFORM acs_permission__grant_permission( default_context, registered_users, ''wp_create_presentation'' ); - PERFORM acs_permission__grant_permission( - default_context, - the_public, - ''wp_view_presentation'' - ); +-- this commented out because permission, with this any user could see an slide that has not become public! +-- PERFORM acs_permission__grant_permission( +-- default_context, +-- the_public, +-- ''wp_view_presentation'' +-- ); return 0; end;' language 'plpgsql'; select inline_11 (); drop function inline_11 (); ---jackp: From here on the functions are defined +-- new permissions roc@ +select acs_privilege__add_child('wp_edit_presentation', 'wp_view_presentation'); +select acs_privilege__add_child('wp_admin_presentation', 'wp_create_presentation'); +select acs_privilege__add_child('wp_admin_presentation', 'wp_edit_presentation'); +select acs_privilege__add_child('wp_admin_presentation', 'wp_delete_presentation'); ---jackp: To p_create each presentation -create function wp_presentation__new ( - timestamptz, - integer, - varchar(400), - varchar(400), - varchar(400), - varchar, - integer, - boolean, - boolean, - varchar, - varchar, - integer -) -returns integer as' -declare - p_creation_date alias for $1; - p_creation_user alias for $2; - p_creation_ip alias for $3; - p_pres_title alias for $4; - p_page_signature alias for $5; - p_copyright_notice alias for $6; - p_style alias for $7; - p_public_p alias for $8; - p_show_modified_p alias for $9; - aud alias for $10; - back alias for $11; - p_parent_id alias for $12; - v_item_id cr_items.item_id%TYPE; - v_audience_item_id cr_items.item_id%TYPE; - v_background_item_id cr_items.item_id%TYPE; - v_revision_id cr_revisions.revision_id%TYPE; - v_audience_revision_id cr_revisions.revision_id%TYPE; - v_background_revision_id cr_revisions.revision_id%TYPE; - v_max_id integer; - v_name cr_wp_presentations.pres_title%TYPE; -begin - select coalesce(max(item_id),0) into v_max_id - from cr_items - where content_type = ''cr_wp_presentation'' - and name like p_pres_title || ''%''; - - v_name := p_pres_title || ''_'' || v_max_id; +-- lets give site-wide permissions, wp-permissions! +select acs_privilege__add_child('admin', 'wp_admin_presentation'); - v_item_id := content_item__new( - v_name, - p_parent_id, - null, - null, - p_creation_date, - p_creation_user, - null, - p_creation_ip, - ''content_item'', - ''cr_wp_presentation'', - null, - null, - ''text/plain'', - null, - null, - ''text'' - ); - v_revision_id := content_revision__new( - null, - null, - current_timestamp, - ''text/plain'', - null, - null, - v_item_id, - null, - p_creation_date, - p_creation_user, - p_creation_ip - ); - - PERFORM content_item__set_live_revision(v_revision_id); - ---jackp: Actually place the information entered by the user into the table - insert into cr_wp_presentations - ( - presentation_id, - pres_title, - page_signature, - copyright_notice, - style, - public_p, - show_modified_p - ) values ( - v_revision_id, - p_pres_title, - p_page_signature, - p_copyright_notice, - p_style, - p_public_p, - p_show_modified_p - ); - - v_audience_item_id := content_item__new( - aud, - v_item_id, - null, - null, - p_creation_date, - p_creation_user, - null, - p_creation_ip, - ''content_item'', - ''cr_wp_presentation_aud'', - null, - null, - ''text/plain'', - null, - null, - ''text'' - ); - - v_audience_revision_id := content_revision__new( - null, - null, - current_timestamp, - ''text/plain'', - null, - aud, - v_audience_item_id, - null, - p_creation_date, - p_creation_user, - p_creation_ip - ); - - PERFORM content_item__set_live_revision(v_audience_revision_id); - - insert into cr_wp_presentations_aud - ( - id, - presentation_id - ) values ( - v_audience_revision_id, - v_revision_id - ); - - v_background_item_id := content_item__new( - back, - v_item_id, - null, - null, - p_creation_date, - p_creation_user, - null, - p_creation_ip, - ''content_item'', - ''cr_wp_presentation_back'', - null, - null, - ''text/plain'', - null, - null, - ''text'' - ); - - v_background_revision_id := content_revision__new( - null, - null, - current_timestamp, - ''text/plain'', - null, - back, - v_background_item_id, - null, - p_creation_date, - p_creation_user, - p_creation_ip - ); - - PERFORM content_item__set_live_revision(v_background_revision_id); - - insert into cr_wp_presentations_back - ( - id, - presentation_id - ) values ( - v_background_revision_id, - v_revision_id - ); - - return v_item_id; -end;' language 'plpgsql'; - -create function wp_presentation__delete_audience ( - integer -) -returns integer as' -declare - audience_item_id alias for $1; -begin - delete from cr_wp_presentations_aud - where exists (select 1 from cr_revisions where revision_id = cr_wp_presentations_aud.id and item_id = audience_item_id); - delete from cr_item_publish_audit - where item_id = audience_item_id; - - PERFORM content_item__delete(audience_item_id); -return 0; -end;' language 'plpgsql'; - -create function wp_presentation__delete_background ( - integer -) -returns integer as' -declare - background_item_id alias for $1; -begin - delete from cr_wp_presentations_back - where exists (select 1 from cr_revisions where revision_id = cr_wp_presentations_back.id and item_id = background_item_id); - delete from cr_item_publish_audit - where item_id = background_item_id; - - PERFORM content_item__delete(background_item_id); - return 0; -end;' language 'plpgsql'; - -create function wp_presentation__delete ( - integer -) -returns integer as' -declare - pres_item_id alias for $1; - v_audience_item_id cr_items.item_id%TYPE; - v_background_item_id cr_items.item_id%TYPE; - del_rec record; -begin - for del_rec in select item_id as slide_item_id - from cr_items - where content_type = ''cr_wp_slide'' - and parent_id = pres_item_id - loop - PERFORM wp_slide__delete(del_rec.slide_item_id); - end loop; - - select item_id into v_audience_item_id - from cr_items - where content_type = ''cr_wp_presentation_aud'' - and parent_id = pres_item_id; - - PERFORM wp_presentation__delete_audience(v_audience_item_id); - - select item_id into v_background_item_id - from cr_items - where content_type = ''cr_wp_presentation_back'' - and parent_id = pres_item_id; - - PERFORM wp_presentation__delete_background(v_background_item_id); - - delete from acs_permissions where object_id = pres_item_id; - -- update acs_objects set context_id=null where context_id = pres_item_id; - delete from cr_wp_presentations where exists (select 1 from cr_revisions where cr_revisions.revision_id = cr_wp_presentations.presentation_id and cr_revisions.item_id = pres_item_id); - PERFORM content_item__delete(pres_item_id); -return 0; -end;' language 'plpgsql'; - --- DRB: All these could've been implemented as a single function with a type argument --- but I'm not going to rewrite all of wp-slim's queries just to clean this up... - -create function wp_presentation__get_ad_revision (integer) returns text as ' -declare - p_pres_revision_id alias for $1; -begin - return r.content - from cr_revisions r, - cr_wp_presentations_aud pa - where pa.presentation_id = p_pres_revision_id - and r.revision_id = pa.id; -end;' language 'plpgsql'; - -create function wp_presentation__get_audience ( - integer -) returns text as' -declare - p_pres_item_id alias for $1; -begin - return content - from cr_revisions, cr_items - where cr_items.content_type = ''cr_wp_presentation_aud'' - and cr_items.parent_id = p_pres_item_id - and cr_revisions.revision_id = cr_items__live_revision; -end;' language 'plpgsql'; - -create function wp_presentation__get_bg_revision (integer) returns text as ' -declare - p_pres_revision_id alias for $1; -begin - return r.content - from cr_revisions r, - cr_wp_presentations_aud pa - where pa.presentation_id = p_pres_revision_id - and r.revision_id = pa.id; -end;' language 'plpgsql'; - -create function wp_presentation__get_background ( - integer -) returns text as' -declare - pres_item_id alias for $1; -begin - return content - from cr_revisions, cr_items - where cr_items.content_type = ''cr_wp_presentation_bak'' - and cr_items.parent_id = p_pres_item_id - and cr_revisions.revision_id = cr_items__live_revision; -end;' language 'plpgsql'; - - -create function wp_presentation__new_revision ( - timestamptz, - integer, - varchar, - integer, - varchar(400), - varchar(200), - varchar(400), - integer, - boolean, - boolean, - varchar, - varchar -) returns integer as' -declare - p_creation_date alias for $1; - p_creation_user alias for $2; - p_creation_ip alias for $3; - p_pres_item_id alias for $4; - p_pres_title alias for $5; - p_page_signature alias for $6; - p_copyright_notice alias for $7; - p_style alias for $8; - p_public_p alias for $9; - p_show_modified_p alias for $10; - p_audience alias for $11; - p_background alias for $12; - v_audience_item_id cr_items.item_id%TYPE; - v_background_item_id cr_items.item_id%TYPE; - v_revision_id cr_revisions.revision_id%TYPE; - v_audience_revision_id cr_revisions.revision_id%TYPE; - v_background_revision_id cr_revisions.revision_id%TYPE; -begin - v_revision_id := content_revision__new( - null, - null, - current_timestamp, - ''text/plain'', - null, - null, - p_pres_item_id, - null, - p_creation_date, - p_creation_user, - p_creation_ip - ); - - PERFORM content_item__set_live_revision(v_revision_id); - - insert into cr_wp_presentations - ( - presentation_id, - pres_title, - page_signature, - copyright_notice, - style, - public_p, - show_modified_p - ) values ( - v_revision_id, - p_pres_title, - p_page_signature, - p_copyright_notice, - p_style, - p_public_p, - p_show_modified_p - ); - - select item_id into v_audience_item_id - from cr_items - where parent_id = p_pres_item_id - and content_type = ''cr_wp_presentation_aud''; - - v_audience_revision_id := content_revision__new( - null, - null, - current_timestamp, - ''text/plain'', - null, - p_audience, - v_audience_item_id, - null, - p_creation_date, - p_creation_user, - p_creation_ip - ); - - PERFORM content_item__set_live_revision(v_audience_revision_id); - - insert into cr_wp_presentations_aud - ( - id, - presentation_id - ) values ( - v_audience_revision_id, - v_revision_id - ); - - select item_id into v_background_item_id - from cr_items - where parent_id = p_pres_item_id - and content_type = ''cr_wp_presentation_back''; - - v_background_revision_id := content_revision__new( - null, - null, - current_timestamp, - ''text/plain'', - null, - p_background, - v_background_item_id, - null, - p_creation_date, - p_creation_user, - p_creation_ip - ); - - PERFORM content_item__set_live_revision(v_background_revision_id); - - insert into cr_wp_presentations_back - ( - id, - presentation_id - ) values ( - v_background_revision_id, - v_revision_id - ); - return 0; -end;' language 'plpgsql'; - -create function wp_slide__new ( - integer, - timestamptz, - integer, - varchar, - varchar, - integer, - integer, - integer, - varchar, - varchar, - varchar, - boolean, - boolean, - integer -) returns integer as' -declare - p_pres_item_id alias for $1; - p_creation_date alias for $2; - p_creation_user alias for $3; - p_creation_ip alias for $4; - p_slide_title alias for $5; - p_style alias for $6; - p_original_slide_id alias for $7; - p_sort_key alias for $8; - p_preamble alias for $9; - p_bullet_items alias for $10; - p_postamble alias for $11; - p_include_in_outline_p alias for $12; - p_context_break_after_p alias for $13; - p_context_id alias for $14; - v_item_id cr_items.item_id%TYPE; - v_preamble_item_id cr_items.item_id%TYPE; - v_postamble_item_id cr_items.item_id%TYPE; - v_bullet_items_item_id cr_items.item_id%TYPE; - v_revision_id cr_revisions.revision_id%TYPE; - v_preamble_revision_id cr_revisions.revision_id%TYPE; - v_postamble_revision_id cr_revisions.revision_id%TYPE; - v_bullet_items_revision_id cr_revisions.revision_id%TYPE; - v_max_id integer; - v_name varchar; -begin - select coalesce(max(item_id),0) into v_max_id - from cr_items - where content_type = ''cr_wp_slide'' - and name like p_slide_title || ''%''; - - v_name := p_slide_title || ''_'' || v_max_id; - - v_item_id := content_item__new( - v_name, - p_pres_item_id, - null, - null, - p_creation_date, - p_creation_user, - null, - p_creation_ip, - ''content_item'', - ''cr_wp_slide'', - null, - null, - ''text/plain'', - null, - null, - ''text'' - ); - - v_revision_id := content_revision__new( - null, - null, - current_timestamp, - ''text/plain'', - null, - null, - v_item_id, - null, - p_creation_date, - p_creation_user, - p_creation_ip - ); - - PERFORM content_item__set_live_revision(v_revision_id); - - update cr_wp_slides - set sort_key = sort_key + 1 - where sort_key >= p_sort_key - and exists (select 1 from cr_items, cr_revisions where parent_id = - p_pres_item_id and cr_items.item_id = cr_revisions.item_id - and cr_revisions.revision_id=cr_wp_slides.slide_id); - - insert into cr_wp_slides - ( - slide_id, - original_slide_id, - sort_key, - slide_title, - include_in_outline_p, - context_break_after_p, - style - ) values ( - v_revision_id, - p_original_slide_id, - p_sort_key, - p_slide_title, - p_include_in_outline_p, - p_context_break_after_p, - p_style - ); - - v_preamble_item_id := content_item__new( - ''preamble'', - v_item_id, - null, - null, - p_creation_date, - p_creation_user, - null, - p_creation_ip, - ''content_item'', - ''cr_wp_slide_preamble'', - null, - null, - ''text/plain'', - null, - null, - ''text'' - ); - - v_preamble_revision_id := content_revision__new( - null, - null, - current_timestamp, - ''text/plain'', - null, - p_preamble, - v_preamble_item_id, - null, - p_creation_date, - p_creation_user, - p_creation_ip - ); - - PERFORM content_item__set_live_revision(v_preamble_revision_id); - - insert into cr_wp_slides_preamble - ( - id, - slide_id - ) values ( - v_preamble_revision_id, - v_revision_id - ); - - v_postamble_item_id := content_item__new( - ''postamble'', - v_item_id, - null, - null, - p_creation_date, - p_creation_user, - null, - p_creation_ip, - ''content_item'', - ''cr_wp_slide_postamble'', - null, - null, - ''text/plain'', - null, - null, - ''text'' - ); - - - v_postamble_revision_id := content_revision__new( - null, - null, - current_timestamp, - ''text/plain'', - null, - p_postamble, - v_postamble_item_id, - null, - p_creation_date, - p_creation_user, - p_creation_ip - ); - - PERFORM content_item__set_live_revision(v_postamble_revision_id); - - insert into cr_wp_slides_postamble - ( - id, - slide_id - ) values ( - v_postamble_revision_id, - v_revision_id - ); - - v_bullet_items_item_id := content_item__new( - ''bullet_items'', - v_item_id, - null, - null, - p_creation_date, - p_creation_user, - null, - p_creation_ip, - ''content_item'', - ''cr_wp_slide_bullet_items'', - null, - null, - null, - ''text/plain'', - null, - ''text'' - ); - - - v_bullet_items_revision_id := content_revision__new( - null, - null, - current_timestamp, - ''text/plain'', - null, - p_bullet_items, - v_bullet_items_item_id, - null, - p_creation_date, - p_creation_user, - p_creation_ip - ); - - PERFORM content_item__set_live_revision(v_bullet_items_revision_id); - - insert into cr_wp_slides_bullet_items - ( - id, - slide_id - ) values ( - v_bullet_items_revision_id, - v_revision_id - ); - return v_item_id; -end;' language 'plpgsql'; - -create function wp_slide__delete_preamble ( - integer -) returns integer as' -declare - delete_preamble__preamble_item_id alias for $1; -begin - delete from cr_wp_slides_preamble - where exists (select 1 from cr_revisions where revision_id = - cr_wp_slides_preamble.id - and item_id = delete_preamble__preamble_item_id); - - delete from cr_item_publish_audit - where item_id = delete_preamble__preamble_item_id; - - PERFORM content_item__delete(delete_preamble__preamble_item_id); - return 0; -end;' language 'plpgsql'; - -create function wp_slide__delete_postamble( - integer -) returns integer as' -declare - delete_postamble__postamble_item_id alias for $1; -begin - delete from cr_wp_slides_postamble - where exists (select 1 from cr_revisions where revision_id = - cr_wp_slides_postamble.id - and item_id = delete_postamble__postamble_item_id); - - delete from cr_item_publish_audit - where item_id = delete_postamble__postamble_item_id; - - PERFORM content_item__delete(delete_postamble__postamble_item_id); - return 0; -end;' language 'plpgsql'; - -create function wp_slide__delete_bullet_items( - integer -) returns integer as' -declare - delete_bullet_items__bullet_items_item_id alias for $1; -begin - delete from cr_wp_slides_bullet_items - where exists (select 1 from cr_revisions where revision_id = - cr_wp_slides_bullet_items.id - and item_id = delete_bullet_items__bullet_items_item_id); - - delete from cr_item_publish_audit - where item_id = delete_bullet_items__bullet_items_item_id; - - PERFORM content_item__delete(delete_bullet_items__bullet_items_item_id); - return 0; -end;' language 'plpgsql'; - -create function wp_slide__delete( - integer -) returns integer as' -declare - del_rec record; - slide_item_id alias for $1; - v_sort_key cr_wp_slides.sort_key%TYPE; - v_pres_item_id cr_items.item_id%TYPE; - v_preamble_item_id cr_items.item_id%TYPE; - v_postamble_item_id cr_items.item_id%TYPE; - v_bullet_items_item_id cr_items.item_id%TYPE; -begin - for del_rec in select item_id as attach_item_id - from cr_items - where content_type in (''cr_wp_image_attachment'', ''cr_wp_file_attachment'') - and parent_id = slide_item_id - loop - wp_attachment__delete(del_rec.attach_item_id); - end loop; - - select item_id into v_preamble_item_id - from cr_items - where content_type = ''cr_wp_slide_preamble'' - and parent_id = slide_item_id; - - PERFORM wp_slide__delete_preamble(v_preamble_item_id); - - select item_id into v_postamble_item_id - from cr_items - where content_type = ''cr_wp_slide_postamble'' - and parent_id = slide_item_id; - - PERFORM wp_slide__delete_postamble(v_postamble_item_id); - - select item_id into v_bullet_items_item_id - from cr_items - where content_type = ''cr_wp_slide_bullet_items'' - and parent_id = slide_item_id; - - PERFORM wp_slide__delete_bullet_items(v_bullet_items_item_id); - --- sort_key of all revisions should be the same - select max(s.sort_key), max(i.parent_id) into v_sort_key, - v_pres_item_id - from cr_wp_slides s, cr_revisions r, cr_items i - where r.item_id = slide_item_id - and r.revision_id = s.slide_id - and i.item_id = r.item_id; - - delete from cr_wp_slides where exists (select 1 from cr_revisions - where cr_revisions.revision_id = cr_wp_slides.slide_id - and cr_revisions.item_id = slide_item_id); - - update cr_wp_slides set sort_key = sort_key - 1 - where sort_key > v_sort_key and exists - (select 1 from cr_revisions r, cr_items i - where i.parent_id = v_pres_item_id and i.item_id = r.item_id - and r.revision_id = cr_wp_slides.slide_id); - --- update acs_objects set context_id=null --- where context_id = slide_item_id; - - delete from cr_item_publish_audit where item_id = slide_item_id; - - PERFORM content_item__delete(slide_item_id); - return 0; -end;' language 'plpgsql'; - -create function wp_slide__get_preamble_revision ( - integer -) returns text as ' -declare - p_slide_revision_id alias for $1; -begin - return content - from cr_revisions r, cr_wp_slides_preamble sp - where sp.slide_id = p_slide_revision_id - and r.revision_id = sp.id; -end;' language 'plpgsql'; - -create function wp_slide__get_postamble_revision ( - integer -) returns text as ' -declare - p_slide_revision_id alias for $1; -begin - return content - from cr_revisions r, cr_wp_slides_postamble sp - where sp.slide_id = p_slide_revision_id - and r.revision_id = sp.id; -end;' language 'plpgsql'; - -create function wp_slide__get_bullet_items_revision ( - integer -) returns text as ' -declare - p_slide_revision_id alias for $1; -begin - return content - from cr_revisions r, cr_wp_slides_bullet_items sp - where sp.slide_id = p_slide_revision_id - and r.revision_id = sp.id; -end;' language 'plpgsql'; - -create function wp_slide__get_postamble( - integer -) returns text as ' -declare - p_slide_item_id alias for $1; -begin - return content - from cr_revisions, cr_items - where cr_items.content_type = ''cr_wp_slide_postamble'' - and cr_items.parent_id = p_slide_item_id - and cr_revisions.revision_id = cr_items.live_revision; -end;' language 'plpgsql'; - -create function wp_slide__get_preamble( - integer -) returns text as' -declare - p_slide_item_id alias for $1; -begin - return content - from cr_revisions, cr_items - where cr_items.content_type = ''cr_wp_slide_preamble'' - and cr_items.parent_id = p_slide_item_id - and cr_revisions.revision_id = cr_items.live_revision; -end;' language 'plpgsql'; - -create function wp_slide__get_bullet_items( - integer -) returns text as' -declare - p_slide_item_id alias for $1; -begin - return content - from cr_revisions, cr_items - where cr_items.content_type = ''cr_wp_slide_bullet_items'' - and cr_items.parent_id = p_slide_item_id - and cr_revisions.revision_id = cr_items.live_revision; -end;' language 'plpgsql'; - -create function wp_slide__new_revision( - timestamptz, - integer, - varchar, - integer, - varchar, - text, - varchar, - varchar, - integer, - integer, - integer, - boolean, - boolean -) returns integer as' -declare - p_creation_date alias for $1; - p_creation_user alias for $2; - p_creation_ip alias for $3; - p_slide_item_id alias for $4; - p_slide_title alias for $5; - p_preamble alias for $6; - p_bullet_items alias for $7; - p_postamble alias for $8; - p_style alias for $9; - p_original_slide_id alias for $10; - p_sort_key alias for $11; - p_include_in_outline_p alias for $12; - p_context_break_after_p alias for $13; - v_preamble_item_id cr_items.item_id%TYPE; - v_postamble_item_id cr_items.item_id%TYPE; - v_bullet_items_item_id cr_items.item_id%TYPE; - v_revision_id cr_revisions.revision_id%TYPE; - v_preamble_revision_id cr_revisions.revision_id%TYPE; - v_postamble_revision_id cr_revisions.revision_id%TYPE; - v_bullet_items_revision_id cr_revisions.revision_id%TYPE; -begin - v_revision_id := content_revision__new( - null, - null, - current_timestamp, - ''text/plain'', - null, - null, - p_slide_item_id, - null, - p_creation_date, - p_creation_user, - p_creation_ip - ); - - PERFORM content_item__set_live_revision(v_revision_id); - - insert into cr_wp_slides - ( - slide_id, - slide_title, - style, - original_slide_id, - sort_key, - include_in_outline_p, - context_break_after_p - ) values ( - v_revision_id, - p_slide_title, - p_style, - p_original_slide_id, - p_sort_key, - p_include_in_outline_p, - p_context_break_after_p - ); - - select item_id into v_preamble_item_id - from cr_items - where parent_id = p_slide_item_id - and content_type = ''cr_wp_slide_preamble''; - - v_preamble_revision_id := content_revision__new( - null, - null, - current_timestamp, - ''text/plain'', - null, - p_preamble, - v_preamble_item_id, - null, - p_creation_date, - p_creation_user, - p_creation_ip - ); - - PERFORM content_item__set_live_revision(v_preamble_revision_id); - - insert into cr_wp_slides_preamble - ( - id, - slide_id - ) values ( - v_preamble_revision_id, - v_revision_id - ); - - select item_id into v_postamble_item_id - from cr_items - where parent_id = p_slide_item_id - and content_type = ''cr_wp_slide_postamble''; - - v_postamble_revision_id := content_revision__new( - null, - null, - current_timestamp, - ''text/plain'', - null, - p_postamble, - v_postamble_item_id, - null, - p_creation_date, - p_creation_user, - p_creation_ip - ); - - PERFORM content_item__set_live_revision(v_postamble_revision_id); - - insert into cr_wp_slides_postamble - ( - id, - slide_id - ) values ( - v_postamble_revision_id, - v_revision_id - ); - - select item_id into v_bullet_items_item_id - from cr_items - where parent_id = p_slide_item_id - and content_type = ''cr_wp_slide_bullet_items''; - - v_bullet_items_revision_id := content_revision__new( - null, - null, - current_timestamp, - ''text/plain'', - null, - p_bullet_items, - v_bullet_items_item_id, - null, - p_creation_date, - p_creation_user, - p_creation_ip - ); - - PERFORM content_item__set_live_revision(v_bullet_items_revision_id); - - insert into cr_wp_slides_bullet_items - ( - id, - slide_id - ) values ( - v_bullet_items_revision_id, - v_revision_id - ); - return 0; -end;' language 'plpgsql'; - -create function wp_attachment__delete( - integer -) returns integer as' -declare - p_attach_item_id alias for $1; -begin - delete from cr_wp_file_attachments - where exists (select 1 from cr_revisions where revision_id - = cr_wp_file_attachments.attach_id - and item_id = p_attach_item_id); - - delete from cr_wp_image_attachments - where exists (select 1 from cr_revisions where revision_id - = cr_wp_image_attachments.attach_id - and item_id = p_attach_item_id); - - delete from cr_item_publish_audit - where item_id = p_attach_item_id; - - PERFORM content_item__delete(p_attach_item_id); - return 0; -end;' language 'plpgsql'; - -create function wp_attachment__new_revision ( - integer -) returns integer as' -declare - p_attach_item_id alias for $1; -begin - return 0; -end; 'language 'plpgsql'; - - - - -create function wp_presentation__set_live_revision(integer) returns integer as ' -declare - p_revision_id alias for $1; - v_revision_id integer; -begin - perform content_item__set_live_revision(p_revision_id); - - select id into v_revision_id - from cr_wp_presentations_aud - where presentation_id = p_revision_id; - - perform content_item__set_live_revision(v_revision_id); - - select id into v_revision_id - from cr_wp_presentations_back - where presentation_id = p_revision_id; - - perform content_item__set_live_revision(v_revision_id); - return 0; -end;' language 'plpgsql'; - - - Index: openacs-4/packages/wp-slim/sql/postgresql/wp-slim-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/sql/postgresql/wp-slim-drop.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/wp-slim/sql/postgresql/wp-slim-drop.sql 17 May 2003 12:49:58 -0000 1.4 +++ openacs-4/packages/wp-slim/sql/postgresql/wp-slim-drop.sql 28 Aug 2003 09:42:00 -0000 1.5 @@ -315,26 +315,35 @@ default_context := acs__magic_object_id(''default_context''); registered_users := acs__magic_object_id(''registered_users''); - the_public := acs__magic_object_id(''the_public''); +-- the_public := acs__magic_object_id(''the_public''); PERFORM acs_permission__revoke_permission ( default_context, registered_users, ''wp_create_presentation'' ); - PERFORM acs_permission__revoke_permission ( - default_context, - the_public, - ''wp_view_presentation'' - ); +-- PERFORM acs_permission__revoke_permission ( +-- default_context, +-- the_public, +-- ''wp_view_presentation'' +-- ); return 0; end;' language 'plpgsql'; select inline_11 (); drop function inline_11 (); --checked + +select acs_privilege__remove_child('admin', 'wp_admin_presentation'); + +select acs_privilege__remove_child('wp_edit_presentation', 'wp_view_presentation'); +select acs_privilege__remove_child('wp_admin_presentation', 'wp_create_presentation'); +select acs_privilege__remove_child('wp_admin_presentation', 'wp_edit_presentation'); +select acs_privilege__remove_child('wp_admin_presentation', 'wp_delete_presentation'); + + create function inline_12 () returns integer as' begin @@ -469,9 +478,9 @@ integer, varchar, integer, - varchar(400), - varchar(200), - varchar(400), + varchar, + varchar, + varchar, integer, boolean, boolean, @@ -500,10 +509,19 @@ drop view cr_wp_presentationsx; drop table cr_wp_presentations; -drop table wp_styles; drop function wp_slide__get_bullet_items_revision(integer); drop function wp_slide__get_postamble_revision(integer); drop function wp_slide__get_bullet_items(integer); drop function wp_slide__get_postamble(integer); drop function wp_presentation__set_live_revision(integer); + +drop sequence wp_style_seq; + + +drop function wp_style__delete(integer); + +drop function wp_style__image_delete(integer); +drop table wp_style_images; +drop table wp_styles; + Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/sql/postgresql/upgrade/upgrade-4.0b3-4.1.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/tcl/printer-view-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/tcl/printer-view-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/wp-slim/tcl/printer-view-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/tcl/printer-view-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wp-slim/tcl/printer-view-procs.tcl 17 May 2003 12:50:28 -0000 1.2 +++ openacs-4/packages/wp-slim/tcl/printer-view-procs.tcl 28 Aug 2003 09:42:00 -0000 1.3 @@ -7,16 +7,6 @@ slide_item_id } { -db_multirow attach_list get_attachments { - - select live_revision as attach_id, display, name as file_name - from (select live_revision, name - from cr_items - where parent_id = :slide_item_id and - content_type in ('cr_wp_image_attachment', 'cr_wp_file_attachment') - ) a - left join cr_wp_image_attachments on (a.live_revision = attach_id) +db_multirow attach_list get_attachments { *SQL* } } - -} Index: openacs-4/packages/wp-slim/tcl/printer-view-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/tcl/printer-view-procs.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wp-slim/tcl/printer-view-procs.xql 17 May 2003 12:50:28 -0000 1.2 +++ openacs-4/packages/wp-slim/tcl/printer-view-procs.xql 28 Aug 2003 09:42:00 -0000 1.3 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <queryset> - + <fullquery name="get_attachments"> <querytext> select live_revision as attach_id, display, name as file_name Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/tcl/wp-slim-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/tcl/wp-slim-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? 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.2 -r1.3 --- openacs-4/packages/wp-slim/www/attach-del.tcl 4 Oct 2001 04:29:01 -0000 1.2 +++ openacs-4/packages/wp-slim/www/attach-del.tcl 28 Aug 2003 09:42:00 -0000 1.3 @@ -10,8 +10,12 @@ } { slide_item_id:naturalnum,notnull attach_item_id:naturalnum,notnull + pres_item_id:naturalnum,notnull } +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_delete_presentation db_exec_plsql revisions_and_item_delete { @@ -20,4 +24,4 @@ end; } -ad_returnredirect "attach-list?[export_url_vars slide_item_id]" +ad_returnredirect "attach-list?[export_url_vars slide_item_id pres_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.4 -r1.5 --- openacs-4/packages/wp-slim/www/attach-detail.tcl 6 Sep 2002 15:32:23 -0000 1.4 +++ openacs-4/packages/wp-slim/www/attach-detail.tcl 28 Aug 2003 09:42:00 -0000 1.5 @@ -30,6 +30,11 @@ and item_id = :slide_item_id }] +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_edit_presentation + + set context [list [list "edit-slide?[export_url_vars slide_item_id pres_item_id]" "Edit Slide"] "Details"] db_multirow revisions revisions_get { Index: openacs-4/packages/wp-slim/www/attach-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/attach-list.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/wp-slim/www/attach-list.adp 22 May 2003 15:18:55 -0000 1.4 +++ openacs-4/packages/wp-slim/www/attach-list.adp 28 Aug 2003 09:42:00 -0000 1.5 @@ -4,7 +4,7 @@ <ul> <multiple name="att"> -<li>@att.name@ (<a href="attach-del?slide_item_id=@slide_item_id@&attach_item_id=@att.item_id@">remove</a> | <a href="attach-detail?slide_item_id=@slide_item_id@&attach_item_id=@att.item_id@&file_name=@att.name@">details</a>) +<li>@att.name@ (<a href="attach-del?slide_item_id=@slide_item_id@&attach_item_id=@att.item_id@&pres_item_id=@pres_item_id@">remove</a> | <a href="attach-detail?slide_item_id=@slide_item_id@&attach_item_id=@att.item_id@&file_name=@att.name@&pres_item_id=@pres_item_id@">details</a>) </multiple> </ul> 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.3 -r1.4 --- openacs-4/packages/wp-slim/www/attach-list.tcl 6 Sep 2002 15:32:23 -0000 1.3 +++ openacs-4/packages/wp-slim/www/attach-list.tcl 28 Aug 2003 09:42:00 -0000 1.4 @@ -10,13 +10,18 @@ @cvs-id $Id$ } { slide_item_id:naturalnum,notnull + pres_item_id:naturalnum,notnull } -properties { slide_item_id context att:multirow } +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_edit_presentation + set pres_item_id [db_string pres_item_id_get { select parent_id from cr_items 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.7 -r1.8 --- openacs-4/packages/wp-slim/www/attach.tcl 17 May 2003 12:50:50 -0000 1.7 +++ openacs-4/packages/wp-slim/www/attach.tcl 28 Aug 2003 09:42:00 -0000 1.8 @@ -70,5 +70,4 @@ ad_script_abort } - ad_returnredirect edit-slide?[export_url_vars slide_item_id pres_item_id] Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/create-presentation-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? 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.5 -r1.6 --- openacs-4/packages/wp-slim/www/create-presentation.adp 22 May 2003 15:18:55 -0000 1.5 +++ openacs-4/packages/wp-slim/www/create-presentation.adp 28 Aug 2003 09:42:00 -0000 1.6 @@ -16,7 +16,7 @@ </tr> <tr> <th nowrap align=right>Title:</th> - <td><input type=text name=pres_title size=50 value=""></td> + <td><input type=text name=pres_title size=50 maxlength="400"value=""></td> </tr> <tr> <td></td><td> @@ -25,7 +25,7 @@ </tr> <tr> <th nowrap align=right>Page Signature:</th> - <td><input type=text name=page_signature size=50 value=""></td> + <td><input type=text name=page_signature size=50 maxlength="200" value=""></td> </tr> <tr> <td></td><td> @@ -37,7 +37,7 @@ </tr> <tr> <th nowrap align=right>Copyright Notice:</th> - <td><input type=text name=copyright_notice size=50 value=""></td> + <td><input type=text name=copyright_notice size=50 maxlength="400" value=""></td> </tr> <tr> <td></td><td> @@ -81,10 +81,7 @@ </tr> <tr> <th nowrap align=right>Style:</th> - <td><select name=style> -<option value=-1 selected>Default (Plain) - -</select> + <td>@available_styles@ </td> </tr> <tr> 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.3 -r1.4 --- openacs-4/packages/wp-slim/www/create-presentation.tcl 6 Sep 2002 15:32:23 -0000 1.3 +++ openacs-4/packages/wp-slim/www/create-presentation.tcl 28 Aug 2003 09:42:00 -0000 1.4 @@ -11,6 +11,25 @@ context:onevalue } +set package_id [ad_conn package_id] +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $package_id -privilege wp_create_presentation + +set items [db_list_of_lists wp_styles { *SQL* }] + + set names [list] + set values [list] + foreach image $items { + lappend names [lindex $image 1] + lappend values [lindex $image 0] + } + + lappend names "none" + lappend values -1 + + set available_styles "<select name=style> + [ad_generic_optionlist $names $values -1]</select>\n" + set title "Create Presentation" set context [list $title] Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/create-presentation.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/wp-slim/www/delete-presentation-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/delete-presentation-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wp-slim/www/delete-presentation-2.tcl 18 Sep 2002 12:07:02 -0000 1.2 +++ openacs-4/packages/wp-slim/www/delete-presentation-2.tcl 28 Aug 2003 09:42:00 -0000 1.3 @@ -18,7 +18,7 @@ if { [ad_check_password $user_id $password] } { db_exec_plsql delete_presentation { - begin + begin wp_presentation.delete(:pres_item_id); end; } @@ -27,4 +27,4 @@ ad_script_abort } -ad_returnredirect "" \ No newline at end of file +ad_returnredirect "" 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.2 -r1.3 --- openacs-4/packages/wp-slim/www/delete-slide-2.tcl 4 Oct 2001 04:29:01 -0000 1.2 +++ openacs-4/packages/wp-slim/www/delete-slide-2.tcl 28 Aug 2003 09:42:00 -0000 1.3 @@ -12,7 +12,11 @@ pres_item_id:naturalnum,notnull } +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_delete_presentation + db_exec_plsql delete_slide { begin wp_slide.delete(:slide_item_id); Index: openacs-4/packages/wp-slim/www/delete-slide.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/delete-slide.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/wp-slim/www/delete-slide.adp 22 May 2003 15:18:55 -0000 1.4 +++ openacs-4/packages/wp-slim/www/delete-slide.adp 28 Aug 2003 09:42:00 -0000 1.5 @@ -7,11 +7,10 @@ Are you sure that you want to delete this slide? <ul> -<li>Title: as -<li>Contents: +<li>Title: @slide_title@ </ul> <input type=button value="Yes, delete the slide." onClick="location.href='delete-slide-2?pres_item_id=@pres_item_id@&slide_item_id=@slide_item_id@'"> <input type=button value="No, I want to go back." onClick="location.href='presentation-top?pres_item_id=@pres_item_id@'"> -</p> \ No newline at end of file +</p> 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.3 -r1.4 --- openacs-4/packages/wp-slim/www/delete-slide.tcl 6 Sep 2002 15:32:23 -0000 1.3 +++ openacs-4/packages/wp-slim/www/delete-slide.tcl 28 Aug 2003 09:42:00 -0000 1.4 @@ -10,9 +10,14 @@ } { slide_item_id:naturalnum,notnull pres_item_id:naturalnum,notnull + slide_title } +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_delete_presentation + set context [list "Delete a Slide"] ad_return_template 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.5 -r1.6 --- openacs-4/packages/wp-slim/www/edit-presentation-2.tcl 10 Sep 2002 22:23:30 -0000 1.5 +++ openacs-4/packages/wp-slim/www/edit-presentation-2.tcl 28 Aug 2003 09:42:00 -0000 1.6 @@ -17,7 +17,10 @@ } +#added permission checking roc@ set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_edit_presentation + set creation_ip [ad_conn peeraddr] db_exec_plsql update_wp_presentation { Index: openacs-4/packages/wp-slim/www/edit-presentation-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/edit-presentation-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/edit-presentation-oracle.xql 4 Oct 2001 04:23:13 -0000 1.1 +++ openacs-4/packages/wp-slim/www/edit-presentation-oracle.xql 28 Aug 2003 09:42:00 -0000 1.2 @@ -6,7 +6,7 @@ <fullquery name="get_presentation_data"> <querytext> - 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, wp_presentation.get_audience(:pres_item_id) as audience, wp_presentation.get_background(:pres_item_id) as background, style from cr_wp_presentations p, cr_items i where i.item_id = :pres_item_id and i.live_revision = p.presentation_id @@ -15,4 +15,5 @@ </fullquery> + </queryset> Index: openacs-4/packages/wp-slim/www/edit-presentation-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/edit-presentation-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/edit-presentation-postgresql.xql 4 Oct 2001 04:23:13 -0000 1.1 +++ openacs-4/packages/wp-slim/www/edit-presentation-postgresql.xql 28 Aug 2003 09:42:00 -0000 1.2 @@ -6,7 +6,7 @@ <fullquery name="get_presentation_data"> <querytext> - select p.pres_title, p.page_signature, p.copyright_notice, p.public_p, + select p.pres_title, p.page_signature, p.copyright_notice, p.public_p, style, p.show_modified_p from cr_wp_presentations p, cr_items i where i.item_id = :pres_item_id @@ -36,5 +36,4 @@ </querytext> </fullquery> - </queryset> Index: openacs-4/packages/wp-slim/www/edit-presentation.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/edit-presentation.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/wp-slim/www/edit-presentation.adp 22 May 2003 15:18:55 -0000 1.4 +++ openacs-4/packages/wp-slim/www/edit-presentation.adp 28 Aug 2003 09:42:00 -0000 1.5 @@ -21,7 +21,7 @@ </tr> <tr> <th nowrap align=right>Title:</th> - <td><input type=text name=pres_title size=50 value="@pres_title@"> + <td><input type=text name=pres_title size=50 maxlength="400" value="@pres_title@"> </tr> <tr> <td></td><td> @@ -30,7 +30,7 @@ </tr> <tr> <th nowrap align=right>Page Signature:</th> - <td><input type=text name=page_signature size=50 value="@page_signature@"></td> + <td><input type=text name=page_signature size=50 maxlength="200" value="@page_signature@"></td> </tr> <tr> <td></td><td> @@ -42,7 +42,7 @@ </tr> <tr> <th nowrap align=right>Copyright Notice:</th> - <td><input type=text name=copyright_notice size=50 value="@copyright_notice@"></td> + <td><input type=text name=copyright_notice size=50 maxlength="400" value="@copyright_notice@"></td> </tr> <tr> <td></td><td> @@ -105,12 +105,7 @@ </tr> <tr> <th nowrap align=right>Style:</th> - <td><select name=style> -<option value=-1>Default (Plain) - -<option value="upload">I'll provide my own -</select> - </td> + <td>@available_styles@ </tr> <tr> <td></td><td> 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.5 -r1.6 --- openacs-4/packages/wp-slim/www/edit-presentation.tcl 17 May 2003 12:50:50 -0000 1.5 +++ openacs-4/packages/wp-slim/www/edit-presentation.tcl 28 Aug 2003 09:42:00 -0000 1.6 @@ -19,15 +19,15 @@ } +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege 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 - 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_presentation_data { *SQL* } + db_1row get_aud_data { select name as audience from cr_revisions, cr_items @@ -53,4 +53,20 @@ set audience [ad_quotehtml $audience] set background [ad_quotehtml $background] +set items [db_list_of_lists wp_styles { *SQL* }] + + set names [list] + set values [list] + foreach image $items { + lappend names [lindex $image 1] + lappend values [lindex $image 0] + } + + lappend names "none" + lappend values -1 + + set available_styles "<select name=style> + [ad_generic_optionlist $names $values $style]</select>\n" + + ad_return_template Index: openacs-4/packages/wp-slim/www/edit-presentation.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/edit-presentation.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/edit-presentation.xql 15 Nov 2001 01:47:13 -0000 1.1 +++ openacs-4/packages/wp-slim/www/edit-presentation.xql 28 Aug 2003 09:42:00 -0000 1.2 @@ -35,5 +35,16 @@ </querytext> </fullquery> +<fullquery name="wp_styles"> + <querytext> + + select style_id, (case when owner = :user_id then name || ' (yours)' else name end) as name + from wp_styles + where owner = :user_id + or public_p = 't' + order by name + + </querytext> +</fullquery> </queryset> 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.5 -r1.6 --- openacs-4/packages/wp-slim/www/edit-slide-2.tcl 17 May 2003 12:50:50 -0000 1.5 +++ openacs-4/packages/wp-slim/www/edit-slide-2.tcl 28 Aug 2003 09:42:00 -0000 1.6 @@ -24,12 +24,15 @@ } +#added permission checking roc@ set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_edit_presentation + set creation_ip [ad_conn peeraddr] # construct the list of bullet_items set bullet_items [list] -for {set index 1} {$index < [expr $bullet_num + 1]} {incr index} { +for {set index 1} {$index <= [expr $bullet_num + 1]} {incr index} { if {![empty_string_p $bullet($index)]} { lappend bullet_items $bullet($index) } Index: openacs-4/packages/wp-slim/www/edit-slide.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/Attic/edit-slide.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/wp-slim/www/edit-slide.adp 22 May 2003 15:18:55 -0000 1.5 +++ openacs-4/packages/wp-slim/www/edit-slide.adp 28 Aug 2003 09:42:00 -0000 1.6 @@ -71,5 +71,3 @@ </center> </form> - - 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.5 -r1.6 --- openacs-4/packages/wp-slim/www/edit-slide.tcl 17 May 2003 12:50:50 -0000 1.5 +++ openacs-4/packages/wp-slim/www/edit-slide.tcl 28 Aug 2003 09:42:00 -0000 1.6 @@ -21,8 +21,12 @@ } -set context [list "Edit Slide"] +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_edit_presentation +set context [list "presentation-top?[export_url_vars pres_item_id] {presentation}" {Edit Slide}] + db_1row get_slide_info { select s.slide_title, s.sort_key, @@ -63,6 +67,8 @@ set bullet_num 0 multirow create bullets item widget rows prev +# up to 3 bullets now! roc@ +lappend bullet_items {} {} foreach item $bullet_items { if {[string length $item] < 60} { set rows 1 @@ -74,7 +80,7 @@ multirow append bullets $item $widget $rows $bullet_num incr bullet_num } -incr bullet_num +incr bullet_num set bullet_max [expr $bullet_num + 1] # quote html tags contained in bullet items Index: openacs-4/packages/wp-slim/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/index-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wp-slim/www/index-oracle.xql 13 Mar 2002 22:50:53 -0000 1.2 +++ openacs-4/packages/wp-slim/www/index-oracle.xql 28 Aug 2003 09:42:00 -0000 1.3 @@ -3,6 +3,14 @@ <queryset> <rdbms><type>oracle</type><version>8.1.6</version></rdbms> +<fullquery name="extra_where_clauses"> + <querytext> + + and ao.create_date >= (sysdate - $show_age) + + </querytext> +</fullquery> + <fullquery name="get_all_public_presentations"> <querytext> @@ -17,6 +25,7 @@ and ao.creation_user = p.person_id and pres.public_p = 't' and ao.context_id = :package_id + $extra_where_clauses </querytext> </fullquery> @@ -33,6 +42,7 @@ and ao.object_id = i.item_id and ao.creation_user = :user_id and ao.context_id = :package_id + $extra_where_clauses </querytext> </fullquery> @@ -52,8 +62,14 @@ 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 ao.context_id = :package_id + $extra_where_clauses + and exists (select 1 + from acs_object_party_privilege_map m + where m.object_id = i.item_id + and m.party_id = :user_id + and m.privilege = 'wp_view_presentation') + $extra_where_clauses </querytext> </fullquery> Index: openacs-4/packages/wp-slim/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/index-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wp-slim/www/index-postgresql.xql 13 Mar 2002 22:50:53 -0000 1.2 +++ openacs-4/packages/wp-slim/www/index-postgresql.xql 28 Aug 2003 09:42:00 -0000 1.3 @@ -3,6 +3,14 @@ <queryset> <rdbms><type>postgresql</type><version>7.1</version></rdbms> +<fullquery name="extra_where_clauses"> + <querytext> + + and ao.creation_date >= (current_timestamp - cast('$show_age days' as interval)) + + </querytext> +</fullquery> + <fullquery name="get_all_public_presentations"> <querytext> @@ -17,6 +25,7 @@ and ao.creation_user = p.person_id and pres.public_p = 't' and ao.context_id = :package_id + $extra_where_clauses </querytext> </fullquery> @@ -33,6 +42,7 @@ and ao.object_id = i.item_id and ao.creation_user = :user_id and ao.context_id = :package_id + $extra_where_clauses </querytext> </fullquery> @@ -41,22 +51,25 @@ <fullquery name="get_all_visible_presentations"> <querytext> - select i.item_id as pres_item_id, - pres.pres_title, - to_char(ao.creation_date, 'Month DD, YYYY') as creation_date, - ao.creation_user, - p.first_names || ' ' || p.last_name as full_name, + select i.item_id as pres_item_id, + pres.pres_title, + to_char(ao.creation_date, 'Month DD, YYYY') as creation_date, + ao.creation_user, + p.first_names || ' ' || p.last_name as full_name, acs_permission__permission_p(i.item_id, :user_id, 'wp_edit_presentation') as edit_p - from cr_items i, cr_wp_presentations pres, persons p, acs_objects ao - where i.live_revision = pres.presentation_id - 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 ao.context_id = :package_id - + from cr_items i, cr_wp_presentations pres, persons p, acs_objects ao + where i.live_revision = pres.presentation_id + and ao.object_id = i.item_id + and ao.creation_user <> :user_id + and ao.creation_user = p.person_id + and ao.context_id = :package_id + $extra_where_clauses + and exists (select 1 + from acs_object_party_privilege_map m + where m.object_id = i.item_id + and m.party_id = :user_id + and m.privilege = 'wp_view_presentation') </querytext> </fullquery> - </queryset> Index: openacs-4/packages/wp-slim/www/index-unregistered.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/index-unregistered.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/wp-slim/www/index-unregistered.adp 6 Sep 2002 21:51:10 -0000 1.3 +++ openacs-4/packages/wp-slim/www/index-unregistered.adp 28 Aug 2003 09:42:00 -0000 1.4 @@ -2,6 +2,49 @@ <property name="title">WimpyPoint</property> <property name="context"></property> +<table border=0 width="100%"> +<tr><td align=left> +[ +<if @show_age@ eq 7> +<b>Last Week</b> +</if> +<else> +<a href=index?show_age=7>Last Week</a> +</else> +| +<if @show_age@ eq 14> +<b>Last Two Weeks</b> +</if> +<else> +<a href=index?show_age=14>Last Two Weeks</a> +</else> +| +<if @show_age@ eq 20> +<b>Last Month</b> +</if> +<else> +<a href=index?show_age=30>Last Month</a> +</else> +| +<if @show_age@ eq 0> +<b>All</b> +</if> +<else> +<a href=index?show_age=0>All</a> +</else> +] +</td> +<td align=right> +<h2>Options</h2> +<ul> + <li>To create or edit presentations, please <a href="/register/?return_url=@return_url@">log in</a> + <li>Show a list of <a href="users">all WimpyPoint users.</a> +</ul> +</td> +</tr> +</table> +<br> + <h2> Everyone's Presentations</h2> <ul> @@ -10,8 +53,3 @@ </multiple> </ul> -<h2>Options</h2> -<ul> - <li>To create or edit presentations, please <a href="/register/?return_url=@return_url@">log in</a> - <li>Show a list of <a href="users">all WimpyPoint users.</a> -</ul> \ No newline at end of file Index: openacs-4/packages/wp-slim/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/index.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/wp-slim/www/index.adp 22 May 2003 15:18:55 -0000 1.5 +++ openacs-4/packages/wp-slim/www/index.adp 28 Aug 2003 09:42:00 -0000 1.6 @@ -2,29 +2,84 @@ <property name="title">WimpyPoint</property> <property name="context">@context;noquote@</property> +<table border=0 width="100%"> +<tr><td align=left> +[ +<if @show_age@ eq 7> +<b>Last Week</b> +</if> +<else> +<a href=index?show_age=7&@show_user_value@>Last Week</a> +</else> +| +<if @show_age@ eq 14> +<b>Last Two Weeks</b> +</if> +<else> +<a href=index?show_age=14&@show_user_value@>Last Two Weeks</a> +</else> +| +<if @show_age@ eq 30> +<b>Last Month</b> +</if> +<else> +<a href=index?show_age=30&@show_user_value@>Last Month</a> +</else> +| +<if @show_age@ eq 0> +<b>All</b> +</if> +<else> +<a href=index?show_age=0&@show_user_value@>All</a> +</else> +] +</td> + + +<td align=right> +[ +<if @show_user@ eq "yours"> +<b>Yours</b> +| +<a href=index?show_user=all&@show_age_value@>Everyone's</a> +</if> +<else> +<a href=index?show_user=yours&@show_age_value@>Yours</a> +| +<b>Everyone's</b> +</else> +] +</td> +</tr> +</table> + <h2>My Presentations</h2> <ul> <multiple name=presentations> -<li><a href="display/@presentations.pres_item_id@/">@presentations.pres_title@</a> created on @presentations.creation_date@ [ <a href="presentation-top?pres_item_id=@presentations.pres_item_id@">edit</a> ] -</multiple> +<li><a href="display/@presentations.pres_item_id@/">@presentations.pres_title@</a> created on @presentations.creation_date@ [ <a href="presentation-top?pres_item_id=@presentations.pres_item_id@">edit</a> ] [<a href="presentation-print-view.tcl?item_id=@presentations.pres_item_id@">print view </a>] +</multiple> </ul> +<h2>Options</h2> +<ul> + <li><a href="create-presentation">Create a new presentation.</a> + <li><a href="style-list">Edit your styles.</a> + <li>Show a list of <a href="users">all WimpyPoint users.</a> +</ul> + + +<if @show_user@ eq "all"> <h2> Everyone's Presentations</h2> <ul> <multiple name=allpresentations> <li><a href="display/@allpresentations.pres_item_id@/">@allpresentations.pres_title@</a> created by <a href="/shared/community-member?user_id=@allpresentations.creation_user@">@allpresentations.full_name@</a> on @allpresentations.creation_date@ -<if @allpresentations.edit_p@ eq t> -[ <a href="presentation-top?pres_item_id=@allpresentations.pres_item_id@">edit</a> ] +<if @allpresentations.edit_p@ eq "t"> +[ <a href="presentation-top?pres_item_id=@allpresentations.pres_item_id@">edit</a> ] [<a href="presentation-print-view.tcl?item_id=@allpresentations.pres_item_id@">print view </a>] </if> </multiple> </ul> +</if> - -<h2>Options</h2> -<ul> - <li><a href="create-presentation">Create a new presentation.</a> - <li>Show a list of <a href="users">all WimpyPoint users.</a> -</ul> \ No newline at end of file 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.4 -r1.5 --- openacs-4/packages/wp-slim/www/index.tcl 6 Sep 2002 15:32:23 -0000 1.4 +++ openacs-4/packages/wp-slim/www/index.tcl 28 Aug 2003 09:42:00 -0000 1.5 @@ -5,10 +5,13 @@ and give you some options...like creating a new presentation or editing an old one. - @author Paul Konigsberg (paul@arsdigita.com) + @author Rocael Hernandez (roc@viaro.net) openacs package owner + @author Paul Konigsberg (paul@arsdigita.com, original) @creation-date Wed Nov 8 17:33:21 2000 - @cvs-id $Id$ + @cvs-id index.tcl,v 1.4.2.1 2003/05/21 15:31:03 rocaelh Exp } { + {show_age:integer "14"} + {show_user "yours"} } set package_id [ad_conn package_id] @@ -17,47 +20,25 @@ set user_id [ad_verify_and_get_user_id] +set show_user_value "show_user=$show_user" +set show_age_value "show_age=$show_age" + +if {$show_age != 0} { + set extra_where_clauses [db_map extra_where_clauses] +} else { + set extra_where_clauses "" +} + if {$user_id == 0} { - db_multirow allpresentations get_all_public_presentations { - select i.item_id as pres_item_id, - pres.pres_title, - to_char(ao.creation_date, 'Month DD, YYYY') as creation_date, - ao.creation_user, - p.first_names || ' ' || p.last_name as full_name - from cr_items i, cr_wp_presentations pres, persons p, acs_objects ao - where i.live_revision = pres.presentation_id - and ao.object_id = i.item_id - and ao.creation_user = p.person_id - and pres.public_p = 't' - } + db_multirow allpresentations get_all_public_presentations { *SQL* } set return_url [ns_urlencode [ad_conn url]] ad_return_template index-unregistered } else { - db_multirow presentations get_my_presentations { - select i.item_id as pres_item_id, - p.pres_title, - to_char(ao.creation_date, 'Month DD, YYYY') as creation_date - from cr_items i, cr_wp_presentations p, acs_objects ao - where i.live_revision = p.presentation_id - and ao.object_id = i.item_id - and ao.creation_user = :user_id - } + db_multirow presentations get_my_presentations { *SQL* } - db_multirow allpresentations get_all_visible_presentations { - select i.item_id as pres_item_id, - pres.pres_title, - to_char(ao.creation_date, 'Month DD, YYYY') as creation_date, - ao.creation_user, - p.first_names || ' ' || p.last_name as full_name, - acs_permission.permission_p(i.item_id, :user_id, 'wp_edit_presentation') as edit_p - from cr_items i, cr_wp_presentations pres, persons p, acs_objects ao - where i.live_revision = pres.presentation_id - 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') = 'f' + if {$show_user == "all"} { + db_multirow allpresentations get_all_visible_presentations { *SQL* } } ad_return_template index Index: openacs-4/packages/wp-slim/www/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/index.vuh,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wp-slim/www/index.vuh 31 Oct 2001 20:42:07 -0000 1.2 +++ openacs-4/packages/wp-slim/www/index.vuh 28 Aug 2003 09:42:00 -0000 1.3 @@ -51,6 +51,11 @@ global ad_conn set ad_conn(file) "$file_path/get-binary-data.tcl" adp_parse_ad_conn_file +} elseif {[regexp {^styles/(default|[0-9]+)/(.*)} $url match style_id file_name]} { + # Serve a specific attachment + global ad_conn + set ad_conn(file) "$file_path/serve-style.tcl" + adp_parse_ad_conn_file } else { # Didn't understand the URL. ns_log notice "## Wimpy Point: Sorry I could not resolve the URL you requested: $url" Index: openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-oracle.xql 4 Oct 2001 04:23:13 -0000 1.1 +++ openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-oracle.xql 28 Aug 2003 09:42:00 -0000 1.2 @@ -3,35 +3,12 @@ <queryset> <rdbms><type>oracle</type><version>8.1.6</version></rdbms> -<fullquery name="group_add"> +<fullquery name="permission_grant"> <querytext> - - declare - cursor v_cursor is - select member_id - from group_member_map - where group_id = :group_id; - begin - if :role = 'read' then - for c in v_cursor loop - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_view_presentation'); - end loop; - elsif (:role = 'write') then - for c in v_cursor loop - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_view_presentation'); - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_edit_presentation'); - end loop; - else - for c in v_cursor loop - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_view_presentation'); - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_edit_presentation'); - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_admin_presentation'); - end loop; - end if; - end; - + begin + acs_permission.grant_permission(:pres_item_id, :member_id, :permission); + end; </querytext> </fullquery> - </queryset> Index: openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-postgresql.xql 4 Oct 2001 04:23:13 -0000 1.1 +++ openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-postgresql.xql 28 Aug 2003 09:42:00 -0000 1.2 @@ -3,42 +3,12 @@ <queryset> <rdbms><type>postgresql</type><version>7.1</version></rdbms> -<fullquery name="group_add"> +<fullquery name="permission_grant"> <querytext> - - - select - if :role = ''read'' then - for record in select member_id - from group_member_map - where group_id = :group_id; - loop - acs_permission__grant_permission(:pres_item_id, c.member_id,''wp_view_presentation''); - end loop; - else if (:role = ''write'') then - for record in select member_id - from group_member_map - where group_id = :group_id; - loop - acs_permission__grant_permission(:pres_item_id, c.member_id, ''wp_view_presentation''); - acs_permission__grant_permission(:pres_item_id, c.member_id, -''wp_edit_presentation''); - end loop; - else - for record in select member_id - from group_member_map - where group_id = :group_id; - loop - acs_permission__grant_permission(:pres_item_id, c.member_id, -''wp_view_presentation''); - acs_permission__grant_permission(:pres_item_id, c.member_id, -''wp_edit_presentation''); - acs_permission__grant_permission(:pres_item_id, c.member_id, -''wp_admin_presentation''); - end loop; - end if; - - + begin + perform acs_permission__grant_permission(:pres_item_id, :member_id, :permission); + return 0; + end; </querytext> </fullquery> Index: openacs-4/packages/wp-slim/www/presentation-acl-add-group-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl-add-group-3.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/presentation-acl-add-group-3.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/presentation-acl-add-group-3.tcl 28 Aug 2003 09:42:00 -0000 1.2 @@ -16,30 +16,15 @@ ad_require_permission $pres_item_id wp_admin_presentation # adds a group of users -db_exec_plsql group_add { - declare - cursor v_cursor is - select member_id - from group_member_map - where group_id = :group_id; - begin - if :role = 'read' then - for c in v_cursor loop - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_view_presentation'); - end loop; - elsif (:role = 'write') then - for c in v_cursor loop - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_view_presentation'); - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_edit_presentation'); - end loop; - else - for c in v_cursor loop - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_view_presentation'); - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_edit_presentation'); - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_admin_presentation'); - end loop; - end if; - end; +db_foreach group_grant { *SQL } { + if {$role == "write"} { + set permission "wp_edit_presentation" + } elseif {$role == "admin"} { + set permission "wp_admin_presentation" + } else { + set permission "wp_view_presentation" + } + db_exec_plsql permission_grant { *SQL } } -ad_returnredirect presentation-acl?[export_url_vars pres_item_id] \ No newline at end of file +ad_returnredirect presentation-acl?[export_url_vars pres_item_id] Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/presentation-acl-add-group-3.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/wp-slim/www/presentation-acl.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wp-slim/www/presentation-acl.tcl 6 Sep 2002 15:32:23 -0000 1.2 +++ openacs-4/packages/wp-slim/www/presentation-acl.tcl 28 Aug 2003 09:42:00 -0000 1.3 @@ -16,20 +16,10 @@ pres_item_id } -ad_require_permission $pres_item_id wp_admin_presentation +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_admin_presentation -set user_id [ad_maybe_redirect_for_registration] -#wp_check_authorization $pres_item_id $user_id "write" -#db_1row pres_select { -#select title, -# creation_user, -# public_p, -# group_id -#from wp_presentations -#where pres_item_id = :pres_item_id -#} - db_1row get_presentaiton { select p.pres_title as title, p.public_p, @@ -90,4 +80,4 @@ db_release_unused_handles -ad_return_template \ No newline at end of file +ad_return_template Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/presentation-print-view-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/presentation-print-view-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/wp-slim/www/presentation-print-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-print-view.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wp-slim/www/presentation-print-view.adp 22 May 2003 15:18:55 -0000 1.2 +++ openacs-4/packages/wp-slim/www/presentation-print-view.adp 28 Aug 2003 09:42:00 -0000 1.3 @@ -1,5 +1,6 @@ <master> <property name="title">@pres_title;noquote@</property> +<property name="context">@context;noquote@</property> <h2>@pres_title@</h2> a Wimpy Point Presentation owned by <a href="/shared/community-member?user_id=@owner_id@">@owner_name@</a> Index: openacs-4/packages/wp-slim/www/presentation-print-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-print-view.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/presentation-print-view.tcl 21 Sep 2002 17:09:10 -0000 1.1 +++ openacs-4/packages/wp-slim/www/presentation-print-view.tcl 28 Aug 2003 09:42:00 -0000 1.2 @@ -2,7 +2,8 @@ ad_page_contract { This generates a printer friendly view of a presentation, suitable for print-out thru' a browser. @author Samir Joshi(samir@symphinity.com) - @creation-date Thu 8 Aug 2002 + @author Rocael HR (roc@viaro.net) + @creation-date Thu 1 Apr 2003 } { item_id:naturalnum,notnull @@ -18,7 +19,11 @@ owner_name:onevalue owner_id : onevalue } + +set context [list "Print View"] set user_id [ad_verify_and_get_user_id] +## permission checking roc@ +permission::require_permission -party_id $user_id -object_id $item_id -privilege wp_view_presentation set subsite_name [ad_conn package_url] regexp {^(.+)/$} $subsite_name match subsite_name Index: openacs-4/packages/wp-slim/www/presentation-print-view.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-print-view.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/presentation-print-view.xql 21 Sep 2002 17:09:10 -0000 1.1 +++ openacs-4/packages/wp-slim/www/presentation-print-view.xql 28 Aug 2003 09:42:00 -0000 1.2 @@ -51,18 +51,4 @@ </querytext> </fullquery> -<fullquery name="get_slide_info"> - <querytext> - select s.slide_title as title , - i.item_id as slide_id , - s.sort_key,wp_slide__get_preamble(i.item_id) as preamble, - wp_slide__get_postamble(i.item_id) as postamble, - wp_slide__get_bullet_items(i.item_id) as bullet_list - 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 - </querytext> -</fullquery> - </queryset> 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.3 -r1.4 --- openacs-4/packages/wp-slim/www/presentation-revisions.tcl 6 Sep 2002 15:32:23 -0000 1.3 +++ openacs-4/packages/wp-slim/www/presentation-revisions.tcl 28 Aug 2003 09:42:00 -0000 1.4 @@ -14,7 +14,12 @@ } +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_edit_presentation + + db_multirow revisions revisions_get { select r.revision_id, to_char(ao.creation_date, 'HH24:MI:SS Mon DD, YYYY') as creation_date, Index: openacs-4/packages/wp-slim/www/presentation-top-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-top-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/presentation-top-oracle.xql 4 Oct 2001 04:23:13 -0000 1.1 +++ openacs-4/packages/wp-slim/www/presentation-top-oracle.xql 28 Aug 2003 09:42:00 -0000 1.2 @@ -3,14 +3,16 @@ <queryset> <rdbms><type>oracle</type><version>8.1.6</version></rdbms> -<fullquery name="get_presentaiton"> +<fullquery name="get_presentation"> <querytext> select p.public_p, p.pres_title as presentation_title, acs_permission.permission_p(:pres_item_id, :user_id, 'wp_admin_presentation') as admin_p, acs_permission.permission_p(:pres_item_id, :user_id, 'wp_delete_presentation') as delete_p, - ao.creation_user + ao.creation_user, + p.show_comments_p, + p.presentation_id from cr_wp_presentations p, cr_items i, acs_objects ao @@ -21,19 +23,23 @@ </querytext> </fullquery> - -<fullquery name="get_viewers"> + +<fullquery name="get_users"> <querytext> - select first_names || ' ' || last_name as full_name, - person_id, - acs_permission.permission_p(:pres_item_id, person_id, 'wp_view_presentation') as view_p, - acs_permission.permission_p(:pres_item_id, person_id, 'wp_edit_presentation') as edit_p, - acs_permission.permission_p(:pres_item_id, person_id, 'wp_admin_presentation') as admin_p - from persons - where acs_permission.permission_p(:pres_item_id, person_id, 'wp_view_presentation') = 't' - or acs_permission.permission_p(:pres_item_id, person_id, 'wp_edit_presentation') = 't' - or acs_permission.permission_p(:pres_item_id, person_id, 'wp_admin_presentation') = 't' + select distinct (p.person_id), + p.first_names || ' ' || p.last_name as full_name, + perm.privilege + 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' + or perm.privilege = 'wp_edit_presentation' + or perm.privilege = 'wp_admin_presentation' + ) + order by p.person_id, perm.privilege ASC </querytext> </fullquery> Index: openacs-4/packages/wp-slim/www/presentation-top-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-top-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wp-slim/www/presentation-top-postgresql.xql 17 May 2003 12:50:50 -0000 1.2 +++ openacs-4/packages/wp-slim/www/presentation-top-postgresql.xql 28 Aug 2003 09:42:00 -0000 1.3 @@ -3,14 +3,16 @@ <queryset> <rdbms><type>postgresql</type><version>7.1</version></rdbms> -<fullquery name="get_presentaiton"> +<fullquery name="get_presentation"> <querytext> select p.public_p, p.pres_title as presentation_title, acs_permission__permission_p(:pres_item_id, :user_id, 'wp_admin_presentation') as admin_p, acs_permission__permission_p(:pres_item_id, :user_id, 'wp_delete_presentation') as delete_p, - ao.creation_user + ao.creation_user, + p.show_comments_p, + p.presentation_id from cr_wp_presentations p, cr_items i, acs_objects ao @@ -21,19 +23,23 @@ </querytext> </fullquery> - -<fullquery name="get_viewers"> + +<fullquery name="get_users"> <querytext> - select first_names || ' ' || last_name as full_name, - person_id, - acs_permission__permission_p(:pres_item_id, person_id, 'wp_view_presentation') as view_p, - acs_permission__permission_p(:pres_item_id, person_id, 'wp_edit_presentation') as edit_p, - acs_permission__permission_p(:pres_item_id, person_id, 'wp_admin_presentation') as admin_p - from persons - where acs_permission__permission_p(:pres_item_id, person_id, 'wp_view_presentation') = 't' - or acs_permission__permission_p(:pres_item_id, person_id, 'wp_edit_presentation') = 't' - or acs_permission__permission_p(:pres_item_id, person_id, 'wp_admin_presentation') = 't' + select distinct on (p.person_id) p.person_id, + p.first_names || ' ' || p.last_name as full_name, + perm.privilege + 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' + or perm.privilege = 'wp_edit_presentation' + or perm.privilege = 'wp_admin_presentation' + ) + order by p.person_id, perm.privilege ASC </querytext> </fullquery> Index: openacs-4/packages/wp-slim/www/presentation-top.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-top.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/wp-slim/www/presentation-top.adp 22 May 2003 15:18:55 -0000 1.5 +++ openacs-4/packages/wp-slim/www/presentation-top.adp 28 Aug 2003 09:42:00 -0000 1.6 @@ -3,7 +3,6 @@ <property name="context">@context;noquote@</property> <h3>The Slides</h3> - <if @slides:rowcount@ eq 0> <a href="create-slide?sort_key=1&pres_item_id=@pres_item_id@">Create the first slide.</a> </if> @@ -16,7 +15,7 @@ <td> [ <a href="edit-slide?slide_item_id=@slides.slide_item_id@&pres_item_id=@pres_item_id@">edit</a> | <if @delete_p@ eq t> - <a href="delete-slide?slide_item_id=@slides.slide_item_id@&pres_item_id=@pres_item_id@">delete</a> | + <a href="delete-slide?slide_item_id=@slides.slide_item_id@&pres_item_id=@pres_item_id@&slide_title=@slides.slide_title@">delete</a> | </if> <a href="attach-list?slide_item_id=@slides.slide_item_id@&pres_item_id=@pres_item_id@">attach</a> | <a href="slide-revisions?slide_item_id=@slides.slide_item_id@&pres_item_id=@pres_item_id@">view revisions</a>] @@ -37,6 +36,7 @@ <h3>Options</h3> <ul> <li> <a href="display/@pres_item_id@/">Show presentation.</a> +<li> <a href="presentation-print-view.tcl?item_id=@pres_item_id@">Printer friendly view. </a> <li> <a href="edit-presentation?pres_item_id=@pres_item_id@">Edit presentation properties.</a> <if @delete_p@ eq t> <li> <a href="delete-presentation?pres_item_id=@pres_item_id@&title=@encoded_title@">Delete this presentation.</a> @@ -49,28 +49,33 @@ <if @public_p@ eq t> <li> Everyone can view the presentation, since it is public. </if> -<multiple name="viewers"> - <li><a href="/shared/community-member?user_id=@viewers.person_id@">@viewers.full_name@</a> - <if @viewers.person_id@ eq @creation_user@> +<multiple name="users"> + <li><a href="/shared/community-member?user_id=@users.person_id@">@users.full_name@</a> + <if @users.person_id@ eq @creation_user@> (creator) </if> - <if @viewers.person_id@ eq @user_id@> + <if @users.person_id@ eq @user_id@> (You) </if> - [ - <if @viewers.view_p@ eq t> - read + <if @users.privilege@ eq "wp_admin_presentation"> + [ admin ] </if> - <if @viewers.edit_p@ eq t> - write - </if> - <if @viewers.admin_p@ eq t> - admin - </if> - ] + <elseif @users.privilege@ eq "wp_edit_presentation"> + [ editor ] + </elseif> + <else> + [ viewer ] + </else> </multiple> + <if @admin_p@ eq t> <li><a href="presentation-acl?pres_item_id=@pres_item_id@">Change people who can view/edit this presentation</a> +<if @show_comments_p@ eq "t"> + <li>All viewers can see the comments (<a href=toggle-comments-view?pres_item_id=@pres_item_id@&presentation_id=@presentation_id@&view=f>make available only for editors</a>) + </if> +<else> + <li>Editors can see the comments (<a href=toggle-comments-view?pres_item_id=@pres_item_id@&presentation_id=@presentation_id@&view=t>make available to all viewers</a>) +</else> </if> </ul> 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.4 -r1.5 --- openacs-4/packages/wp-slim/www/presentation-top.tcl 6 Sep 2002 15:32:23 -0000 1.4 +++ openacs-4/packages/wp-slim/www/presentation-top.tcl 28 Aug 2003 09:42:00 -0000 1.5 @@ -22,22 +22,13 @@ } +#added permission checking roc@ set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_edit_presentation -db_1row get_presentaiton { -select p.public_p, - p.pres_title as presentation_title, - acs_permission.permission_p(:pres_item_id, :user_id, 'wp_admin_presentation') as admin_p, - acs_permission.permission_p(:pres_item_id, :user_id, 'wp_delete_presentation') as delete_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 = :pres_item_id -} +db_1row get_presentation { *SQL* } + set encoded_title [ns_urlencode $presentation_title] set context [list "$presentation_title"] set subsite_name [ad_conn package_url] @@ -51,18 +42,17 @@ order by s.sort_key } -db_multirow viewers get_viewers { - select first_names || ' ' || last_name as full_name, - person_id, - acs_permission.permission_p(:pres_item_id, person_id, 'wp_view_presentation') as view_p, - acs_permission.permission_p(:pres_item_id, person_id, 'wp_edit_presentation') as edit_p, - acs_permission.permission_p(:pres_item_id, person_id, 'wp_admin_presentation') as admin_p - from persons - where acs_permission.permission_p(:pres_item_id, person_id, 'wp_view_presentation') = 't' - or acs_permission.permission_p(:pres_item_id, person_id, 'wp_edit_presentation') = 't' - or acs_permission.permission_p(:pres_item_id, person_id, 'wp_admin_presentation') = 't' +#lets not show duplicate users for this +#the oracle select distinct (p.person_id) doesn't work? so lets verify it in the db_multirow, in PG works fine =) roc@ +set users_list [list] +db_multirow users get_users {} { + if {[lsearch $users_list $person_id] != -1} { + continue + } + lappend users_list $person_id } + #set public_p [db_string get_permissions { #select decode(count(1),1,'The Public','') #from acs_permissions 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 -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/presentation-top.xql 4 Oct 2001 04:29:01 -0000 1.1 +++ openacs-4/packages/wp-slim/www/presentation-top.xql 28 Aug 2003 09:42:00 -0000 1.2 @@ -14,5 +14,5 @@ </querytext> </fullquery> - + </queryset> Index: openacs-4/packages/wp-slim/www/serve-presentation-revision-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-presentation-revision-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/serve-presentation-revision-oracle.xql 4 Oct 2001 04:23:13 -0000 1.1 +++ openacs-4/packages/wp-slim/www/serve-presentation-revision-oracle.xql 28 Aug 2003 09:42:00 -0000 1.2 @@ -12,7 +12,8 @@ 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 + wp_presentation.get_background_revision(:pres_revision_id) as background, + p.style from cr_wp_presentations p, cr_items i where i.item_id = :pres_item_id and p.presentation_id = :pres_revision_id Index: openacs-4/packages/wp-slim/www/serve-presentation-revision-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-presentation-revision-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/serve-presentation-revision-postgresql.xql 4 Oct 2001 04:23:13 -0000 1.1 +++ openacs-4/packages/wp-slim/www/serve-presentation-revision-postgresql.xql 28 Aug 2003 09:42:00 -0000 1.2 @@ -10,7 +10,8 @@ p.page_signature, p.copyright_notice, p.public_p, - p.show_modified_p + p.show_modified_p, + p.style from cr_wp_presentations p, cr_items i where i.item_id = :pres_item_id and p.presentation_id = :pres_revision_id 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.6 -r1.7 --- openacs-4/packages/wp-slim/www/serve-presentation-revision.adp 22 May 2003 15:18:55 -0000 1.6 +++ openacs-4/packages/wp-slim/www/serve-presentation-revision.adp 28 Aug 2003 09:42:00 -0000 1.7 @@ -1,6 +1,9 @@ -<master> +<master src="wp-presentation-master"> <property name="title">@pres_title;noquote@</property> <property name="context">@context;noquote@</property> +<property name="style_id">@style;noquote@</property> +<property name="page_signature">@page_signature;noquote@</property> +<property name="copyright_notice">@copyright_notice;noquote@</property> <h3>One Revision</h3> @@ -30,7 +33,7 @@ <th align=left>Show Modified Date?</th> <td>@show_modified_p@</td> </tr> - +wp <tr> <th align=left>Audience</th> <td>@audience@</td> 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.4 -r1.5 --- openacs-4/packages/wp-slim/www/serve-presentation-revision.tcl 6 Sep 2002 15:32:23 -0000 1.4 +++ openacs-4/packages/wp-slim/www/serve-presentation-revision.tcl 28 Aug 2003 09:42:00 -0000 1.5 @@ -25,6 +25,10 @@ ad_return_error "Wimpy Point" "Could not get a pres_item_id and a pres_revision_id out of url=$url" } +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_view_presentation + set subsite_name [ad_conn package_url] regexp {^(.+)/$} $subsite_name match subsite_name Index: openacs-4/packages/wp-slim/www/serve-presentation-revision.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-presentation-revision.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/serve-presentation-revision.xql 15 Nov 2001 01:47:13 -0000 1.1 +++ openacs-4/packages/wp-slim/www/serve-presentation-revision.xql 28 Aug 2003 09:42:00 -0000 1.2 @@ -6,9 +6,9 @@ <querytext> select p.pres_title, p.page_signature, - p.copyright_notice, p.public_p, - p.show_modified_p + p.show_modified_p , + p.copyright_notice from cr_wp_presentations p, cr_items i where i.item_id = :pres_item_id and p.presentation_id = :pres_revision_id Index: openacs-4/packages/wp-slim/www/serve-presentation.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-presentation.adp,v diff -u -r1.7 -r1.8 --- openacs-4/packages/wp-slim/www/serve-presentation.adp 22 May 2003 15:18:55 -0000 1.7 +++ openacs-4/packages/wp-slim/www/serve-presentation.adp 28 Aug 2003 09:42:00 -0000 1.8 @@ -1,19 +1,30 @@ <master src="wp-presentation-master"> <property name="title">@pres_title;noquote@</property> <property name="context">"one presentation"</property> +<property name="style_id">@style@</property> +<property name="page_signature">@page_signature@</property> +<property name="copyright_notice">@copyright_notice@</property> <table align=right> <tr> - <td><a href="@subsite_name@">done</a> | + <td><a href="@subsite_name@">done</a> <if @first_slide_item_id@ not nil> - <a href="@subsite_name@/display/@pres_item_id@/@first_slide_item_id@.wimpy">next</a> + | <a href="@subsite_name@/display/@pres_item_id@/@first_slide_item_id@.wimpy">next</a> </if> </td> </tr> </table> <h2>@pres_title@</h2> a Wimpy Point Presentation owned by <a href="/shared/community-member?user_id=@owner_id@">@owner_name@</a> +<if @collaborators:rowcount@ gt 0> +<br> in collaboration with +<multiple name="collaborators"> +<a href="/shared/community-member?user_id=@collaborators.person_id@">@collaborators.full_name@</a> +<if @collaborators.rownum@ lt @collaborators:rowcount@>, </if> +</multiple> +</if> +. <hr> <ul> @@ -22,6 +33,3 @@ </multiple> </ul> -<p>Here is a <a href="@subsite_name@/presentation-print-view.tcl?item_id=@pres_item_id@">printer-friendly</a> version of the presentation. - <br> -@page_signature@ 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.3 -r1.4 --- openacs-4/packages/wp-slim/www/serve-presentation.tcl 21 Sep 2002 17:09:10 -0000 1.3 +++ openacs-4/packages/wp-slim/www/serve-presentation.tcl 28 Aug 2003 09:42:00 -0000 1.4 @@ -24,6 +24,9 @@ ad_return_error "Wimpy Point" "Could not get a pres_item_id and slide_item_id out of url=$url" } +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_view_presentation set subsite_name [ad_conn package_url] regexp {^(.+)/$} $subsite_name match subsite_name @@ -37,12 +40,7 @@ and exists (select 1 from cr_wp_slides s where s.slide_id=cr_items.live_revision and s.sort_key=1) } -db_1row get_presentation_info { - 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 -} +db_1row get_presentation_info { *SQL* } db_1row get_owner_name { select first_names || ' ' || last_name as owner_name, person_id as owner_id @@ -59,4 +57,13 @@ order by s.sort_key " +set users_list [list] +db_multirow collaborators get_collaborators { *SQL* } { + if {[lsearch $users_list $person_id] != -1} { + continue + } + lappend users_list $person_id +} + + 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 -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/serve-presentation.xql 4 Oct 2001 04:29:01 -0000 1.1 +++ openacs-4/packages/wp-slim/www/serve-presentation.xql 28 Aug 2003 09:42:00 -0000 1.2 @@ -17,7 +17,7 @@ <fullquery name="get_presentation_info"> <querytext> - select p.pres_title, p.page_signature + select p.pres_title, p.page_signature, p.style, p.copyright_notice from cr_wp_presentations p, cr_items i where i.item_id = :pres_item_id and i.live_revision = p.presentation_id @@ -50,5 +50,26 @@ </querytext> </fullquery> + +<fullquery name="get_collaborators"> + <querytext> + + select p.person_id, + p.first_names || ' ' || p.last_name as full_name, + perm.privilege + from persons p, + acs_permissions perm + where perm.object_id = :pres_item_id + and perm.grantee_id <> :owner_id + and perm.grantee_id = p.person_id + and + ( perm.privilege = 'wp_edit_presentation' + or perm.privilege = 'wp_admin_presentation' + ) + order by p.person_id, perm.privilege ASC + + + </querytext> +</fullquery> </queryset> Index: openacs-4/packages/wp-slim/www/serve-slide-revision.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-slide-revision.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/wp-slim/www/serve-slide-revision.adp 22 May 2003 15:18:55 -0000 1.5 +++ openacs-4/packages/wp-slim/www/serve-slide-revision.adp 28 Aug 2003 09:42:00 -0000 1.6 @@ -1,6 +1,9 @@ -<master> +<master src="wp-presentation-master"> <property name="title">@slide_title;noquote@</property> <property name="context">@context;noquote@</property> +<property name="style_id">@style;noquote@</property> +<property name="page_signature">@page_signature;noquote@</property> +<property name="copyright_notice">@copyright_notice;noquote@</property> <if @show_modified_p@ eq t> <i>Last modified @modified_date@</i> @@ -84,4 +87,4 @@ </multiple> -@page_signature@ \ No newline at end of file +@page_signature@ 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.3 -r1.4 --- openacs-4/packages/wp-slim/www/serve-slide-revision.tcl 6 Sep 2002 15:32:23 -0000 1.3 +++ openacs-4/packages/wp-slim/www/serve-slide-revision.tcl 28 Aug 2003 09:42:00 -0000 1.4 @@ -31,6 +31,9 @@ ad_return_error "Wimpy Point" "Could not get a pres_item_id, slide_item_id and slide_revision_id out of url=$url" } +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_view_presentation set subsite_name [ad_conn package_url] regexp {^(.+)/$} $subsite_name match subsite_name 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 -r1.2 -r1.3 --- openacs-4/packages/wp-slim/www/serve-slide-revision.xql 15 Nov 2001 01:47:13 -0000 1.2 +++ openacs-4/packages/wp-slim/www/serve-slide-revision.xql 28 Aug 2003 09:42:00 -0000 1.3 @@ -5,7 +5,9 @@ <querytext> select p.page_signature, - p.show_modified_p + p.copyright_notice, + p.show_modified_p, + p.style from cr_wp_presentations p, cr_items i where i.item_id = :pres_item_id and i.live_revision = p.presentation_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.8 -r1.9 --- openacs-4/packages/wp-slim/www/serve-slide.adp 22 May 2003 15:18:55 -0000 1.8 +++ openacs-4/packages/wp-slim/www/serve-slide.adp 28 Aug 2003 09:42:00 -0000 1.9 @@ -1,6 +1,9 @@ <master src="wp-presentation-master"> <property name="title">@slide_title;noquote@</property> <property name="context">@context;noquote@</property> +<property name="style_id">@style;noquote@</property> +<property name="page_signature">@page_signature;noquote@</property> +<property name="copyright_notice">@copyright_notice;noquote@</property> <table align=right> <tr> @@ -94,3 +97,23 @@ @page_signature@ +<if @edit_p@ eq 1 or @show_comments_p@ eq "t"> + +<if @comments@ ne ""> +<h3>Slide Comments</h3> +@comments@ +</if> + +</if> + + +<if @edit_p@ eq 1> + +<if @comment_link@ ne ""> +<ul> +<li> +@comment_link@ +</ul> +</if> + +</if> 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.5 -r1.6 --- openacs-4/packages/wp-slim/www/serve-slide.tcl 6 Sep 2002 15:32:23 -0000 1.5 +++ openacs-4/packages/wp-slim/www/serve-slide.tcl 28 Aug 2003 09:42:00 -0000 1.6 @@ -29,7 +29,19 @@ ad_return_error "Wimpy Point" "Could not get a pres_item_id and slide_item_id out of url=$url" } +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_view_presentation +set edit_p 0 +if {[permission::permission_p -party_id $user_id -object_id $pres_item_id -privilege wp_edit_presentation]} { + set edit_p 1 +} +set delete_p 0 +if {[permission::permission_p -party_id $user_id -object_id $pres_item_id -privilege wp_delete_presentation]} { + set delete_p 1 +} + set subsite_name [ad_conn package_url] regexp {^(.+)/$} $subsite_name match subsite_name #set pkg_key [ad_conn package_key] @@ -48,13 +60,7 @@ and ao.object_id = s.slide_id } -db_1row get_presentation_page_signature { - 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 -} +db_1row get_presentation_page_signature { *SQL* } set context [list [list "$subsite_name/display/$pres_item_id" "one presentation"] "one slide"] @@ -90,10 +96,8 @@ if {$sort_key == 1} { # this is the only slide. set href_back "" - set href_forward "<a href=\"$subsite_name/display/$pres_item_id\">top</a>" - } else { - set href_forward {} } + set href_forward "<a href=\"$subsite_name/display/$pres_item_id\">top</a>" } else { set href_forward "<a href=\"$subsite_name/display/$pres_item_id/${next_slide_item_id}.wimpy\">next</a>" } @@ -107,5 +111,22 @@ and i.live_revision = x.attach_id } -set href_back_forward "$href_back $href_forward" +set extra "" +if {$edit_p == 1} { + append extra "<a href=\"$subsite_name/edit-slide?[export_url_vars slide_item_id pres_item_id]\">edit</a> | " +} +if {$delete_p == 1} { + append extra "<a href=\"$subsite_name/delete-slide?[export_url_vars slide_item_id pres_item_id slide_title]\">delete</a> |" +} + +set href_back_forward "$href_back $extra $href_forward" + + +#comments capability added roc@ +if {$edit_p == 1 || $show_comments_p == "t"} { + set comment_link [general_comments_create_link $slide_item_id $url] + set comments [general_comments_get_comments -print_content_p 1 -print_attachments_p 1 \ + $slide_item_id $url] +} + 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 -r1.2 -r1.3 --- openacs-4/packages/wp-slim/www/serve-slide.xql 15 Nov 2001 01:47:13 -0000 1.2 +++ openacs-4/packages/wp-slim/www/serve-slide.xql 28 Aug 2003 09:42:00 -0000 1.3 @@ -5,7 +5,10 @@ <querytext> select p.page_signature, - p.show_modified_p + p.copyright_notice, + p.show_modified_p, + p.style, + p.show_comments_p from cr_wp_presentations p, cr_items i where i.item_id = :pres_item_id and i.live_revision = p.presentation_id Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/serve-style.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/wp-slim/www/slide-publish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/slide-publish.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/slide-publish.tcl 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/slide-publish.tcl 28 Aug 2003 09:42:00 -0000 1.2 @@ -10,8 +10,13 @@ } { revision_id:naturalnum,notnull return_url:notnull + pres_item_id:notnull } +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_edit_presentation + db_exec_plsql live_revision_set { declare v_revision_id cr_revisions.revision_id%TYPE; @@ -35,4 +40,4 @@ end; } -ad_returnredirect $return_url \ No newline at end of file +ad_returnredirect $return_url Index: openacs-4/packages/wp-slim/www/slide-revisions.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/slide-revisions.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/wp-slim/www/slide-revisions.adp 22 May 2003 15:18:55 -0000 1.4 +++ openacs-4/packages/wp-slim/www/slide-revisions.adp 28 Aug 2003 09:42:00 -0000 1.5 @@ -14,7 +14,7 @@ <font color=red>Created by @revisions.full_name@ from @revisions.creation_ip@ at @revisions.creation_date@</font> (<a href="@subsite_name@slide_revision/@pres_item_id@/@slide_item_id@/@revisions.revision_id@.wimpy">view</a>) </if> <else> -Created by @revisions.full_name@ from @revisions.creation_ip@ at @revisions.creation_date@ (<a href="@subsite_name@slide_revision/@pres_item_id@/@slide_item_id@/@revisions.revision_id@.wimpy">view</a> | <a href="slide-publish?revision_id=@revisions.revision_id@&return_url=@return_url@">go live</a>) +Created by @revisions.full_name@ from @revisions.creation_ip@ at @revisions.creation_date@ (<a href="@subsite_name@slide_revision/@pres_item_id@/@slide_item_id@/@revisions.revision_id@.wimpy">view</a> | <a href="slide-publish?revision_id=@revisions.revision_id@&pres_item_id=@pres_item_id@&return_url=@return_url@">go live</a>) </else> </multiple> 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.3 -r1.4 --- openacs-4/packages/wp-slim/www/slide-revisions.tcl 6 Sep 2002 15:32:23 -0000 1.3 +++ openacs-4/packages/wp-slim/www/slide-revisions.tcl 28 Aug 2003 09:42:00 -0000 1.4 @@ -16,7 +16,11 @@ subsite_name } +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_edit_presentation + set subsite_name [ad_conn package_url] set context [list [list "presentation-top?[export_url_vars pres_item_id]" "Presentation"] "Slide Revisions"] 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.2 -r1.3 --- openacs-4/packages/wp-slim/www/slides-reorder-2.tcl 4 Oct 2001 04:29:01 -0000 1.2 +++ openacs-4/packages/wp-slim/www/slides-reorder-2.tcl 28 Aug 2003 09:42:00 -0000 1.3 @@ -12,6 +12,10 @@ } +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_edit_presentation + # Just iterate over the values for slide_id in order and set their respective # sort_keys to 1, 2, 3, ... set counter 0 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.3 -r1.4 --- openacs-4/packages/wp-slim/www/slides-reorder.tcl 6 Sep 2002 15:32:23 -0000 1.3 +++ openacs-4/packages/wp-slim/www/slides-reorder.tcl 28 Aug 2003 09:42:00 -0000 1.4 @@ -14,6 +14,10 @@ } +#added permission checking roc@ +set user_id [ad_verify_and_get_user_id] +permission::require_permission -party_id $user_id -object_id $pres_item_id -privilege wp_edit_presentation + set header [ad_header "Reorder Slides"] Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-delete-2-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-delete-2-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-delete-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-delete.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-delete.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-edit-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-edit-2.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-edit.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-edit.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-edit.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-image-add.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-image-add.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-image-delete-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-image-delete-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-image-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-list-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-list-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-list.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-list.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-list.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-view.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-view.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/style-view.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/toggle-comments-view.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/toggle-comments-view.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/wp-slim/www/upload-attachments.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/upload-attachments.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/wp-slim/www/upload-attachments.adp 22 May 2003 15:18:55 -0000 1.4 +++ openacs-4/packages/wp-slim/www/upload-attachments.adp 28 Aug 2003 09:42:00 -0000 1.5 @@ -9,19 +9,14 @@ <center><p> <table border=2 cellpadding=10><tr><td> <table cellspacing=0 cellpadding=0> -<tr> - <th align=left nowrap>File Name</th><td> </td> - <th align=right nowrap>File Size</th><td> </td> - <th nowrap>Display</th> -</tr> <tr><td colspan=7><hr></td></tr> <tr><td colspan=7 align=center><i>There are <if @attachment_count@ eq 0> @attachment_count@ </if> <else> -<a href="attach-list?slide_item_id=@slide_item_id@">@attachment_count@</a> +<a href="attach-list?slide_item_id=@slide_item_id@&pres_item_id=@pres_item_id@">@attachment_count@</a> </else> attachments currently associated with this slide.</i></td></tr> Index: openacs-4/packages/wp-slim/www/users.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/users.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/wp-slim/www/users.adp 22 May 2003 15:18:55 -0000 1.4 +++ openacs-4/packages/wp-slim/www/users.adp 28 Aug 2003 09:42:00 -0000 1.5 @@ -9,4 +9,8 @@ <li><a href="/shared/community-member?user_id=@users.person_id@">@users.first_names@ @users.last_name@</a>, @users.email@ (@users.num_presentations@) </multiple> </ul> - +<p> +Note: this is not a complete list of the users. +Users who are collaborators on +presentations owned by others are excluded. Users who have created +only private presentations are excluded. Index: openacs-4/packages/wp-slim/www/users.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/users.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/wp-slim/www/users.tcl 6 Sep 2002 15:32:23 -0000 1.3 +++ openacs-4/packages/wp-slim/www/users.tcl 28 Aug 2003 09:42:00 -0000 1.4 @@ -32,11 +32,6 @@ group by p.person_id, p.first_names, p.last_name, parties.email } -set footer "Note: this is not a complete list of the users. -Users who are collaborators on -presentations owned by others are excluded. Users who have created -only private presentations are excluded. -[ad_footer]" ad_return_template Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/view-image.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/wp-slim/www/wp-presentation-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/wp-presentation-master.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/wp-slim/www/wp-presentation-master.adp 22 May 2003 15:18:55 -0000 1.3 +++ openacs-4/packages/wp-slim/www/wp-presentation-master.adp 28 Aug 2003 09:42:00 -0000 1.4 @@ -1,16 +1,20 @@ <html> <head> +<link rel=stylesheet href="<%=[ad_conn package_url]%>styles/<if @style_id@ eq "-1">default</if><else>@style_id@</else>/style.css" type="text/css"> <title>@title@</title> @header_stuff@ </head> -<body<multiple name=attribute> @attribute.key@="@attribute.value@"</multiple>> +<body <%=[wp_header $style_id]%>> <if @body_start_include@ not nil> <include src="@body_start_include;noquote@" /> </if> <slave> +<br> +@copyright_notice@ + <hr /> -<address><a href="mailto:@signatory@">@signatory@</a></address> +<address><a href="mailto:@page_signature@">@page_signature@</a></address> @ds_link@ </body> </html> Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/www/blank-master.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/www/blank-master.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/www/default-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/default-master.adp,v diff -u -r1.13 -r1.14 --- openacs-4/www/default-master.adp 26 Aug 2003 13:38:26 -0000 1.13 +++ openacs-4/www/default-master.adp 28 Aug 2003 09:49:50 -0000 1.14 @@ -1,10 +1,9 @@ -@doc_type;noquote@ -<html> -<head> -<title>@title;noquote@</title> -@header_stuff;noquote@ -</head> -<body<multiple name=attribute> @attribute.key@="@attribute.value@"</multiple>> +<master src="blank-master"> + <property name="title">@title;noquote@</property> + <if @header_stuff@ not nil><property name="header_stuff">@header_stuff;noquote@</property></if> + <if @focus@ not nil><property name="focus">@focus;noquote@</property></if> + <if @doc_type@ not nil><property name="focus">@doc_type;noquote@</property></if> + <include src="login-status" /> <if @body_start_include@ not nil> @@ -15,11 +14,8 @@ @context_bar;noquote@ <hr /> <slave> -<if @curriculum_bar_p@> +<if @curriculum_bar_p@ true> <include src="/packages/curriculum/lib/bar" /> </if> <hr /> <address><a href="mailto:@signatory@">@signatory@</a></address> -@ds_link;noquote@ -</body> -</html> Index: openacs-4/www/default-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/default-master.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/www/default-master.tcl 26 Aug 2003 13:39:13 -0000 1.13 +++ openacs-4/www/default-master.tcl 28 Aug 2003 09:49:50 -0000 1.14 @@ -8,16 +8,12 @@ # $Id$ # -# fall back on defaults for title, signatory and header_stuff +# fall back on defaults if { [template::util::is_nil title] } { set title [ad_conn instance_name] } -if { [template::util::is_nil doc_type] } { - set doc_type {<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">} -} - if { [template::util::is_nil signatory] } { set signatory [ad_system_owner] } @@ -30,11 +26,7 @@ set context_bar [ad_context_bar] } -if { ![info exists header_stuff] } { - set header_stuff {} -} - # Attributes template::multirow create attribute key value @@ -54,29 +46,6 @@ [ad_parameter -package_id $pkg_id background dummy "/graphics/bg.gif"] } -if { ![template::util::is_nil focus] } { - # Handle elements wohse name contains a dot - - if { [regexp {^([^.]*)\.(.*)$} $focus match form_name element_name] } { - # Add safety code to test that the element exists - set header_stuff "$header_stuff - <script language=\"JavaScript\"> - function acs_focus( form_name, element_name ){ - if (document.forms == null) return; - if (document.forms\[form_name\] == null) return; - if (document.forms\[form_name\].elements\[element_name\] == null) return; - - document.forms\[form_name\].elements\[element_name\].focus(); - } - </script> - " - - template::multirow append \ - attribute onload "javascript:acs_focus('${form_name}', '${element_name}')" - } -} - - # Developer-support if { [llength [namespace eval :: info procs ds_link]] == 1 } { Index: openacs-4/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/Attic/index-oracle.xql,v diff -u -r1.4 -r1.5 --- openacs-4/www/index-oracle.xql 15 Apr 2003 10:32:08 -0000 1.4 +++ openacs-4/www/index-oracle.xql 28 Aug 2003 09:49:50 -0000 1.5 @@ -18,7 +18,7 @@ 'read') = 't' and apm_packages.package_id = site_nodes.object_id and apm_package_types.package_key = apm_packages.package_key - order by initial_install_p, name + order by initial_install_p, upper(name), name </querytext> </fullquery> Index: openacs-4/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/Attic/index-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/www/index-postgresql.xql 15 Apr 2003 10:32:08 -0000 1.4 +++ openacs-4/www/index-postgresql.xql 28 Aug 2003 09:49:50 -0000 1.5 @@ -18,7 +18,7 @@ 'read') = 't' and apm_packages.package_id = site_nodes.object_id and apm_package_types.package_key = apm_packages.package_key - order by initial_install_p, name + order by initial_install_p, upper(acs_object__name(object_id)) </querytext> </fullquery> Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/www/lists.css'. Fisheye: No comparison available. Pass `N' to diff?