Merge branch 'master' into uat live-2013-10-31 uat-2013-10-31
authorIain Patterson <me@iain.cx>
Thu, 31 Oct 2013 16:50:05 +0000 (12:50 -0400)
committerIain Patterson <me@iain.cx>
Thu, 31 Oct 2013 16:50:05 +0000 (12:50 -0400)
lib/area.php
lib/contact.php
lib/functions.php
lib/order.php

index 8872a43..9b0d5e1 100644 (file)
     echo "Delivery days:";
     if (check_admin(1)) {
       for ($i = 0; $i < count($week); $i++) {
-        echo " <input type=\"checkbox\" name=\"day_$i\"";
+        echo " <input type=\"checkbox\" id=\"day_$i\" name=\"day_$i\"";
         if ($days & (1 << $i)) echo " checked";
-        echo ">$week[$i]\n";
+        echo "><label for=\"day_$i\">$week[$i]</label>\n";
       }
     }
     else {
index 051f291..f376406 100644 (file)
     echo "  <td>";
     for ($i = count($parcel_sizes); $i < count($parcel_contents); $i++) {
       if (1 << $i == $GLOBALS['PARCEL_TOILETRY']) continue;
-      echo "  <input type=\"checkbox\" name=\"parcel_$i\"";
+      echo "  <input type=\"checkbox\" id=\"parcel_$i\" name=\"parcel_$i\"";
       if ($contact->getParcel() & (1 << $i)) echo " checked";
-      echo ">$parcel_contents[$i]\n";
+      echo "><label for=\"parcel_$i\">$parcel_contents[$i]</label>\n";
     }
     echo "</td>\n";
     echo "</tr>\n";
 
     $contact = new Contact;
     if (! update_contact($contact, $area_id, true)) return false;
+    $name = $contact->getDisplayname();
     return $contact->getId();
   }
 
index 2fcbe0e..eb48c4b 100644 (file)
 
   function show_role_form($role, $roles) {
     for ($i = 0; $i < count($roles); $i++) {
-      echo " <input type=\"checkbox\" name=\"role_$i\"";
+      echo " <input type=\"checkbox\" id=\"role_$i\" name=\"role_$i\"";
       if ($role & (1 << $i)) echo " checked";
-      echo ">$roles[$i]\n";
+      echo "><label for=\"role_$i\">$roles[$i]</label>\n";
     }
   }
 
index 7c68455..6c75211 100644 (file)
 
     echo "<p>Restrict to order states:\n";
     for ($i = 0; $i < count($states); $i++) {
-      echo " <input type=\"checkbox\" name=\"state_$i\"";
+      echo " <input type=\"checkbox\" id=\"state_$i\" name=\"state_$i\"";
       if ($state_mask & (1 << $i)) echo " checked";
-      echo ">$states[$i]\n";
+      echo "><label for=\"state_$i\">$states[$i]</label>\n";
     }
     echo "</p>\n";
   }
     echo "  <td>Parcel contents</td>\n";
     echo "  <td>";
     for ($i = count($parcel_sizes); $i < count($parcel_contents); $i++) {
-      echo "  <input type=\"checkbox\" name=\"parcel_$i\"";
+      echo "  <input type=\"checkbox\" id=\"parcel_$i\" name=\"parcel_$i\"";
       if ($order->getParcel() & (1 << $i)) echo " checked";
-      echo ">$parcel_contents[$i]\n";
+      echo "><label for=\"parcel_$i\">$parcel_contents[$i]</label>\n";
     }
     echo "</td>\n";
     echo "</tr>\n";