function uc_order_pane_order_comments in Ubercart 7.3
Same name and namespace in other branches
- 5 uc_order/uc_order_order_pane.inc \uc_order_pane_order_comments()
- 6.2 uc_order/uc_order.order_pane.inc \uc_order_pane_order_comments()
Handles the "Order Comments" order pane.
1 string reference to 'uc_order_pane_order_comments'
- uc_order_uc_order_pane in uc_order/
uc_order.module - Implements hook_uc_order_pane().
File
- uc_order/
uc_order.order_pane.inc, line 858 - This file contains the callbacks for the default order panes supplied with Ubercart and their corresponding helper functions.
Code
function uc_order_pane_order_comments($op, $order, &$form = NULL, &$form_state = NULL) {
switch ($op) {
case 'view':
$comments = uc_order_comments_load($order->order_id);
return tapir_get_table('uc_op_order_comments_view_table', $comments);
case 'customer':
$comments = uc_order_comments_load($order->order_id);
$header = array(
t('Date'),
t('Status'),
t('Message'),
);
$rows[] = array(
array(
'data' => format_date($order->created, 'uc_store'),
'class' => array(
'date',
),
),
array(
'data' => '-',
'class' => array(
'status',
),
),
array(
'data' => t('Order created.'),
'class' => array(
'message',
),
),
);
if (count($comments) > 0) {
foreach ($comments as $comment) {
$rows[] = array(
array(
'data' => format_date($comment->created, 'uc_store'),
'class' => array(
'date',
),
),
array(
'data' => $comment->title,
'class' => array(
'status',
),
),
array(
'data' => check_plain($comment->message),
'class' => array(
'message',
),
),
);
}
}
$build = array(
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
'#attributes' => array(
'class' => array(
'uc-order-comments',
),
),
);
return $build;
}
}