Use Snapshots permission instead of Events permission for Snapshots

This commit is contained in:
Isaac Connor 2021-04-12 15:19:21 -04:00
parent 1b50314f9e
commit f59a72a638
3 changed files with 4 additions and 4 deletions

View File

@ -718,7 +718,7 @@ function getMontageReviewHTML($view) {
function getSnapshotsHTML($view) { function getSnapshotsHTML($view) {
$result = ''; $result = '';
if ( canView('Events') ) { if ( canView('Snapshots') ) {
$class = $view == 'snapshots' ? ' selected' : ''; $class = $view == 'snapshots' ? ' selected' : '';
$result .= '<li id="getSnapshotsHTML" class="nav-item dropdown"><a class="nav-link'.$class.'" href="?view=snapshots">' .translate('Snapshots'). '</a></li>'.PHP_EOL; $result .= '<li id="getSnapshotsHTML" class="nav-item dropdown"><a class="nav-link'.$class.'" href="?view=snapshots">' .translate('Snapshots'). '</a></li>'.PHP_EOL;
} }

View File

@ -18,7 +18,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// //
if ( !canView('Events') ) { if ( !canView('Snapshots') ) {
$view = 'error'; $view = 'error';
return; return;
} }
@ -85,7 +85,7 @@ if ( !$snapshot->Id() ) {
<div id="content" class="justify-content-center"> <div id="content" class="justify-content-center">
<?php <?php
$events = $snapshot->Events(); $events = $snapshot->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 ) { foreach ( $snapshot->Events() as $event ) {
$imgSrc = $event->getThumbnailSrc(array(), '&amp;'); $imgSrc = $event->getThumbnailSrc(array(), '&amp;');
echo '<img src="?view=image&eid='.$event->Id().'&fid=snapshot" width="'.$width.'%"/>'; echo '<img src="?view=image&eid='.$event->Id().'&fid=snapshot" width="'.$width.'%"/>';

View File

@ -18,7 +18,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // 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'; $view = 'error';
return; return;
} }