diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 364b20794..84471c3e4 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -13,6 +13,12 @@ - fix [ 1167937 ] Asset Manager and No-Cache Imcompatible - fix [ 1167917 ] Link to Page Tree and No-Cache Imcompatible - fix [ 1168084 ] file uploads don't work. + - fix [ 1169239 ] Manage subscription codes -> Delete Selected -> Empty page + - fix [ 1169246 ] Manage subscription codes -> Cannot select single day + - fix [ 1169271 ] Last Post incorrect + - The items listed under new content are now in alphabetical order as they + should be. + - Fixed some template problems with the folder asset and the failsafe style. - fix [ 1167720 ] Folder::view() subfolder_loop - missing.. [mwilson] - fix [ 1169379 ] eventscalendar wobjects have wrong scope after upgrade - fix [ 1168812 ] navigation sometimes fails to use correct... [mwilson] diff --git a/docs/upgrades/upgrade_6.5.3-6.5.4.pl b/docs/upgrades/upgrade_6.5.3-6.5.4.pl deleted file mode 100644 index 877136fbd..000000000 --- a/docs/upgrades/upgrade_6.5.3-6.5.4.pl +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/perl - -use lib "../../lib"; -use Getopt::Long; -use strict; -use WebGUI::Session; -use WebGUI::SQL; -use WebGUI::Asset; - -my $configFile; -my $quiet; - -GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet -); - -WebGUI::Session::open("../..",$configFile); - -#-------------------------------------------- -print "\tdo something.\n" unless ($quiet); - - -WebGUI::Session::close(); - - diff --git a/docs/upgrades/upgrade_6.5.3-6.5.4.sql b/docs/upgrades/upgrade_6.5.3-6.5.4.sql index ee1fd6ef9..c8c947fe8 100644 --- a/docs/upgrades/upgrade_6.5.3-6.5.4.sql +++ b/docs/upgrades/upgrade_6.5.3-6.5.4.sql @@ -1,2 +1,4 @@ insert into webguiVersion values ('6.5.4','upgrade',unix_timestamp()); +update template set template='\">\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n
\r\n \">\" border=\"0\" alt=\"\"> \">\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \">\" border=\"0\" alt=\"\"> \">\r\n \r\n \r\n \r\n ^D(\"%z %Z\",);\r\n \r\n \r\n
' where assetId='PBtmpl0000000000000078'; +update template set template='\r\n\r\n \r\n ^Page(\"title\"); - WebGUI\r\n \r\n \r\n \r\n \r\n ^AdminBar;\r\n
\r\n ^AssetProxy(flexmenu);\r\n
\r\n
\r\n \r\n


\r\n ^LoginToggle; \r\n   ^a(^@;); \r\n   ^H;\r\n   ^AdminToggle;\r\n
\r\n\r\n\r\n' where assetId='PBtmpl0000000000000060'; diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index ed37bab96..7b441c4ad 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -1,6 +1,6 @@ package WebGUI; our $VERSION = "6.5.4"; -our $STATUS = "beta"; +our $STATUS = "gamma"; #------------------------------------------------------------------- # WebGUI is Copyright 2001-2005 Plain Black Corporation. diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index f7076d3c5..54f38b9a6 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -369,11 +369,11 @@ sub definition { }, startDate=>{ fieldType=>'dateTime', - defaultValue=>undef + defaultValue=>997995720 }, endDate=>{ fieldType=>'dateTime', - defaultValue=>undef + defaultValue=>32472169200 }, assetSize=>{ noFormPost=>1, @@ -684,7 +684,7 @@ sub getAssetAdderLinks { my $getContainerLinks = shift; my $type = "assets"; $type = "assetContainers" if ($getContainerLinks); - my @links; + my %links; foreach my $class (@{$session{config}{$type}}) { my $load = "use ".$class; eval ($load); @@ -703,10 +703,7 @@ sub getAssetAdderLinks { } else { my $url = $self->getUrl("func=add&class=".$class); $url = WebGUI::URL::append($url,$addToUrl) if ($addToUrl); - push(@links, { - label=>$label, - url=>$url - }); + $links{$label} = $url; } } } @@ -721,12 +718,16 @@ sub getAssetAdderLinks { my $asset = WebGUI::Asset->newByDynamicClass($id,$class); my $url = $self->getUrl("func=add&class=".$class."&prototype=".$id); $url = WebGUI::URL::append($url,$addToUrl) if ($addToUrl); - push(@links,{ - label=>$asset->get("title"), - url=>$url - }); + $links{$asset->get("title")} = $url; } - return \@links; + my @sortedLinks; + foreach my $label (sort keys %links) { + push(@sortedLinks,{ + label=>$label, + url=>$links{$label} + }); + } + return \@sortedLinks; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/FilePile.pm b/lib/WebGUI/Asset/FilePile.pm index 0113afbf6..438d87556 100644 --- a/lib/WebGUI/Asset/FilePile.pm +++ b/lib/WebGUI/Asset/FilePile.pm @@ -163,6 +163,8 @@ sub editSave { $data{className} = $className; $data{storageId} = $storage->getId; $data{filename} = $data{title} = $data{menuTitle} = $filename; + $data{templateId} = 'PBtmpl0000000000000024'; + $data{templateId} = 'PBtmpl0000000000000088' if ($className eq "WebGUI::Asset::File::Image"); $data{url} = $class->getParent->getUrl.'/'.$filename; my $newAsset = $class->getParent->addChild(\%data); $newAsset->setSize($storage->getFileSize($filename)); diff --git a/lib/WebGUI/Asset/Post/Thread.pm b/lib/WebGUI/Asset/Post/Thread.pm index 6dbcdcdf5..4ba1c9d84 100644 --- a/lib/WebGUI/Asset/Post/Thread.pm +++ b/lib/WebGUI/Asset/Post/Thread.pm @@ -469,27 +469,16 @@ sub rate { #------------------------------------------------------------------- -=head2 setLastPost ( lastPostDate, lastPostId ) +=head2 setStatusApproved ( ) -Sets the pertinent details for the last post. Can also be done directly using the set method. - -=head3 lastPostDate - -The epoch date of the post. - -=head3 lastPostId - -The unique id of the post. +Sets the post to approved and sends any necessary notifications. =cut -sub setLastPost { - my ($self, $postDate, $postId) = @_; - $self->update({ - lastPostId=>$postId, - lastPostDate=>$postDate - }); - $self->getParent->setLastPost($postDate, $postId); +sub setStatusApproved { + my $self = shift; + $self->SUPER::setStatusApproved; + $self->getParent->incrementThreads($self->get("dateUpdated"),$self->getId) unless ($self->isReply); } diff --git a/lib/WebGUI/Asset/Template.pm b/lib/WebGUI/Asset/Template.pm index 7f3e378bd..152312789 100644 --- a/lib/WebGUI/Asset/Template.pm +++ b/lib/WebGUI/Asset/Template.pm @@ -137,7 +137,10 @@ Returns the TabForm object that will be used in generating the edit page for thi sub getEditForm { my $self = shift; my $tabform = $self->SUPER::getEditForm(); - # $tabform->getTab("properties")->raw(''); + $tabform->hidden({ + name=>"returnUrl", + value=>$session{form}{returnUrl} + }); if ($self->getValue("namespace") eq "") { my $namespaces = WebGUI::SQL->buildHashRef("select distinct(namespace),namespace from template order by namespace"); @@ -334,6 +337,14 @@ sub www_edit { return $self->getAdminConsole->render($self->getEditForm->print,WebGUI::International::get('edit template', 'Template')); } +#------------------------------------------------------------------- +sub www_goBackToPage { + my $self = shift; + WebGUI::HTTP::setRedirect($session{form}{returnUrl}) if ($session{form}{returnUrl}); + return ""; +} + + #------------------------------------------------------------------- sub www_manage { my $self = shift; diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 2ef477dc9..c971cadd7 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -755,31 +755,6 @@ sub recalculateRating { } -#------------------------------------------------------------------- - -=head2 setLastPost ( lastPostDate, lastPostId ) - -Sets the pertinent details for the last post. Can also be done directly using the set method. - -=head3 lastPostDate - -The epoch date of the post. - -=head3 lastPostId - -The asset id of the post. - -=cut - -sub setLastPost { - my ($self, $postDate, $postId) = @_; - $self->update({ - lastPostId=>$postId, - lastPostDate=>$postDate - }); -} - - #------------------------------------------------------------------- =head2 subscribe ( ) diff --git a/lib/WebGUI/Asset/Wobject/Folder.pm b/lib/WebGUI/Asset/Wobject/Folder.pm index fac40f8f2..dc92c443f 100644 --- a/lib/WebGUI/Asset/Wobject/Folder.pm +++ b/lib/WebGUI/Asset/Wobject/Folder.pm @@ -165,6 +165,8 @@ sub view { type=>$child->getName, url=>$child->getUrl, isImage=>$isImage, + canEdit=>$child->canEdit, + controls=>$child->getToolbar, isFile=>$isFile, "thumbnail.url"=>$thumbnail, "file.url"=>$file diff --git a/lib/WebGUI/Asset/Wobject/Navigation.pm b/lib/WebGUI/Asset/Wobject/Navigation.pm index 4bbfde730..a9bcaa97e 100644 --- a/lib/WebGUI/Asset/Wobject/Navigation.pm +++ b/lib/WebGUI/Asset/Wobject/Navigation.pm @@ -81,6 +81,10 @@ sub getEditForm { -value=>$self->getValue('templateId'), -namespace=>"Navigation" ); + $tabform->hidden({ + name=>"returnUrl", + value=>$session{form}{returnUrl} + }); my ($descendantsChecked, $selfChecked, $pedigreeChecked, $siblingsChecked); my @assetsToInclude = split("\n",$self->getValue("assetsToInclude")); my $afterScript; @@ -239,7 +243,11 @@ Returns a toolbar with a set of icons that hyperlink to functions that delete, e sub getToolbar { my $self = shift; if ($self->getToolbarState) { - my $toolbar = editIcon('func=edit',$self->get("url")); + my $returnUrl; + if (exists $session{asset}) { + $returnUrl = "&proceed=goBackToPage&returnUrl=".WebGUI::URL::escape($session{asset}->getUrl); + } + my $toolbar = editIcon('func=edit'.$returnUrl,$self->get("url")); return ''.$self->getName.''.$toolbar; } return $self->SUPER::getToolbar(); @@ -388,6 +396,14 @@ sub www_edit { } +#------------------------------------------------------------------- +sub www_goBackToPage { + my $self = shift; + WebGUI::HTTP::setRedirect($session{form}{returnUrl}) if ($session{form}{returnUrl}); + return ""; +} + + #------------------------------------------------------------------- # we eventually should reaadd this sub www_preview { diff --git a/lib/WebGUI/HTMLForm.pm b/lib/WebGUI/HTMLForm.pm index d33ff3a99..7f72f9e7d 100644 --- a/lib/WebGUI/HTMLForm.pm +++ b/lib/WebGUI/HTMLForm.pm @@ -2138,10 +2138,6 @@ The left column label for this form row. The namespace (or type) of templates to show in this list. -=head3 afterEdit - -A URL that will be acted upon after editing a template. Typically there is a link next to the select list that reads "Edit this template" and this is the URL to go to after editing is complete. - =head3 extras If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows: @@ -2171,11 +2167,12 @@ sub template { $label = $label || WebGUI::International::get(356); my $template = WebGUI::Asset->newByDynamicClass($value); if (defined $template && $template->canEdit) { - # if ($afterEdit) { - $buttons = editIcon("func=edit",$template->get("url")); - #"&namespace=".$namespace."&afterEdit=".WebGUI::URL::escape($afterEdit)); - # } - $buttons .= manageIcon("func=manage",$template->get("url")); + my $returnUrl; + if (exists $session{asset}) { + $returnUrl = "&proceed=goBackToPage&returnUrl=".WebGUI::URL::escape($session{asset}->getUrl); + } + $buttons = editIcon("func=edit".$returnUrl,$template->get("url")); + $buttons .= manageIcon("",$template->getParent->get("url")); } $output = WebGUI::Form::template({ "name"=>$name, diff --git a/lib/WebGUI/Operation/Subscription.pm b/lib/WebGUI/Operation/Subscription.pm index 28d72d927..10fbc39dd 100644 --- a/lib/WebGUI/Operation/Subscription.pm +++ b/lib/WebGUI/Operation/Subscription.pm @@ -1,6 +1,7 @@ package WebGUI::Operation::Subscription; use strict; +use WebGUI::DateTime; use WebGUI::Session; use WebGUI::SQL; use WebGUI::HTMLForm; @@ -268,6 +269,8 @@ sub www_listSubscriptionCodeBatches { $output .= ''; $output .= $p->getBarTraditional($session{form}{pn}); + $output = $i18n->get('no subscription code batches') unless (@{$batches}); + return _submenu($output, 'Manage subscription code batches', 'manage batch'); } @@ -279,9 +282,9 @@ sub www_listSubscriptionCodes { my $i18n = WebGUI::International->new("Subscription"); my $dcStart = WebGUI::FormProcessor::date('dcStart'); - my $dcStop = WebGUI::FormProcessor::date('dcStop'); + my $dcStop = WebGUI::DateTime::addToTime(WebGUI::FormProcessor::date('dcStop'),23,59); my $duStart = WebGUI::FormProcessor::date('duStart'); - my $duStop = WebGUI::FormProcessor::date('duStop'); + my $duStop = WebGUI::DateTime::addToTime(WebGUI::FormProcessor::date('duStop'),23,59); my $batches = WebGUI::SQL->buildHashRef("select batchId, description from subscriptionCodeBatch"); $output .= $i18n->get('selection message'); diff --git a/lib/WebGUI/i18n/English/Subscription.pm b/lib/WebGUI/i18n/English/Subscription.pm index b7b9d32b0..79ad335a2 100755 --- a/lib/WebGUI/i18n/English/Subscription.pm +++ b/lib/WebGUI/i18n/English/Subscription.pm @@ -1,6 +1,12 @@ package WebGUI::i18n::English::Subscription; our $I18N = { + 'no subscription code batches' => { + message => q|No subscription code batches have been created yet. Use the submenu on the right to generate a batch.|, + lastUpdated => 1101228391, + context => q|Displayed if no subscription code batches have been created| + }, + 'listSubscriptionCodes title' => { message => q|Manage Subscription Codes|, lastUpdated => 1101228391, diff --git a/sbin/fileImport.pl b/sbin/fileImport.pl index a94adbb49..9aee6c997 100644 --- a/sbin/fileImport.pl +++ b/sbin/fileImport.pl @@ -46,6 +46,7 @@ my $override; my $quiet; my $webUser = 'apache'; my $assetId; +my $parentAssetId; GetOptions( 'configFile=s'=>\$configFile, @@ -57,7 +58,7 @@ GetOptions( 'pathToFiles=s'=>\$pathToFiles, 'quiet'=>\$quiet, 'webUser=s'=>\$webUser, - 'parentAssetId=s'=>\$parrentAssetId + 'parentAssetId=s'=>\$parentAssetId ); @@ -138,7 +139,11 @@ sub addFiles { foreach my $file (@{$filelist}) { print "\tAdding ".$file->{filename}." to the database.\n" unless ($quiet); my $class = 'WebGUI::Asset::File'; - $class = 'WebGUI::Asset::File::Image' if (isIn($file->{ext},@nailable)); + my $templateId = 'PBtmpl0000000000000024'; + if (isIn($file->{ext},@nailable)) { + $class = 'WebGUI::Asset::File::Image'; + $templateId = 'PBtmpl0000000000000088' + } my $url = $parent->getUrl.'/'.$file->{filename}; my $storage = WebGUI::Storage->create; my $filename = $storage->addFileFromFilesystem($pathToFiles.$session{os}{slash}.$file->{filename}); @@ -148,9 +153,12 @@ sub addFiles { menuTitle=>$filename, filename=>$filename, storageId=>$storage->getId, + isHidden=>1, url=>$url, groupIdView=>$groupToView, groupIdEdit=>$groupToEdit, + templateId=>$templateId, + endDate=>32472169200, ownerUserId=>$owner }); $newAsset->generateThumbnail if ($class eq 'WebGUI::Asset::File::Image'); @@ -192,7 +200,6 @@ sub buildFileList { $filename = $1; $ext = $2; push(@filelist,{ext=>$ext, filename=>$file}); - $filelist{$filename}{$ext} = $file; print "Found file $file.\n" unless ($quiet); } }