Merge branch 'master' into storageareas

This commit is contained in:
Isaac Connor
2017-05-30 10:21:01 -04:00
4 changed files with 1590 additions and 1617 deletions

View File

File diff suppressed because it is too large Load Diff

View File

@@ -32,10 +32,9 @@ require ZoneMinder::Base;
require Date::Manip;
use parent qw(ZoneMinder::Object);
#our @ISA = qw(ZoneMinder::Object);
use vars qw/ $table $primary_key /;
$table = 'Events';
$table = 'Filters';
$primary_key = 'Id';
# ==========================================================================
#
@@ -100,7 +99,7 @@ sub Execute {
my $sql = $self->Sql();
if ( $self->{HasDiskPercent} ) {
my $disk_percent = getDiskPercent( $$self{Storage} ? $$self{Storage}->Path() : () );
my $disk_percent = getDiskPercent();
$sql =~ s/zmDiskPercent/$disk_percent/g;
}
if ( $self->{HasDiskBlocks} ) {
@@ -196,9 +195,6 @@ sub Sql {
# This gets used later, I forget for what
$$self{Server} = new ZoneMinder::Server( $temp_value );
}
} elsif ( $term->{attr} eq 'StorageId' ) {
$value = "'$temp_value'";
$$self{Storage} = new ZoneMinder::Storage( $temp_value );
} elsif ( $term->{attr} eq 'Name'
|| $term->{attr} eq 'Cause'
|| $term->{attr} eq 'Notes'
@@ -254,14 +250,14 @@ sub Sql {
} # end if terms
if ( $self->{Sql} ) {
#if ( $self->{AutoMessage} ) {
if ( $self->{AutoMessage} ) {
# Include all events, including events that are still ongoing
# and have no EndTime yet
$sql .= " and ( ".$self->{Sql}." )";
#} else {
} else {
# Only include closed events (events with valid EndTime)
#$sql .= " where not isnull(E.EndTime) and ( ".$self->{Sql}." )";
#}
$sql .= " where not isnull(E.EndTime) and ( ".$self->{Sql}." )";
}
}
my @auto_terms;
if ( $self->{AutoArchive} ) {
@@ -269,9 +265,9 @@ sub Sql {
}
# Don't do this, it prevents re-generation and concatenation.
# If the file already exists, then the video won't be re-recreated
#if ( $self->{AutoVideo} ) {
#push @auto_terms, "E.Videoed = 0";
#}
if ( $self->{AutoVideo} ) {
push @auto_terms, "E.Videoed = 0";
}
if ( $self->{AutoUpload} ) {
push @auto_terms, "E.Uploaded = 0";
}

View File

@@ -1,7 +1,7 @@
# ==========================================================================
#
# ZoneMinder Object Module, $Date$, $Revision$
# Copyright (C) 2001-2008 Philip Coombes
# Copyright (C) 2001-2017 ZoneMinder LLC
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -113,50 +113,34 @@ sub AUTOLOAD {
1;
__END__
# Below is stub documentation for your module. You'd better edit it!
=head1 NAME
ZoneMinder::Database - Perl extension for blah blah blah
ZoneMinder::Object
=head1 SYNOPSIS
use ZoneMinder::Object;
use parent ZoneMinder::Object;
This package should likely not be used directly, as it is meant mainly to be a parent for all other ZoneMinder classes.
=head1 DESCRIPTION
Stub documentation for ZoneMinder, created by h2xs. It looks like the
author of the extension was negligent enough to leave the stub
unedited.
Blah blah blah.
A base Object to act as parent for other ZoneMinder Objects.
=head2 EXPORT
None by default.
=head1 SEE ALSO
Mention other useful documentation such as the documentation of
related modules or operating system documentation (such as man pages
in UNIX), or any relevant external documentation such as RFCs or
standards.
If you have a mailing list set up for your module, mention it here.
If you have a web site set up for your module, mention it here.
=head1 AUTHOR
Philip Coombes, E<lt>philip.coombes@zoneminder.comE<gt>
Isaac Connor, E<lt>isaac@zoneminder.comE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2001-2008 Philip Coombes
Copyright (C) 2001-2017 ZoneMinder LLC
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.3 or,