--- mp_orders/mp_orders.module +++ mp_orders/mp_orders.module @@ -22,9 +22,9 @@ function mp_orders_help($path, $arg) { switch ($path) { case 'user/%/selling/fulfill': - return l('View Orders','user/'. $arg[1] .'/selling/fulfill') .' | '. l('Fulfill Orders','user/'. $arg[1] .'/selling/fulfill/edit') .'

'. t("The following is a list of all the orders placed on your products. You can view an order by clicking the view icon next to its name.") .'

'; + return l(t('View Orders'),'user/'. $arg[1] .'/selling/fulfill') .' | '. l(t('Fulfill Orders'),'user/'. $arg[1] .'/selling/fulfill/edit') .'

'. t("The following is a list of all the orders placed on your products. You can view an order by clicking the view icon next to its name.") .'

'; case 'user/%/selling/fulfill/edit': - return l('View Orders','user/'. $arg[1] .'/selling/fulfill') .' | '. l('Fulfill Orders','user/'. $arg[1] .'/selling/fulfill/edit') .'

'. t("The following is a list of all the orders placed on your products. You can record that you shipped an order by selecting the checkbox and pressing update.") .'

'; + return l(t('View Orders'),'user/'. $arg[1] .'/selling/fulfill') .' | '. l(t('Fulfill Orders'),'user/'. $arg[1] .'/selling/fulfill/edit') .'

'. t("The following is a list of all the orders placed on your products. You can record that you shipped an order by selecting the checkbox and pressing update.") .'

'; } } @@ -84,8 +84,8 @@ function mp_orders_init() { if (arg(3) == 'fulfill') { drupal_add_css(drupal_get_path('module', 'mp_orders') .'/mp_orders.css'); - uc_add_js("function open_packingslip(order_id) { window.open(Drupal.settings.basePath + '". (variable_get('clean_url', 0) ? '' : '?q=') ."user/". arg(1) ."/selling/fulfill/' + order_id + '/print', '". t('Packing Slip') ."', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=480,left=50,top=50'); }", 'inline'); - } + drupal_add_js('function open_packingslip(order_id) { window.open(Drupal.settings.basePath + "'. (variable_get('clean_url', 0) ? '' : '?q=') .'user/'. arg(1) .'/selling/fulfill/" + order_id + "/print", "'. t('Packing Slip') .'", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=480,left=50,top=50"); }', 'inline'); + } } /** @@ -202,11 +202,11 @@ $breadcrumb[] = l(t('Order @order', array('@order' => $order_id)), 'user/'. arg(1) .'/selling/fulfill/'. $order_id); drupal_set_breadcrumb($breadcrumb); - $output .= '
Ship To:
'. uc_order_pane_ship_to('view', $order) .'
Products:
'. drupal_render(tapir_get_table('op_products_view_table', $order->products)) .'
'; + $output .= '
'.t('Ship to').'
'. uc_order_pane_ship_to('view', $order) .'
'.t('Products').'
'. drupal_render(tapir_get_table('op_products_view_table', $order)) .'
'; if (user_access('write own order comments')) { $comments = mp_orders_load_comments($uid, $order_id); - $output .= '
Order Comments:
'. drupal_render(tapir_get_table('mp_orders_comments_view_table', $comments)) .'
'; - $output .= '
Write Comment:
'. drupal_get_form('uc_order_view_update_form', $order) .'
'; + $output .= '
'.t('Order comments').'
'. drupal_render(tapir_get_table('mp_orders_comments_view_table', $comments)) .'
'; + $output .= '
'.t('Update order').'
'. drupal_get_form('uc_order_view_update_form', $order) .'
'; } return $output; } @@ -383,7 +383,7 @@ array('data' => $order->delivery_last_name), array('data' => uc_currency_format($total)), array('data' => format_date($order->created, 'custom', variable_get('uc_date_format_default', 'm/d/Y'))), - array('data' => $order->order_status) + array('data' => t($order->order_status)) ); if ($mp_quote_present) { @@ -439,7 +439,7 @@ * Return an array of only the seller's comments for an order. */ function mp_orders_load_comments($uid, $order_id) { - $result = db_query("SELECT * FROM {uc_order_comments} AS oc LEFT JOIN {uc_order_statuses} AS os ON oc.order_status = os.order_status_id WHERE oc.order_id = %d AND oc.uid = %d ORDER BY oc.created", $order_id, $uid); + $result = db_query("SELECT * FROM {uc_order_comments} AS oc LEFT JOIN {uc_order_statuses} AS os ON oc.order_status = os.order_status_id WHERE oc.order_id = %d AND oc.uid = %d OR oc.uid = 0 ORDER BY oc.created, oc.comment_id", $order_id, $uid); while ($comment = db_fetch_object($result)) { $comments[] = $comment; } @@ -450,49 +450,54 @@ * Overrides op_order_comments_view_table(). * Return a table of comments for an order. */ -function mp_orders_comments_view_table($op, $comments = null) { - switch ($op) { - case 'fields': - $fields[] = array( - 'name' => 'date', - 'title' => t('Date'), - 'weight' => 0, - 'enabled' => TRUE, - 'attributes' => array('class' => 'text-center') + function mp_orders_comments_view_table($comments) { + $table = array( + '#type' => 'tapir_table', + '#attributes' => array('class' => 'order-pane-table'), + ); + + $table['#columns']['date'] = array( + 'cell' => array('data' => t('Date'), 'class' => 'text-center'), + 'weight' => 0, + ); + $table['#columns']['notified'] = array( + 'cell' => t('Notified'), + 'weight' => 2, + ); + $table['#columns']['comment'] = array( + 'cell' => array('data' => t('Comment'), 'width' => '80%'), + 'weight' => 4, + ); + + if (is_array($comments)) { + foreach ($comments as $comment) { + $data = array(); + $data['date'] = array( + '#value' => format_date($comment->created, 'custom', variable_get('uc_date_format_default', 'm/d/Y') .'<\b\r />g:i:s A'), + '#cell_attributes' => array('align' => 'center', 'nowrap' => 'true'), ); - $fields[] = array( - 'name' => 'notified', - 'title' => t('Customer Notified'), - 'weight' => 2, - 'enabled' => TRUE + $data['notified'] = array( + '#value' => (($comment->notified == 1) + ? '' + : ''), + '#cell_attributes' => array('align' => 'center'), ); - $fields[] = array( - 'name' => 'comment', - 'title' => t('Comment'), - 'weight' => 4, - 'enabled' => TRUE, - 'attributes' => array('width' => '80%') + $data['comment'] = array( + '#value' => filter_xss_admin($comment->message), ); - return $fields; - - case 'data': - if (is_array($comments)) { - foreach ($comments as $comment) { - $data['date'][] = array('data' => format_date($comment->created, 'custom', variable_get('uc_date_format_default', 'm/d/Y') .'<\b\r />g:i:s A'), 'align' => 'center', 'nowrap' => 'true'); - $data['notified'][] = array('data' => (($comment->notified == 1) ? '': ''), 'align' => 'center'); - $data['comment'][] = array('data' => filter_xss_admin($comment->message)); - } - } - else { - $data['comment'][] = array('data' => t('This order has no comments associated with it.'), 'colspan' => 10); - } - return $data; - - case 'attributes': - $attributes = array('class' => 'order-pane-table'); - return $attributes; + $table['#rows'][] = $data; + } + } + else { + $data['comment'] = array( + '#value' => t('This order has no comments associated with it.'), + '#cell_attributes' => array('colspan' => 'full'), + ); + $table['#rows'][] = $data; } + return $table; } + function mp_orders_print_packingslip($user, $order) { $order_id = $order->order_id; --- mp_products/mp_products.admin.inc +++ mp_products/mp_products.admin.inc @@ -19,7 +19,7 @@ if (module_exists(mp_reports) && user_access('view own reports')) { $output .= l(t('Click here to view your sales reports.'), 'user/'. $user->uid .'/selling/reports') .'
'; } - $output .= t('

Sales Summary

'); + $output .= '

'.t('Sales Summary').'

'; $output .= mp_reports_summary($user); drupal_set_title(t('Sales Overview')); return $output; @@ -56,7 +56,7 @@ while ($product = db_fetch_object($result)) { $link = l($product->title, 'node/'. $product->nid); $link .= ''. l('View Product', 'node/'. $product->nid, array('title' => 'View Product', 'html' => TRUE)) . l('Edit Product', 'node/'. $product->nid .'/edit', array('title' => 'Edit Product', 'html' => TRUE)) .''; - $listed = ($product->status == 0) ? 'Not Currently Listed' : 'For Sale'; + $listed = ($product->status == 0) ? t('Not Currently Listed') : t('For Sale'); $rows[] = array( array('data' => $product->nid), --- mp_reports/mp_reports.admin.inc +++ mp_reports/mp_reports.admin.inc @@ -53,7 +53,7 @@ if (variable_get('mp_reports_enable_check', FALSE)) { $methods[] = t('Manual'); } - + $methods[99] = t('not filled'); if ($args['paid'] == 1) { $paid_statuses = "('0', '1', '2', '3', '4', '5')"; } @@ -81,7 +81,9 @@ $user = user_load(array('uid' => $seller)); $name = $user->name; $link = l($name, 'user/'. $seller); - + if ($user->payment_method == NULL) { + $user->payment_method = 99; + } // Build the order data for the seller. $result = db_query("SELECT sos.order_id FROM {uc_orders} AS o LEFT JOIN {mp_seller_order_statuses} AS sos ON o.order_id = sos.order_id WHERE sos.uid = %d AND %d <= o.created AND o.created <= %d AND sos.order_status IN $order_statuses AND sos.seller_paid_status IN $paid_statuses", $seller, $args['start_date'], $args['end_date']); @@ -323,7 +325,7 @@ /** * Returns a form for custom seller sales viewing */ -function mp_reports_seller_custom_form($values) { +function mp_reports_seller_custom_form($form_state, $values) { $form['search'] = array( '#type' => 'fieldset', '#title' => t('Customize seller report parameters'), --- mp_reports/mp_reports.module +++ mp_reports/mp_reports.module @@ -31,15 +31,15 @@ case 'user/%/selling/reports': return '

'. t("Reports") .'

'. t("The following is a list of available reports for viewing your sales. Click on a report type below to view.") .'

'; case 'user/%/selling/reports/product': - return '

'. t("Product Sales") .'

'. l('Product Sales', 'user/'. $arg[1] .'/selling/reports/product') .' | '. l('Sales Summary', 'user/'. $arg[1] .'/selling/reports/summary') .' | '. l('Sales Per Year', 'user/'. $arg[1] .'/selling/reports/sales') .'
'. t("Below is a table of sales by product.") .'
'; + return '

'. t("Product Sales") .'

'. l(t('Product Sales'), 'user/'. $arg[1] .'/selling/reports/product') .' | '. l(t('Sales Summary'), 'user/'. $arg[1] .'/selling/reports/summary') .' | '. l(t('Sales Per Year'), 'user/'. $arg[1] .'/selling/reports/sales') .'
'. t("Below is a table of sales by product.") .'
'; case 'user/%/selling/reports/summary': - return '

'. t("Sales Summary") .'

'. l('Product Sales', 'user/'. $arg[1] .'/selling/reports/product') .' | '. l('Sales Summary', 'user/'. $arg[1] .'/selling/reports/summary') .' | '. l('Sales Per Year', 'user/'. $arg[1] .'/selling/reports/sales') .'
'. t("Below is a summary of your sales.") .'
'; + return '

'. t("Sales Summary") .'

'. l(t('Product Sales'), 'user/'. $arg[1] .'/selling/reports/product') .' | '. l(t('Sales Summary'), 'user/'. $arg[1] .'/selling/reports/summary') .' | '. l(t('Sales Per Year'), 'user/'. $arg[1] .'/selling/reports/sales') .'
'. t("Below is a summary of your sales.") .'
'; case 'admin/store/reports/seller/statuses': return '
'. t('Below is a list of seller order statuses. The listing only displays those seller orders which are NOT complete. Click on a seller\'s ID to view user page. Click on an order ID to view order page.') .'
'; } if (strpos($path, 'user/%/selling/reports/sales') === 0) { $year = (is_null($_GET['year'])) ? format_date(time(), 'custom', "Y") : $_GET['year']; - return '

'. t("Sales Per Year") .'

'. l('Product Sales', 'user/'. $arg[1] .'/selling/reports/product') .' | '. l('Sales Summary', 'user/'. $arg[1] .'/selling/reports/summary') .' | '. l('Sales Per Year', 'user/'. $arg[1] .'/selling/reports/sales') .'

'. t('This is the monthly break down of your sales for the year @year. You can view your sales for different years by entering a year in the box.', array('@year' => $year)) .'

'; + return '

'. t("Sales Per Year") .'

'. l(t('Product Sales'), 'user/'. $arg[1] .'/selling/reports/product') .' | '. l(t('Sales Summary'), 'user/'. $arg[1] .'/selling/reports/summary') .' | '. l(t('Sales Per Year'), 'user/'. $arg[1] .'/selling/reports/sales') .'

'. t('This is the monthly break down of your sales for the year @year. You can view your sales for different years by entering a year in the box.', array('@year' => $year)) .'

'; } }