git://git.iain.cx/iain
/
readifood.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Show outstanding orders in contact view.
[readifood.git]
/
lib
/
functions.php
diff --git
a/lib/functions.php
b/lib/functions.php
index
2f32a22
..
511e0cf
100644
(file)
--- a/
lib/functions.php
+++ b/
lib/functions.php
@@
-185,6
+185,13
@@
return $order_ids;
}
return $order_ids;
}
+ function get_contact_orders($contact, $state_mask = null) {
+ $q = new OrderQuery;
+ $q->filterByBeneficiaryId($contact->getId());
+ if ($state_mask) $q->filterById(get_order_ids_by_state($state_mask));
+ return $q->orderByDate()->find();
+ }
+
function get_user_by_contact_id($id, $verbose = true) {
$q = new UserQuery;
$user = $q->findOneByContactId($id);
function get_user_by_contact_id($id, $verbose = true) {
$q = new UserQuery;
$user = $q->findOneByContactId($id);