diff --git a/distros/redhat/CMakeLists.txt b/distros/redhat/CMakeLists.txt index f1a1bc75b..45cafe57d 100644 --- a/distros/redhat/CMakeLists.txt +++ b/distros/redhat/CMakeLists.txt @@ -21,7 +21,7 @@ endif(ZM_TARGET_DISTRO MATCHES "^el") # Configure the common zoneminder files configure_file(common/zoneminder.logrotate.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.logrotate @ONLY) configure_file(common/zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY) -file(MAKE_DIRECTORY sock swap zoneminder zoneminder-upload events temp) +file(MAKE_DIRECTORY sock swap zoneminder events temp) # Configure the Apache zoneminder files configure_file(httpd/zm-httpd.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zm-httpd.conf @ONLY) @@ -51,7 +51,6 @@ install(DIRECTORY sock swap DESTINATION /var/lib/zoneminder DIRECTORY_PERMISSION install(DIRECTORY zoneminder DESTINATION /var/log DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(DIRECTORY zoneminder DESTINATION /var/run DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(DIRECTORY zoneminder DESTINATION /var/cache DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) -install(DIRECTORY zoneminder-upload DESTINATION /var/spool DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(DIRECTORY events temp DESTINATION /var/lib/zoneminder DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) # Install the Apache zoneminder files diff --git a/src/zm_config.cpp b/src/zm_config.cpp index ddd3bcaa7..3d1a36381 100644 --- a/src/zm_config.cpp +++ b/src/zm_config.cpp @@ -107,7 +107,7 @@ void zmLoadConfig() { snprintf(staticConfig.video_file_format, sizeof(staticConfig.video_file_format), "%%s/%%s"); } -void process_configfile(char* configFile) { +void process_configfile(char const *configFile) { FILE *cfg; char line[512]; if ( (cfg = fopen(configFile, "r")) == NULL ) { diff --git a/src/zm_config.h.in b/src/zm_config.h.in index 9831677f0..2bd324cf7 100644 --- a/src/zm_config.h.in +++ b/src/zm_config.h.in @@ -62,7 +62,7 @@ extern void zmLoadConfig(); -extern void process_configfile( char* configFile ); +extern void process_configfile(char const *configFile); struct StaticConfig { std::string DB_HOST; diff --git a/web/skins/classic/views/console.php b/web/skins/classic/views/console.php index 1c0698ec6..f8fa8c2b1 100644 --- a/web/skins/classic/views/console.php +++ b/web/skins/classic/views/console.php @@ -244,7 +244,7 @@ echo $table_head; for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) { $monitor = $displayMonitors[$monitor_i]; $Monitor = new ZM\Monitor($monitor); - + include('function.php'); if ( $monitor_i and ( $monitor_i % 100 == 0 ) ) { echo ''; echo $table_head; @@ -325,7 +325,7 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) { ?> - '.translate('Fn'.$monitor['Function']).( empty($monitor['Enabled']) ? ', disabled' : '' ) .'', canEdit('Monitors') ) ?>
+

Name()); ?> '. makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', ''.validHtmlStr($Monitor->Source()).'', canEdit('Monitors') ).''; + echo ''. makeLink( '?view=monitor&mid='.$monitor['Id'], ''.validHtmlStr($Monitor->Source()).'', canEdit('Monitors') ).''; if ( $show_storage_areas ) { ?> Name()) : ($monitor['StorageId']?'Deleted '.$monitor['StorageId'].'' : '') ?> diff --git a/web/skins/classic/views/function.php b/web/skins/classic/views/function.php index 022853eaf..2fc53d812 100644 --- a/web/skins/classic/views/function.php +++ b/web/skins/classic/views/function.php @@ -22,42 +22,35 @@ if ( !canEdit('Monitors') ) { $view = 'error'; return; } - -$monitor = ZM\Monitor::find_one(array('Id'=>$_REQUEST['mid'])); - -$focusWindow = true; - -xhtmlHeaders(__FILE__, translate('Function').' - '.validHtmlStr($monitor->Name())); ?> - -
- -
-
- - - + +
diff --git a/web/skins/classic/views/js/console.js b/web/skins/classic/views/js/console.js index ab8fc8daa..2b4ffe935 100644 --- a/web/skins/classic/views/js/console.js +++ b/web/skins/classic/views/js/console.js @@ -135,6 +135,18 @@ function reloadWindow() { } function initPage() { + + $j('.functionLnk').click(function(evt) { + if ( ! canEditEvents ) { + alert("You do not have permission to change monitor function."); + return; + } + var mid = evt.currentTarget.getAttribute("data-mid"); + + evt.preventDefault(); + $j('#modalFunction-'+mid).modal('show'); + }); + reloadWindow.periodical(consoleRefreshTimeout); if ( showVersionPopup ) { createPopup('?view=version', 'zmVersion', 'version'); @@ -154,6 +166,26 @@ function initPage() { // Setup the thumbnail video animation initThumbAnimation(); + + // Manage the CANCEL modal buttons + $j('.funcCancelBtn').click(function(evt) { + var mid = evt.currentTarget.getAttribute("data-mid"); + + evt.preventDefault(); + $j('#modalFunction-'+mid).modal('hide'); + }); + + // Manage the SAVE modal buttons + $j('.funcSaveBtn').click(function(evt) { + var mid = evt.currentTarget.getAttribute("data-mid"); + var newFunc = $j("#funcSelect-"+mid).val(); + var newEnabled = $j('#newEnabled-'+mid).is(':checked') ? 1 : 0; + + evt.preventDefault(); + $j.getJSON(thisUrl + '?view=function&action=function&mid='+mid+'&newFunction='+newFunc+'&newEnabled='+newEnabled); + window.location.reload(true); + }); + } function applySort(event, ui) {