diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index e540be5fb..bf4d80e66 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -18,6 +18,7 @@ - Changed the ?op=editProduct form to a TabForm. - fixed a small error in WebGUI::Group documentation. - Added WebGUI::Text with some CSV functions. + - Added Karma RFE: Thumbnail size can be enterred in CS 7.0.9 - Removed the need for DateTime::Cron::Simple, which also added the ability diff --git a/docs/upgrades/upgrade_7.0.9-7.1.0.pl b/docs/upgrades/upgrade_7.0.9-7.1.0.pl index 88f43a0f7..4144e31a2 100755 --- a/docs/upgrades/upgrade_7.0.9-7.1.0.pl +++ b/docs/upgrades/upgrade_7.0.9-7.1.0.pl @@ -23,11 +23,21 @@ recalculateProjectCompletion($session); updateSqlReportTable($session); updateProductsTable($session); makeLdapRecursiveFiltersText($session); +addImageStuffToCs($session); finish($session); # this line required -##------------------------------------------------- +#------------------------------------------------- +sub addImageStuffToCs { + my $session = shift; + print "\tAdding thumbnail and image sizing to CS.\n" unless $quiet; + $session->db->write("alter table Collaboration add column thumbnailSize int not null default 0"); + $session->db->write("alter table Collaboration add column maxImageSize int not null default 0"); +} + + +#------------------------------------------------- sub recalculateProjectCompletion { my $session = shift; print "\tForcing project completion recalculation.\n" unless $quiet; diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm index 1e8ca86b6..9e618716e 100644 --- a/lib/WebGUI/Asset/Post.pm +++ b/lib/WebGUI/Asset/Post.pm @@ -747,10 +747,10 @@ sub postProcess { if ($storage->isImage($file)) { ##Use generateThumbnail to shrink size to site's max image size ##We should look into using the new resize method instead. - $storage->generateThumbnail($file,$self->session->setting->get("maxImageSize")); + $storage->generateThumbnail($file, $self->getThread->getParent->get("maxImageSize") || $self->session->setting->get("maxImageSize")); $storage->deleteFile($file); $storage->renameFile('thumb-'.$file,$file); - $storage->generateThumbnail($file); + $storage->generateThumbnail($file, $self->getThread->getParent->get("thumbnailSize")); } $size += $storage->getFileSize($file); } diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 6eec5a3ec..4a65a2315 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -339,6 +339,20 @@ sub definition { label=>$i18n->get('approval workflow'), hoverHelp=>$i18n->get('approval workflow description'), }, + thumbnailSize => { + fieldType => "integer", + defaultValue => 0, + tab => "display", + label => $i18n->get("thumbnail size"), + hoverHelp => $i18n->get("thumbnail size help") + }, + maxImageSize => { + fieldType => "integer", + defaultValue => 0, + tab => "display", + label => $i18n->get("max image size"), + hoverHelp => $i18n->get("max image size help") + }, mailServer=>{ fieldType=>"text", defaultValue=>undef, diff --git a/lib/WebGUI/Help/Asset_Collaboration.pm b/lib/WebGUI/Help/Asset_Collaboration.pm index d14bd3054..60a9da4b0 100644 --- a/lib/WebGUI/Help/Asset_Collaboration.pm +++ b/lib/WebGUI/Help/Asset_Collaboration.pm @@ -16,6 +16,16 @@ our $HELP = { description => 'display last reply description', namespace => 'Asset_Collaboration', }, + { + title => 'thumbnail size', + description => 'thumbnail size help', + namespace => 'Asset_Collaboration', + }, + { + title => 'max image size', + description => 'max image size help', + namespace => 'Asset_Collaboration', + }, { title => 'system template', description => 'system template description', diff --git a/lib/WebGUI/i18n/English/Asset_Collaboration.pm b/lib/WebGUI/i18n/English/Asset_Collaboration.pm index da8039043..c4ac89f38 100644 --- a/lib/WebGUI/i18n/English/Asset_Collaboration.pm +++ b/lib/WebGUI/i18n/English/Asset_Collaboration.pm @@ -14,6 +14,30 @@ our $I18N = { context => q|thread link| }, + 'max image size' => { + message => q|Maximum Image Size|, + lastUpdated => 0, + context => q|field label for image on display tab| + }, + + 'max image size help' => { + message => q|Set the size of the image attachments for this Collaboration System. If you set it to 0 then the default size set in the master settings will be used. Also, changing this setting does not retroactively change the size of images already in the CS. You'll have to re-save each post to get the size to change.|, + lastUpdated => 0, + context => q|help for display setting label| + }, + + 'thumbnail size' => { + message => q|Thumbnail Size|, + lastUpdated => 0, + context => q|field label for thumbnails on display tab| + }, + + 'thumbnail size help' => { + message => q|Set the size of the thumbnails for this Collaboration System. If you set it to 0 then the default size set in the master settings will be used. Also, changing this setting does not retroactively change the size of thumbnails already in the CS. You'll have to re-save each post to get the size to change.|, + lastUpdated => 0, + context => q|help for display setting label| + }, + 'require subscription for email posting' => { message => q|Require subscription for email posts?|, lastUpdated => 0,