Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/DEV-capside/release-3.9.0:6365-6370
/branches/DEV-extra-notification-data:6734-6746
/branches/DEV-odw-calculations:9016-9160
/branches/DEV-restapi-monitoringservers:9778
/branches/DEV-snmp-multi:7324-7376
/branches/US187:9403-9479
/branches/US198b:8875-8994
/branches/US310:9851-9873
/branches/US539:12178-12182
/branches/enterprise/BRAN-3.14:6874,6882,6956
/branches/enterprise/DEV-professional:6494-8475,8477-8478,8486,8490,8492,8494,8499-8500,8515,8518-8519,8524,8527-8529,8531-8532,8536,8538,8540-8544,8547-8552,8554,8557,8600-8601,8637,8749,8772,8897,8917,8944-8945,8947,8950-8952,8967,8969,8979,8982,8987,8998,9006,9008,9011,9013,9026,9033-9036,9038,9040,9042,9044,9048,9050-9053,9062,9064-9065,9069,9078,9081,9088,9096,9099-9101,9103,9105,9115,9118,9347,9353-9354,9411,9432,9445,9486,9538-9550,9569-9571,9620,9635,9637-9638,9645-9647,9693,9699,9721,9814,9825,9857,9879,9881,9939,10002,10029,10038-10041,10070,10086,10093,10345,10347,10388,10407,10481,10549,10560-10562,10565,10568,10571,10577,10932,11025,11035,11360-11612,11798-11799,11920,12075-12076,12096,12189,12207,12232,12266,12288,12322,12334,12355,12372,12401-12406,12428,12491,12523,12539-12540,12544,12546,12555,12580,12583,12599-12600,12609,12611,12614-12615,12618,12624,12630-12631,12633,12643,12645-12646,12649,12653-12654,12657,12663,12744,13126-13127,13211
/branches/nagvis-iframe:9764-9786
/branches/opsview2runtime:10960-11258
/branches/opsview2runtime_xs:11279-11303
/branches/us168:8759,8762-8763,8766-8768,8770,8774-8777,8794,8798-8799,8801-8803,8821-8822,8834,8837-8838,8932,8937,8947,8969,8977,8981,9004,9007,9009-9010,9012,9024,9049
/commercial/branches/BRAN-4.2:10944,11017
/commercial/branches/BRAN-4.3:12423-12426
/commercial/branches/US306-slaves:9804-9823
/commercial/branches/US307-network-map:9685-9837
+ /branches/DEV-capside/release-3.9.0:6365-6370
/branches/DEV-extra-notification-data:6734-6746
/branches/DEV-odw-calculations:9016-9160
/branches/DEV-restapi-monitoringservers:9778
/branches/DEV-snmp-multi:7324-7376
/branches/US187:9403-9479
/branches/US198b:8875-8994
/branches/US310:9851-9873
/branches/US539:12178-12182
/branches/enterprise/BRAN-3.14:6874,6882,6956
/branches/enterprise/DEV-professional:6494-8475,8477-8478,8486,8490,8492,8494,8499-8500,8515,8518-8519,8524,8527-8529,8531-8532,8536,8538,8540-8544,8547-8552,8554,8557,8600-8601,8637,8749,8772,8897,8917,8944-8945,8947,8950-8952,8967,8969,8979,8982,8987,8998,9006,9008,9011,9013,9026,9033-9036,9038,9040,9042,9044,9048,9050-9053,9062,9064-9065,9069,9078,9081,9088,9096,9099-9101,9103,9105,9115,9118,9347,9353-9354,9411,9432,9445,9486,9538-9550,9569-9571,9620,9635,9637-9638,9645-9647,9693,9699,9721,9814,9825,9857,9879,9881,9939,10002,10029,10038-10041,10070,10086,10093,10345,10347,10388,10407,10481,10549,10560-10562,10565,10568,10571,10577,10932,11025,11035,11360-11612,11798-11799,11920,12075-12076,12096,12189,12207,12232,12266,12288,12322,12334,12355,12372,12401-12406,12428,12491,12523,12539-12540,12544,12546,12555,12580,12583,12599-12600,12609,12611,12614-12615,12618,12624,12630-12631,12633,12643,12645-12646,12649,12653-12654,12657-12658,12660,12663,12744,13126-13127,13211
/branches/nagvis-iframe:9764-9786
/branches/opsview2runtime:10960-11258
/branches/opsview2runtime_xs:11279-11303
/branches/us168:8759,8762-8763,8766-8768,8770,8774-8777,8794,8798-8799,8801-8803,8821-8822,8834,8837-8838,8932,8937,8947,8969,8977,8981,9004,9007,9009-9010,9012,9024,9049
/commercial/branches/BRAN-4.2:10944,11017
/commercial/branches/BRAN-4.3:12423-12426
/commercial/branches/US306-slaves:9804-9823
/commercial/branches/US307-network-map:9685-9837
Property changes on: trunk/opsview-core/bin/nagconfgen.pl
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/DEV-capside/release-3.9.0/opsview-core/bin/nagconfgen.pl:6365-6370
/branches/DEV-extra-notification-data/opsview-core/bin/nagconfgen.pl:6734-6746
/branches/DEV-odw-calculations/opsview-core/bin/nagconfgen.pl:9016-9160
/branches/DEV-restapi-monitoringservers/opsview-core/bin/nagconfgen.pl:9778
/branches/DEV-snmp-multi/opsview-core/bin/nagconfgen.pl:7324-7376
/branches/US187/opsview-core/bin/nagconfgen.pl:9403-9479
/branches/US198b/opsview-core/bin/nagconfgen.pl:8875-8994
/branches/US310/opsview-core/bin/nagconfgen.pl:9851-9873
/branches/US539/opsview-core/bin/nagconfgen.pl:12178-12182
/branches/enterprise/BRAN-3.14/opsview-core/bin/nagconfgen.pl:6874,6882,6956
/branches/enterprise/DEV-professional/opsview-core/bin/nagconfgen.pl:6494-8475,8477-8478,8486,8490,8492,8494,8499-8500,8515,8518-8519,8524,8527-8529,8531-8532,8536,8538,8540-8544,8547-8552,8554,8557,8600-8601,8637,8749,8772,8897,8917,8944-8945,8947,8950-8952,8967,8969,8979,8982,8987,8998,9006,9008,9011,9013,9026,9033-9036,9038,9040,9042,9044,9048,9050-9053,9062,9064-9065,9069,9078,9081,9088,9096,9099-9101,9103,9105,9115,9118,9347,9353-9354,9411,9432,9445,9486,9538-9550,9569-9571,9620,9635,9637-9638,9645-9647,9693,9699,9721,9814,9825,9857,9879,9881,9939,10002,10029,10038-10041,10070,10086,10093,10345,10347,10388,10407,10481,10549,10560-10562,10565,10568,10571,10577,10932,11025,11035,11360-11612,11798-11799,11920,12075-12076,12096,12189,12207,12232,12266,12288,12322,12334,12355,12372,12401-12406,12428,12491,12523,12539-12540,12544,12546,12555,12580,12583,12599-12600,12609,12611,12614-12615,12618,12624,12630-12631,12633,12643,12645-12646,12649,12653-12654,12657,12663,12744
/branches/enterprise/DEV-professional/opsview-core/bin-protected/nagconfgen.pl:13211
/branches/nagvis-iframe/opsview-core/bin/nagconfgen.pl:9764-9786
/branches/opsview2runtime/opsview-core/bin/nagconfgen.pl:10960-11258
/branches/opsview2runtime_xs/opsview-core/bin/nagconfgen.pl:11279-11303
/branches/us168/opsview-core/bin/nagconfgen.pl:8759,8762-8763,8766-8768,8770,8774-8777,8794,8798-8799,8801-8803,8821-8822,8834,8837-8838,8932,8937,8947,8969,8977,8981,9004,9007,9009-9010,9012,9024,9049
/commercial/branches/BRAN-4.2/opsview-core/bin/nagconfgen.pl:10944,11017
/commercial/branches/BRAN-4.3/opsview-core/bin/nagconfgen.pl:12423-12426
/commercial/branches/US306-slaves/opsview-core/bin/nagconfgen.pl:9804-9823
/commercial/branches/US307-network-map/opsview-core/bin/nagconfgen.pl:9685-9837
+ /branches/DEV-capside/release-3.9.0/opsview-core/bin/nagconfgen.pl:6365-6370
/branches/DEV-extra-notification-data/opsview-core/bin/nagconfgen.pl:6734-6746
/branches/DEV-odw-calculations/opsview-core/bin/nagconfgen.pl:9016-9160
/branches/DEV-restapi-monitoringservers/opsview-core/bin/nagconfgen.pl:9778
/branches/DEV-snmp-multi/opsview-core/bin/nagconfgen.pl:7324-7376
/branches/US187/opsview-core/bin/nagconfgen.pl:9403-9479
/branches/US198b/opsview-core/bin/nagconfgen.pl:8875-8994
/branches/US310/opsview-core/bin/nagconfgen.pl:9851-9873
/branches/US539/opsview-core/bin/nagconfgen.pl:12178-12182
/branches/enterprise/BRAN-3.14/opsview-core/bin/nagconfgen.pl:6874,6882,6956
/branches/enterprise/DEV-professional/opsview-core/bin/nagconfgen.pl:6494-8475,8477-8478,8486,8490,8492,8494,8499-8500,8515,8518-8519,8524,8527-8529,8531-8532,8536,8538,8540-8544,8547-8552,8554,8557,8600-8601,8637,8749,8772,8897,8917,8944-8945,8947,8950-8952,8967,8969,8979,8982,8987,8998,9006,9008,9011,9013,9026,9033-9036,9038,9040,9042,9044,9048,9050-9053,9062,9064-9065,9069,9078,9081,9088,9096,9099-9101,9103,9105,9115,9118,9347,9353-9354,9411,9432,9445,9486,9538-9550,9569-9571,9620,9635,9637-9638,9645-9647,9693,9699,9721,9814,9825,9857,9879,9881,9939,10002,10029,10038-10041,10070,10086,10093,10345,10347,10388,10407,10481,10549,10560-10562,10565,10568,10571,10577,10932,11025,11035,11360-11612,11798-11799,11920,12075-12076,12096,12189,12207,12232,12266,12288,12322,12334,12355,12372,12401-12406,12428,12491,12523,12539-12540,12544,12546,12555,12580,12583,12599-12600,12609,12611,12614-12615,12618,12624,12630-12631,12633,12643,12645-12646,12649,12653-12654,12657-12658,12660,12663
,12744
/branches/enterprise/DEV-professional/opsview-core/bin-protected/nagconfgen.pl:13211
/branches/nagvis-iframe/opsview-core/bin/nagconfgen.pl:9764-9786
/branches/opsview2runtime/opsview-core/bin/nagconfgen.pl:10960-11258
/branches/opsview2runtime_xs/opsview-core/bin/nagconfgen.pl:11279-11303
/branches/us168/opsview-core/bin/nagconfgen.pl:8759,8762-8763,8766-8768,8770,8774-8777,8794,8798-8799,8801-8803,8821-8822,8834,8837-8838,8932,8937,8947,8969,8977,8981,9004,9007,9009-9010,9012,9024,9049
/commercial/branches/BRAN-4.2/opsview-core/bin/nagconfgen.pl:10944,11017
/commercial/branches/BRAN-4.3/opsview-core/bin/nagconfgen.pl:12423-12426
/commercial/branches/US306-slaves/opsview-core/bin/nagconfgen.pl:9804-9823
/commercial/branches/US307-network-map/opsview-core/bin/nagconfgen.pl:9685-9837
Modified: trunk/opsview-core/lib/Opsview/ResultSet/Hostgroups.pm
===================================================================
--- trunk/opsview-core/lib/Opsview/ResultSet/Hostgroups.pm 2013-08-15 15:08:15 UTC (rev 13254)
+++ trunk/opsview-core/lib/Opsview/ResultSet/Hostgroups.pm 2013-08-15 15:09:45 UTC (rev 13255)
@@ -43,12 +43,12 @@
}
# Note: The ordering is by matpath, which may fail if there are duplicate hostgroup names with the same parent
-sub by_tree_arrayref {
+sub search_by_tree {
my $self = shift;
# The CONCAT trick was seen on MySQL site http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
# by Chris Stubben to count number of comma separators
- my @tree = $self->search(
+ return $self->search(
{},
{
"select" => [
@@ -59,7 +59,6 @@
order_by => "matpath",
}
);
- \@tree;
}
sub restricted_leaves_arrayref {
Modified: trunk/opsview-core/lib/Opsview/Schema/Roles.pm
===================================================================
--- trunk/opsview-core/lib/Opsview/Schema/Roles.pm 2013-08-15 15:08:15 UTC (rev 13254)
+++ trunk/opsview-core/lib/Opsview/Schema/Roles.pm 2013-08-15 15:09:45 UTC (rev 13255)
@@ -220,6 +220,24 @@
return $self->accesses->search_rs( { name => $accessname } )->count > 0;
}
+sub allowed_hostgroups_hierarchy {
+ my ($self) = @_;
+ if ( $self->tenancy && !$self->is_primary_for_tenant ) {
+ return $self->tenancy->primary_role->valid_hostgroups_hierarchy;
+ }
+ else {
+ return $self->result_source->schema->resultset("Hostgroups")
+ ->search_by_tree;
+ }
+}
+
+sub valid_hostgroups_hierarchy {
+ my ($self) = @_;
+ my $hg_paths = [ map { $_->matpath . "%" } ( $self->hostgroups->all ) ];
+ return $self->result_source->schema->resultset("Hostgroups")
+ ->search( { matpath => { "-like" => $hg_paths } } );
+}
+
sub allowed_hostgroups {
my ($self) = @_;
if ( $self->tenancy && !$self->is_primary_for_tenant ) {
Modified: trunk/opsview-core/t/944hostgroups.t
===================================================================
--- trunk/opsview-core/t/944hostgroups.t 2013-08-15 15:08:15 UTC (rev 13254)
+++ trunk/opsview-core/t/944hostgroups.t 2013-08-15 15:09:45 UTC (rev 13255)
@@ -93,7 +93,8 @@
"Got hostgroup leaves for somehosts"
);
-my $listref = $rs->by_tree_arrayref;
+my @results = $rs->search_by_tree;
+my $listref = \@results;
isa_ok( $listref->[0], "Opsview::Schema::Hostgroups" );
is( $listref->[0]->name, "> Opsview" );
is( $listref->[0]->id, 1 );
Property changes on: trunk/opsview-web/lib/Opsview/Web/I18N/i_default.po
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/DEV-capside/release-3.9.0/opsview-web/lib/Opsview/Web/I18N/i_default.po:6365-6370
/branches/DEV-extra-notification-data/opsview-web/lib/Opsview/Web/I18N/i_default.po:6734-6746
/branches/DEV-odw-calculations/opsview-web/lib/Opsview/Web/I18N/i_default.po:9016-9160
/branches/DEV-restapi-monitoringservers/opsview-web/lib/Opsview/Web/I18N/i_default.po:9778
/branches/DEV-snmp-multi/opsview-web/lib/Opsview/Web/I18N/i_default.po:7324-7376
/branches/US187/opsview-web/lib/Opsview/Web/I18N/i_default.po:9403-9479
/branches/US198b/opsview-web/lib/Opsview/Web/I18N/i_default.po:8875-8994
/branches/US310/opsview-web/lib/Opsview/Web/I18N/i_default.po:9851-9873
/branches/US539/opsview-web/lib/Opsview/Web/I18N/i_default.po:12178-12182
/branches/enterprise/BRAN-3.14/opsview-web/lib/Opsview/Web/I18N/i_default.po:6874,6882,6956
/branches/enterprise/DEV-professional/opsview-web/lib/Opsview/Web/I18N/i_default.po:6494-8475,8477-8478,8486,8490,8492,8494,8499-8500,8515,8518-8519,8524,8527-8529,8531-8532,8536,8538,8540-8544,8547-8552,8554,8557,8600-8601,8637,8749,8772,8897,8917,8944-8945,8947,8950-8952,8967,8969,8979,8982,8987,8998,9006,9008,9011,9013,9026,9033-9036,9038,9040,9042,9044,9048,9050-9053,9062,9064-9065,9069,9078,9081,9088,9096,9099-9101,9103,9105,9115,9118,9347,9353-9354,9411,9432,9445,9486,9538-9550,9569-9571,9620,9635,9637-9638,9645-9647,9693,9699,9721,9814,9825,9857,9879,9881,9939,10002,10029,10038-10041,10070,10086,10093,10345,10347,10388,10407,10481,10549,10560-10562,10565,10568,10571,10577,10932,11025,11035,11360-11612,11798-11799,11920,12075-12076,12096,12189,12207,12232,12266,12288,12322,12334,12355,12372,12401-12406,12428,12491,12539-12540,12544,12555,12580,12583,12599-12600,12609,12611,12614-12615,12618,12624,12630-12631,12633,12643,12645-12646,12649,12653-12654,12657,12663,12744,13
126-13127,13211
/branches/nagvis-iframe/opsview-web/lib/Opsview/Web/I18N/i_default.po:9764-9786
/branches/opsview2runtime/opsview-web/lib/Opsview/Web/I18N/i_default.po:10960-11258
/branches/opsview2runtime_xs/opsview-web/lib/Opsview/Web/I18N/i_default.po:11279-11303
/branches/us168/opsview-web/lib/Opsview/Web/I18N/i_default.po:8759,8762-8763,8766-8768,8770,8774-8777,8794,8798-8799,8801-8803,8821-8822,8834,8837-8838,8932,8937,8947,8969,8977,8981,9004,9007,9009-9010,9012,9024,9049
/commercial/branches/BRAN-4.2/opsview-web/lib/Opsview/Web/I18N/i_default.po:10944,11017
/commercial/branches/BRAN-4.3/opsview-web/lib/Opsview/Web/I18N/i_default.po:12423-12426
/commercial/branches/US306-slaves/opsview-web/lib/Opsview/Web/I18N/i_default.po:9804-9823
/commercial/branches/US307-network-map/opsview-web/lib/Opsview/Web/I18N/i_default.po:9685-9837
+ /branches/DEV-capside/release-3.9.0/opsview-web/lib/Opsview/Web/I18N/i_default.po:6365-6370
/branches/DEV-extra-notification-data/opsview-web/lib/Opsview/Web/I18N/i_default.po:6734-6746
/branches/DEV-odw-calculations/opsview-web/lib/Opsview/Web/I18N/i_default.po:9016-9160
/branches/DEV-restapi-monitoringservers/opsview-web/lib/Opsview/Web/I18N/i_default.po:9778
/branches/DEV-snmp-multi/opsview-web/lib/Opsview/Web/I18N/i_default.po:7324-7376
/branches/US187/opsview-web/lib/Opsview/Web/I18N/i_default.po:9403-9479
/branches/US198b/opsview-web/lib/Opsview/Web/I18N/i_default.po:8875-8994
/branches/US310/opsview-web/lib/Opsview/Web/I18N/i_default.po:9851-9873
/branches/US539/opsview-web/lib/Opsview/Web/I18N/i_default.po:12178-12182
/branches/enterprise/BRAN-3.14/opsview-web/lib/Opsview/Web/I18N/i_default.po:6874,6882,6956
/branches/enterprise/DEV-professional/opsview-web/lib/Opsview/Web/I18N/i_default.po:6494-8475,8477-8478,8486,8490,8492,8494,8499-8500,8515,8518-8519,8524,8527-8529,8531-8532,8536,8538,8540-8544,8547-8552,8554,8557,8600-8601,8637,8749,8772,8897,8917,8944-8945,8947,8950-8952,8967,8969,8979,8982,8987,8998,9006,9008,9011,9013,9026,9033-9036,9038,9040,9042,9044,9048,9050-9053,9062,9064-9065,9069,9078,9081,9088,9096,9099-9101,9103,9105,9115,9118,9347,9353-9354,9411,9432,9445,9486,9538-9550,9569-9571,9620,9635,9637-9638,9645-9647,9693,9699,9721,9814,9825,9857,9879,9881,9939,10002,10029,10038-10041,10070,10086,10093,10345,10347,10388,10407,10481,10549,10560-10562,10565,10568,10571,10577,10932,11025,11035,11360-11612,11798-11799,11920,12075-12076,12096,12189,12207,12232,12266,12288,12322,12334,12355,12372,12401-12406,12428,12491,12539-12540,12544,12555,12580,12583,12599-12600,12609,12611,12614-12615,12618,12624,12630-12631,12633,12643,12645-12646,12649,12653-12654,12657-12658,12660,12
663,12744,13126-13127,13211
/branches/nagvis-iframe/opsview-web/lib/Opsview/Web/I18N/i_default.po:9764-9786
/branches/opsview2runtime/opsview-web/lib/Opsview/Web/I18N/i_default.po:10960-11258
/branches/opsview2runtime_xs/opsview-web/lib/Opsview/Web/I18N/i_default.po:11279-11303
/branches/us168/opsview-web/lib/Opsview/Web/I18N/i_default.po:8759,8762-8763,8766-8768,8770,8774-8777,8794,8798-8799,8801-8803,8821-8822,8834,8837-8838,8932,8937,8947,8969,8977,8981,9004,9007,9009-9010,9012,9024,9049
/commercial/branches/BRAN-4.2/opsview-web/lib/Opsview/Web/I18N/i_default.po:10944,11017
/commercial/branches/BRAN-4.3/opsview-web/lib/Opsview/Web/I18N/i_default.po:12423-12426
/commercial/branches/US306-slaves/opsview-web/lib/Opsview/Web/I18N/i_default.po:9804-9823
/commercial/branches/US307-network-map/opsview-web/lib/Opsview/Web/I18N/i_default.po:9685-9837
Modified: trunk/opsview-web/root/admin/role/tab-configuration
===================================================================
--- trunk/opsview-web/root/admin/role/tab-configuration 2013-08-15 15:08:15 UTC (rev 13254)
+++ trunk/opsview-web/root/admin/role/tab-configuration 2013-08-15 15:09:45 UTC (rev 13255)
@@ -112,42 +112,30 @@
</tr>
</table>
-[% UNLESS is_system_role %]
+[% UNLESS is_system_role;
- <table>
- <tr>
- <td>
-
- [%
scrolling_list(
form_label => c.loc('ui.admin.role.edit.configuration.label.hostgroups'),
name => 'hostgroups',
- object_class => 'OpsviewSchema::Hostgroups',
- method_arrayref => 'by_tree_arrayref',
+ resultset_iterator => object.scalar.allowed_hostgroups_hierarchy.scalar.search_by_tree,
help_keyword => 'host_groups',
multiple => 1,
size => 10,
);
- %]
- <div>
- <label class="fields"> </label>
- [%
checkbox(
- label => c.loc('ui.admin.role.edit.configuration.label.all_monitoringservers'),
+ form_label => c.loc('ui.admin.role.edit.configuration.label.monitoringservers'),
+ help => c.loc('ui.admin.role.edit.configuration.label.all_monitoringservers'),
name => 'all_monitoringservers',
object_class => 'OpsviewSchema::Roles',
_onclick_ => 'toggleMS()',
);
- %]
- </div>
- <div id="monitoringserversdiv">
- [%
+%]<div id="monitoringserversdiv" class="input">[%
+
scrolling_list(
- form_label => c.loc('ui.admin.role.edit.configuration.label.monitoringservers'),
name => 'monitoringservers',
- object_class => 'OpsviewSchema::Monitoringservers',
+ resultset_iterator => object.scalar.allowed_monitoringservers,
help_keyword => 'monitoring_servers',
multiple => 1,
size => 10,
@@ -155,10 +143,6 @@
%]
</div>
- </td>
- </tr>
- </table>
-
[% END %]
</div>