From f59a72a6385da520723925458ee8ebf9ee0b3204 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 12 Apr 2021 15:19:21 -0400 Subject: [PATCH] Use Snapshots permission instead of Events permission for Snapshots --- web/skins/classic/includes/functions.php | 2 +- web/skins/classic/views/snapshot.php | 4 ++-- web/skins/classic/views/snapshots.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index c4074b1c2..ddb8667a4 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -718,7 +718,7 @@ function getMontageReviewHTML($view) { function getSnapshotsHTML($view) { $result = ''; - if ( canView('Events') ) { + if ( canView('Snapshots') ) { $class = $view == 'snapshots' ? ' selected' : ''; $result .= ''.PHP_EOL; } diff --git a/web/skins/classic/views/snapshot.php b/web/skins/classic/views/snapshot.php index 042d4fe41..f608ee814 100644 --- a/web/skins/classic/views/snapshot.php +++ b/web/skins/classic/views/snapshot.php @@ -18,7 +18,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // -if ( !canView('Events') ) { +if ( !canView('Snapshots') ) { $view = 'error'; return; } @@ -85,7 +85,7 @@ if ( !$snapshot->Id() ) {
Events(); - $width = 100 / ( ( count($events) < 4 ) ? count($events) : 4 ) -1; + $width = 100 / ( count($events) < 2 ? 1 : ( ( count($events) < 4 ) ? count($events) : 4 ) )-1; foreach ( $snapshot->Events() as $event ) { $imgSrc = $event->getThumbnailSrc(array(), '&'); echo ''; diff --git a/web/skins/classic/views/snapshots.php b/web/skins/classic/views/snapshots.php index 781aff967..a5f58f600 100644 --- a/web/skins/classic/views/snapshots.php +++ b/web/skins/classic/views/snapshots.php @@ -18,7 +18,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // -if ( !canView('Events') || (!empty($_REQUEST['execute']) && !canEdit('Events')) ) { +if (!canView('Snapshots')) { $view = 'error'; return; }