The link "Create an order for this customer" appears on page "Customer orders".
But the page "Create order" restricted by permission "create orders".
That link should exists only when user has this permission.
So I made the patch. Check it.

Index: uc_store.admin.inc
===================================================================
--- uc_store.admin.inc	(revision 14777)
+++ uc_store.admin.inc	(working copy)
@@ -919,6 +919,8 @@
  * Display a list of orders made by a customer.
  */
 function uc_store_customer_orders($uid) {
+  global $user;
+
   $result = pager_query("SELECT * FROM {uc_orders} WHERE uid = %d AND "
                        ."order_status IN ". uc_order_status_list('general', TRUE)
                        ." ORDER BY created DESC", 50, 0,
@@ -986,8 +988,10 @@
     'revision' => 'formatted-original',
     'type' => 'amount',
   );
-  $output = '<p>'. l(t('Create an order for this customer.'),
-                     'admin/store/orders/create/'. $uid) .'</p>';
+  if (user_access('create orders', $user)) {
+    $output = '<p>'. l(t('Create an order for this customer.'),
+                       'admin/store/orders/create/'. $uid) .'</p>';
+  }
   $output .= '<p>'. t('!totals_orders orders shown match that account with !totals_items items purchased and !totals_total spent:',
                      array('!totals_orders' => $totals['orders'],
                            '!totals_items' => $totals['items'], 
CommentFileSizeAuthor
#1 662010_create_order.patch831 bytesIsland Usurper

Comments

Island Usurper’s picture

Status: Needs review » Fixed
StatusFileSize
new831 bytes

I had forgotten that those pages even existed. Since user_access() uses the current user by default, I cleaned up your changes a bit before committing.

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.