Split get_contact_orders().
[readifood.git] / lib / order.php
index 38a235a..95d96bb 100644 (file)
     foreach ($contacts as $contact) {
       option("requester_id", $contact->getId(), $contact->getDisplayname(), $order->getRequesterId());
     }
-    echo "</select></td>\n";
+    echo "</select>";
+    $contact = get_contact_by_id($order->getRequesterId(), false);
+    if ($contact) echo " " . get_small_link($contact->getDisplayname(), $contact->getURL());
+    echo "</td>\n";
     echo "</tr>\n";
 
     /* Beneficiary. */
         option("beneficiary_id", $contact->getId(), $contact->getDisplayname(), $order->getBeneficiaryId());
       }
     }
-    echo "</select></td>\n";
+    echo "</select>";
+    $contact = get_contact_by_id($order->getBeneficiaryId(), false);
+    if ($contact) echo " " . get_small_link($contact->getDisplayname(), $contact->getURL());
+    echo "</td>\n";
     echo "</tr>\n";
 
     /* Hub. */
     foreach ($hubs as $hub) {
       option("hub_id", $hub->getId(), $hub->getDisplayname(), $order->getHubId());
     }
-    echo "</select></td>\n";
+    echo "</select>";
+    $hub = get_hub_by_id($order->getHubId(), false);
+    if ($hub) echo " " . get_small_link($hub->getDisplayname(), $hub->getURL());
+    echo "</td>\n";
     echo "</tr>\n";
 
     /* Parcel type. */
       foreach ($contacts as $contact) {
         option("driver_id", $contact->getId(), $contact->getDisplayname(), $driver_id);
       }
-      echo "</select></td>\n";
+      echo "</select>";
+      $contact = get_contact_by_id($driver_id, false);
+      if ($contact) echo " " . get_small_link($contact->getDisplayname(), $contact->getURL());
+      echo "</td>\n";
     }
     else echo "  <td>No drivers!</td>\n";
     echo "</tr>\n";
     if (! count($order_states)) return;
 
     echo "<h3>Order history</h3>\n";
+    echo "<p class=\"history\">\n";
     foreach ($order_states as $order_state) {
       $date = $order_state->getUpdated();
 
         }
       }
       #$state = $states[$order_state->getState()];
-      echo "<p><strong>$username</strong> changed order to state <strong>$state</strong>";
+      echo "<strong>$username</strong> changed order to state <strong>$state</strong>";
       if ($driver) echo " for driver " . $driver->getDisplayname();
-      echo " on $date.</p>\n";
+      echo " on $date.<br>\n";
     }
+    echo "</p>\n";
   }
 
   function show_order(&$id = null) {