Added more keys to the list of bad EXIF keys. CameraID and CameraType seem to make JSON croak...
Fixed issue where bad EXIF cache would kill the entire album Added more variables for resolutions Added better handling of Pending albums and photos.
This commit is contained in:
parent
adcd560cba
commit
d43065b122
8 changed files with 180 additions and 17 deletions
|
|
@ -557,10 +557,25 @@ sub getAlbumIds {
|
|||
|
||||
my $orderBy = $options->{ orderBy } || "lineage ASC";
|
||||
|
||||
# Deal with "pending" albums.
|
||||
my %pendingRules;
|
||||
if ( $self->canEdit ) {
|
||||
$pendingRules{ statusToInclude } = [ 'pending', 'approved' ];
|
||||
}
|
||||
else {
|
||||
$pendingRules{ statusToInclude } = [ 'pending', 'approved' ];
|
||||
$pendingRules{ whereClause } = q{
|
||||
(
|
||||
status = "approved" || ownerUserId = "} . $self->session->user->userId . q{"
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
my $assets
|
||||
= $self->getLineage(['descendants'], {
|
||||
includeOnlyClasses => ['WebGUI::Asset::Wobject::GalleryAlbum'],
|
||||
orderByClause => $orderBy,
|
||||
( %pendingRules ),
|
||||
});
|
||||
|
||||
return $assets;
|
||||
|
|
@ -873,7 +888,7 @@ sub view_listAlbums {
|
|||
$p->appendTemplateVars( $var );
|
||||
|
||||
for my $assetId ( @{ $p->getPageData } ) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId );
|
||||
my $asset = WebGUI::Asset::Wobject::GalleryAlbum->newPending( $session, $assetId );
|
||||
push @{ $var->{albums} }, $asset->getTemplateVars;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -295,6 +295,21 @@ sub canEdit {
|
|||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 canEditIfLocked ( [userId] )
|
||||
|
||||
Override this to allow editing when locked under a different version tag.
|
||||
|
||||
=cut
|
||||
|
||||
sub canEditIfLocked {
|
||||
my $self = shift;
|
||||
my $userId = shift;
|
||||
|
||||
return $self->canEdit( $userId );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 canView ( [userId] )
|
||||
|
||||
Returns true if the user can view this asset. C<userId> is a WebGUI user ID.
|
||||
|
|
@ -350,6 +365,42 @@ sub getAutoCommitWorkflowId {
|
|||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 getCurrentRevisionDate ( session, assetId )
|
||||
|
||||
Override this to allow instanciation of "pending" GalleryAlbums for those who
|
||||
are authorized to see them.
|
||||
|
||||
=cut
|
||||
|
||||
sub getCurrentRevisionDate {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $assetId = shift;
|
||||
|
||||
# Get the highest revision date, instanciate the asset, and see if
|
||||
# the permissions are enough to return the revisionDate.
|
||||
my $revisionDate
|
||||
= $session->db->quickScalar(
|
||||
"SELECT MAX(revisionDate) FROM GalleryAlbum WHERE assetId=?",
|
||||
[ $assetId ]
|
||||
);
|
||||
|
||||
return undef unless $revisionDate;
|
||||
|
||||
my $asset = WebGUI::Asset->new( $session, $assetId, $class, $revisionDate );
|
||||
|
||||
return undef unless $asset;
|
||||
|
||||
if ( $asset->get( 'status' ) eq "approved" || $asset->canEdit ) {
|
||||
return $revisionDate;
|
||||
}
|
||||
else {
|
||||
return $class->SUPER::getCurrentRevisionDate( $session, $assetId );
|
||||
}
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 getFileIds ( )
|
||||
|
||||
Gets an array reference of asset IDs for all the files in this album.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue