Commits

Anonymous committed 2d10d48

Sort divisions before ordering (DivsXML)
Fix search box (index.php and search.php)
Fix logo link to homepage (index.php)
Fix parliaments.inc when no parlimentary session details passed

Comments (0)

Files changed (6)

custom/cluster/Makefile

 # to octave itself.  It also writes the raw distance metric
 # to the database for use.
 mpcoords:
-	cluster-parliament-static.pl
+	perl cluster-parliament-static.pl
 .PHONY: mpcoords
 
 # Make Java applet

loader/PublicWhip/DivsXML.pm

     );
 
     opendir DIR, $debatepath or die "Cannot open $debatepath: $!\n";
-    while ( my $file = readdir(DIR) ) {
+    my @files;
+    while (my $file = readdir(DIR)) {
+	push(@files,$file);
+    }
+    @files=sort { $a cmp $b} @files;
+    foreach my $file (@files) {
         if ( $file =~ m/^$fileprefix(\d\d\d\d-\d\d-\d\d)([a-z]*).xml$/ ) {
             $curdate = $1;
             $cursuffix = $2;

loader/calc_caches.php

 					   division_date, division_number, pw_division.house as house";
 	$qfrom =  " FROM pw_division";
 
-	$qjoin .= " LEFT JOIN pw_mp ON
+	$qjoin = " LEFT JOIN pw_mp ON
             		pw_division.house = pw_mp.house AND
             		pw_mp.entered_house <= pw_division.division_date AND
             		pw_division.division_date < pw_mp.left_house";

website/index.php

 <div class="homesearch">
 <h2>Search the Whip</h2>
 <p>Enter your <strong>postcode</strong>, an <strong>MP</strong> or <strong>Lord’s name</strong>, or a particular <strong>topic</strong> of interest</p>
-<form class="searchtitlebarform" action="/search.php" name="pw">
-<input maxLength=256 size=12 id="query" onblur="fadeout(this)" onfocus="fadein(this)"> <button type="submit" value="Submit">Submit</button>
+<form class="searchtitlebarform" action="/search.php" name="pw" method="get">
+<input maxLength=256 size=12 name="query" id="query" onblur="fadeout(this)" onfocus="fadein(this)"> <button type="submit" value="Submit" name="button">Submit</button>
 </form>
 </div>
 <div class="homesponsor">
 <div class="clear"></div>
 </div>
 <?php pw_footer(); ?>
-<?php //cache_end(); ?>
+<?php //cache_end(); ?>

website/parliaments.inc

 $parlsessions = array(
 	'2002' => array('from' => '2002-11-13', 'to' => '2003-11-20', 'name' => '2002/2003'),
 );
-$parlsession = db_scrub($_GET["session"]);
+$session=NULL;
+if (isset($_GET['session'])) {
+	$session=$_GET['session'];
+}
+$parlsession = db_scrub($session);
 
 function parliament_count()
 {

website/search.php

 
 <p class="search">Enter your postcode, MP name, constituency or debate topic:</p>
 <form class="search" action="search.php" name=pw>
-<input maxLength=256 size=25 name=query id=query value=""> <input type="submit" value="Search" name="button">
+<input maxLength=256 size=25 name="query" id="query" value=""> <input type="submit" value="Search" name="button">
 </form>
 
 <p class="search"><i>Example: "OX1 3DR", "<?=$random_mp?>"<?=$random_constituency?> or "<?=$random_topic?>"</i>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.