diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 4e97e4e85..e494ad60f 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -19,6 +19,7 @@ - fixed: Display of short pagination bar when there's less than 1 page of data in StoryArchive - added: Storage now has a getHexId method for returning a cached hexadecimal version of the storageId. - fixed: FilePump should copy filesystem directories and their files when given a file URI that is a directory. + - fixed #10133: Matrix compare for priv. group open to any user 7.7.6 - Added mobile style template. If enabled in settings, will serve alternate style templates diff --git a/docs/upgrades/packages-7.7.7/matrix-default-view-template.wgpkg b/docs/upgrades/packages-7.7.7/matrix-default-view-template.wgpkg new file mode 100644 index 000000000..e9a1adf2e Binary files /dev/null and b/docs/upgrades/packages-7.7.7/matrix-default-view-template.wgpkg differ diff --git a/docs/upgrades/upgrade_7.7.6-7.7.7.pl b/docs/upgrades/upgrade_7.7.6-7.7.7.pl index d1f32a3d1..3f9631d2d 100644 --- a/docs/upgrades/upgrade_7.7.6-7.7.7.pl +++ b/docs/upgrades/upgrade_7.7.6-7.7.7.pl @@ -42,9 +42,18 @@ addMapAsset( $session ); installFilePumpHandler($session); installFilePumpTable($session); installFilePumpAdminGroup($session); +addMatrixMaxGroup($session); finish($session); # this line required +#---------------------------------------------------------------------------- +sub addMatrixMaxGroup { + my $session = shift; + print "\tAdding maxComparisonsGroup to Matrix..." unless $quiet; + $session->db->write("alter table Matrix add column maxComparisonsGroup char(22);"); + $session->db->write("alter table Matrix add column maxComparisonsGroupInt integer;"); + print "Done.\n" unless $quiet; +} #---------------------------------------------------------------------------- sub fixSMSUserProfileI18N { diff --git a/lib/WebGUI/Asset/Wobject/Matrix.pm b/lib/WebGUI/Asset/Wobject/Matrix.pm index ce2d26b7f..6a768f9ff 100644 --- a/lib/WebGUI/Asset/Wobject/Matrix.pm +++ b/lib/WebGUI/Asset/Wobject/Matrix.pm @@ -230,6 +230,19 @@ sub definition { hoverHelp =>$i18n->get('max comparisons privileged description'), label =>$i18n->get('max comparisons privileged label'), }, + maxComparisonsGroup=>{ + fieldType =>"group", + tab =>"properties", + hoverHelp =>$i18n->get('maxgroup description'), + label =>$i18n->get('maxgroup label'), + }, + maxComparisonsGroupInt=>{ + fieldType =>"integer", + tab =>"properties", + defaultValue =>25, + hoverHelp =>$i18n->get('maxgroup per description'), + label =>$i18n->get('maxgroup per label'), + }, groupToAdd=>{ fieldType =>"group", tab =>"security", @@ -454,6 +467,9 @@ sub getCompareForm { if($self->session->user->isVisitor){ $maxComparisons = $self->get('maxComparisons'); } + elsif($self->session->user->isInGroup( $self->get("maxComparisonsGroup") )) { + $maxComparisons = $self->get('maxComparisonsGroupInt'); + } else{ $maxComparisons = $self->get('maxComparisonsPrivileged'); } @@ -627,6 +643,21 @@ sub view { $var->{listAttributes_url} = $self->getUrl('func=listAttributes'); $var->{search_url} = $self->getUrl('func=search'); $var->{compareForm_url} = $self->getUrl(); + + my $maxComparisons; + if($self->session->user->isVisitor){ + $maxComparisons = $self->get('maxComparisons'); + } + elsif($self->session->user->isInGroup( $self->get("maxComparisonsGroup") )) { + $maxComparisons = $self->get('maxComparisonsGroupInt'); + } + else{ + $maxComparisons = $self->get('maxComparisonsPrivileged'); + } + $var->{javascript} = ""; if ($self->canEdit){ # Get all the MatrixListings that are still pending. @@ -858,6 +889,9 @@ sub www_compare { if($self->session->user->isVisitor){ $maxComparisons = $self->get('maxComparisons'); } + elsif($self->session->user->isInGroup( $self->get("maxComparisonsGroup") )) { + $maxComparisons = $self->get('maxComparisonsGroupInt'); + } else{ $maxComparisons = $self->get('maxComparisonsPrivileged'); } diff --git a/lib/WebGUI/i18n/English/Asset_Matrix.pm b/lib/WebGUI/i18n/English/Asset_Matrix.pm index 38d8422e1..9ed0b2644 100644 --- a/lib/WebGUI/i18n/English/Asset_Matrix.pm +++ b/lib/WebGUI/i18n/English/Asset_Matrix.pm @@ -427,6 +427,16 @@ listing,|, lastUpdated => 1135271460, }, + 'maxgroup per description' => { + message => q|Specifies how many comparisons are allowed for the privileged group.|, + lastUpdated => 0, + }, + + 'maxgroup description' => { + message => q|Select a group for which a specific maximum comparisons can be selected.|, + lastUpdated => 0, + }, + 'max comparisons description' => { message => q|Specifies how many comparisons are allowed in searches and comparisons.|, lastUpdated => 0, @@ -602,6 +612,16 @@ to increase performance. How long should we cache them?|, message => q|Compare Color: Yes|, lastUpdated => 0, }, + + 'maxgroup per label' => { + message => q|Maximum for Privileged Group|, + lastUpdated => 0, + }, + + 'maxgroup label' => { + message => q|Privileged Maximum Group|, + lastUpdated => 0, + }, 'max comparisons label' => { message => q|Maximum Comparisons|,