From bb7d5af591a4fbb9963afc46fa992f742a2d3355 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 13 May 2013 05:32:37 -0400 Subject: [PATCH] Added order notes field. Allow freeform notes for an order, for instance for noting specific dietary requirements such as no tomatoes. --- lib/delivery.php | 7 +++++++ lib/order.php | 8 ++++++++ propel/schema.xml | 1 + 3 files changed, 16 insertions(+) diff --git a/lib/delivery.php b/lib/delivery.php index 4c7c4f0..43800ca 100644 --- a/lib/delivery.php +++ b/lib/delivery.php @@ -133,6 +133,13 @@ echo "\n
" . htmlspecialchars($address->getPostcode()); echo "

\n"; + $notes = $order->getNotes(); + if ($notes) { + echo "

Notes:\n"; + echo htmlspecialchars($notes); + echo "

\n"; + } + echo "
\n\n"; } } diff --git a/lib/order.php b/lib/order.php index 95d96bb..7872f94 100644 --- a/lib/order.php +++ b/lib/order.php @@ -304,6 +304,12 @@ echo "\n"; echo "\n"; + /* Notes. */ + echo "\n"; + echo " Notes\n"; + echo " "; textarea("notes", $order->getNotes()); echo "\n"; + echo "\n"; + /* Driver. */ echo "\n"; echo " Driver\n"; @@ -425,6 +431,7 @@ for ($i = count($parcel_sizes); $i < count($parcel_contents); $i++) { if ($_POST['parcel_' . $i] == "on") $parcel |= (1 << $i); } + $notes = $_POST['notes']; if ($date) { list($y, $m, $d) = explode('-', $date); @@ -469,6 +476,7 @@ $order->setBeneficiaryId($beneficiary_id); $order->setHubId($hub_id); $order->setParcel($parcel); + $order->setNotes($notes); /* XXX: begin/commit */ try { diff --git a/propel/schema.xml b/propel/schema.xml index 7d7e6c0..3ab248b 100644 --- a/propel/schema.xml +++ b/propel/schema.xml @@ -133,6 +133,7 @@ + -- 2.7.4