Index: openacs-4/packages/dotfolio-ui/lib/dotfolio-master.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio-ui/lib/dotfolio-master.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/dotfolio-ui/lib/dotfolio-master.tcl 23 Jun 2005 01:39:02 -0000 1.2
+++ openacs-4/packages/dotfolio-ui/lib/dotfolio-master.tcl 2 Aug 2005 01:50:07 -0000 1.3
@@ -22,6 +22,13 @@
set subnavbar_link {}
}
+# Rename title to page_title, as title is used below for the navigation tabs.
+if { ![info exists title] } {
+ set page_title {}
+} else {
+ set page_title $title
+}
+
set dotfolioCSS [parameter::get_from_package_key -parameter "DotfolioCSS" \
-package_key "dotfolio"]
@@ -39,6 +46,10 @@
set subsite_url {}
}
+set user_id [ad_conn user_id]
+set is_adviser_p 0
+set has_dotfolio_p [dotfolio::has_dotfolio_p -user_id $user_id]
+
# Need to ignore the admin section to avoid permissions problems.
# Would prefer portfolio owners to be subsite administrators but not
# have all the privileges of an administrator. Do not want to display
@@ -48,11 +59,45 @@
# Refer to proc get_pageflow_struct in
# /packages/acs-subsite/tcl/subsite-procs.tcl.
template::multirow create tabs name label title url selected_p link_p
-template::multirow foreach sections {
- if {![string equal $name "admin"]} {
+# If the user is an owner or admin, then display all tabs except admin.
+if { [dotfolio::user::owner_p -node_id $subsite_node_id $user_id] || \
+ [dotfolio::admin_p -user_id $user_id]} {
+ template::multirow foreach sections {
- template::multirow append tabs $name $label $title $url \
- $selected_p $link_p
+ if {![string equal $name "admin"]} {
+
+ template::multirow append tabs $name $label $title $url \
+ $selected_p $link_p
+ }
}
+
+} elseif { [dotfolio::user::type_adviser_p -user_id $user_id] } {
+ set is_adviser_p 1
+
+ # Else if user is an adviser, then display all tabs except admin
+ # and the organiser tab.
+ template::multirow foreach sections {
+
+ if {![string equal $name "admin"] && \
+ ![string equal $name "organise"] && \
+ ![string equal $name "members"]} {
+
+ template::multirow append tabs $name $label $title $url \
+ $selected_p $link_p
+ }
+ }
+
+} else {
+ # Otherwise only display home and blog tabs.
+ template::multirow foreach sections {
+
+ if {[string equal $name "home"] || \
+ [string equal $name "blog"]} {
+
+ template::multirow append tabs $name $label $title $url \
+ $selected_p $link_p
+ }
+ }
+
}
Index: openacs-4/packages/dotfolio-ui/lib/index-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio-ui/lib/index-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/dotfolio-ui/lib/index-postgresql.xql 5 May 2005 08:54:42 -0000 1.1
+++ openacs-4/packages/dotfolio-ui/lib/index-postgresql.xql 2 Aug 2005 01:50:07 -0000 1.2
@@ -11,6 +11,8 @@
WHERE pkg.package_key = 'lars-blogger'
AND pkg.package_id IN ([join $list_of_package_ids ,])
AND blog.package_id = pkg.package_id
+ AND blog.draft_p = 'f'
+ AND blog.deleted_p = 'f'
ORDER BY blog.entry_date DESC
Index: openacs-4/packages/dotfolio-ui/lib/related-items.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio-ui/lib/related-items.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/dotfolio-ui/lib/related-items.adp 5 May 2005 08:54:42 -0000 1.1
+++ openacs-4/packages/dotfolio-ui/lib/related-items.adp 2 Aug 2005 01:50:07 -0000 1.2
@@ -3,9 +3,9 @@
Index: openacs-4/packages/dotfolio-ui/lib/related-items.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio-ui/lib/related-items.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/dotfolio-ui/lib/related-items.tcl 23 Jun 2005 01:39:02 -0000 1.2
+++ openacs-4/packages/dotfolio-ui/lib/related-items.tcl 2 Aug 2005 01:50:07 -0000 1.3
@@ -9,16 +9,21 @@
}
-set url [dotfolio::ui::organiser_url]
set return_url [ad_return_url]
set delete_related_url "related/relation-delete"
+set user_id [ad_conn user_id]
+set url [dotfolio::ui::users_organiser_url -user_id $user_id]
# Stuff for related items
relation::get_related -object_id $displayed_object_id -datasource related
-template::multirow extend related delete_url
+template::multirow extend related delete_url object_type created_rel_p
template::multirow foreach related {
set delete_url [export_vars -base $url$delete_related_url \
{rel_id return_url}]
+
+ set object_type [dotfolio::object_type_pretty_name -object_id $object_id]
+
+ set created_rel_p [dotfolio::ui::created_rel_p -user_id $user_id -rel_id $rel_id]
}
template::list::create \
@@ -27,16 +32,23 @@
-key object_id \
-elements {
object_title {
- label \#dotfolio-ui.related_items\#
+ label \#dotfolio-ui.related_item\#
link_url_eval {/o/$object_id}
link_html {title \#dotfolio-ui.view_item\#}
- html {width "100%"}
}
+ object_type {
+ label \#dotfolio-ui.type\#
+ }
+ name {
+ label \#dotfolio-ui.created_by\#
+ }
+ related_on {
+ label \#dotfolio-ui.created_on\#
+ }
remove {
- display_template {Remove}
+ display_template {\#dotfolio-ui.remove2\#}
link_url_eval {$delete_url}
link_html {title \#dotfolio-ui.remove_item\#}
- sub_class narrow
}
}
Index: openacs-4/packages/dotfolio-ui/www/related/relate-list.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio-ui/www/related/relate-list.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotfolio-ui/www/related/relate-list.adp 2 Aug 2005 01:50:07 -0000 1.1
@@ -0,0 +1 @@
+
Index: openacs-4/packages/dotfolio-ui/www/related/relate-list.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio-ui/www/related/relate-list.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotfolio-ui/www/related/relate-list.tcl 2 Aug 2005 01:50:07 -0000 1.1
@@ -0,0 +1,83 @@
+ad_page_contract {
+ Relate object_id.
+ Requires registration.
+
+ @param object_one the target relate item
+ @param orderby "clipboard,desc"
+ @param admin_p
+
+ @author Jeff Davis davis@xarg.net
+ @creation-date 10/30/2003
+ @cvs-id $Id: relate-list.tcl,v 1.1 2005/08/02 01:50:07 ncarroll Exp $
+} {}
+
+
+set elements {
+ type {
+ label {Type}
+ display_template "@relate.pretty_name@"
+ }
+ object_title {
+ label {Item}
+ }
+ clipboard {
+ label {Clipboard}
+ }
+ clipped {
+ label {Clipped on}
+ display_template "@relate.clipped;noquote@"
+ html {align right}
+ }
+}
+
+#lappend elements extra {
+# label {Debug}
+#}
+
+set bulk [list "Relate" relation-add]
+
+
+template::list::create \
+ -name relate \
+ -multirow relate \
+ -key object_id \
+ -elements $elements \
+ -orderby {
+ type {
+ orderby lower(t.pretty_name),x.clipped
+ }
+ object_title {
+ orderby lower(x.object_title),x.clipped
+ }
+ clipboard {
+ orderby lower(x.clipboard),x.clipped
+ }
+ clipped {
+ orderby x.clipped
+ }
+ } -filters {
+ object_one {}
+ } -bulk_actions $bulk -bulk_action_export_vars object_one
+
+set now [clock_to_ansi [clock seconds]]
+
+db_multirow -extend extra relate relate "
+ SELECT * FROM (
+ SELECT t.pretty_name,o.object_id, co.title as clipboard, coalesce(o.title,'? '|| o.object_type || o.object_id) as object_title, to_char(cm.clipped_on,'YYYY-MM-DD HH24:MI:SS') as clipped
+ FROM acs_objects o, clipboards c, acs_objects co, clipboard_object_map cm, acs_object_types t
+ WHERE c.owner_id = :user_id
+ and cm.clipboard_id = c.clipboard_id
+ and o.object_id = cm.object_id
+ and co.object_id = c.clipboard_id
+ and cm.object_id != :object_one
+ and t.object_type = o.object_type
+ ) x
+ WHERE not exists (
+ SELECT 1
+ FROM acs_rels
+ WHERE rel_type = 'content_rel'
+ and ( (object_id_one = :object_one and object_id_two = x.object_id)
+ or (object_id_one = x.object_id and object_id_two = :object_one)))
+ [template::list::orderby_clause -orderby -name "relate"]" {
+ set clipped [regsub -all { } [util::age_pretty -hours_limit 0 -mode_2_fmt "%X %a" -mode_3_fmt "%x" -timestamp_ansi $clipped -sysdate_ansi $now] {\ }]
+ }
Index: openacs-4/packages/dotfolio-ui/www/related/relate.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio-ui/www/related/relate.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/dotfolio-ui/www/related/relate.adp 5 May 2005 08:54:43 -0000 1.1
+++ openacs-4/packages/dotfolio-ui/www/related/relate.adp 2 Aug 2005 01:50:07 -0000 1.2
@@ -2,6 +2,6 @@
@title@
@context;noquote@
-
+
Index: openacs-4/packages/dotfolio-ui/www/resources/dotfolio-grey.css
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotfolio-ui/www/resources/dotfolio-grey.css,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/dotfolio-ui/www/resources/dotfolio-grey.css 5 May 2005 08:54:43 -0000 1.1
+++ openacs-4/packages/dotfolio-ui/www/resources/dotfolio-grey.css 2 Aug 2005 01:50:07 -0000 1.2
@@ -175,4 +175,14 @@
a.clipperButton:active {
text-decoration: none;
border: solid 1px black;
-}
\ No newline at end of file
+}
+
+.dimension-section {
+ font-size: 80%;
+ font-weight: bold;
+}
+
+.dimension-section-selected {
+ font-size: 80%;
+ font-weight: bold;
+}