diff --git a/docs/upgrades/upgrade_4.2.0-4.3.0.sql b/docs/upgrades/upgrade_4.2.0-4.3.0.sql
index a95849f66..8ff86c812 100644
--- a/docs/upgrades/upgrade_4.2.0-4.3.0.sql
+++ b/docs/upgrades/upgrade_4.2.0-4.3.0.sql
@@ -656,8 +656,10 @@ delete from international where namespace='WebGUI' and internationalId=128;
delete from settings where name='attachmentDirectoryLocal';
delete from settings where name='attachmentDirectoryWeb';
delete from settings where name='lib';
-
-
+update international set message='Attachment' where internationalId=33 and languageId=1 and namespace='UserSubmission';
+alter table page add column startDate int not null default 946710000;
+alter table page add column endDate int not null default 2082783600;
+update page set styleId=-6 where styleId=-3;
diff --git a/lib/WebGUI/Icon.pm b/lib/WebGUI/Icon.pm
index 6f071e0dd..4b0a56f64 100644
--- a/lib/WebGUI/Icon.pm
+++ b/lib/WebGUI/Icon.pm
@@ -21,7 +21,7 @@ use WebGUI::URL;
our @ISA = qw(Exporter);
our @EXPORT = qw(&helpIcon &becomeIcon &cutIcon ©Icon &deleteIcon &editIcon &moveUpIcon &moveDownIcon
- &pageIcon &moveTopIcon &moveBottomIcon &viewIcon);
+ &wobjectIcon &pageIcon &moveTopIcon &moveBottomIcon &viewIcon);
=head1 NAME
@@ -42,6 +42,7 @@ our @EXPORT = qw(&helpIcon &becomeIcon &cutIcon ©Icon &deleteIcon &editIcon
$html = moveUpIcon('op=something');
$html = pageIcon();
$html = viewIcon('op=something');
+ $html = wobjectIcon();
=head1 DESCRIPTION
@@ -58,7 +59,7 @@ our @EXPORT = qw(&helpIcon &becomeIcon &cutIcon ©Icon &deleteIcon &editIcon
#-------------------------------------------------------------------
-=head2 becomeIcon ( urlParameters )
+=head2 becomeIcon ( urlParameters [, pageURL ] )
Generates a button with the word "Become" printed on it.
@@ -67,18 +68,23 @@ our @EXPORT = qw(&helpIcon &becomeIcon &cutIcon ©Icon &deleteIcon &editIcon
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
+=item pageURL
+
+ The URL to any page. Defaults to the current page.
+
=cut
sub becomeIcon {
- my ($output);
- $output = '';
+ my ($output, $pageURL);
+ $pageURL = $_[1] || $session{page}{urlizedTitle};
+ $output = '';
$output .= '
';
return $output;
}
#-------------------------------------------------------------------
-=head2 copyIcon ( urlParameters )
+=head2 copyIcon ( urlParameters [, pageURL ] )
Generates a button with the word "Copy" printed on it.
@@ -87,18 +93,23 @@ sub becomeIcon {
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
+=item pageURL
+
+ The URL to any page. Defaults to the current page.
+
=cut
sub copyIcon {
- my ($output);
- $output = '';
+ my ($output, $pageURL);
+ $pageURL = $_[1] || $session{page}{urlizedTitle};
+ $output = '';
$output .= '
';
return $output;
}
#-------------------------------------------------------------------
-=head2 cutIcon ( urlParameters )
+=head2 cutIcon ( urlParameters [, pageURL ] )
Generates a button with the word "Cut" printed on it.
@@ -107,18 +118,23 @@ sub copyIcon {
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
+=item pageURL
+
+ The URL to any page. Defaults to the current page.
+
=cut
sub cutIcon {
- my ($output);
- $output = '';
+ my ($output, $pageURL);
+ $pageURL = $_[1] || $session{page}{urlizedTitle};
+ $output = '';
$output .= '
';
return $output;
}
#-------------------------------------------------------------------
-=head2 deleteIcon ( urlParameters )
+=head2 deleteIcon ( urlParameters [, pageURL ] )
Generates a button with an "X" printed on it.
@@ -127,18 +143,23 @@ sub cutIcon {
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
+=item pageURL
+
+ The URL to any page. Defaults to the current page.
+
=cut
sub deleteIcon {
- my ($output);
- $output = '';
+ my ($output, $pageURL);
+ $pageURL = $_[1] || $session{page}{urlizedTitle};
+ $output = '';
$output .= '
';
return $output;
}
#-------------------------------------------------------------------
-=head2 editIcon ( urlParameters )
+=head2 editIcon ( urlParameters [, pageURL ] )
Generates a button with the word "Edit" printed on it.
@@ -147,18 +168,23 @@ sub deleteIcon {
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
+=item pageURL
+
+ The URL to any page. Defaults to the current page.
+
=cut
sub editIcon {
- my ($output);
- $output = '';
+ my ($output, $pageURL);
+ $pageURL = $_[1] || $session{page}{urlizedTitle};
+ $output = '';
$output .= '
';
return $output;
}
#-------------------------------------------------------------------
-=head2 becomeIcon ( helpId [, namespace ] )
+=head2 helpIcon ( helpId [, namespace ] )
Generates a button with the word "Help" printed on it.
@@ -184,7 +210,7 @@ sub helpIcon {
#-------------------------------------------------------------------
-=head2 moveBottomIcon ( urlParameters )
+=head2 moveBottomIcon ( urlParameters [, pageURL ] )
Generates a button with a double down arrow printed on it.
@@ -193,18 +219,23 @@ sub helpIcon {
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
+=item pageURL
+
+ The URL to any page. Defaults to the current page.
+
=cut
sub moveBottomIcon {
- my ($output);
- $output = '';
+ my ($output, $pageURL);
+ $pageURL = $_[1] || $session{page}{urlizedTitle};
+ $output = '';
$output .= '
';
return $output;
}
#-------------------------------------------------------------------
-=head2 moveDownIcon ( urlParameters )
+=head2 moveDownIcon ( urlParameters [, pageURL ] )
Generates a button with a down arrow printed on it.
@@ -213,18 +244,23 @@ sub moveBottomIcon {
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
+=item pageURL
+
+ The URL to any page. Defaults to the current page.
+
=cut
sub moveDownIcon {
- my ($output);
- $output = '';
+ my ($output, $pageURL);
+ $pageURL = $_[1] || $session{page}{urlizedTitle};
+ $output = '';
$output .= '
';
return $output;
}
#-------------------------------------------------------------------
-=head2 moveTopIcon ( urlParameters )
+=head2 moveTopIcon ( urlParameters [, pageURL ] )
Generates a button with a double up arrow printed on it.
@@ -233,18 +269,23 @@ sub moveDownIcon {
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
+=item pageURL
+
+ The URL to any page. Defaults to the current page.
+
=cut
sub moveTopIcon {
- my ($output);
- $output = '';
+ my ($output, $pageURL);
+ $pageURL = $_[1] || $session{page}{urlizedTitle};
+ $output = '';
$output .= '
';
return $output;
}
#-------------------------------------------------------------------
-=head2 moveUpIcon ( urlParameters )
+=head2 moveUpIcon ( urlParameters [, pageURL ] )
Generates a button with an up arrow printed on it.
@@ -253,11 +294,16 @@ sub moveTopIcon {
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
+=item pageURL
+
+ The URL to any page. Defaults to the current page.
+
=cut
sub moveUpIcon {
- my ($output);
- $output = '';
+ my ($output, $pageURL);
+ $pageURL = $_[1] || $session{page}{urlizedTitle};
+ $output = '';
$output .= '
';
return $output;
}
@@ -278,7 +324,7 @@ sub pageIcon {
#-------------------------------------------------------------------
-=head2 viewIcon ( urlParameters )
+=head2 viewIcon ( urlParameters [, pageURL ] )
Generates a button with the word "View" printed on it.
@@ -287,15 +333,34 @@ sub pageIcon {
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
+=item pageURL
+
+ The URL to any page. Defaults to the current page.
+
=cut
sub viewIcon {
- my ($output);
- $output = '';
+ my ($output, $pageURL);
+ $pageURL = $_[1] || $session{page}{urlizedTitle};
+ $output = '';
$output .= '
';
return $output;
}
+#-------------------------------------------------------------------
+
+=head2 wobjectIcon ( )
+
+ Generates an icon that looks like a wobject. It's purpose is to
+ represent whether you're looking at page properties or Wobject
+ properties.
+
+=cut
+
+sub wobjectIcon {
+ return '
';
+}
+
1;
diff --git a/lib/WebGUI/Operation/Page.pm b/lib/WebGUI/Operation/Page.pm
index 36ae10ea5..7a61f86f6 100644
--- a/lib/WebGUI/Operation/Page.pm
+++ b/lib/WebGUI/Operation/Page.pm
@@ -12,6 +12,7 @@ package WebGUI::Operation::Page;
use Exporter;
use strict;
+use WebGUI::DateTime;
use WebGUI::HTMLForm;
use WebGUI::Icon;
use WebGUI::International;
@@ -31,7 +32,8 @@ sub _recursivelyChangePrivileges {
my ($sth, $pageId);
$sth = WebGUI::SQL->read("select pageId from page where parentId=$_[0]");
while (($pageId) = $sth->array) {
- WebGUI::SQL->write("update page set ownerId=$session{form}{ownerId}, ownerView=$session{form}{ownerView},
+ WebGUI::SQL->write("update page set startDate=$session{form}{startDate}, endDate=$session{form}{endDate},
+ ownerId=$session{form}{ownerId}, ownerView=$session{form}{ownerView},
ownerEdit=$session{form}{ownerEdit}, groupId='$session{form}{groupId}', groupView=$session{form}{groupView},
groupEdit=$session{form}{groupEdit}, worldView=$session{form}{worldView}, worldEdit=$session{form}{worldEdit}
where pageId=$pageId");
@@ -73,13 +75,18 @@ sub _traversePageTree {
}
$a = WebGUI::SQL->read("select * from page where (pageId<2 or pageId>25) and parentId='$_[0]' order by sequenceNumber");
while (%page = $a->hash) {
- $output .= $depth.'
'.
- ' '.$page{title}.'
';
+ $output .= $depth
+ .pageIcon()
+ .deleteIcon('op=deletePage',$page{urlizedTitle})
+ .editIcon('op=editPage',$page{urlizedTitle})
+ .' '.$page{title}.'
';
$b = WebGUI::SQL->read("select * from wobject where pageId=$page{pageId}");
while (%wobject = $b->hash) {
- $output .= $depth.$spacer.
- '
'.
- $wobject{title}.'
';
+ $output .= $depth.$spacer
+ .wobjectIcon()
+ .deleteIcon('func=delete&wid='.$wobject{wobjectId},$page{urlizedTitle})
+ .editIcon('func=edit&wid='.$wobject{wobjectId},$page{urlizedTitle})
+ .' '. $wobject{title}.'
';
}
$b->finish;
$output .= _traversePageTree($page{pageId},$_[1]+1);
@@ -137,7 +144,7 @@ sub www_deletePageConfirm {
#-------------------------------------------------------------------
sub www_editPage {
- my ($f, $output, %hash, %page);
+ my ($f, $endDate, $output, %hash, %page);
tie %hash, "Tie::IxHash";
if (WebGUI::Privilege::canEditPage($session{form}{npp})) {
$f = WebGUI::HTMLForm->new;
@@ -152,11 +159,13 @@ sub www_editPage {
} else {
%page = %{$session{page}};
}
+ $page{endDate} = (time()+315360000) if ($page{endDate} < 0);
$output = helpIcon(1);
$output .= '