You are here

function uc_order_log in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_order/uc_order.module \uc_order_log()
  2. 7.3 uc_order/uc_order.admin.inc \uc_order_log()

Displays a log of changes made to an order.

2 string references to 'uc_order_log'
uc_order_menu in uc_order/uc_order.module
Implements hook_menu().
uc_order_update_6000 in uc_order/uc_order.install

File

uc_order/uc_order.admin.inc, line 1783
Order administration menu items.

Code

function uc_order_log($order) {
  $result = db_query("SELECT * FROM {uc_order_log} WHERE order_id = %d ORDER BY created, order_log_id", $order->order_id);
  while ($change = db_fetch_object($result)) {
    $user = uc_get_initials($change->uid);
    $rows[] = array(
      'data' => array(
        format_date($change->created, 'short'),
        $user == '-' ? $user : l($user, 'user/' . $change->uid),
        $change->changes,
      ),
      'valign' => 'top',
    );
  }
  if (count($rows)) {
    $header = array(
      t('Time'),
      t('User'),
      t('Changes'),
    );
    $output = theme('table', $header, $rows);
  }
  else {
    $output = t('No changes have been logged for this order.');
  }
  return $output;
}