Index: store.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ecommerce/store/store.module,v
retrieving revision 1.44.2.1
diff -u -F^f -r1.44.2.1 store.module
--- store.module	17 May 2005 03:44:23 -0000	1.44.2.1
+++ store.module	17 May 2005 11:30:56 -0000
@@ -182,6 +182,8 @@ function store_menu($may_cache) {
 
     $items[] = array('path' => "store/history/$uid/subscriptions", 'title' => t('order history'),
       'callback' => 'store_user_subscriptions', 'access' => $user_access, 'type' => MENU_CALLBACK);
+    $items[] = array('path' => "user/$uid/history", 'title' => t('order history'),
+    'callback' => 'store_user_history', 'access' => $user_access, 'type' => MENU_LOCAL_TASK, 'weight' => 1);
   }
 
   return $items;
@@ -227,16 +229,6 @@ function store_settings() {
   return $output;
 }
 
-/**
- * Implementation of hook_user().
- */
-function store_user($type, &$edit, &$user) {
-  // Only display the link for the user who owns it.
-  if ($type == 'view' && $GLOBALS['user']->uid == $user->uid) {
-    return array(t('History') => form_item(t('Orders'), l(t('View your order history'), "store/history/$user->uid")));
-  }
-}
-
 /********************************************************************
  * Themeable Functions
  ********************************************************************/
@@ -1491,7 +1483,12 @@ function store_user_history() {
 
   $uid = $user->uid;
   if ($user->uid == 1 || user_access('administer store')) {
-    $uid = arg(2);
+    if (arg(0) == 'user') {
+      $uid = arg(1);
+    }
+    else {
+      $uid = arg(2);
+    }
   }
   $name = db_result(db_query('SELECT name FROM {users} WHERE uid = %d', $uid));
   $title = t('%username\'s order history', array('%username' => $name));
@@ -1526,7 +1523,7 @@ function store_user_history() {
 
   $pager = theme('pager', NULL, 25, 0, tablesort_pager());
   if (!empty($pager)) {
-    $rows[] = array(array('data' => $pager, 'colspan' => 6));
+    $rows[] = array(array('data' => $pager, 'colspan' => 9));
   }
   $output .= theme("table", $header, $rows);
 
