function uc_order_comments_load in Ubercart 5
Same name and namespace in other branches
- 8.4 uc_order/uc_order.module \uc_order_comments_load()
- 6.2 uc_order/uc_order.module \uc_order_comments_load()
- 7.3 uc_order/uc_order.module \uc_order_comments_load()
Return an array of comments or admin comments for an order.
2 calls to uc_order_comments_load()
- uc_order_pane_admin_comments in uc_order/
uc_order_order_pane.inc - Handle the "Admin Comments" order pane.
- uc_order_pane_order_comments in uc_order/
uc_order_order_pane.inc - Handle the "Order Comments" order pane.
File
- uc_order/
uc_order.module, line 2634
Code
function uc_order_comments_load($order_id, $admin = FALSE) {
if (!$admin) {
$join = " LEFT JOIN {uc_order_statuses} AS os ON oc.order_status = os.order_status_id";
}
$result = db_query("SELECT * FROM {" . ($admin ? 'uc_order_admin_comments' : 'uc_order_comments') . "} AS oc" . $join . " WHERE oc.order_id = %d ORDER BY oc.created", $order_id);
while ($comment = db_fetch_object($result)) {
$comments[] = $comment;
}
return $comments;
}