Bug 25 - Allowed access to event cause and notes fields.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1409 e3e1d417-86f3-4887-817a-d78f3d33393f
pull/27/merge
stan 2005-05-16 12:03:28 +00:00
parent 80a790db53
commit a2f85d3286
7 changed files with 87 additions and 1 deletions

View File

@ -32,6 +32,7 @@ web_DATA = \
zm_html_view_cycle.php \
zm_html_view_error.php \
zm_html_view_event.php \
zm_html_view_eventdetail.php \
zm_html_view_events.php \
zm_html_view_filter.php \
zm_html_view_filtersave.php \
@ -122,6 +123,7 @@ EXTRA_DIST = \
zm_html_view_cycle.php \
zm_html_view_error.php \
zm_html_view_event.php \
zm_html_view_eventdetail.php \
zm_html_view_events.php \
zm_html_view_filter.php \
zm_html_view_filtersave.php \

View File

@ -44,6 +44,11 @@ if ( isset($action) )
{
simpleQuery( "update Events set Name = '$event_name' where Id = '$eid'" );
}
else if ( $action == "eventdetail" && $eid )
{
simpleQuery( "update Events set Cause = '".addslashes($new_event['Cause'])."', Notes = '".addslashes($new_event['Notes'])."' where Id = '$eid'" );
$refresh_parent = true;
}
elseif ( $action == "archive" && $eid )
{
simpleQuery( "update Events set Archived = 1 where Id = '$eid'" );

View File

@ -160,6 +160,7 @@ $jws = array(
'cycle' => array( 'w'=>16, 'h'=>32 ),
'device' => array( 'w'=>196, 'h'=>164 ),
'event' => array( 'w'=>96, 'h'=>168 ),
'eventdetail' => array( 'w'=>400, 'h'=>220 ),
'events' => array( 'w'=>720, 'h'=>480 ),
'filter' => array( 'w'=>560, 'h'=>250 ),
'filtersave' => array( 'w'=>560, 'h'=>220 ),

View File

@ -126,6 +126,7 @@ switch( $view )
case "filter" :
case "filtersave" :
case "event" :
case "eventdetail" :
case "frame" :
case "frames" :
case "stats" :

View File

@ -0,0 +1,76 @@
<?php
//
// ZoneMinder web event detail view file, $Date$, $Revision$
// Copyright (C) 2003, 2004, 2005 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canEdit( 'Events' ) )
{
$view = "error";
return;
}
$sql = "select E.* from Events as E where E.Id = '$eid'";
$result = mysql_query( $sql );
if ( !$result )
die( mysql_error() );
$new_event = mysql_fetch_assoc( $result );
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?= ZM_WEB_TITLE_PREFIX ?> - <?= $zmSlangFrames ?> <?= $eid ?></title>
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script type="text/javascript">
<?php
if ( !empty($refresh_parent) )
{
?>
opener.location.reload(true);
<?php
}
?>
window.focus();
function closeWindow()
{
window.close();
}
</script>
</head>
<body>
<table width="96%" border="0">
<tr>
<td align="left" class="smallhead"><b><?= $zmSlangEvent ?> <?= $eid ?></b></td>
<td align="right" class="text"><a href="javascript: closeWindow();"><?= $zmSlangClose ?></a></td>
</tr>
<tr><td colspan="2"><table width="100%" border="0" cellpadding="3" cellspacing="1">
<form name="event_form" method="post" action="<?= $PHP_SELF ?>">
<input type="hidden" name="view" value="<?= $view ?>">
<input type="hidden" name="action" value="eventdetail">
<input type="hidden" name="eid" value="<?= $eid ?>">
<tr valign="top"><td align="left" class="text"><?= $zmSlangCause ?></td><td align="left" class="text"><input type="text" name="new_event[Cause]" value="<?= $new_event['Cause'] ?>" size="32" class="form"></td></tr>
<tr valign="top"><td align="left" class="text"><?= $zmSlangNotes ?></td><td align="left" class="text"><textarea name="new_event[Notes]" rows="6" cols="50" class="form"><?= $new_event['Notes'] ?></textarea></td></tr>
<tr><td colspan="2" align="left" class="text">&nbsp;</td></tr>
<tr>
<td colspan="2" align="right"><input type="submit" value="<?= $zmSlangSave ?>" class="form"<?php if ( !canEdit( 'Events' ) ) { ?> disabled<?php } ?>>&nbsp;&nbsp;<input type="button" value="<?= $zmSlangCancel ?>" class="form" onClick="closeWindow()"></td>
</tr>
</form>
</table></td>
</tr>
</table>
</body>
</html>

View File

@ -342,7 +342,7 @@ function viewEvents( form, name )
<td align="center" class="text"><a href="javascript: eventWindow( '<?= $PHP_SELF ?>?view=event&eid=<?= $event['Id'] ?><?= $filter_query ?><?= $sort_query ?>&page=1', 'zmEvent', <?= $event['Width']+$jws['event']['w'] ?>, <?= $event['Height']+$jws['event']['h'] ?> );"><?= $event['Id'] ?><?php if ( $event['Archived'] ) echo "*" ?></a></td>
<td align="center" class="text"><a href="javascript: eventWindow( '<?= $PHP_SELF ?>?view=event&eid=<?= $event['Id'] ?><?= $filter_query ?><?= $sort_query ?>&page=1', 'zmEvent', <?= $event['Width']+$jws['event']['w'] ?>, <?= $event['Height']+$jws['event']['h'] ?> );"><?= $event['Name'] ?><?php if ( $event['Archived'] ) echo "*" ?></a></td>
<td align="center" class="text"><?= $event['MonitorName'] ?></td>
<td align="center" class="text"><?= $event['Cause'] ?></td>
<td align="center" class="text"><?= makeLink( "javascript: newWindow( '$PHP_SELF?view=eventdetail&eid=".$event['Id']."', 'zmEventDetail', ".$jws['eventdetail']['w'].", ".$jws['eventdetail']['h']." );", $event['Cause'], canEdit( 'Events' ) ) ?></td>
<td align="center" class="text"><?= strftime( "%m/%d %H:%M:%S", strtotime($event['StartTime']) ) ?></td>
<td align="center" class="text"><?= $event['Length'] ?></td>
<td align="center" class="text"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=frames&eid=<?= $event['Id'] ?>', 'zmFrames', <?= $jws['frames']['w'] ?>, <?= $jws['frames']['h'] ?> );"><?= $event['Frames'] ?></a></td>

View File

@ -366,6 +366,7 @@ $zmSlangNo = 'No';
$zmSlangNormal = 'Normal';
$zmSlangNoSavedFilters = 'NoSavedFilters';
$zmSlangNoStatisticsRecorded = 'There are no statistics recorded for this event/frame';
$zmSlangNotes = 'Notes';
$zmSlangNumPresets = 'Num Presets';
$zmSlangOpen = 'Open';
$zmSlangOpEq = 'equal to';