+my $build_search_link = sub {
+ my ($queue_name, $extra_query) = @_;
+ $queue_name =~ s/(['\\])/\\$1/g; #'
+
+ return RT->Config->Get('WebPath')
+ . "/Search/Results.html?Query="
+ . $m->interp->apply_escapes("Queue = '$queue_name' AND $extra_query", 'u');
+};
+
+my $link_all = sub {
+ my ($queue, $all_statuses) = @_;
+ return $build_search_link->($queue->{Name}, "(".join(" OR ", map "Status = '$_'", @$all_statuses).")");
+};
+
+my $link_status = sub {
+ my ($queue, $status) = @_;
+ return $build_search_link->($queue->{Name}, "Status = '$status'");
+};
+
+$m->callback(
+ CallbackName => 'LinkBuilders',
+ build_search_link => \$build_search_link,
+ link_all => \$link_all,
+ link_status => \$link_status,
+);