Record donation directly from hub list.
[readifood.git] / lib / hub.php
index 56caa57..176903d 100644 (file)
     $role = $hub->getRole();
     $role_string = get_hub_role_string($hub);
     if ($role_string) echo " $role_string";
-    if ($role & $GLOBALS['ROLE_COLLECTION']) printf(" <a class=\"small\" href=\"/donation/to/hub/%s/%d\">Donations</a>", urlencode($hub->getName()), $hub->getId());
-    if ($role & $GLOBALS['ROLE_DISTRIBUTION']) printf(" <a class=\"small\" href=\"/order/to/hub/%s/%d\">Orders</a>", urlencode($hub->getName()), $hub->getId());
+    $d = urlencode($hub->getName());
+    $i = $hub->getId();
+    if ($role & $GLOBALS['ROLE_COLLECTION']) {
+      printf(" <a class=\"small\" href=\"/donation/to/hub/%s/%d\">Donations</a>", $d, $i);
+      echo " " . get_small_link("Record", "/donation/record/to/hub/%s/%d", $d, $i);
+    }
+    if ($role & $GLOBALS['ROLE_DISTRIBUTION']) printf(" <a class=\"small\" href=\"/order/to/hub/%s/%d\">Orders</a>", $d, $i);
     if (check_admin(1)) {
       echo " " . $hub->getDeleteLink();
     }