Index: htdocs/mod/search/index.js =================================================================== --- htdocs/mod/search/index.js (revision 11261) +++ htdocs/mod/search/index.js (working copy) @@ -34,6 +34,26 @@ this.imgminus = new Image(); this.imgminus.src = "/images/es/minimize.gif"; + window.onload = function() { + function checkDisplay() { + if (chosenoption.value == "33") { + ar_type.style.display = "inline"; + ar_type.selectedIndex = "-1"; + //mod_type.setAttribute("size", "10"); + } else { + //mod_type.setAttribute("size", "25"); + ar_type.style.display = "none"; + } + } + var mod_type = document.getElementById("mod_type"); + var ar_type = document.getElementById("ar_type"); + var chosenoption = mod_type.options[mod_type.selectedIndex]; + checkDisplay(); + mod_type.onchange = function() { + chosenoption = this.options[this.selectedIndex]; + checkDisplay(); + } + } /** * Hide all filter types, where no selection has been made. */ @@ -320,6 +340,5 @@ // instantiate, and setup the form. var advancedEditSearch = new AdvancedEditSearch(); mb.registerDOMReadyAction( - new MbEventAction(advancedEditSearch.GID, 'setupForm', "Setup AdvancedEditSearch form") + new MbEventAction(advancedEditSearch.GID, 'setupForm', "Setup AdvancedEditSearch form") ); - Index: htdocs/mod/search/select-filter.html =================================================================== --- htdocs/mod/search/select-filter.html (revision 11261) +++ htdocs/mod/search/select-filter.html (working copy) @@ -82,13 +82,15 @@
  • For my subscribed editors
    As above, but for your subscribed editors only.
  • +
  • Add relationship edits for + artist, + release, + track, + label or + url
    + Vote on only add relationship edits. +
  • - - Index: htdocs/mod/search/setquery.inc =================================================================== --- htdocs/mod/search/setquery.inc (revision 11261) +++ htdocs/mod/search/setquery.inc (working copy) @@ -50,6 +50,7 @@ $minid => "" $maxid => "" $orderby => "asc" + $ar_type => "" @@ -537,6 +538,31 @@ push @where, "m.id <= $maxid" if $maxid ne ""; ################################################################################ + # AR filtering + ################################################################################ + + if ($ar_type && $mod_type[0] == 33 && scalar(@mod_type) == 1 && + $mod_status[0] == &ModDefs::STATUS_OPEN && scalar(@mod_status) == 1) + { + my @clauses; + my @types = split(",", $ar_type); + foreach my $type (@types) + { + if ($type =~ /-/) + { + my ($entity0, $entity1) = split('-', $type); + push @clauses, "(m.newvalue like '%entity0type=$entity0%' AND m.newvalue like '%entity1type=$entity1%')"; + } + else + { + push @clauses, "(m.newvalue like '%entity0type=$type%' OR m.newvalue like '%entity1type=$type%')"; + } + } + + push @where, "(" . join(" OR ", @clauses) . ")"; + } + + ################################################################################ # orderby ################################################################################ Index: htdocs/mod/search/index.html =================================================================== --- htdocs/mod/search/index.html (revision 11261) +++ htdocs/mod/search/index.html (working copy) @@ -157,7 +157,7 @@ <& /comp/linkdoc, "EditType", "Edit type" &>:
    - <%perl> $m->comp( "/comp/options", @@ -173,6 +173,34 @@ ); +
    @@ -476,7 +504,6 @@ <& /comp/tableend &> - <& /comp/footer &> %# vi: set ts=4 sw=4 ft=mason : Index: htdocs/css/main.css =================================================================== --- htdocs/css/main.css (revision 11261) +++ htdocs/css/main.css (working copy) @@ -1276,5 +1276,8 @@ color: grey; font-size: x-small; } +.hide { + display:none; +} /* vi: set ts=4 sw=4 ft=mason : */