diff --git a/distros/ubuntu1204/control b/distros/ubuntu1204/control index 8e613cb95..ad751ef71 100644 --- a/distros/ubuntu1204/control +++ b/distros/ubuntu1204/control @@ -7,7 +7,6 @@ Build-Depends: debhelper (>= 9), python-sphinx | python3-sphinx, apache2-dev, dh ,cmake ,libx264-dev, libmp4v2-dev ,libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libavdevice-dev - ,libboost1.55-dev ,libbz2-dev ,libgcrypt-dev ,libcurl4-gnutls-dev diff --git a/web/api/app/Controller/EventsController.php b/web/api/app/Controller/EventsController.php index 97498db9a..27ee20e5d 100644 --- a/web/api/app/Controller/EventsController.php +++ b/web/api/app/Controller/EventsController.php @@ -57,7 +57,7 @@ class EventsController extends AppController { // API 'limit' => '100', - 'order' => array('StartTime', 'MaxScore'), + 'order' => array('StartTime'), 'paramType' => 'querystring', ); //if ( $this->request->params['GroupId'] ) { diff --git a/web/includes/actions.php b/web/includes/actions.php index 91c5cacf9..d6e6c8377 100644 --- a/web/includes/actions.php +++ b/web/includes/actions.php @@ -665,16 +665,21 @@ if ( canView( 'Groups' ) && $action == 'setgroup' ) { if ( canEdit( 'Groups' ) ) { if ( $action == 'group' ) { $monitors = empty( $_POST['newGroup']['MonitorIds'] ) ? '' : implode(',', $_POST['newGroup']['MonitorIds']); + $group_id = null; if ( !empty($_POST['gid']) ) { + $group_id = $_POST['gid']; dbQuery( 'UPDATE Groups SET Name=?, ParentId=? WHERE Id=?', - array($_POST['newGroup']['Name'], ( $_POST['newGroup']['ParentId'] == '' ? null : $_POST['newGroup']['ParentId'] ), $_POST['gid']) ); - dbQuery( 'DELETE FROM Groups_Monitors WHERE GroupId=?', array($_POST['gid']) ); + array($_POST['newGroup']['Name'], ( $_POST['newGroup']['ParentId'] == '' ? null : $_POST['newGroup']['ParentId'] ), $group_id) ); + dbQuery( 'DELETE FROM Groups_Monitors WHERE GroupId=?', array($group_id) ); } else { - dbQuery( 'INSERT INTO Groups SET Name=?, ParentId=?, MonitorIds=?', - array( $_POST['newGroup']['Name'], ( $_POST['newGroup']['ParentId'] == '' ? null : $_POST['newGroup']['ParentId'] ), $monitors ) ); + dbQuery( 'INSERT INTO Groups (Name,ParentId) VALUES (?,?)', + array( $_POST['newGroup']['Name'], ( $_POST['newGroup']['ParentId'] == '' ? null : $_POST['newGroup']['ParentId'] ) ) ); + $group_id=dbInsertId(); } - foreach ( $_POST['newGroup']['MonitorIds'] as $mid ) { - dbQuery( 'INSERT INTO Groups_Monitors (GroupId,MonitorId) VALUES (?,?)', array($_POST['gid'], $mid) ); + if ( $group_id ) { + foreach ( $_POST['newGroup']['MonitorIds'] as $mid ) { + dbQuery( 'INSERT INTO Groups_Monitors (GroupId,MonitorId) VALUES (?,?)', array($group_id, $mid) ); + } } $view = 'none'; $refreshParent = true; diff --git a/web/skins/classic/views/group.php b/web/skins/classic/views/group.php index a010d75e7..11ea093ed 100644 --- a/web/skins/classic/views/group.php +++ b/web/skins/classic/views/group.php @@ -108,7 +108,7 @@ echo htmlSelect( 'newGroup[ParentId]', $options, $newGroup->ParentId(), array('o foreach ( $monitors as $monitor ) { if ( visibleMonitor( $monitor['Id'] ) ) { ?> - +