From e3b558fc2bfe0d99dd6d5e379ba0b335695afdca Mon Sep 17 00:00:00 2001
From: Martin Kamerbeek
Date: Wed, 19 Jul 2006 15:16:53 +0000
Subject: [PATCH] Fixed bugs in navigation template vars and privilege bug in
WG::A::File. Also added page.parent.rank tmpl_var to the nav template.
---
docs/changelog/7.x.x.txt | 10 ++++++++--
lib/WebGUI/Asset/File.pm | 1 +
lib/WebGUI/Asset/Wobject/Navigation.pm | 7 ++++---
lib/WebGUI/Help/Asset_Navigation.pm | 5 ++++-
lib/WebGUI/i18n/English/Asset_Navigation.pm | 6 ++++++
5 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt
index 0fcab2134..4a29b5d07 100644
--- a/docs/changelog/7.x.x.txt
+++ b/docs/changelog/7.x.x.txt
@@ -19,8 +19,14 @@
- Fixed a bug that didn't allow you to search a matrix.
- Fixed a bug in the upgrade that caused template problems with the WebGUI 6
template if anyone was still using that.
-
-
+ - Fixed a bug where the template variables currentPage.hasViewableSiblings
+ and currentPage.hasViewableChildren were always false. Added the
+ page.parent.rank template variable to the Navigation template. (Martin
+ Kamerbeek / Procolix)
+ - Fixed a bug where WebGUI::Asset::File->addRevision did not set correct
+ privs to the storage associated with it. (Martin Kamerbeek / Procolix)
+
+
7.0.1
- fix: User profile field "Department" needs i18n
- fix: AssetProxied Navigation context menu - items invisible in Style 02
diff --git a/lib/WebGUI/Asset/File.pm b/lib/WebGUI/Asset/File.pm
index c6bc246a2..2e9309db0 100644
--- a/lib/WebGUI/Asset/File.pm
+++ b/lib/WebGUI/Asset/File.pm
@@ -251,6 +251,7 @@ sub processPropertiesFromFormPost {
delete $self->{_storageLocation};
my $storage = $self->getStorageLocation;
my $filename = $storage->addFileFromFormPost("file",1);
+ $storage->setPrivileges($self->get('ownerUserId'), $self->get('groupIdView'), $self->get('groupIdEdit'));
if (defined $filename && $filename ne $self->get("filename")) {
my %data;
$data{filename} = $filename;
diff --git a/lib/WebGUI/Asset/Wobject/Navigation.pm b/lib/WebGUI/Asset/Wobject/Navigation.pm
index 81dbf7591..bb1dfb264 100644
--- a/lib/WebGUI/Asset/Wobject/Navigation.pm
+++ b/lib/WebGUI/Asset/Wobject/Navigation.pm
@@ -438,9 +438,9 @@ sub view {
++$var->{"currentPage.hasSibling"}
if $pageData->{"page.isSibling"};
++$var->{"currentPage.hasViewableSiblings"}
- if ($pageData->{"page.isSibling"} && $pageData->{"isViewable"});
+ if ($pageData->{"page.isSibling"} && $pageData->{"page.isViewable"});
++$var->{"currentPage.hasViewableChildren"}
- if ($pageData->{"page.isChild"} && $pageData->{"isViewable"});
+ if ($pageData->{"page.isChild"} && $pageData->{"page.isViewable"});
my $parent = $asset->getParent;
if (defined $parent) {
@@ -449,7 +449,8 @@ sub view {
}
$pageData->{'page.parent.menuTitle'} = $parent->getMenuTitle;
$pageData->{'page.parent.title'} = $parent->getTitle;
- $pageData->{"page.parent.url"} = $parent->getUrl;
+ $pageData->{"page.parent.url"} = $parent->getUrl;
+ $pageData->{"page.parent.rank"} = $parent->getRank;
$pageData->{"page.isRankedFirst"} = 1 unless exists $lastChildren{$parent->getId};
$lastChildren{$parent->getId} = $asset->getId;
}
diff --git a/lib/WebGUI/Help/Asset_Navigation.pm b/lib/WebGUI/Help/Asset_Navigation.pm
index 116269fa0..fc04015bd 100644
--- a/lib/WebGUI/Help/Asset_Navigation.pm
+++ b/lib/WebGUI/Help/Asset_Navigation.pm
@@ -265,7 +265,10 @@ our $HELP = {
},
{
'name' => 'page.parent.newWindow'
- }
+ },
+ {
+ 'name' => 'page.parent.rank'
+ },
]
}
],
diff --git a/lib/WebGUI/i18n/English/Asset_Navigation.pm b/lib/WebGUI/i18n/English/Asset_Navigation.pm
index 1c306dd44..a582a31b2 100644
--- a/lib/WebGUI/i18n/English/Asset_Navigation.pm
+++ b/lib/WebGUI/i18n/English/Asset_Navigation.pm
@@ -529,6 +529,12 @@ a Google sitemap of your site.
lastUpdated => 1149394665,
},
+ 'page.parent.rank' => {
+ message => q|The rank of the mother of this page.|,
+ lastUpdated => 1153314572,
+ },
+
+
'1097' => {
message => q|These variables are available in Navigation Templates:
|,