# Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: lyle@ubercart.org-20100622180523-2fgr73y96k8t7pf3 # target_branch: bzr://bazaar.ubercart.org/drupal7-uc3/ubercart # testament_sha1: ed024e94b489be21ddd21f615c7eda017eed99d6 # timestamp: 2010-06-23 15:35:51 -0400 # base_revision_id: lyle@ubercart.org-20100621191724-nl79yu6bspkxm132 # # Begin patch === modified file 'payment/uc_payment/uc_payment.info' --- payment/uc_payment/uc_payment.info 2010-04-05 19:25:15 +0000 +++ payment/uc_payment/uc_payment.info 2010-06-21 19:34:42 +0000 @@ -1,7 +1,6 @@ ; $Id$ name = Payment description = Defines an API to let payment modules interact with the cart. -dependencies[] = ca dependencies[] = uc_order dependencies[] = uc_store package = "Ubercart - core (optional)" === modified file 'payment/uc_payment/uc_payment.module' --- payment/uc_payment/uc_payment.module 2010-06-11 19:09:52 +0000 +++ payment/uc_payment/uc_payment.module 2010-06-14 15:27:41 +0000 @@ -15,7 +15,6 @@ require_once('uc_payment_checkout_pane.inc'); require_once('uc_payment_order_pane.inc'); -require_once('uc_payment.ca.inc'); /******************************************************************************* * Hook Functions (Drupal) @@ -579,7 +578,7 @@ $account = user_load($uid); module_invoke_all('uc_payment_entered', $order, $method, $amount, $account, $data, $comment); - ca_pull_trigger('uc_payment_entered', $order, $account); + rules_invoke_event('uc_payment_entered', $order, $account); } /** === renamed file 'payment/uc_payment/uc_payment.ca.inc' => 'payment/uc_payment/uc_payment.rules.inc' --- payment/uc_payment/uc_payment.ca.inc 2010-06-03 14:49:55 +0000 +++ payment/uc_payment/uc_payment.rules.inc 2010-06-17 19:25:47 +0000 @@ -3,173 +3,64 @@ /** * @file - * This file contains the Conditional Actions hooks and functions necessary to make the - * order related entity, conditions, events, and actions work. - */ - - -/****************************************************************************** - * Conditional Actions Hooks * - ******************************************************************************/ - -/** - * Implement hook_ca_predicate(). - */ -function uc_payment_ca_predicate() { - $predicates = array(); - - // Set the order status to "Payment Received" when a payment is received - // and the balance is less than or equal to 0. - $predicates['uc_payment_received'] = array( - '#title' => t('Update order status on full payment'), - '#description' => t('Only happens when a payment is entered and the balance is <= $0.00.'), - '#class' => 'payment', - '#trigger' => 'uc_payment_entered', - '#status' => 1, - '#conditions' => array( - '#operator' => 'AND', - '#conditions' => array( - array( - '#name' => 'uc_payment_condition_order_balance', - '#title' => t('If the balance is less than or equal to $0.00.'), - '#argument_map' => array( - 'order' => 'order', - ), - '#settings' => array( - 'negate' => FALSE, - 'balance_comparison' => 'less_equal', - ), - ), - array( - '#name' => 'uc_order_status_condition', - '#title' => t('If the order status is not already Payment Received.'), - '#argument_map' => array( - 'order' => 'order', - ), - '#settings' => array( - 'negate' => TRUE, - 'order_status' => 'payment_received', - ), - ), - ), - ), - '#actions' => array( - array( - '#name' => 'uc_order_update_status', - '#title' => t('Update the order status to Payment Received.'), - '#argument_map' => array( - 'order' => 'order', - ), - '#settings' => array( - 'order_status' => 'payment_received', - ), - ), - ), - ); - - // Set the order status to "Completed" when checkout is complete, none - // of the products are shippable, and the balance is less than or equal to 0. - $predicates['uc_checkout_complete_paid'] = array( - '#title' => t('Update order status upon checkout completion with full payment'), - '#trigger' => 'uc_checkout_complete', - '#class' => 'payment', - '#status' => 1, - '#weight' => 1, - '#conditions' => array( - '#operator' => 'AND', - '#conditions' => array( - array( - '#name' => 'uc_payment_condition_order_balance', - '#title' => t('If the balance is less than or equal to $0.00.'), - '#argument_map' => array( - 'order' => 'order', - ), - '#settings' => array( - 'negate' => FALSE, - 'balance_comparison' => 'less_equal', - ), - ), - array( - '#name' => 'uc_order_condition_is_shippable', - '#title' => t('If the order is not shippable.'), - '#argument_map' => array( - 'order' => 'order', - ), - '#settings' => array( - 'negate' => TRUE, - ), - ), - ), - ), - '#actions' => array( - array( - '#name' => 'uc_order_update_status', - '#title' => t('Update the order status to Completed.'), - '#argument_map' => array( - 'order' => 'order', - ), - '#settings' => array( - 'order_status' => 'completed', - ), - ) - ), - ); - - return $predicates; -} - -/** - * Implement hook_ca_trigger(). - */ -function uc_payment_ca_trigger() { - $triggers['uc_payment_entered'] = array( - '#title' => t('A payment gets entered for an order'), - '#category' => t('Payment'), - '#arguments' => array( + * Rules definitions. + */ + +/** + * Implement hook_rules_event_info(). + */ +function uc_payment_rules_event_info() { + $events['uc_payment_entered'] = array( + 'label' => t('A payment gets entered for an order'), + 'group' => t('Payment'), + 'variables' => array( 'order' => array( - '#entity' => 'uc_order', - '#title' => t('Order'), + 'type' => 'uc_order', + 'label' => t('Order'), ), 'account' => array( - '#entity' => 'user', - '#title' => t('User'), + 'type' => 'user', + 'label' => t('User'), ), ), ); - return $triggers; + return $events; } /** - * Implement hook_ca_condition(). + * Implement hook_rules_condition_info(). */ -function uc_payment_ca_condition() { +function uc_payment_rules_condition_info() { $conditions['uc_payment_condition_order_balance'] = array( - '#title' => t('Check the order balance'), - '#category' => t('Payment'), - '#callback' => 'uc_payment_condition_order_balance', - '#arguments' => array('order' => array('#entity' => 'uc_order')), - ); - $conditions['uc_order_condition_payment_method'] = array( - '#title' => t('Check the payment method'), - '#category' => t('Order'), - '#callback' => 'uc_order_condition_payment_method', - '#arguments' => array('order' => array('#entity' => 'uc_order')), + 'label' => t('Check the order balance'), + 'group' => t('Payment'), + 'base' => 'uc_payment_condition_order_balance', + 'parameter' => array( + 'order' => array( + 'type' => 'uc_order', + 'label' => t('Order'), + 'restriction' => 'selector', + ), + 'balance_comparison' => array( + 'type' => 'text', + 'label' => t('Operator'), + 'options list' => 'uc_payment_condition_balance_options', + 'restriction' => 'input', + ), + ), ); return $conditions; } - -/****************************************************************************** - * Condition Callbacks and Forms * - ******************************************************************************/ - -// Check the current order balance. -function uc_payment_condition_order_balance($order, $settings) { +/** + * Condition: Check the current order balance. + */ +function uc_payment_condition_order_balance($order, $balance_comparison) { $balance = uc_payment_balance($order); - switch ($settings['balance_comparison']) { + switch ($balance_comparison) { case 'less': return $balance < 0; case 'less_equal': @@ -181,7 +72,7 @@ } } -function uc_payment_condition_order_balance_form($form_state, $settings = array()) { +function uc_payment_condition_balance_options() { $context = array( 'revision' => 'formatted', 'type' => 'amount', @@ -194,32 +85,6 @@ 'greater' => t('Balance is greater than !zero.', $zero), ); - $form['balance_comparison'] = array( - '#type' => 'radios', - '#title' => t('Balance comparison type'), - '#options' => $options, - '#default_value' => isset($settings['balance_comparison']) ? $settings['balance_comparison'] : 'equal', - ); - - return $form; -} - -// Check the order payment method. -function uc_order_condition_payment_method($order, $settings) { - return $order->payment_method == $settings['payment_method']; -} - -function uc_order_condition_payment_method_form($form_state, $settings = array()) { - foreach (_uc_payment_method_list() as $method) { - $options[$method['id']] = $method['title']; - } - - $form['payment_method'] = array( - '#type' => 'radios', - '#title' => t('Payment method'), - '#options' => $options, - '#default_value' => $settings['payment_method'], - ); - - return $form; -} + return $options; +} + === added file 'payment/uc_payment/uc_payment.rules_defaults.inc' --- payment/uc_payment/uc_payment.rules_defaults.inc 1970-01-01 00:00:00 +0000 +++ payment/uc_payment/uc_payment.rules_defaults.inc 2010-06-21 18:52:52 +0000 @@ -0,0 +1,59 @@ +label = t('Update order status on full payment'); + $rule->active = TRUE; + $rule->event('uc_payment_entered') + ->condition(rules_and() + ->condition('uc_payment_condition_order_balance', array( + 'order:select' => 'order', + 'balance_comparison' => 'less_equal', + )) + ->condition(rules_condition('data_is', array( + 'data:select' => 'order:order_status', + 'value' => 'in_checkout', + )) + ->negate())) + ->action('uc_order_update_status', array( + 'order:select' => 'order', + 'order_status' => 'payment_received', + )); + $configs['uc_payment_received'] = $rule; + + // Set the order status to "Completed" when checkout is complete, none + // of the products are shippable, and the balance is less than or equal to 0. + $rule = rules_reaction_rule(); + $rule->label = t('Update order status upon checkout completion with full payment'); + $rule->active = TRUE; + $rule->event('uc_checkout_complete') + ->condition(rules_and() + ->condition('uc_payment_condition_order_balance', array( + 'order:select' => 'order', + 'balance_comparison' => 'less_equal', + )) + ->condition(rules_condition('uc_order_condition_is_shippable', array( + 'order:select' => 'order', + ))->negate()) + ) + ->action('uc_order_update_status', array( + 'order:select' => 'order', + 'order_status' => 'payment_received', + )); + $configs['uc_checkout_complete_paid'] = $rule; + + return $configs; +} === modified file 'shipping/uc_flatrate/uc_flatrate.admin.inc' --- shipping/uc_flatrate/uc_flatrate.admin.inc 2010-04-05 14:37:18 +0000 +++ shipping/uc_flatrate/uc_flatrate.admin.inc 2010-06-10 19:18:33 +0000 @@ -27,12 +27,11 @@ $row[] = uc_price($method->base_rate, $context); $row[] = uc_price($method->product_rate, $context); $row[] = l(t('edit'), 'admin/store/settings/quotes/methods/flatrate/' . $method->mid); - $row[] = l(t('conditions'), CA_UI_PATH . '/uc_flatrate_get_quote_' . $method->mid . '/edit/conditions'); $rows[] = $row; } if (count($rows)) { - $header = array(t('Title'), t('Label'), t('Base rate'), t('Default product rate'), array('data' => t('Operations'), 'colspan' => 2)); + $header = array(t('Title'), t('Label'), t('Base rate'), t('Default product rate'), array('data' => t('Operations'), 'colspan' => 1)); $build['methods'] = array( '#theme' => 'table', '#header' => $header, @@ -101,6 +100,11 @@ '#field_suffix' => $sign_flag ? $currency_sign : '', ); + $conditions = rules_config_load('get_quote_from_flatrate_' . $mid); + if ($conditions) { + $conditions->form($form, $form_state); + } + $form['buttons']['submit'] = array( '#type' => 'submit', '#value' => t('Submit'), @@ -195,7 +199,8 @@ db_delete('uc_flatrate_products') ->condition('mid', $form_state['values']['mid']) ->execute(); - ca_delete_predicate('uc_flatrate_get_quote_' . $form_state['values']['mid']); + + rules_config_delete('get_quote_from_flatrate_' . $form_state['values']['mid']); $enabled = variable_get('uc_quote_enabled', array()); unset($enabled['flatrate_' . $form_state['values']['mid']]); === modified file 'shipping/uc_flatrate/uc_flatrate.module' --- shipping/uc_flatrate/uc_flatrate.module 2010-04-05 14:37:18 +0000 +++ shipping/uc_flatrate/uc_flatrate.module 2010-06-10 15:53:53 +0000 @@ -167,41 +167,6 @@ ******************************************************************************/ /** - * Implement hook_ca_predicate(). - * - * Connect the quote action with the quote event. - */ -function uc_flatrate_ca_predicate() { - $enabled = variable_get('uc_quote_enabled', array()); - $predicates = array(); - - $result = db_query("SELECT mid, title FROM {uc_flatrate_methods}"); - foreach ($result as $method) { - // Ensure default status is set. - $enabled += array('flatrate_' . $method->mid => TRUE); - - $predicates['uc_flatrate_get_quote_' . $method->mid] = array( - '#title' => t('Shipping quote via @method', array('@method' => $method->title)), - '#trigger' => 'get_quote_from_flatrate_' . $method->mid, - '#class' => 'uc_flatrate', - '#status' => $enabled['flatrate_' . $method->mid], - '#actions' => array( - array( - '#name' => 'uc_quote_action_get_quote', - '#title' => t('Fetch a flatrate shipping quote.'), - '#argument_map' => array( - 'order' => 'order', - 'method' => 'method', - ), - ), - ), - ); - } - - return $predicates; -} - -/** * Implement hook_uc_shipping_method(). */ function uc_flatrate_uc_shipping_method() { === modified file 'shipping/uc_quote/uc_quote.info' --- shipping/uc_quote/uc_quote.info 2010-02-02 15:41:04 +0000 +++ shipping/uc_quote/uc_quote.info 2010-06-10 14:30:33 +0000 @@ -1,11 +1,12 @@ ; $Id$ name = Shipping Quotes description = Retrieve and display quotes for shipping products. +dependencies[] = rules dependencies[] = uc_cart -dependencies[] = ca package = "Ubercart - core (optional)" core = 7.x files[] = uc_quote.module files[] = uc_quote.install files[] = uc_quote.admin.inc files[] = uc_quote.pages.inc +files[] = uc_quote.rules_defaults.inc === modified file 'shipping/uc_quote/uc_quote.module' --- shipping/uc_quote/uc_quote.module 2010-06-21 19:17:24 +0000 +++ shipping/uc_quote/uc_quote.module 2010-06-21 19:38:44 +0000 @@ -320,30 +320,6 @@ ******************************************************************************/ /** - * Implement hook_ca_trigger(). - * - * Register an event for each shipping method. Enabled methods have active - * configurations. - */ -function uc_quote_ca_trigger() { - $methods = module_invoke_all('uc_shipping_method'); - $triggers = array(); - foreach ($methods as $id => $method) { - $triggers['get_quote_from_' . $id] = array( - '#title' => t('Getting shipping quote via !method', array('!method' => $method['title'])), - '#category' => t('Quote'), - '#hidden' => TRUE, - '#arguments' => array( - 'order' => array('#entity' => 'uc_order', '#title' => t('Order')), - 'method' => array('#entity' => 'quote_method', '#title' => t('Quote method')), - 'account' => array('#entity' => 'user', '#title' => t('User account')), - ), - ); - } - return $triggers; -} - -/** * Implement hook_ca_condition(). */ function uc_quote_ca_condition() { @@ -457,70 +433,6 @@ return $form; } -/** - * Implement hook_ca_action(). - */ -function uc_quote_ca_action() { - return array( - 'uc_quote_action_get_quote' => array( - '#title' => t('Fetch a shipping quote'), - '#category' => t('Quote'), - '#arguments' => array( - 'order' => array('#entity' => 'uc_order', '#title' => t('Order')), - 'method' => array('#entity' => 'quote_method', '#title' => t('Quote method')), - ), - ), - ); -} - -/** - * Retrieve shipping quote. - * - * @param $order - * The order the quote is for. - * @param $method - * The shipping method to generate the quote. - * @return - * Array of shipping quotes. - */ -function uc_quote_action_get_quote($order, $method) { - $details = array(); - foreach ($order as $key => $value) { - if (substr($key, 0, 9) == 'delivery_') { - $field = substr($key, 9); - $details[$field] = $value; - } - } - ob_start(); - // Load include file containing quote callback, if there is one - if (isset($method['quote']['file'])) { - $inc_file = drupal_get_path('module', $method['module']) . '/' . $method['quote']['file']; - if (is_file($inc_file)) { - require_once $inc_file; - } - } - - if (function_exists($method['quote']['callback'])) { - // This feels wrong, but it's the only way I can ensure that shipping - // methods won't mess up the products in their methods. - $products = array(); - foreach ($order->products as $key => $item) { - if (uc_cart_product_is_shippable($item)) { - $products[$key] = clone $item; - } - } - $quote_data = call_user_func($method['quote']['callback'], $products, $details, $method); - } - $messages = ob_get_contents(); - ob_end_clean(); - - if ($messages && variable_get('uc_quote_log_errors', FALSE)) { - watchdog('quote', '!messages', array('!messages' => $messages), WATCHDOG_WARNING); - watchdog('quote', '
@data
', array('@data' => print_r($quote_data, TRUE)), WATCHDOG_WARNING); - } - return $quote_data; -} - /****************************************************************************** * Ubercart Hooks * ******************************************************************************/ === modified file 'shipping/uc_quote/uc_quote.pages.inc' --- shipping/uc_quote/uc_quote.pages.inc 2010-06-03 20:06:32 +0000 +++ shipping/uc_quote/uc_quote.pages.inc 2010-06-10 14:30:33 +0000 @@ -52,28 +52,9 @@ ); $quote_data = array(); - $arguments = array( - 'order' => array( - '#entity' => 'uc_order', - '#title' => t('Order'), - '#data' => $order, - ), - 'method' => array( - '#entity' => 'quote_method', - '#title' => t('Quote method'), - // #data => each $method in the following foreach() loop; - ), - 'account' => array( - '#entity' => 'user', - '#title' => t('User'), - '#data' => $account, - ), - ); foreach ($methods as $method) { - $arguments['method']['#data'] = $method; - $predicates = ca_load_trigger_predicates('get_quote_from_' . $method['id']); - $predicate = array_shift($predicates); - if ($predicate && ca_evaluate_conditions($predicate, $arguments)) { + $set = rules_config_load('get_quote_from_' . $method['id']); + if (!$set || $set->execute($order)) { $data = uc_quote_action_get_quote($order, $method, $user); foreach ($data as &$quote) { @@ -94,3 +75,51 @@ return $quote_data; } +/** + * Retrieve shipping quote. + * + * @param $order + * The order the quote is for. + * @param $method + * The shipping method to generate the quote. + * @return + * Array of shipping quotes. + */ +function uc_quote_action_get_quote($order, $method) { + $details = array(); + foreach ($order as $key => $value) { + if (substr($key, 0, 9) == 'delivery_') { + $field = substr($key, 9); + $details[$field] = $value; + } + } + ob_start(); + // Load include file containing quote callback, if there is one + if (isset($method['quote']['file'])) { + $inc_file = drupal_get_path('module', $method['module']) . '/' . $method['quote']['file']; + if (is_file($inc_file)) { + require_once $inc_file; + } + } + + if (function_exists($method['quote']['callback'])) { + // This feels wrong, but it's the only way I can ensure that shipping + // methods won't mess up the products in their methods. + $products = array(); + foreach ($order->products as $key => $item) { + if (uc_cart_product_is_shippable($item)) { + $products[$key] = clone $item; + } + } + $quote_data = call_user_func($method['quote']['callback'], $products, $details, $method); + } + $messages = ob_get_contents(); + ob_end_clean(); + + if ($messages && variable_get('uc_quote_log_errors', FALSE)) { + watchdog('quote', '!messages', array('!messages' => $messages), WATCHDOG_WARNING); + watchdog('quote', '
@data
', array('@data' => print_r($quote_data, TRUE)), WATCHDOG_WARNING); + } + return $quote_data; +} + === added file 'shipping/uc_quote/uc_quote.rules_defaults.inc' --- shipping/uc_quote/uc_quote.rules_defaults.inc 1970-01-01 00:00:00 +0000 +++ shipping/uc_quote/uc_quote.rules_defaults.inc 2010-06-10 19:17:11 +0000 @@ -0,0 +1,22 @@ + array('type' => 'uc_order', 'label' => 'Order'), + )); + $set->label = t('@method conditions', array('@method' => $method['title'])); + + $configs['get_quote_from_' . $method['id']] = $set; + } + + return $configs; +} === modified file 'shipping/uc_ups/uc_ups.admin.inc' --- shipping/uc_ups/uc_ups.admin.inc 2010-06-03 14:23:08 +0000 +++ shipping/uc_ups/uc_ups.admin.inc 2010-06-10 15:53:53 +0000 @@ -130,9 +130,12 @@ '#description' => t('When enabled, products are insured for their full value.'), ); - $form['#validate'][] = 'uc_ups_admin_settings_validate'; + $conditions = rules_config_load('get_quote_from_ups'); + if ($conditions) { + $conditions->form($form, $form_state); + } - return system_settings_form($form); + return $form; } /** @@ -159,6 +162,47 @@ } /** + * Submit handler for uc_ups_admin_settings(). + * + * Emulate system_settings_form_submit(), but only on a subset of the form values. + * + * @see uc_ups_admin_settings() + */ +function uc_ups_admin_settings_submit($form, &$form_state) { + $fields = array( + 'uc_ups_access_license', + 'uc_ups_shipper_number', + 'uc_ups_user_id', + 'uc_ups_password', + 'uc_ups_connection_address', + 'uc_ups_services', + 'uc_ups_pickup_type', + 'uc_ups_classification', + 'uc_ups_negotiated_rates', + 'uc_ups_residential_quotes', + 'uc_ups_markup_type', + 'uc_ups_markup', + 'uc_ups_all_in_one', + 'uc_ups_unit_system', + 'uc_ups_insurance', + ); + + foreach ($fields as $key) { + $value = $form_state['values'][$key]; + + if (is_array($value) && isset($form_state['values']['array_filter'])) { + $value = array_keys(array_filter($value)); + } + variable_set($key, $value); + } + + drupal_set_message(t('The configuration options have been saved.')); + + cache_clear_all(); + drupal_theme_rebuild(); +} + +/** * Last chance for user to review shipment. * * @ingroup forms === modified file 'shipping/uc_ups/uc_ups.module' --- shipping/uc_ups/uc_ups.module 2010-06-03 14:23:08 +0000 +++ shipping/uc_ups/uc_ups.module 2010-06-10 15:53:53 +0000 @@ -207,40 +207,6 @@ } /****************************************************************************** - * Conditional Actions Hooks * - ******************************************************************************/ - -/** - * Implement hook_ca_predicate(). - * - * Connect the UPS quote action and event. - */ -function uc_ups_ca_predicate() { - $enabled = variable_get('uc_quote_enabled', array()) + array('ups' => FALSE); - - $predicates = array( - 'uc_ups_get_quote' => array( - '#title' => t('Shipping quote from UPS'), - '#trigger' => 'get_quote_from_ups', - '#class' => 'uc_ups', - '#status' => $enabled['ups'], - '#actions' => array( - array( - '#name' => 'uc_quote_action_get_quote', - '#title' => t('Fetch a shipping quote'), - '#argument_map' => array( - 'order' => 'order', - 'method' => 'method', - ), - ), - ), - ), - ); - - return $predicates; -} - -/****************************************************************************** * Ubercart Hooks * ******************************************************************************/ === modified file 'shipping/uc_usps/uc_usps.admin.inc' --- shipping/uc_usps/uc_usps.admin.inc 2010-03-16 21:15:17 +0000 +++ shipping/uc_usps/uc_usps.admin.inc 2010-06-10 15:53:53 +0000 @@ -42,6 +42,17 @@ '#description' => t('Select the USPS services that are available to customers. Be sure to include the services that the Postal Service agrees are available to you.'), ); + $form['domestic']['env_conditions'] = array( + '#type' => 'fieldset', + '#title' => t('Envelope service conditions'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $conditions = rules_config_load('get_quote_from_usps_env'); + if ($conditions) { + $conditions->form($form['domestic']['env_conditions'], $form_state); + } + $form['domestic']['uc_usps_services'] = array( '#type' => 'checkboxes', '#title' => t('USPS parcel services'), @@ -50,6 +61,17 @@ '#description' => t('Select the USPS services that are available to customers. Be sure to include the services that the Postal Service agrees are available to you.'), ); + $form['domestic']['parcel_conditions'] = array( + '#type' => 'fieldset', + '#title' => t('Parcel service conditions'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $conditions = rules_config_load('get_quote_from_usps'); + if ($conditions) { + $conditions->form($form['domestic']['parcel_conditions'], $form_state); + } + $form['international'] = array( '#type' => 'fieldset', '#title' => t('USPS International'), @@ -66,6 +88,17 @@ '#description' => t('Select the USPS services that are available to customers. Be sure to include the services that the Postal Service agrees are available to you.'), ); + $form['international']['env_conditions'] = array( + '#type' => 'fieldset', + '#title' => t('Envelope service conditions'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $conditions = rules_config_load('get_quote_from_usps_intl_env'); + if ($conditions) { + $conditions->form($form['international']['env_conditions'], $form_state); + } + $form['international']['uc_usps_intl_services'] = array( '#type' => 'checkboxes', '#title' => t('USPS international parcel services'), @@ -74,6 +107,17 @@ '#description' => t('Select the USPS services that are available to customers. Be sure to include the services that the Postal Service agrees are available to you.'), ); + $form['international']['parcel_conditions'] = array( + '#type' => 'fieldset', + '#title' => t('Parcel service conditions'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $conditions = rules_config_load('get_quote_from_usps_intl'); + if ($conditions) { + $conditions->form($form['international']['parcel_conditions'], $form_state); + } + $form['uc_usps_markup_type'] = array( '#type' => 'select', '#title' => t('Markup type'), @@ -101,7 +145,7 @@ '#description' => t('Indicate whether each product is quoted as shipping separately or all in one package. Orders with one kind of product will still use the package quantity to determine the number of packages needed, however.'), ); - return system_settings_form($form); + return $form; } /** @@ -113,3 +157,34 @@ } } +/** + * Submit handler for uc_usps_admin_settings form. + */ +function uc_usps_admin_settings_submit($form, &$form_state) { + $fields = array( + 'uc_usps_user_id', + 'uc_usps_online_rates', + 'uc_usps_env_services', + 'uc_usps_services', + 'uc_usps_intl_env_services', + 'uc_usps_intl_services', + 'uc_usps_markup_type', + 'uc_usps_markup', + 'uc_usps_all_in_once', + ); + + foreach ($fields as $key) { + $value = $form_state['values'][$key]; + + if (is_array($value) && isset($form_state['values']['array_filter'])) { + $value = array_keys(array_filter($value)); + } + variable_set($key, $value); + } + + drupal_set_message(t('The configuration options have been saved.')); + + cache_clear_all(); + drupal_theme_rebuild(); +} + === modified file 'shipping/uc_usps/uc_usps.info' --- shipping/uc_usps/uc_usps.info 2010-02-02 15:41:04 +0000 +++ shipping/uc_usps/uc_usps.info 2010-06-10 18:09:44 +0000 @@ -8,3 +8,4 @@ files[] = uc_usps.install files[] = uc_usps.admin.inc files[] = uc_usps.countries.inc +files[] = uc_usps.rules_defaults.inc === modified file 'shipping/uc_usps/uc_usps.module' --- shipping/uc_usps/uc_usps.module 2010-06-03 14:23:08 +0000 +++ shipping/uc_usps/uc_usps.module 2010-06-10 15:53:53 +0000 @@ -157,136 +157,6 @@ } /****************************************************************************** - * Conditional Actions Hooks * - ******************************************************************************/ - -/** - * Implement hook_ca_predicate(). - * - * Connect USPS quote action and event. - */ -function uc_usps_ca_predicate() { - $enabled = variable_get('uc_quote_enabled', array()) + array( - 'usps' => FALSE, - 'usps_env' => FALSE, - 'usps_intl' => FALSE, - 'usps_intl_env' => FALSE, - ); - $quote_action = array( - '#name' => 'uc_quote_action_get_quote', - '#title' => t('Fetch a shipping quote'), - '#argument_map' => array( - 'order' => 'order', - 'method' => 'method', - ), - ); - // Domestic areas include U.S., American Samoa, Guam, Puerto Rico, and the Virgin Islands - $countries = array(16, 316, 630, 840, 850); - $predicates = array( - 'uc_usps_get_quote' => array( - '#title' => t('Shipping quote from USPS'), - '#trigger' => 'get_quote_from_usps', - '#class' => 'uc_usps', - '#status' => $enabled['usps'], - '#conditions' => array( - '#operator' => 'AND', - '#conditions' => array( - array( - '#name' => 'uc_order_condition_delivery_country', - '#title' => t('Is in domestic US areas (US, AS, GU, PR, VI)'), - '#argument_map' => array( - 'order' => 'order', - ), - '#settings' => array( - 'countries' => $countries, - ), - ), - ), - ), - '#actions' => array( - $quote_action, - ), - ), - 'uc_usps_get_env_quote' => array( - '#title' => t('Shipping quote from USPS'), - '#trigger' => 'get_quote_from_usps_env', - '#class' => 'uc_usps', - '#status' => $enabled['usps_env'], - '#conditions' => array( - '#operator' => 'AND', - '#conditions' => array( - array( - '#name' => 'uc_order_condition_delivery_country', - '#title' => t('Is in domestic US areas (US, AS, GU, PR, VI)'), - '#argument_map' => array( - 'order' => 'order', - ), - '#settings' => array( - 'countries' => $countries, - ), - ), - ), - ), - '#actions' => array( - $quote_action, - ), - ), - 'uc_usps_get_intl_quote' => array( - '#title' => t('Shipping quote from USPS Intl.'), - '#trigger' => 'get_quote_from_usps_intl', - '#class' => 'uc_usps', - '#status' => $enabled['usps_intl'], - '#conditions' => array( - '#operator' => 'AND', - '#conditions' => array( - array( - '#name' => 'uc_order_condition_delivery_country', - '#title' => t('Is not in domestic US areas (US, AS, GU, PR, VI)'), - '#argument_map' => array( - 'order' => 'order', - ), - '#settings' => array( - 'negate' => TRUE, - 'countries' => $countries, - ), - ), - ), - ), - '#actions' => array( - $quote_action, - ), - ), - 'uc_usps_get_intl_env_quote' => array( - '#title' => t('Shipping quote from USPS Intl.'), - '#trigger' => 'get_quote_from_usps_intl_env', - '#class' => 'uc_usps', - '#status' => $enabled['usps_intl_env'], - '#conditions' => array( - '#operator' => 'AND', - '#conditions' => array( - array( - '#name' => 'uc_order_condition_delivery_country', - '#title' => t('Is not in domestic US areas (US, AS, GU, PR, VI)'), - '#argument_map' => array( - 'order' => 'order', - ), - '#settings' => array( - 'negate' => TRUE, - 'countries' => $countries, - ), - ), - ), - ), - '#actions' => array( - $quote_action, - ), - ), - ); - - return $predicates; -} - -/****************************************************************************** * Ubercart Hooks * ******************************************************************************/ === added file 'shipping/uc_usps/uc_usps.rules_defaults.inc' --- shipping/uc_usps/uc_usps.rules_defaults.inc 1970-01-01 00:00:00 +0000 +++ shipping/uc_usps/uc_usps.rules_defaults.inc 2010-06-10 15:53:53 +0000 @@ -0,0 +1,42 @@ + t('American Samoa'), + 316 => t('Guam'), + 630 => t('Puerto Rico'), + 840 => t('United States'), + 850 => t('Virgin Islands (US)'), + ); + + $domestic = rules_or(); + $domestic->label = t('Order delivers to one of'); + $domestic_env = clone $domestic; + + $foreign = rules_or(); + $foreign->negate(); + $foreign->label = t('NOT Order delivers to one of'); + $foreign_env = clone $foreign; + + foreach ($countries as $country => $name) { + $condition = rules_condition('data_is', array('data:select' => 'order:delivery-address:country', 'value' => $country)); + $condition->label = $name; + + $domestic->condition(clone $condition); + $domestic_env->condition(clone $condition); + $foreign->condition(clone $condition); + $foreign_env->condition($condition); + } + + + $configs['get_quote_from_usps']->condition($domestic); + $configs['get_quote_from_usps_env']->condition($domestic_env); + $configs['get_quote_from_usps_intl']->condition($foreign); + $configs['get_quote_from_usps_intl_env']->condition($foreign_env); +} + === modified file 'shipping/uc_weightquote/uc_weightquote.admin.inc' --- shipping/uc_weightquote/uc_weightquote.admin.inc 2010-04-05 14:37:18 +0000 +++ shipping/uc_weightquote/uc_weightquote.admin.inc 2010-06-10 19:18:33 +0000 @@ -4,7 +4,6 @@ /** * @file * Weight quote shipping method administration menu items. - * */ /** @@ -29,15 +28,14 @@ $row[] = uc_price($method->base_rate, $context); $row[] = uc_price($method->product_rate, $context); $row[] = l(t('edit'), 'admin/store/settings/quotes/methods/weightquote/' . $method->mid); - $row[] = l(t('conditions'), CA_UI_PATH . '/uc_weightquote_get_quote_' . $method->mid . '/edit/conditions'); $rows[] = $row; } if (count($rows)) { - $header = array(t('Title'), t('Label'), t('Base rate'), t('Default product rate'), array('data' => t('Operations'), 'colspan' => 2)); + $header = array(t('Title'), t('Label'), t('Base rate'), t('Default product rate'), array('data' => t('Operations'), 'colspan' => 1)); $build['methods'] = array( '#theme' => 'table', '#header' => $header, - 'rows' => $rows, + '#rows' => $rows, ); } @@ -105,6 +103,11 @@ '#field_suffix' => t('!sign per !unit', array('!sign' => $sign_flag ? $currency_sign : '', '!unit' => variable_get('uc_weight_unit', 'lb'))), ); + $conditions = rules_config_load('get_quote_from_weightquote_' . $mid); + if ($conditions) { + $conditions->form($form, $form_state); + } + $form['buttons']['submit'] = array( '#type' => 'submit', '#value' => t('Submit'), @@ -199,7 +202,8 @@ db_delete('uc_weightquote_products') ->condition('mid', $mid) ->execute(); - ca_delete_predicate('uc_weightquote_get_quote_' . $form_state['values']['mid']); + + rules_config_delete('get_quote_from_weightquote_' . $mid); $enabled = variable_get('uc_quote_enabled', array()); unset($enabled['weightquote_' . $mid]); === modified file 'shipping/uc_weightquote/uc_weightquote.module' --- shipping/uc_weightquote/uc_weightquote.module 2010-04-05 14:37:18 +0000 +++ shipping/uc_weightquote/uc_weightquote.module 2010-06-10 19:18:33 +0000 @@ -169,41 +169,6 @@ ******************************************************************************/ /** - * Implement hook_ca_predicate(). - * - * Connect the quote action with the quote event. - */ -function uc_weightquote_ca_predicate() { - $enabled = variable_get('uc_quote_enabled', array()); - $predicates = array(); - - $result = db_query("SELECT mid, title FROM {uc_weightquote_methods}"); - foreach ($result as $method) { - // Ensure the default status is set. - $enabled += array('weightquote_' . $method->mid => FALSE); - - $predicates['uc_weightquote_get_quote_' . $method->mid] = array( - '#title' => t('Shipping quote via @method', array('@method' => $method->title)), - '#trigger' => 'get_quote_from_weightquote_' . $method->mid, - '#class' => 'uc_weightquote', - '#status' => $enabled['weightquote_' . $method->mid], - '#actions' => array( - array( - '#name' => 'uc_quote_action_get_quote', - '#title' => t('Fetch a weightquote shipping quote.'), - '#argument_map' => array( - 'order' => 'order', - 'method' => 'method', - ), - ), - ), - ); - } - - return $predicates; -} - -/** * Implement hook_uc_shipping_method(). */ function uc_weightquote_uc_shipping_method() { === modified file 'uc_cart/uc_cart.info' --- uc_cart/uc_cart.info 2010-02-25 16:24:47 +0000 +++ uc_cart/uc_cart.info 2010-06-21 19:34:42 +0000 @@ -1,7 +1,6 @@ ; $Id$ name = Cart description = REQUIRED. Controls the shopping cart for an Ubercart e-commerce site. -dependencies[] = ca dependencies[] = uc_order dependencies[] = uc_product package = Ubercart - core @@ -9,7 +8,8 @@ files[] = uc_cart.module files[] = uc_cart.install files[] = uc_cart.admin.inc -files[] = uc_cart.ca.inc files[] = uc_cart.pages.inc +files[] = uc_cart.rules.inc +files[] = uc_cart.rules_defaults.inc files[] = uc_cart.test files[] = uc_cart_checkout_pane.inc === modified file 'uc_cart/uc_cart.module' --- uc_cart/uc_cart.module 2010-06-03 14:53:42 +0000 +++ uc_cart/uc_cart.module 2010-06-15 13:40:04 +0000 @@ -12,7 +12,6 @@ */ require_once('uc_cart_checkout_pane.inc'); -require_once('uc_cart.ca.inc'); /******************************************************************************* * Hook Functions (Drupal) @@ -1341,7 +1340,7 @@ unset($_SESSION['cart_order'], $_SESSION['do_complete'], $_SESSION['new_user']); module_invoke_all('uc_uc_checkout_complete', $order, $account); - ca_pull_trigger('uc_checkout_complete', $order, $account); + rules_invoke_event('uc_checkout_complete', $order); return array( '#theme' => 'uc_cart_complete_sale', === renamed file 'uc_cart/uc_cart.ca.inc' => 'uc_cart/uc_cart.rules.inc' --- uc_cart/uc_cart.ca.inc 2010-04-08 21:22:14 +0000 +++ uc_cart/uc_cart.rules.inc 2010-05-27 20:39:22 +0000 @@ -3,157 +3,29 @@ /** * @file - * This file contains the Conditional Actions hooks and functions necessary to + * This file contains the Rules hooks and functions necessary to * make the cart related entity, conditions, events, and actions work. */ /****************************************************************************** - * Conditional Actions Hooks * - ******************************************************************************/ - -/** - * Implement hook_ca_condition(). - */ -function uc_cart_ca_condition() { - $conditions['uc_cart_condition_product_class'] = array( - '#title' => t('Order has a product of a particular class'), - '#category' => t('Order: Product'), - '#callback' => 'uc_cart_condition_product_class', - '#arguments' => array( - 'order' => array( - '#entity' => 'uc_order', - '#title' => t('Order'), - ), - ), - ); - - return $conditions; -} - -/** - * Implement hook_ca_trigger(). - */ -function uc_cart_ca_trigger() { - $triggers['uc_checkout_complete'] = array( - '#title' => t('Customer completes checkout'), - '#category' => t('Cart'), - '#arguments' => array( - 'order' => array( - '#entity' => 'uc_order', - '#title' => t('Order'), - ), - 'account' => array( - '#entity' => 'user', - '#title' => t('Customer user account'), - ) - ), - ); - - return $triggers; -} - -/** - * Implement hook_ca_predicate(). - */ -function uc_cart_ca_predicate() { - $predicates = array(); - - // Setup a default predicate for customer checkout notifications. - $predicates['uc_checkout_customer_notification'] = array( - '#title' => t('E-mail customer checkout notification'), - '#description' => t('E-mail the customer an invoice from their recent order.'), - '#class' => 'notification', - '#status' => 1, - '#trigger' => 'uc_checkout_complete', - '#actions' => array( - array( - '#name' => 'uc_order_email_invoice', - '#title' => t('Send an e-mail to the customer'), - '#argument_map' => array( - 'order' => 'order', - ), - '#settings' => array( - 'from' => uc_store_email_from(), - 'addresses' => '[uc_order:email]', - 'subject' => t('Your Order at [store:name]'), - 'template' => 'customer', - 'view' => 'checkout-mail', - ), - ), - ), - ); - - // Setup a default predicate for admin checkout notifications. - $predicates['uc_checkout_admin_notification'] = array( - '#title' => t('E-mail admin checkout notification'), - '#description' => t('E-mail a short order summary to an administrator when a customer checks out.'), - '#class' => 'notification', - '#status' => 1, - '#trigger' => 'uc_checkout_complete', - '#actions' => array( - array( - '#name' => 'uc_order_email_invoice', - '#title' => t('Send an e-mail to the administrator(s)'), - '#argument_map' => array( - 'order' => 'order', - ), - '#settings' => array( - 'from' => uc_store_email_from(), - 'addresses' => variable_get('uc_store_email', ''), - 'subject' => t('New Order at [store:name]'), - 'template' => 'admin', - 'view' => 'admin-mail', - ), - ), - ), - ); - - return $predicates; -} - -/****************************************************************************** - * Condition Callbacks and Forms * - ******************************************************************************/ - -/** - * Check that an order has a product of the selected class. - * - * @see uc_cart_condition_product_class_form() - */ -function uc_cart_condition_product_class($order, $settings) { - $result = FALSE; - $types = array(); - foreach ($order->products as $product) { - // Ignore "blank line" custom products. - if ($product->nid) { - // Cache product types to avoid extra queries. - if (!isset($types[$product->nid])) { - if (isset($product->type)) { - $types[$product->nid] = $product->type; - } - else { - $types[$product->nid] = db_query("SELECT type FROM {node} WHERE nid = :nid", array(':nid' => $product->nid))->fetchField(); - } - } - if ($types[$product->nid] == $settings['class']) { - $result = TRUE; - break; - } - } - } - - return $result; -} - -/** - * @see uc_cart_condition_product_class() - */ -function uc_cart_condition_product_class_form($form, &$form_state, $settings = array()) { - $form['class'] = array('#type' => 'select', - '#title' => t('Product class'), - '#options' => uc_product_type_names(), - '#default_value' => $settings['class'], - ); - - return $form; -} + * Rules Hooks * + ******************************************************************************/ + +/** + * Implement hook_rules_event_info(). + */ +function uc_cart_rules_event_info() { + $events['uc_checkout_complete'] = array( + 'label' => t('Customer completes checkout'), + 'group' => t('Cart'), + 'variables' => array( + 'order' => array( + 'type' => 'uc_order', + 'label' => t('Order'), + ), + ), + ); + + return $events; +} + === added file 'uc_cart/uc_cart.rules_defaults.inc' --- uc_cart/uc_cart.rules_defaults.inc 1970-01-01 00:00:00 +0000 +++ uc_cart/uc_cart.rules_defaults.inc 2010-06-21 18:52:52 +0000 @@ -0,0 +1,47 @@ +label = t('E-mail customer checkout notification'); + $rule->active = TRUE; + $rule->event('uc_checkout_complete') + ->action('uc_order_email_invoice', array( + 'order:select' => 'order', + 'from' => uc_store_email_from(), + 'addresses' => '[uc_order:email]', + 'subject' => t('Your Order at [store:name]'), + 'template' => 'customer', + 'view' => 'checkout-mail', + )); + + $configs['uc_checkout_customer_notification'] = $rule; + + // Setup a default predicate for admin checkout notifications. + $rule = rules_reaction_rule(); + $rule ->label = t('E-mail admin checkout notification'); + $rule->active = TRUE; + $rule->event('uc_checkout_complete') + ->action('uc_order_email_invoice', array( + 'order:select' => 'order', + 'from' => uc_store_email_from(), + 'addresses' => variable_get('uc_store_email', ''), + 'subject' => t('New Order at [store:name]'), + 'template' => 'admin', + 'view' => 'admin-mail', + )); + + $configs['uc_checkout_admin_notification'] = $rule; + + return $configs; +} + === modified file 'uc_file/uc_file.install' --- uc_file/uc_file.install 2010-04-01 18:42:54 +0000 +++ uc_file/uc_file.install 2010-06-21 18:54:19 +0000 @@ -147,7 +147,7 @@ 'file_key' => array( 'description' => 'A hash of the data in this row.', 'type' => 'varchar', - 'length' => 32, + 'length' => 64, 'not null' => TRUE, 'default' => '', ), @@ -227,3 +227,15 @@ return t("Variable 'uc_file_file_mask' changed to @mask.", array('@mask', $mask)); } + +/** + * Increase the length of {uc_file_users}.file_key. + */ +function uc_file_update_7001() { + db_change_field('uc_file_users', 'file_key', 'file_key', array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + )); +} === modified file 'uc_file/uc_file.module' --- uc_file/uc_file.module 2010-04-26 18:08:32 +0000 +++ uc_file/uc_file.module 2010-06-21 19:08:20 +0000 @@ -14,8 +14,6 @@ * Development sponsored by the Ubercart project. http://www.ubercart.org */ -require_once('uc_file.ca.inc'); - /** * The max amount of files shown on any page that displays files * in a table/pager. @@ -28,15 +26,6 @@ ******************************************************************************/ /** - * Implement hook_help(). - */ -function uc_file_help($path, $arg) { - if ($path == 'node/%/edit/features' && $arg[4] == 'file') { - return t('Add file downloads through this page and then use the conditional actions interface to limit which orders they are applied to. Most important is the order status on which file download access will be triggered.', array('!url' => url(CA_UI_PATH))); - } -} - -/** * Implement hook_form_alter(). */ function uc_file_form_alter(&$form, &$form_state, $form_id) { @@ -712,10 +701,24 @@ $granularity_value = $time_status ? $file_product->time_granularity : 'never'; } else { - $default_shippable = $node->shippable; - $download_status = FALSE; - $address_status = FALSE; - $time_status = FALSE; + $file_product = FALSE; + + $default_feature = NULL; + + $default_model = ''; + $default_filename = ''; + $default_description = ''; + $default_shippable = $node->shippable; + + $download_status = FALSE; + $download_value = NULL; + + $address_status = FALSE; + $address_value = NULL; + + $time_status = FALSE; + $quantity_value = NULL; + $granularity_value = 'never'; } $form['nid'] = array( @@ -1690,7 +1693,7 @@ $file_user['expiration'] = $file_user['expiration'] ? $file_user['expiration'] : 0; // Calculate hash - $file_user['file_key'] = $file_user['file_key'] ? $file_user['file_key'] : drupal_get_token(serialize($file_user)); + $file_user['file_key'] = isset($file_user['file_key']) && $file_user['file_key'] ? $file_user['file_key'] : drupal_get_token(serialize($file_user)); // Write and queue the file_user object. drupal_write_record('uc_file_users', $file_user, $key); === renamed file 'uc_file/uc_file.ca.inc' => 'uc_file/uc_file.rules.inc' --- uc_file/uc_file.ca.inc 2010-04-26 18:08:32 +0000 +++ uc_file/uc_file.rules.inc 2010-06-22 16:57:29 +0000 @@ -3,130 +3,134 @@ /** * @file - * This file contains the Conditional Actions hooks and functions necessary to - * make the file-related entity, conditions, events, and actions work. + * Rules hooks and functions for uc_file.module. */ -/****************************************************************************** - * Conditional Actions Hooks * - ******************************************************************************/ - /** - * Implement hook_ca_entity(). + * Implement hook_rules_data_info(). * * An entity is defined in order to get file expiration(s) down to token in the * email. */ -function uc_file_ca_entity() { - - // CA entity for a file expiration object. - $entities['uc_file_expiration'] = array( - '#title' => t('Ubercart file expiration(s)'), - '#type' => 'array', - ); - - return $entities; -} - -/** - * Implement hook_ca_predicate(). - */ -function uc_file_ca_predicate() { - - // Renew all the files on an order when the status matches what's set in the files admin settings. - $configurations['uc_file_renewal'] = array( - '#title' => t('Renew purchased files'), - '#description' => t('Renew purchased files if the order status matches.'), - '#class' => 'renewal', - '#trigger' => 'uc_order_status_update', - '#status' => 1, - '#conditions' => array( - '#operator' => 'AND', - '#conditions' => array( - array( - '#name' => 'uc_order_status_condition', - '#title' => t('If the order status is completed.'), - '#argument_map' => array( - 'order' => 'updated_order', - ), - '#settings' => array( - 'order_status' => 'completed', - ), - ), - ), - ), - '#actions' => array( - array( - '#name' => 'uc_file_order_renew', - '#title' => t('Update all file expirations for this order.'), - '#argument_map' => array( - 'order' => 'order', - ), - ), - ), - ); - - $order_args = array( - 'order' => 'order', - 'expiration' => 'expiration', - ); - - // Notify the user when a file is granted. - $configurations['uc_file_notify_grant_trigger'] = array( - '#title' => t('Notify customer when a file is granted'), - '#description' => t('Notify the customer when they have had a file granted on their user.'), - '#class' => 'notification', - '#trigger' => 'uc_file_notify_grant', - '#status' => 1, - '#actions' => array( - array( - '#name' => 'uc_file_order_email', - '#title' => t('Send an e-mail to the customer'), - '#argument_map' => $order_args, - '#settings' => array( - 'from' => uc_store_email_from(), - 'addresses' => '[uc_order:email]', - 'subject' => t("File Downloads for Order# [uc_order:order-id]"), - 'message' => t("Your order (order# [uc_order:link]) at [store:name] included file download(s). You may access them with the following link(s):\n\n[uc_file:downloads]\n\nAfter downloading these files these links will have expired. If you need to download the files again, you can login at [site:login-link] and visit the \"My Account\" section of the site.\n\nThanks again, \n\n[store:name]\n[site:slogan]"), - 'format' => filter_default_format(), - ), - ), - ), - ); - - return $configurations; -} - -/** - * Implement hook_ca_action(). - */ -function uc_file_ca_action() { - +function uc_file_rules_data_info() { + $data['uc_file_expiration'] = array( + 'label' => t('Ubercart file expiration(s)'), + 'wrap' => TRUE, + 'property info' => array( + 'fuid' => array( + 'type' => 'integer', + 'label' => t('File-user ID'), + 'description' => t('Primary key for user permission to download a file.'), + ), + 'fid' => array( + 'type' => 'integer', + 'label' => t('File ID'), + 'description' => t('The file that may be downloaded.'), + ), + 'uid' => array( + 'type' => 'integer', + 'label' => t('User ID'), + 'description' => t('The user account that has permission to download a file.'), + ), + 'pfid' => array( + 'type' => 'integer', + 'label' => t('Product feature ID'), + 'description' => t('The product feature that granted permission to download the file.'), + ), + 'file-key' => array( + 'type' => 'text', + 'label' => t('File key'), + 'description' => t('A hash of the permission and expiraiton data.'), + ), + 'granted' => array( + 'type' => 'date', + 'label' => t('Granted time'), + 'description' => t('The time the permission to download the file was granted.'), + ), + 'expiration' => array( + 'type' => 'date', + 'label' => t('Expiration time'), + 'description' => t('The time when the permission to download the file will expire.'), + ), + 'accessed' => array( + 'type' => 'integer', + 'label' => t('Accesses'), + 'description' => t('The number of times the file has been accessed.'), + ), + 'addresses' => array( + 'type' => 'list', + 'label' => t('IP addresses'), + 'description' => t('List of IP addresses to which the file has been downloaded.'), + ), + 'download-limit' => array( + 'type' => 'integer', + 'label' => t('Download limit'), + 'description' => t('The numer of times the user may download the file.'), + ), + 'address-limit' => array( + 'type' => 'integer', + 'label' => t('Address limit'), + 'description' => t('The number of different IP addresses that may download the file.'), + ), + ), + 'group' => t('File download'), + 'token type' => 'uc_file', + ); + + return $data; +} + +/** + * Implement hook_rules_action_info(). + */ +function uc_file_rules_action_info() { + // Renew file expirations. $actions['uc_file_order_renew'] = array( - '#title' => t('Renew the files on an order.'), - '#category' => t('renewal'), - '#callback' => 'uc_file_action_order_renew', - '#arguments' => array( + 'label' => t('Renew the files on an order.'), + 'group' => t('renewal'), + 'base' => 'uc_file_action_order_renew', + 'parameter' => array( 'order' => array( - '#entity' => 'uc_order', - '#title' => t('Order'), + 'type' => 'uc_order', + 'label' => t('Order'), ), ), ); // Send an email to an order with a file expiration $actions['uc_file_order_email'] = array( - '#title' => t('Send an order email regarding files.'), - '#category' => t('Notification'), - '#callback' => 'uc_file_action_order_email', - '#arguments' => array( + 'label' => t('Send an order email regarding files.'), + 'group' => t('Notification'), + 'base' => 'uc_file_action_order_email', + 'parameter' => array( 'order' => array( - '#entity' => 'uc_order', - '#title' => t('Order'), + 'type' => 'uc_order', + 'label' => t('Order'), ), 'expiration' => array( - '#entity' => 'uc_file_expiration', - '#title' => t('File expiration'), + 'type' => 'uc_file_expiration', + 'label' => t('File expiration'), + ), + 'from' => array( + 'type' => 'text', + 'label' => t('Sender'), + ), + 'addresses' => array( + 'type' => 'text', + 'label' => t('Recipients'), + ), + 'subject' => array( + 'type' => 'text', + 'label' => t('Subject'), + ), + 'message' => array( + 'type' => 'text', + 'label' => t('Message'), + ), + 'format' => array( + 'type' => 'integer', + 'label' => t('Message format'), + 'options list' => 'uc_file_message_formats', ), ), ); @@ -135,38 +139,58 @@ } /** - * Implement hook_ca_trigger(). - */ -function uc_file_ca_trigger() { - + * Options list callback for message formats. + */ +function uc_file_message_formats() { + global $user; + + $options = array(); + $formats = filter_formats($user); + foreach ($formats as $format) { + $options[$format->format] = $format->name; + } + + return $options; +} + +/** + * Implement hook_rules_event_info(). + */ +function uc_file_rules_event_info() { $args = array( 'order' => array( - '#entity' => 'uc_order', - '#title' => t('Order'), + 'type' => 'uc_order', + 'label' => t('Order'), ), 'expiration' => array( - '#entity' => 'uc_file_expiration', - '#title' => t('File expiration'), + 'type' => 'uc_file_expiration', + 'label' => t('File expiration'), ), ); - $triggers['uc_file_notify_grant'] = array( - '#title' => t('E-mail for granted files'), - '#category' => t('Notification'), - '#arguments' => $args, + $events['uc_file_notify_grant'] = array( + 'label' => t('E-mail for granted files'), + 'group' => t('Notification'), + 'variables' => $args, ); - return $triggers; + return $events; } /** * Send an email with order and file replacement tokens. * * The recipients, subject, and message fields take order token replacements. - * - * @see uc_file_action_order_email_form() */ -function uc_file_action_order_email($order, $file_expiration, $settings) { +function uc_file_action_order_email($order, $file_expiration, $from, $addresses, $subject, $message, $format) { + $settings = array( + 'from' => $from, + 'addresses' => $addresses, + 'subject' => $subject, + 'message' => $message, + 'format' => $format, + ); + // Token replacements for the subject and body $settings['replacements'] = array( 'uc_order' => $order, @@ -191,63 +215,6 @@ } /** - * @see uc_file_action_order_email() - */ -function uc_file_action_order_email_form($form_state, $settings = array()) { - return uc_file_build_email_form($form_state, $settings, array('site', 'store', 'uc_order', 'uc_file')); -} - -/** - * Build an email action settings form. - */ -function uc_file_build_email_form($form, &$form_state, $settings, $token_filters) { - $form['from'] = array( - '#type' => 'textfield', - '#title' => t('Sender'), - '#default_value' => $settings['from'], - '#description' => t('The "From" address.'), - '#required' => TRUE, - ); - $form['addresses'] = array( - '#type' => 'textarea', - '#title' => t('Recipients'), - '#default_value' => $settings['addresses'], - '#description' => t('Enter the email addresses to receive the notifications, one on each line. You may use order tokens for dynamic email addresses.'), - '#required' => TRUE, - ); - $form['subject'] = array( - '#type' => 'textfield', - '#title' => t('Subject'), - '#default_value' => $settings['subject'], - '#required' => TRUE, - ); - $form['message'] = array( - '#type' => 'textarea', - '#title' => t('Message'), - '#default_value' => $settings['message'], - '#text_format' => $settings['format'], - ); - - $form['token_help'] = array( - '#type' => 'fieldset', - '#title' => t('Replacement patterns'), - '#description' => t('You can make use of the replacement patterns in the recipients field, the subject, and the message body.'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ); - foreach ($token_filters as $name) { - $form['token_help'][$name] = array( - '#type' => 'fieldset', - '#title' => t('@name replacement patterns', array('@name' => drupal_ucfirst($name))), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ); - } - - return $form; -} - -/** * Renew an orders product files. * * @param $order @@ -290,7 +257,7 @@ $file_modification = array( 'download_limit' => uc_file_get_download_limit($file), 'address_limit' => uc_file_get_address_limit($file), - 'expiration' => _uc_file_expiration_date(uc_file_get_time_limit($file), $file_user->expiration), + 'expiration' => _uc_file_expiration_date(uc_file_get_time_limit($file), ($file_user ? $file_user->expiration : NULL)), ); // Add file_user(s) for this file/directory. (No overwrite) @@ -312,6 +279,6 @@ // Notify the user of their download(s). if ($user_downloads) { - ca_pull_trigger('uc_file_notify_grant', $order, $user_downloads); + rules_invoke_event('uc_file_notify_grant', $order, $user_downloads); } } === added file 'uc_file/uc_file.rules_defaults.inc' --- uc_file/uc_file.rules_defaults.inc 1970-01-01 00:00:00 +0000 +++ uc_file/uc_file.rules_defaults.inc 2010-06-22 16:53:15 +0000 @@ -0,0 +1,42 @@ +label = t('Renew purchased files'); + $rule->active = TRUE; + $rule->event('uc_order_status_update'); + $rule->condition('data_is', array('data:select' => 'updated_order:order-status', 'value' => 'completed')) + ->action('uc_file_order_renew', array( + 'order:select' => 'order', + )); + $configs['uc_file_renewal'] = $rule; + + // Notify the user when a file is granted. + $rule = rules_reaction_rule(); + $rule->label = t('Notify customer when a file is granted'); + $rule->active = TRUE; + $rule->event('uc_file_notify_grant'); + $rule->action('uc_file_order_email', array( + 'order:select' => 'order', + 'expiration:select' => 'expiration', + 'from' => uc_store_email_from(), + 'addresses' => '[order:email]', + 'subject' => t("File Downloads for Order# [order:order-id]"), + 'message' => t("Your order (order# [order:link]) at [store:name] included file download(s). You may access them with the following link(s):\n\n[expiration:downloads]\n\nAfter downloading these files these links will have expired. If you need to download the files again, you can login at [site:login-link] and visit the \"My Account\" section of the site.\n\nThanks again, \n\n[store:name]\n[site:slogan]"), + 'format' => filter_default_format(), + )); + $configs['uc_file_notify_grant_trigger'] = $rule; + + return $configs; +} + === modified file 'uc_order/uc_order.admin.inc' --- uc_order/uc_order.admin.inc 2010-05-24 21:22:53 +0000 +++ uc_order/uc_order.admin.inc 2010-06-21 19:34:42 +0000 @@ -99,7 +99,7 @@ $form['customer']['uc_cust_order_invoice_template'] = array( '#type' => 'select', '#title' => t('On-site invoice template'), - '#description' => t('Select the invoice template to use when invoices are viewed on the site.
This is separate from the template used to e-mail invoices to customers which is configured through Conditional actions.', array('!url' => url(CA_UI_PATH))), + '#description' => t('Select the invoice template to use when invoices are viewed on the site.
This is separate from the template used to e-mail invoices to customers which is configured through Rules.', array('!url' => url(RULES_UI_PATH))), '#options' => uc_order_template_options(), '#summary' => t('You are using the %template order invoice template.', array('%template' => variable_get('uc_cust_order_invoice_template', 'customer'))), '#default_value' => variable_get('uc_cust_order_invoice_template', 'customer'), === modified file 'uc_order/uc_order.api.php' --- uc_order/uc_order.api.php 2010-06-03 14:04:58 +0000 +++ uc_order/uc_order.api.php 2010-06-21 19:34:42 +0000 @@ -91,7 +91,7 @@ */ function hook_uc_line_item_alter(&$item, $order) { $account = user_load($order->uid); - ca_pull_trigger('calculate_line_item_discounts', $item, $account); + rules_invoke_event('calculate_line_item_discounts', $item, $account); } /** @@ -272,6 +272,15 @@ } /** + * Respond to order product deletion. + */ +function hook_uc_order_product_delete($order_product_id) { + // Put back the stock. + $product = db_query("SELECT model, qty FROM {uc_order_products} WHERE order_product_id = :id", array(':id' => $order_product_id))->fetchObject(); + uc_stock_adjust($product->model, $product->qty); +} + +/** * Register static order states. * * Order states are module-defined categories for order statuses. Each state === modified file 'uc_order/uc_order.info' --- uc_order/uc_order.info 2010-04-05 19:24:56 +0000 +++ uc_order/uc_order.info 2010-06-21 19:34:42 +0000 @@ -1,13 +1,13 @@ ; $Id$ name = Order description = REQUIRED. Receive and manage orders through your website. -dependencies[] = ca package = Ubercart - core core = 7.x files[] = uc_order.module files[] = uc_order.install files[] = uc_order.admin.inc -files[] = uc_order.ca.inc files[] = uc_order.line_item.inc files[] = uc_order.order_pane.inc +files[] = uc_order.rules.inc +files[] = uc_order.rules_defaults.inc files[] = uc_order.tokens.inc === added file 'uc_order/uc_order.info.inc' --- uc_order/uc_order.info.inc 1970-01-01 00:00:00 +0000 +++ uc_order/uc_order.info.inc 2010-06-09 19:04:17 +0000 @@ -0,0 +1,251 @@ + array( + 'type' => 'text', + 'label' => t('First name'), + 'description' => t('First name of the addressee.'), + ), + 'last-name' => array( + 'type' => 'text', + 'label' => t('Last name'), + 'description' => t('Last naem of the addressee.'), + ), + 'company' => array( + 'type' => 'text', + 'label' => t('Company'), + 'description' => t('Name of the company at the address.'), + ), + 'street1' => array( + 'type' => 'text', + 'label' => t('Street line 1'), + 'description' => t('First line of the street address.'), + ), + 'street2' => array( + 'type' => 'text', + 'label' => t('Street line 2'), + 'description' => t('Second line of the street address.'), + ), + 'city' => array( + 'type' => 'text', + 'label' => t('City'), + 'description' => t('Address city.'), + ), + 'zone' => array( + 'type' => 'integer', + 'label' => t('Zone'), + 'description' => t('Address state/province/zone.'), + 'options list' => 'uc_zone_option_list', + ), + 'postal-code' => array( + 'type' => 'text', + 'label' => t('Postal code'), + 'description' => t('Address post code.'), + ), + 'country' => array( + 'type' => 'integer', + 'label' => t('Country'), + 'description' => t('Address country.'), + 'options list' => 'uc_country_option_list', + ), + 'phone' => array( + 'type' => 'text', + 'label' => t('Phone'), + 'description' => t('Contact phone number.'), + ), + 'email' => array( + 'type' => 'text', + 'label' => t('Email'), + 'description' => t('Contact email address.'), + ), + ); + + return array( + 'uc_order_product' => array( + 'properties' => array( + 'order-product-id' => array( + 'type' => 'integer', + 'label' => t('Order product ID'), + 'description' => t('The unique ID for the purchased product.'), + ), + 'order-id' => array( + 'type' => 'integer', + 'label' => t('Order ID'), + 'description' => t('The order ID that owns the product.'), + 'required' => TRUE, + ), + 'nid' => array( + 'type' => 'integer', + 'label' => t('Node ID'), + 'description' => t('The unique ID of the node representing the product.'), + 'clear' => array('node'), + ), + 'node' => array( + 'type' => 'node', + 'label' => t('Node'), + 'description' => t('The node representing the product.'), + ), + 'title' => array( + 'type' => 'text', + 'label' => t('Title'), + 'description' => t('The product title.'), + ), + 'model' => array( + 'type' => 'text', + 'label' => t('Model/SKU'), + 'description' => t('The model number of the product.'), + ), + 'qty' => array( + 'type' => 'integer', + 'label' => t('Quantity'), + 'description' => t('The number of the same product ordered.'), + ), + 'cost' => array( + 'type' => 'decimal', + 'label' => t('Cost'), + 'description' => t('The cost to the store for the product.'), + ), + 'price' => array( + 'type' => 'decimal', + 'label' => t('Price'), + 'description' => t('The price paid for the ordered product.'), + ), + 'weight' => array( + 'type' => 'decimal', + 'label' => t('Weight'), + 'description' => t('The physical weight of the product.'), + ), + ), + ), + 'uc_order' => array( + 'properties' => array( + 'order-id' => array( + 'type' => 'integer', + 'label' => t('Order ID'), + 'description' => t('Primary key: the order ID.'), + 'query callback' => 'entity_metadata_table_query', + ), + 'uid' => array( + 'type' => 'integer', + 'label' => t('User ID'), + 'description' => t('The unique ID of the customer who placed the order.'), + 'clear' => array('customer'), + 'query callback' => 'entity_metadata_table_query', + 'setter permission' => 'edit orders', + ), + 'customer' => array( + 'type' => 'user', + 'label' => t('Customer'), + 'destription' => t('The user who placed the order.'), + 'getter callback' => 'uc_order_uc_order_get_properties', + 'setter callback' => 'uc_order_uc_order_set_properties', + 'setter permission' => 'edit orders', + 'clear' => array('uid'), + ), + 'delivery-address' => array( + 'type' => 'struct', + 'label' => t('Delivery address'), + 'description' => t('The destination of the shipped products.'), + 'getter callback' => 'uc_order_address_property_get', + 'setter callback' => 'uc_order_address_property_set', + 'setter permission' => 'edit orders', + 'property info' => $address_info, + ), + 'billing-address' => array( + 'type' => 'struct', + 'label' => t('Billing address'), + 'description' => t('The destination of the bill and invoice.'), + 'getter callback' => 'uc_order_address_property_get', + 'setter callback' => 'uc_order_address_property_set', + 'setter permission' => 'edit orders', + 'property info' => $address_info, + ), + 'order-status' => array( + 'type' => 'text', + 'label' => t('Order status'), + 'description' => t('The status of the order.'), + 'required' => TRUE, + 'options list' => 'uc_order_status_list', + 'setter permission' => 'edit orders', + 'query callback' => 'entity_metadata_table_query', + ), + 'order-total' => array( + 'type' => 'decimal', + 'label' => t('Order total'), + 'description' => t('The total amount due for the order.'), + 'getter callback' => 'uc_order_get_total', + 'query callback' => 'entity_metadata_table_query', + ), + 'primary-email' => array( + 'type' => 'text', + 'label' => t('Primary email'), + 'description' => t('The primary email address of the customer.'), + 'setter permission' => 'edit orders', + 'query callback' => 'entity_metadata_table_query', + ), + 'payment-method' => array( + 'type' => 'text', + 'label' => t('Payment method'), + 'description' => t('The method of payment.'), + 'query callback' => 'entity_metadata_table_query', + ), + 'created' => array( + 'type' => 'date', + 'label' => t('Date created'), + 'description' => t('The date the order was placed.'), + 'query callback' => 'entity_metadata_table_query', + ), + 'modified' => array( + 'type' => 'date', + 'label' => t('Date modified'), + 'description' => t('The date the order was most recently changed.'), + 'query callback' => 'entity_metadata_table_query', + ), + 'host' => array( + 'type' => 'text', + 'label' => t('Host IP'), + 'description' => t('Host IP address of the person paying for the order.'), + 'query callback' => 'entity_metadata_table_query', + ), + 'products' => array( + 'type' => 'list', + 'label' => t('Products'), + 'description' => t('The products that have been ordered.'), + 'getter callback' => 'uc_order_get_properties', + 'setter callback' => 'uc_order_set_properties', + 'setter permission' => 'edit orders', + 'clear' => array('order_total'), + ), + ), + ), + ); +} + +/** + * Callback for getting node properties. + * @see entity_metadata_node_entity_info_alter() + */ +function uc_order_uc_order_get_properties($order, array $options, $name, $entity_type) { + switch ($name) { + case 'customer': + return $order->uid; + } +} + +/** + * Callback for setting node properties. + * @see entity_metadata_node_entity_info_alter() + */ +function uc_order_uc_order_set_properties($order, $name, $value) { + if ($name == 'customer') { + $order->uid = $value; + } +} + === modified file 'uc_order/uc_order.module' --- uc_order/uc_order.module 2010-05-24 19:55:46 +0000 +++ uc_order/uc_order.module 2010-06-16 14:20:51 +0000 @@ -13,7 +13,6 @@ require_once('uc_order.order_pane.inc'); require_once('uc_order.line_item.inc'); -require_once('uc_order.ca.inc'); class UcOrder { @@ -444,6 +443,56 @@ } /** + * Implement hook_entity_info(). + */ +function uc_order_entity_info() { + return array( + 'uc_order' => array( + 'label' => t('Order'), + 'base table' => 'uc_orders', + 'uri callback' => 'uc_order_uri', + 'fieldable' => TRUE, + 'entity keys' => array( + 'id' => 'order_id', + ), + 'bundles' => array( + 'uc_order' => array( + 'label' => t('Order'), + ), + ), + 'view modes' => array( + 'full' => array( + 'label' => t('Invoice'), + 'admin' => array( + 'path' => 'admin/store/settings/orders', + 'access arguments' => array('administer store'), + ), + ), + ), + 'access callback' => 'uc_order_order_entity_access', + 'create callback' => 'uc_order_new', + 'save callback' => 'uc_order_save', + 'delete callback' => 'uc_order_delete', + ), + 'uc_order_product' => array( + 'label' => t('Order product'), + 'base table' => 'uc_order_products', + 'entity keys' => array( + 'id' => 'order_product_id', + ), + 'bundles' => array( + 'uc_order_product' => array( + 'label' => t('Order product'), + ), + ), + 'access callback' => 'uc_order_order_product_access', + 'save callback' => 'uc_order_product_entity_save', + 'delete callback' => 'uc_order_product_delete', + ), + ); +} + +/** * Implement hook_user_view(). */ function uc_order_user_view($account, $view_mode) { @@ -923,54 +972,47 @@ * Module and Helper Functions ******************************************************************************/ +function uc_order_order_entity_access($op, $order = NULL, $account = NULL) { + if ($op == 'delete') { + if (!empty($order)) { + return uc_order_can_delete($order, $account); + } + else { + return FALSE; + } + } + + if ($op == 'edit') { + return user_access('edit orders', $account); + } + + if ($op == 'view') { + if (user_access('view all_orders', $account)) { + return TRUE; + } + + return (!empty($order) && $order->uid == $account->uid && user_access('view own orders', $account)); + } +} + /** * Generate a new order for user $uid. */ function uc_order_new($uid = 0, $state = 'in_checkout') { - $order = new stdClass(); + $order = new UcOrder(); if ($uid > 0) { $user = user_load($uid); $email = $user->mail; + $order->primary_email = $email; } $order->uid = $uid; $order->order_status = uc_order_state_default($state); - $order->primary_email = $email; - $order->products = array(); + $order->created = REQUEST_TIME; + $order->modified = REQUEST_TIME; - $order->order_id = db_insert('uc_orders') - ->fields(array( - 'uid' => $uid, - 'order_status' => $order->order_status, - 'order_total' => 0, - 'primary_email' => $email, - 'delivery_first_name' => '', - 'delivery_last_name' => '', - 'delivery_phone' => '', - 'delivery_company' => '', - 'delivery_street1' => '', - 'delivery_street2' => '', - 'delivery_city' => '', - 'delivery_zone' => 0, - 'delivery_postal_code' => '', - 'delivery_country' => 0, - 'billing_first_name' => '', - 'billing_last_name' => '', - 'billing_phone' => '', - 'billing_company' => '', - 'billing_street1' => '', - 'billing_street2' => '', - 'billing_city' => '', - 'billing_zone' => 0, - 'billing_postal_code' => '', - 'billing_country' => 0, - 'payment_method' => '', - 'data' => '', - 'created' => REQUEST_TIME, - 'modified' => REQUEST_TIME, - )) - ->execute(); + drupal_write_record('uc_orders', $order); uc_order_module_invoke('new', $order, NULL); @@ -1021,6 +1063,15 @@ return $user; } +function uc_order_order_product_access($op, $product = NULL, $account = NULL) { + if (isset($product) && $product->order_id) { + $order = uc_order_load($product->order_id); + return uc_order_order_entity_access($op, $order, $account); + } + + return FALSE; +} + /** * Save a product to an order. */ @@ -1039,6 +1090,26 @@ } /** + * API wrapper for uc_order_product_save(). + * + * @todo: Change the signature for uc_order_product_save() to this one. + */ +function uc_order_product_entity_save($product) { + return uc_order_product_save($product->order_id, $product); +} + +/** + * Remove a product from an order. + */ +function uc_order_product_delete($order_product_id) { + db_delete('uc_order_products') + ->condition('order_product_id', $order_product_id) + ->execute(); + + module_invoke_all('uc_order_product_delete', $order_product_id); +} + +/** * Load an order from the database. */ function uc_order_load($order_id) { @@ -1297,7 +1368,7 @@ uc_order_log_changes($order->order_id, $change); $updated = uc_order_load($order_id); - ca_pull_trigger('uc_order_status_update', $order, $updated); + rules_invoke_event('uc_order_status_update', $order, $updated); return TRUE; } @@ -1750,6 +1821,7 @@ } if ($sql) { + $ids = array(); foreach ($statuses[$scope] as $status) { $ids[] = $status['id']; } @@ -1816,38 +1888,14 @@ ); } - if (user_access('delete orders') || user_access('unconditionally delete orders')) { - // Unconditional deletion perms are always TRUE. - $can_delete = TRUE; - if (!user_access('unconditionally delete orders')) { - // Only users with unconditional deletion perms can delete completed orders. - if ($state == 'completed') { - $can_delete = FALSE; - } - else { - // See if any modules have a say in this order's eligibility for deletion - foreach (module_implements('uc_order') as $module) { - $function = $module . '_uc_order'; - // $order must be passed by reference. - if (function_exists($function) && ($response = $function('can_delete', $order, NULL))) { - // Break out early if possible. - if ($response === FALSE) { - $can_delete = FALSE; - break; - } - } - } - } - } - if ($can_delete) { - $alt = t('Delete order @order_id.', $order_id); - $actions[] = array( - 'name' => t('Delete'), - 'url' => 'admin/store/orders/' . $order->order_id . '/delete', - 'icon' => '' . $alt . '', - 'title' => $alt, - ); - } + if (uc_order_can_delete($order)) { + $alt = t('Delete order @order_id.', $order_id); + $actions[] = array( + 'name' => t('Delete'), + 'url' => 'admin/store/orders/' . $order->order_id . '/delete', + 'icon' => '' . $alt . '', + 'title' => $alt, + ); } $extra = module_invoke_all('uc_order_actions', $order); @@ -1872,13 +1920,84 @@ * * Access callback for admin/store/orders/%uc_order/delete. */ -function uc_order_can_delete($order) { - $can_delete = FALSE; - foreach (uc_order_actions($order) as $action) { - if ($action['name'] == t('Delete')) { +function uc_order_can_delete($order, $account = NULL) { + if (user_access('unconditionally delete orders', $account)) { + // Unconditional deletion perms are always TRUE. + return TRUE; + } + elseif (user_access('delete orders', $account)) { + // Only users with unconditional deletion perms can delete completed orders. + if ($state == 'completed') { + return FALSE; + } + else { $can_delete = TRUE; + // See if any modules have a say in this order's eligibility for deletion + foreach (module_implements('uc_order') as $module) { + $function = $module . '_uc_order'; + // $order must be passed by reference. + if (function_exists($function) && ($response = $function('can_delete', $order, NULL))) { + // Break out early if possible. + if ($response === FALSE) { + $can_delete = FALSE; + break; + } + } + } + + return $can_delete; } } - - return $can_delete; -} + else { + return FALSE; + } +} + +/** + * Entity metadata callback to get delivery or billing address of an order. + */ +function uc_order_address_property_get($order, array $options, $name, $entity_type) { + switch ($name) { + case 'delivery-address': + $type = 'delivery_'; + break; + + case 'billing-address': + $type = 'billing_'; + break; + + default: + return NULL; + } + + $address = new UcAddress(); + + foreach ($address as $field => $value) { + $address->{$field} = $order->{$type . $field}; + } + + return $address; +} + +/** + * Entity metadata callback to set delivery or billing address of an order. + */ +function uc_order_address_property_set($order, $name, $address) { + switch ($name) { + case 'delivery-address': + $type = 'delivery_'; + break; + + case 'billing-address': + $type = 'billing_'; + break; + + default: + return; + } + + foreach ($address as $field => $value) { + $order->{$type . $field} = $value; + } +} + === modified file 'uc_order/uc_order.order_pane.inc' --- uc_order/uc_order.order_pane.inc 2010-06-03 19:26:32 +0000 +++ uc_order/uc_order.order_pane.inc 2010-06-15 13:40:04 +0000 @@ -678,14 +678,7 @@ $order_product_id = intval($form_state['triggering_element']['#return_value']); - // Put back the stock. - if (module_exists('uc_stock')) { - $product = db_query("SELECT model, qty FROM {uc_order_products} WHERE order_product_id = :id", array(':id' => $order_product_id))->fetchObject(); - uc_stock_adjust($product->model, $product->qty); - } - db_delete('uc_order_products') - ->condition('order_product_id', $order_product_id) - ->execute(); + uc_order_product_delete($order_product_id); $order = $form_state['build_info']['args'][0]; $matches = array(); @@ -1148,7 +1141,7 @@ // Let conditional actions send email if requested. if ($form_state['values']['notify']) { $order = uc_order_load($form_state['values']['order_id']); - ca_pull_trigger('uc_order_status_email_update', $order); + rules_invoke_event('uc_order_status_email_update', $order); } drupal_set_message(t('Order updated.')); === renamed file 'uc_order/uc_order.ca.inc' => 'uc_order/uc_order.rules.inc' --- uc_order/uc_order.ca.inc 2010-04-08 21:22:14 +0000 +++ uc_order/uc_order.rules.inc 2010-06-15 13:32:57 +0000 @@ -3,285 +3,120 @@ /** * @file - * This file contains the Conditional Actions hooks and functions necessary to - * make the order related entity, conditions, events, and actions work. + * This file contains the Rules hooks and functions necessary to make the order + * related entity, conditions, events, and actions work. */ /****************************************************************************** - * Conditional Actions Hooks * + * Rules Hooks * ******************************************************************************/ /** - * Implement hook_ca_entity(). + * Implement hook_rules_data_info(). */ -function uc_order_ca_entity() { - $entities['uc_order'] = array( - '#title' => t('Ubercart order object'), - '#type' => 'object', - '#load' => 'uc_order_load', - '#save' => 'uc_order_save', - ); - $entities['uc_line_item'] = array( - '#title' => t('Order line item'), - '#type' => 'array', - ); - - return $entities; +function uc_order_rules_data_info() { + $types['uc_order'] = array( + 'label' => t('Ubercart order object'), + 'wrap' => TRUE, + 'group' => t('Ubercart'), + ); + $types['uc_order_product'] = array( + 'label' => t('Ubercart ordered product'), + 'wrap' => TRUE, + 'parent' => 'node', + 'group' => t('Ubercart'), + ); + + $types['uc_line_item'] = array( + 'label' => t('Order line item'), + 'wrap' => TRUE, + 'group' => t('Ubercart'), + 'token type' => FALSE, + ); + + return $types; } /** - * Implement hook_ca_trigger(). + * Implement hook_rules_event_info(). */ -function uc_order_ca_trigger() { - $triggers['uc_order_status_update'] = array( - '#title' => t('Order status gets updated'), - '#category' => t('Order'), - '#arguments' => array( +function uc_order_rules_event_info() { + $events['uc_order_status_update'] = array( + 'label' => t('Order status gets updated'), + 'group' => t('Order'), + 'variables' => array( 'order' => array( - '#entity' => 'uc_order', - '#title' => t('Original order'), + 'type' => 'uc_order', + 'label' => t('Original order'), ), 'updated_order' => array( - '#entity' => 'uc_order', - '#title' => t('Updated order'), + 'type' => 'uc_order', + 'label' => t('Updated order'), ), ), ); - $triggers['uc_order_status_email_update'] = array( - '#title' => t('E-mail requested for order status update'), - '#category' => t('Order'), - '#arguments' => array( + $events['uc_order_status_email_update'] = array( + 'label' => t('E-mail requested for order status update'), + 'group' => t('Order'), + 'variables' => array( 'order' => array( - '#entity' => 'uc_order', - '#title' => t('Order'), - ), - ), - ); - - return $triggers; -} - -/** - * Implement hook_ca_predicate(). - */ -function uc_order_ca_predicate() { - $predicates = array(); - - $predicates['uc_order_update_email_customer'] = array( - '#title' => t('E-mail an order update notification'), - '#description' => t('Notify the customer when the order status is changed.'), - '#class' => 'notification', - '#status' => 1, - '#trigger' => 'uc_order_status_email_update', - '#conditions' => array( - '#operator' => 'AND', - '#conditions' => array( - array( - '#name' => 'uc_order_status_condition', - '#title' => t('If the order status is not still In Checkout.'), - '#argument_map' => array( - 'order' => 'order', - ), - '#settings' => array( - 'negate' => TRUE, - 'order_status' => 'in_checkout', - ), - ), - ), - ), - '#actions' => array( - array( - '#name' => 'uc_order_email', - '#title' => t('Send an e-mail to the customer'), - '#argument_map' => array( - 'order' => 'order', - ), - '#settings' => array( - 'from' => uc_store_email_from(), - 'addresses' => '[uc_order:email]', - 'subject' => t('Order #[uc_order:order-id] Update'), - 'message' => uc_get_message('order_update_email'), - 'format' => filter_default_format(), - ), - ), - ), - ); - - return $predicates; -} - -/** - * Implement hook_ca_condition(). - */ -function uc_order_ca_condition() { - $order_arg = array( - '#entity' => 'uc_order', - ); - - $conditions['uc_order_status_condition'] = array( - '#title' => t('Check the order status'), - '#description' => t('Returns TRUE if the current order status matches the status specified below.'), - '#category' => t('Order'), - '#callback' => 'uc_order_condition_check_order_status', - '#arguments' => array( - 'order' => $order_arg, - ), - ); - - $conditions['uc_order_condition_total'] = array( - '#title' => t('Check the order total'), - '#description' => t('Returns TRUE if the current order total is within the parameters below.'), - '#category' => t('Order'), - '#callback' => 'uc_order_condition_total', - '#arguments' => array( - 'order' => $order_arg, - ), - ); - - $conditions['uc_order_condition_delivery_postal_code'] = array( - '#title' => t("Check an order's shipping postal code"), - '#category' => t('Order: Shipping address'), - '#description' => t('Returns TRUE if the shipping postal code is in the specified area.'), - '#callback' => 'uc_order_condition_delivery_postal_code', - '#arguments' => array( - 'order' => $order_arg - ), - ); - $conditions['uc_order_condition_delivery_zone'] = array( - '#title' => t("Check an order's shipping @zone", array('@zone' => uc_get_field_name('zone'))), - '#category' => t('Order: Shipping address'), - '#description' => t('Returns TRUE if the shipping @zone is in the specified list.', array('@zone' => uc_get_field_name('zone'))), - '#callback' => 'uc_order_condition_delivery_zone', - '#arguments' => array( - 'order' => $order_arg, - ), - ); - $conditions['uc_order_condition_delivery_country'] = array( - '#title' => t("Check an order's shipping country"), - '#category' => t('Order: Shipping address'), - '#description' => t('Returns TRUE if the shipping country is in the specified list.'), - '#callback' => 'uc_order_condition_delivery_country', - '#arguments' => array( - 'order' => $order_arg, - ), - ); - $conditions['uc_order_condition_billing_postal_code'] = array( - '#title' => t("Check an order's billing postal code"), - '#category' => t('Order: Billing address'), - '#description' => t('Returns TRUE if the billing postal code is in the specified area.'), - '#callback' => 'uc_order_condition_billing_postal_code', - '#arguments' => array( - 'order' => $order_arg, - ), - ); - $conditions['uc_order_condition_billing_zone'] = array( - '#title' => t("Check an order's billing @zone", array('@zone' => uc_get_field_name('zone'))), - '#category' => t('Order: Billing address'), - '#description' => t('Returns TRUE if the billing @zone is in the specified list.', array('@zone' => uc_get_field_name('zone'))), - '#callback' => 'uc_order_condition_billing_zone', - '#arguments' => array( - 'order' => $order_arg, - ), - ); - $conditions['uc_order_condition_billing_country'] = array( - '#title' => t("Check an order's billing country"), - '#category' => t('Order: Billing address'), - '#description' => t('Returns TRUE if the billing country is in the specified list.'), - '#callback' => 'uc_order_condition_billing_country', - '#arguments' => array( - 'order' => $order_arg, - ), - ); + 'type' => 'uc_order', + 'label' => t('Order'), + ), + ), + ); + + return $events; +} + +/** + * Implement hook_rules_condition_info(). + */ +function uc_order_rules_condition_info() { $conditions['uc_order_condition_has_products'] = array( - '#title' => t("Check an order's products"), - '#category' => t('Order: Product'), - '#description' => t('Returns TRUE if the order has any, all, or only the products in the list.'), - '#callback' => 'uc_order_condition_has_products', - '#arguments' => array( - 'order' => $order_arg, + 'label' => t("Check an order's products"), + 'group' => t('Order: Product'), + 'base' => 'uc_order_condition_has_products', + 'parameter' => array( + 'order' => array( + 'type' => 'uc_order', + 'label' => t('Order'), + ), ), ); $conditions['uc_order_condition_count_products'] = array( - '#title' => t("Check an order's number of products"), - '#category' => t('Order: Product'), - '#description' => t('Determines if the order has the specified number of products, possibly of a certain type.'), - '#callback' => 'uc_order_condition_count_products', - '#arguments' => array( - 'order' => $order_arg, + 'label' => t("Check an order's number of products"), + 'group' => t('Order: Product'), + 'base' => 'uc_order_condition_count_products', + 'parameter' => array( + 'order' => array( + 'type' => 'uc_order', + 'label' => t('Order'), + ), ), ); $conditions['uc_order_condition_products_weight'] = array( - '#title' => t("Check an order's total weight"), - '#category' => t('Order: Product'), - '#description' => t('Determines if the order has the specified weight, possibly counting only a certain type of product.'), - '#callback' => 'uc_order_condition_products_weight', - '#arguments' => array( - 'order' => $order_arg, + 'label' => t("Check an order's total weight"), + 'group' => t('Order: Product'), + 'help' => t('Compare the weight of all of the products, or the weight of just one type in the order.'), + 'base' => 'uc_order_condition_products_weight', + 'parameter' => array( + 'order' => array( + 'type' => 'uc_order', + 'label' => t('Order'), + ), ), ); $conditions['uc_order_condition_is_shippable'] = array( - '#title' => t('Check if an order can be shipped'), - '#category' => t('Order'), - '#description' => t('Returns TRUE if the order has any shippable products.'), - '#callback' => 'uc_order_condition_is_shippable', - '#arguments' => array( - 'order' => $order_arg, - ), - ); - - $conditions['uc_order_condition_user_name'] = array( - '#title' => t('Check the user name.'), - '#category' => t('Order: User'), - '#description' => t('Returns TRUE if the user name matches the condition.'), - '#callback' => 'uc_order_condition_user_name', - '#arguments' => array( - 'order' => $order_arg, - ), - ); - $conditions['uc_order_condition_user_mail'] = array( - '#title' => t('Check the user email address.'), - '#category' => t('Order: User'), - '#description' => t('Returns TRUE if the user email addresses matches the condition.'), - '#callback' => 'uc_order_condition_user_mail', - '#arguments' => array( - 'order' => $order_arg, - ), - ); - $conditions['uc_order_condition_user_created'] = array( - '#title' => t('Check the user creation date.'), - '#category' => t('Order: User'), - '#description' => t('Returns TRUE if the user creation date matches the condition.'), - '#callback' => 'uc_order_condition_user_created', - '#arguments' => array( - 'order' => $order_arg, - ), - ); - $conditions['uc_order_condition_user_login'] = array( - '#title' => t('Check the user last login date.'), - '#category' => t('Order: User'), - '#description' => t('Returns TRUE if the user last login date matches the condition.'), - '#callback' => 'uc_order_condition_user_login', - '#arguments' => array( - 'order' => $order_arg, - ), - ); - $conditions['uc_order_condition_user_language'] = array( - '#title' => t('Check the user language setting.'), - '#category' => t('Order: User'), - '#description' => t('Returns TRUE if the user language setting matches the condition.'), - '#callback' => 'uc_order_condition_user_language', - '#arguments' => array( - 'order' => $order_arg, - ), - ); - $conditions['uc_order_condition_user_roles'] = array( - '#title' => t('Check the role of the user.'), - '#category' => t('Order: User'), - '#description' => t('Returns TRUE if the user roles match your settings.'), - '#callback' => 'uc_order_condition_user_roles', - '#arguments' => array( - 'order' => $order_arg, + 'label' => t('Check if an order can be shipped'), + 'group' => t('Order'), + 'base' => 'uc_order_condition_is_shippable', + 'parameter' => array( + 'order' => array( + 'type' => 'uc_order', + 'label' => t('Order'), + ), ), ); @@ -289,297 +124,111 @@ } /** - * Implement hook_ca_action(). + * Implement hook_rules_action_info(). */ -function uc_order_ca_action() { +function uc_order_rules_action_info() { $order_arg = array( - '#entity' => 'uc_order', - '#title' => t('Order'), + 'type' => 'uc_order', + 'label' => t('Order'), ); $actions['uc_order_update_status'] = array( - '#title' => t('Update the order status'), - '#category' => t('Order'), - '#callback' => 'uc_order_action_update_status', - '#arguments' => array( + 'label' => t('Update the order status'), + 'group' => t('Order'), + 'base' => 'uc_order_action_update_status', + 'parameter' => array( 'order' => $order_arg, + 'order_status' => array( + 'type' => 'text', + 'label' => t('Status'), + 'options list' => 'uc_order_action_update_status_options', + ), ), ); $actions['uc_order_action_add_comment'] = array( - '#title' => t('Add a comment to the order'), - '#category' => t('Order'), - '#callback' => 'uc_order_action_add_comment', - '#arguments' => array( + 'label' => t('Add a comment to the order'), + 'group' => t('Order'), + 'base' => 'uc_order_action_add_comment', + 'parameter' => array( 'order' => $order_arg, + 'comment' => array( + 'type' => 'text', + 'label' => t('Comment'), + ), + 'comment_type' => array( + 'type' => 'text', + 'label' => t('Comment type'), + 'restriction' => 'input', + 'options list' => 'uc_order_action_comment_types', + ), ), ); $actions['uc_order_email'] = array( - '#title' => t('Send an order email'), - '#category' => t('Order'), - '#callback' => 'uc_order_action_email', - '#arguments' => array( + 'label' => t('Send an order email'), + 'group' => t('Order'), + 'base' => 'uc_order_action_email', + 'parameter' => array( 'order' => $order_arg, + 'from' => array( + 'type' => 'text', + 'label' => t('Sender'), + ), + 'addresses' => array( + 'type' => 'text', + 'label' => t('Recipients'), + 'description' => t('Enter the email addresses to receive the notifications, one on each line. You may use order tokens for dynamic email addresses.'), + ), + 'subject' => array( + 'type' => 'text', + 'label' => t('Subject'), + ), + 'message' => array( + 'type' => 'text', + 'label' => t('Message'), + ), ), ); $actions['uc_order_email_invoice'] = array( - '#title' => t('Email an order invoice'), - '#category' => t('Order'), - '#callback' => 'uc_order_action_email_invoice', - '#arguments' => array( + 'label' => t('Email an order invoice'), + 'group' => t('Order'), + 'base' => 'uc_order_action_email_invoice', + 'parameter' => array( 'order' => $order_arg, + 'from' => array( + 'type' => 'text', + 'label' => t('Sender'), + ), + 'addresses' => array( + 'type' => 'text', + 'label' => t('Recipients'), + ), + 'subject' => array( + 'type' => 'text', + 'label' => t('Subject'), + ), + 'template' => array( + 'type' => 'text', + 'label' => t('Invoice template'), + 'options list' => 'uc_order_template_options', + 'restriction' => 'input', + ), + 'view' => array( + 'type' => 'text', + 'label' => t('Included information'), + 'options list' => 'uc_order_action_email_invoice_view_options', + 'restriction' => 'input', + ), ), ); return $actions; } - /****************************************************************************** * Condition Callbacks and Forms * ******************************************************************************/ /** - * Check the current order status. - * - * @see uc_order_condition_check_order_status_form() - */ -function uc_order_condition_check_order_status($order, $settings) { - // Return TRUE if the order status matches. - return $order->order_status == $settings['order_status']; -} - -/** - * @see uc_order_condition_check_order_status() - */ -function uc_order_condition_check_order_status_form($form_state, $settings = array()) { - foreach (uc_order_status_list('general') as $status) { - $options[$status['id']] = $status['title']; - } - foreach (uc_order_status_list('specific') as $status) { - $options[$status['id']] = $status['title']; - } - $form['order_status'] = array( - '#type' => 'select', - '#title' => t('Order status'), - '#options' => $options, - '#default_value' => $settings['order_status'], - ); - - return $form; -} - -/** - * Check the current order balance. - * - * @see uc_order_condition_total_form() - */ -function uc_order_condition_total($order, $settings) { - switch ($settings['order_total_comparison']) { - case 'less': - return $order->order_total < $settings['order_total_value']; - case 'less_equal': - return $order->order_total <= $settings['order_total_value']; - case 'equal': - return $order->order_total == $settings['order_total_value']; - case 'greater_equal': - return $order->order_total >= $settings['order_total_value']; - case 'greater': - return $order->order_total > $settings['order_total_value']; - } -} - -/** - * @see uc_order_condition_total() - */ -function uc_order_condition_total_form($form_state, $settings = array()) { - $form['order_total_value'] = array( - '#type' => 'textfield', - '#title' => t('Order total value'), - '#description' => t('Specify a value to compare the order total against.'), - '#default_value' => $settings['order_total_value'], - '#size' => 16, - '#field_prefix' => variable_get('uc_sign_after_amount', FALSE) ? '' : variable_get('uc_currency_sign', '$'), - '#field_suffix' => variable_get('uc_sign_after_amount', FALSE) ? variable_get('uc_currency_sign', '$') : '', - ); - - $options = array( - 'less' => t('Total is less than specified value.'), - 'less_equal' => t('Total is less than or equal to specified value.'), - 'equal' => t('Total is equal to specified value.'), - 'greater_equal' => t('Total is greater than or equal to specified value.'), - 'greater' => t('Total is greater than specified value.'), - ); - $form['order_total_comparison'] = array( - '#type' => 'radios', - '#title' => t('Order total comparison type'), - '#options' => $options, - '#default_value' => isset($settings['order_total_comparison']) ? $settings['order_total_comparison'] : 'greater_equal', - ); - - return $form; -} - -/** - * Check an order's delivery postal code. - * - * @see uc_order_condition_delivery_postal_code_form() - */ -function uc_order_condition_delivery_postal_code($order, $settings) { - // Trim the wildcard off the pattern. - $pattern = rtrim($settings['pattern'], '*'); - - // Return TRUE if the delivery postal code begins with the pattern. - return strpos($order->delivery_postal_code, $pattern) === 0; -} - -/** - * @see uc_order_condition_delivery_postal_code() - */ -function uc_order_condition_delivery_postal_code_form($form_state, $settings = array()) { - $form['pattern'] = array( - '#type' => 'textfield', - '#title' => uc_get_field_name('postal_code'), - '#default_value' => $settings['pattern'], - '#description' => t('Specify a postal code or postal code pattern. Use "*" as a wild card to specify a range of postal codes.
Example: In the US, 402* represents all areas from 40200 to 40299.'), - '#size' => 15, - // '#required' => TRUE, - ); - - return $form; -} - -/** - * Check an order's delivery zone. - * - * @see uc_order_condition_delivery_zone_form() - */ -function uc_order_condition_delivery_zone($order, $settings) { - return in_array($order->delivery_zone, $settings['zones']); -} - -/** - * @see uc_order_condition_delivery_zone_form() - */ -function uc_order_condition_delivery_zone_form($form_state, $settings = array()) { - $result = db_query("SELECT z.*, c.country_name FROM {uc_zones} AS z LEFT JOIN {uc_countries} AS c ON z.zone_country_id = c.country_id ORDER BY c.country_name, z.zone_name"); - foreach ($result as $zone) { - $options[$zone->country_name][$zone->zone_id] = $zone->zone_name; - } - - $form['zones'] = array( - '#type' => 'select', - '#title' => uc_get_field_name('zone'), - '#options' => $options, - '#default_value' => $settings['zones'], - '#multiple' => TRUE, - // '#required' => TRUE, - ); - - return $form; -} - -/** - * Check an order's delivery country. - * - * @see uc_order_condition_delivery_country_form() - */ -function uc_order_condition_delivery_country($order, $settings) { - return in_array($order->delivery_country, $settings['countries']); -} - -/** - * @see uc_order_condition_delivery_country() - */ -function uc_order_condition_delivery_country_form($form_state, $settings = array()) { - $form['countries'] = uc_country_select(uc_get_field_name('country')); - $form['countries']['#default_value'] = $settings['countries']; - $form['countries']['#multiple'] = TRUE; - // $form['countries']['#required'] = TRUE; - - return $form; -} - -/** - * Check an order's billing postal code. - * - * @see uc_order_condition_billing_postal_code_form() - */ -function uc_order_condition_billing_postal_code($order, $settings) { - // Trim the wildcard off the pattern. - $pattern = rtrim($settings['pattern'], '*'); - - // Return TRUE if the delivery postal code begins with the pattern. - return strpos($order->billing_postal_code, $pattern) === 0; -} - -/** - * @see uc_order_condition_billing_postal_code() - */ -function uc_order_condition_billing_postal_code_form($form_state, $settings = array()) { - $form['pattern'] = array( - '#type' => 'textfield', - '#title' => uc_get_field_name('postal_code'), - '#default_value' => $settings['pattern'], - '#description' => t('Specify a postal code or postal code pattern. Use "*" as a wild card to specify a range of postal codes.
Example: In the US, 402* represents all areas from 40200 to 40299.'), - '#size' => 15, - // '#required' => TRUE, - ); - - return $form; -} - -/** - * Check an order's billing zone. - * - * @see uc_order_condition_billing_zone_form() - */ -function uc_order_condition_billing_zone($order, $settings) { - return in_array($order->billing_zone, $settings['zones']); -} - -/** - * @see uc_order_condition_billing_zone() - */ -function uc_order_condition_billing_zone_form($form_state, $settings = array()) { - $result = db_query("SELECT z.*, c.country_name FROM {uc_zones} AS z LEFT JOIN {uc_countries} AS c ON z.zone_country_id = c.country_id ORDER BY c.country_name, z.zone_name"); - foreach ($result as $zone) { - $options[$zone->country_name][$zone->zone_id] = $zone->zone_name; - } - - $form['zones'] = array( - '#type' => 'select', - '#title' => uc_get_field_name('zone'), - '#options' => $options, - '#default_value' => $settings['zones'], - '#multiple' => TRUE, - // '#required' => TRUE, - ); - - return $form; -} - -/** - * Check an order's billing country. - * - * @see uc_order_condition_billing_country_form() - */ -function uc_order_condition_billing_country($order, $settings) { - return in_array($order->billing_country, $settings['countries']); -} - -/** - * @see uc_order_condition_billing_country() - */ -function uc_order_condition_billing_country_form($form_state, $settings = array()) { - $form['countries'] = uc_country_select(uc_get_field_name('country')); - $form['countries']['#default_value'] = $settings['countries']; - $form['countries']['#multiple'] = TRUE; - // $form['countries']['#required'] = TRUE; - - return $form; -} - -/** * Check that the order has the selected combination of products. * * @see uc_order_condition_has_products_form() @@ -806,255 +455,6 @@ return uc_order_is_shippable($order); } -/** - * Check a user name. - * - * @see uc_order_condition_user_name() - */ -function uc_order_condition_user_name($order, $settings) { - if (empty($order->uid)) { - // Anonymous users have no names. - return empty($settings['name']); - } - else { - // Load from the order. - if ($account = uc_order_user_load($order)) { - return $account->name == $settings['name']; - } - // Or, if the user doesn't exist anymore, return FALSE - else { - return FALSE; - } - } -} - -/** - * @see uc_order_condition_user_name() - */ -function uc_order_condition_user_name_form($form_state, $settings = array()) { - $form['name'] = array( - '#type' => 'textfield', - '#title' => t('User name'), - '#default_value' => isset($settings['name']) ? $settings['name'] : '', - '#autocomplete_path' => 'user/autocomplete', - '#description' => t('Leave blank for %anonymous.', array('%anonymous' => variable_get('anonymous', t('Anonymous')))), - ); - - return $form; -} - -/** - * Check an user email. - * - * @see uc_order_condition_user_email_form() - */ -function uc_order_condition_user_mail($order, $settings) { - $account = uc_order_user_load($order); - return $account->mail == $settings['mail']; -} - -/** - * @see uc_order_condition_user_mail() - */ -function uc_order_condition_user_mail_form($form_state, $settings = array()) { - $form['mail'] = array( - '#type' => 'textfield', - '#title' => t('User email'), - '#default_value' => isset($settings['mail']) ? $settings['mail'] : '', - ); - - return $form; -} - -/** - * Check an user creation date. - * - * @see uc_order_condition_user_created_form() - */ -function uc_order_condition_user_created($order, $settings) { - $account = uc_order_user_load($order); - - // Get the beginning of the day the user registered. - $user_created = $account->created - ($account->created % 86400); - $settings_created = gmmktime(0, 0, 0, $settings['created']['month'], $settings['created']['day'], $settings['created']['year']); - - switch ($settings['operator']) { - case 'less': - return $user_created < $settings_created; - case 'less_equal': - return $user_created <= $settings_created; - case 'equal': - return $user_created == $settings_created; - case 'not_equal': - return $user_created != $settings_created; - case 'greater_equal': - return $user_created >= $settings_created; - case 'greater': - return $user_created > $settings_created; - } -} - -/** - * @see uc_order_condition_user_created() - */ -function uc_order_condition_user_created_form($form_state, $settings = array()) { - $form['operator'] = array( - '#type' => 'radios', - '#title' => t('Operator'), - '#options' => array( - 'less' => t('User was created before the specified date.'), - 'less_equal' => t('User was created on or before the specified date.'), - 'equal' => t('User was created on the specified date.'), - 'not_equal' => t('User was not created on the specified date.'), - 'greater_equal' => t('User was created on or after the specified date.'), - 'greater' => t('User was created after the specified date.'), - ), - '#default_value' => isset($settings['operator']) ? $settings['operator'] : 'equal', - ); - $form['created'] = array( - '#type' => 'date', - '#title' => t('User creation date'), - '#default_value' => isset($settings['created']) ? $settings['created'] : '', - ); - - return $form; -} - -/** - * Check an user last login date. - * - * @see uc_order_condition_user_login_form() - */ -function uc_order_condition_user_login($order, $settings) { - $account = uc_order_user_load($order); - - // Get the beginning of the day the user last logged in. - $user_login = $account->login - ($account->login % 86400); - $settings_login = gmmktime(0, 0, 0, $settings['login']['month'], $settings['login']['day'], $settings['login']['year']); - - switch ($settings['operator']) { - case 'less': - return $user_login < $settings_login; - case 'less_equal': - return $user_login <= $settings_login; - case 'equal': - return $user_login == $settings_login; - case 'not_equal': - return $user_login != $settings_login; - case 'greater_equal': - return $user_login >= $settings_login; - case 'greater': - return $user_login > $settings_login; - } -} - -/** - * @see uc_order_condition_user_login() - */ -function uc_order_condition_user_login_form($form_state, $settings = array()) { - $form['operator'] = array( - '#type' => 'radios', - '#title' => t('Operator'), - '#options' => array( - 'less' => t('User last logged in before the specified date.'), - 'less_equal' => t('User last logged in on, or before the specified date.'), - 'equal' => t('User last logged in on the specified date.'), - 'not_equal' => t('User did not log in last on the specified date.'), - 'greater_equal' => t('User last logged in on or after the specified date.'), - 'greater' => t('User last logged after the specified date.'), - ), - '#default_value' => isset($settings['operator']) ? $settings['operator'] : 'equal', - ); - $form['login'] = array( - '#type' => 'date', - '#title' => t('User last login date'), - '#default_value' => isset($settings['created']) ? $settings['created'] : '', - ); - - return $form; -} - -/** - * Check an user language setting. - * - * @see uc_order_condition_user_language_form() - */ -function uc_order_condition_user_language($order, $settings) { - $account = uc_order_user_load($order); - $user_prefered_language = user_preferred_language($account); - return $user_prefered_language->language == $settings['language']; -} - -/** - * @see uc_order_condition_user_language() - */ -function uc_order_condition_user_language_form($form_state, $settings = array()) { - $languages = language_list(); - $options = array(); - foreach ($languages as $language) { - $options[$language->language] = $language->name . ' (' . $language->native . ')'; - } - $form['language'] = array( - '#type' => 'select', - '#title' => t('User language setting'), - '#options' => $options, - '#default_value' => isset($settings['language']) ? $settings['language'] : '', - ); - - return $form; -} - -/** - * Check an user roles. - * - * @see uc_order_condition_user_roles_form() - */ -function uc_order_condition_user_roles($order, $settings) { - $account = uc_order_user_load($order); - $settings['roles'] = array_filter($settings['roles']); - - if ($settings['operator'] == 'AND') { - foreach ($settings['roles'] as $key) { - if (!isset($account->roles[$key])) { - return FALSE; - } - } - return TRUE; - } - else { - foreach ($settings['roles'] as $key) { - if (isset($account->roles[$key])) { - return TRUE; - } - } - return FALSE; - } -} - -/** - * @see uc_order_condition_user_roles() - */ -function uc_order_condition_user_roles_form($form_state, $settings = array()) { - $form['operator'] = array( - '#type' => 'radios', - '#title' => t('Operator'), - '#description' => t('If you use an AND case and want to check a custom role, make sure authenticated user is checked too or the condition will return FALSE.'), - '#options' => array( - 'AND' => t('AND: If the user has all of these roles.'), - 'OR' => t('OR: If the user has any of these roles.'), - ), - '#default_value' => isset($settings['operator']) ? $settings['operator'] : 'AND', - ); - $form['roles'] = array( - '#type' => 'checkboxes', - '#title' => t('Roles'), - '#options' => user_roles(), - '#default_value' => isset($settings['roles']) ? $settings['roles'] : array(), - ); - - return $form; -} - /****************************************************************************** * Action Callbacks and Forms * ******************************************************************************/ @@ -1073,21 +473,17 @@ /** * @see uc_order_action_update_status() */ -function uc_order_action_update_status_form($form_state, $settings = array()) { +function uc_order_action_update_status_options() { + $options = array(); + foreach (uc_order_status_list('general') as $status) { $options[$status['id']] = $status['title']; } foreach (uc_order_status_list('specific') as $status) { $options[$status['id']] = $status['title']; } - $form['order_status'] = array( - '#type' => 'select', - '#title' => t('Order status'), - '#options' => $options, - '#default_value' => $settings['order_status'], - ); - return $form; + return $options; } /** @@ -1105,25 +501,12 @@ /** * @see uc_order_action_add_comment() */ -function uc_order_action_add_comment_form($form_state, $settings = array()) { - $form['comment_type'] = array( - '#type' => 'radios', - '#title' => t('Select an order comment type'), - '#options' => array( - 'admin' => t('Enter this as an admin comment.'), - 'order' => t('Enter this as a customer order comment.'), - 'notified' => t('Enter this as a customer order comment with a notified icon.'), - ), - '#default_value' => $settings['comment_type'], - ); - $form['comment'] = array( - '#type' => 'textarea', - '#title' => t('Comment'), - '#description' => t('Enter the comment message. Uses order, store, and site tokens.', array('!url' => url('admin/store/help/tokens'))), - '#default_value' => $settings['comment'], - ); - - return $form; +function uc_order_action_order_comment_types() { + return array( + 'admin' => t('Enter this as an admin comment.'), + 'order' => t('Enter this as a customer order comment.'), + 'notified' => t('Enter this as a customer order comment with a notified icon.'), + ); } /** @@ -1247,61 +630,10 @@ /** * @see uc_order_action_email_invoice() */ -function uc_order_action_email_invoice_form($form_state, $settings = array()) { - $form['from'] = array( - '#type' => 'textfield', - '#title' => t('Sender'), - '#default_value' => isset($settings['from']) ? $settings['from'] : uc_store_email_from(), - '#description' => t('The "From" address.'), - '#required' => TRUE, - ); - $form['addresses'] = array( - '#type' => 'textarea', - '#title' => t('Recipients'), - '#default_value' => isset($settings['addresses']) ? $settings['addresses'] : '[uc_order:email]', - '#description' => t('Enter the email addresses to receive the notifications, one on each line. You may use order tokens for dynamic email addresses.'), - '#required' => TRUE, - ); - $form['subject'] = array( - '#type' => 'textfield', - '#title' => t('Subject'), - '#default_value' => $settings['subject'], - '#required' => TRUE, - ); - - $form['token_help'] = array( - '#type' => 'fieldset', - '#title' => t('Replacement patterns'), - '#description' => t('You can make use of the replacement patterns in the recipients, the subject, and the template file.'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ); - foreach (array('global', 'order') as $name) { - $form['token_help'][$name] = array( - '#type' => 'fieldset', - '#title' => t('@name replacement patterns', array('@name' => drupal_ucfirst($name))), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ); - } - - $form['template'] = array( - '#type' => 'select', - '#title' => t('Invoice template'), - '#description' => t('Select the invoice template to use for this email.'), - '#options' => uc_order_template_options(), - '#default_value' => $settings['template'], - ); - $form['view'] = array( - '#type' => 'radios', - '#title' => t('Included information'), - '#options' => array( - 'print' => t('Show the business header and shipping method.'), - 'admin-mail' => t('Show all of the above plus the help text, email text, and store footer.'), - 'checkout-mail' => t('Show all of the above plus the "thank you" message.'), - ), - '#default_value' => $settings['view'], - ); - - return $form; +function uc_order_action_email_invoice_view_options() { + return array( + 'print' => t('Show the business header and shipping method.'), + 'admin-mail' => t('Show all of the above plus the help text, email text, and store footer.'), + 'checkout-mail' => t('Show all of the above plus the "thank you" message.'), + ); } === added file 'uc_order/uc_order.rules_defaults.inc' --- uc_order/uc_order.rules_defaults.inc 1970-01-01 00:00:00 +0000 +++ uc_order/uc_order.rules_defaults.inc 2010-06-21 18:52:52 +0000 @@ -0,0 +1,31 @@ +label = t('E-mail an order update notification'); + $rule->active = TRUE; + $rule->event('uc_order_status_email_update') + ->condition(rules_condition('data_is', array('data:select' => 'order:order-status', 'value' => 'in_checkout'))->negate()) + ->action('uc_order_email', array( + 'order:select' => 'order', + 'from' => uc_store_email_from(), + 'addresses' => '[uc_order:email]', + 'subject' => t('Order #[uc_order:order-id] Update'), + 'message' => uc_get_message('order_update_email'), + 'format' => filter_default_format(), + )); + + $configs['uc_order_update_email_customer'] = $rule; + + return $configs; +} + === modified file 'uc_order/uc_order.tokens.inc' --- uc_order/uc_order.tokens.inc 2010-04-05 19:24:56 +0000 +++ uc_order/uc_order.tokens.inc 2010-06-22 16:51:50 +0000 @@ -157,8 +157,12 @@ break; } - $values[$tokens['url']] = $url; - $values[$tokens['link']] = l($order->order_id, $url); + if (isset($tokens['url'])) { + $values[$tokens['url']] = $url; + } + if (isset($tokens['link'])) { + $values[$tokens['link']] = l($order->order_id, $url); + } break; case 'admin-url': @@ -170,8 +174,12 @@ break; } - $values[$tokens['admin-url']] = $admin_url; - $values[$tokens['admin-link']] = l($order->order_id, $admin_url); + if (isset($tokens['admin-url'])) { + $values[$tokens['admin-url']] = $admin_url; + } + if (isset($tokens['admin-link'])) { + $values[$tokens['admin-link']] = l($order->order_id, $admin_url); + } break; case 'subtotal': === modified file 'uc_stock/uc_stock.info' --- uc_stock/uc_stock.info 2010-04-05 19:55:02 +0000 +++ uc_stock/uc_stock.info 2010-06-22 18:05:23 +0000 @@ -1,7 +1,6 @@ ; $Id$ name = Stock description = Manage stock levels of your Ubercart products -dependencies[] = ca dependencies[] = uc_product dependencies[] = uc_reports dependencies[] = uc_store === modified file 'uc_stock/uc_stock.module' --- uc_stock/uc_stock.module 2010-04-13 13:27:26 +0000 +++ uc_stock/uc_stock.module 2010-06-22 18:05:23 +0000 @@ -14,8 +14,6 @@ * Development sponsored by the Ubercart project. http://www.ubercart.org */ -require_once('uc_stock.ca.inc'); - /****************************************************************************** * Hook Functions (Drupal) * ******************************************************************************/ @@ -148,6 +146,15 @@ return $messages; } +/** + * Implement hook_uc_order_product_delete(). + */ +function uc_stock_uc_order_product_delete($order_product_id) { + // Put back the stock. + $product = db_query("SELECT model, qty FROM {uc_order_products} WHERE order_product_id = :id", array(':id' => $order_product_id))->fetchObject(); + uc_stock_adjust($product->model, $product->qty); +} + /****************************************************************************** * Module and Helper Functions * ******************************************************************************/ === renamed file 'uc_stock/uc_stock.ca.inc' => 'uc_stock/uc_stock.rules.inc' --- uc_stock/uc_stock.ca.inc 2010-04-13 13:27:26 +0000 +++ uc_stock/uc_stock.rules.inc 2010-06-22 18:05:23 +0000 @@ -3,61 +3,32 @@ /** * @file - * This file contains all the Workflow-NG hooks that are neccesary for Workflow - * integeration with the uc_stock module + * Rules hooks for uc_stock.module. */ -/****************************************************************************** - * Conditional Action Hooks * - ******************************************************************************/ - /** - * Implement hook_ca_predicate(). + * Implement hook_rules_action_info(). */ -function uc_stock_ca_predicate() { - $predicates['uc_stock_decrement_on_order'] = array( - '#title' => t('Decrement stock upon order submission'), - '#trigger' => 'uc_checkout_complete', - '#class' => 'uc_stock', - '#status' => 1, - '#actions' => array( - array( - '#name' => 'uc_stock_action_decrement_stock', - '#title' => t('Decrement stock of products in order'), - '#argument_map' => array( - 'order' => 'order', - ), +function uc_stock_rules_action_info() { + $actions['uc_stock_action_decrement_stock'] = array( + 'label' => t('Decrement stock of products on the order with tracking activated.'), + 'group' => t('Stock'), + 'base' => 'uc_stock_action_decrement_stock', + 'parameter' => array( + 'order' => array( + 'type' => 'uc_order', + 'label' => t('Order'), ), ), ); - return $predicates; -} - -/** - * Implement hook_action(). - */ -function uc_stock_ca_action() { - $actions['uc_stock_action_decrement_stock'] = array( - '#title' => t('Decrement stock of products on the order with tracking activated.'), - '#callback' => 'uc_stock_action_decrement_stock', - '#arguments' => array( - 'order' => array('#entity' => 'uc_order', '#title' => t('Order')), - ), - '#category' => t('Stock'), - ); - return $actions; } -/****************************************************************************** - * Conditional Action Callbacks and Forms * - ******************************************************************************/ - /** * Decrease the stock of ordered products. */ -function uc_stock_action_decrement_stock($order, $settings) { +function uc_stock_action_decrement_stock($order) { if (is_array($order->products)) { array_walk($order->products, 'uc_stock_adjust_product_stock', $order); } === added file 'uc_stock/uc_stock.rules_defaults.inc' --- uc_stock/uc_stock.rules_defaults.inc 1970-01-01 00:00:00 +0000 +++ uc_stock/uc_stock.rules_defaults.inc 2010-06-22 18:05:23 +0000 @@ -0,0 +1,23 @@ +label = t('Decrement stock upon order submission'); + $rule->active = TRUE; + $rule->event('uc_checkout_complete'); + $rule->action('uc_stock_action_decrement_stock', array('order:select' => 'order')); + $configs['uc_stock_decrement_on_order'] = $rule; + + return $configs; +} + === modified file 'uc_store/uc_store.module' --- uc_store/uc_store.module 2010-06-11 19:31:18 +0000 +++ uc_store/uc_store.module 2010-06-11 20:14:33 +0000 @@ -68,10 +68,10 @@ public $street2 = ''; public $city = ''; public $zone = 0; - public $postal_code = 0; + public $postal_code = ''; public $country = 0; public $phone = ''; - public $emial = ''; + public $email = ''; function __construct() { } @@ -1289,6 +1289,19 @@ } /** + * Helper function to return zone options, grouped by country. + */ +function uc_zone_option_list() { + $result = db_query("SELECT z.*, c.country_name FROM {uc_zones} AS z LEFT JOIN {uc_countries} AS c ON z.zone_country_id = c.country_id ORDER BY c.country_name, z.zone_name"); + + foreach ($result as $zone) { + $options[$zone->country_name][$zone->zone_id] = $zone->zone_name; + } + + return $options; +} + +/** * Retrieve a country's name from the database, using its ID. * * @param $id @@ -1339,6 +1352,20 @@ return $select; } +function uc_country_option_list() { + $result = db_query("SELECT * FROM {uc_countries} WHERE version > :version ORDER BY :sort", array(':version' => 0, ':sort' => 'country_name')); + + $options = array(); + while ($country = $result->fetchAssoc()) { + $options[$country['country_id']] = $country['country_name']; + } + if (count($options) == 0) { + $options[] = t('No countries found.'); + } + + return $options; +} + /** * Create a day select box for a form. */ === modified file 'uc_taxes/uc_taxes.admin.inc' --- uc_taxes/uc_taxes.admin.inc 2010-03-24 13:11:48 +0000 +++ uc_taxes/uc_taxes.admin.inc 2010-06-10 19:18:33 +0000 @@ -12,7 +12,7 @@ function uc_taxes_admin_settings() { $rows = array(); - $header = array(t('Name'), t('Rate'), t('Taxed products'), t('Taxed product types'), t('Taxed line items'), t('Weight'), array('data' => t('Operations'), 'colspan' => 4)); + $header = array(t('Name'), t('Rate'), t('Taxed products'), t('Taxed product types'), t('Taxed line items'), t('Weight'), array('data' => t('Operations'), 'colspan' => 3)); // Loop through all the defined tax rates. foreach (uc_taxes_rate_load() as $rate_id => $rate) { @@ -27,7 +27,6 @@ implode(', ', $rate->taxed_line_items), $rate->weight, l(t('edit'), 'admin/store/settings/taxes/' . $rate_id . '/edit'), - l(t('conditions'), CA_UI_PATH . '/uc_taxes_' . $rate_id . '/edit/conditions'), l(t('clone'), 'admin/store/settings/taxes/' . $rate_id . '/clone'), l(t('delete'), 'admin/store/settings/taxes/' . $rate_id . '/delete'), ); @@ -35,7 +34,7 @@ // Let the user know if no tax rates are defined. if (empty($rows)) { - $rows[] = array(array('data' => t('No rates available.'), 'colspan' => 10)); + $rows[] = array(array('data' => t('No rates available.'), 'colspan' => 9)); } // Build the output including the table and a link to add a new rate. @@ -140,6 +139,11 @@ '#default_value' => $rate_id ? $rate->weight : 0, ); + if (module_exists('rules')) { + $conditions = rules_config_load('uc_taxes_' . $rate->id); + $conditions->form($form, $form_state); + } + $form['submit'] = array( '#type' => 'submit', '#value' => t('Submit'), @@ -184,11 +188,14 @@ ); uc_taxes_rate_save((object) $rate); - // Update the name of the associated predicate. - db_update('ca_predicates') - ->fields(array('title' => $rate['name'])) - ->condition('pid', 'uc_taxes_' . $rate['id']) - ->execute(); + // Update the name of the associated conditions. + if (module_exists('rules')) { + $conditions = rules_config_load('uc_taxes_' . $rate['id']); + if ($conditions) { + $conditions->label = $rate['name']; + $conditions->save(); + } + } // Display a message and redirect back to the overview. drupal_set_message(t('Tax rate %name saved.', array('%name' => $form_state['values']['name']))); @@ -211,10 +218,10 @@ // Save the new rate. $rate = uc_taxes_rate_save($rate); - // Clone the associated predicate as well. - if ($predicate = ca_load_predicate('uc_taxes_' . $rate_id)) { - $predicate['#pid'] = 'uc_taxes_' . $rate->id; - ca_save_predicate($predicate); + // Clone the associated conditions as well. + if ($conditions = rules_config_load('uc_taxes_' . $rate_id)) { + unset($conditions->id); + $conditions->save('uc_taxes_' . $rate->id); } // Display a message and redirect back to the overview. === modified file 'uc_taxes/uc_taxes.api.php' --- uc_taxes/uc_taxes.api.php 2010-03-16 21:15:17 +0000 +++ uc_taxes/uc_taxes.api.php 2010-06-09 19:05:00 +0000 @@ -20,17 +20,6 @@ * An array of tax line item objects keyed by a module-specific id. */ function hook_uc_calculate_tax($order) { - global $user; - if (is_numeric($order)) { - $order = uc_order_load($order); - $account = user_load(array('uid' => $order->uid)); - } - elseif ((int)$order->uid) { - $account = user_load(array('uid' => intval($order->uid))); - } - else { - $account = $user; - } if (!is_object($order)) { return array(); } @@ -54,25 +43,8 @@ $use_same_rates = FALSE; } - $arguments = array( - 'order' => array( - '#entity' => 'uc_order', - '#title' => t('Order'), - '#data' => $order, - ), - 'tax' => array( - '#entity' => 'tax', - '#title' => t('Tax rule'), - // #data => each $tax in the following foreach() loop; - ), - 'account' => array( - '#entity' => 'user', - '#title' => t('User'), - '#data' => $account, - ), - ); + $use_rules = module_exists('rules'); - $predicates = ca_load_trigger_predicates('calculate_taxes'); foreach (uc_taxes_rate_load() as $tax) { if ($use_same_rates) { foreach ((array)$order->line_items as $old_line) { @@ -83,9 +55,16 @@ } } - $arguments['tax']['#data'] = $tax; - if (ca_evaluate_conditions($predicates['uc_taxes_' . $tax->id], $arguments)) { - $line_item = uc_taxes_action_apply_tax($order, $tax); + if ($use_rules) { + $set = rules_config_load('uc_taxes_' . $tax->id); + $apply = $set->execute($order); + } + else { + $apply = TRUE; + } + + if ($apply) { + $line_item = uc_taxes_apply_tax($order, $tax); if ($line_item) { $order->taxes[$line_item->id] = $line_item; } === modified file 'uc_taxes/uc_taxes.info' --- uc_taxes/uc_taxes.info 2010-02-02 15:41:04 +0000 +++ uc_taxes/uc_taxes.info 2010-06-21 19:34:42 +0000 @@ -4,10 +4,10 @@ dependencies[] = uc_store dependencies[] = uc_payment dependencies[] = uc_product -dependencies[] = ca package = "Ubercart - core (optional)" core = 7.x files[] = uc_taxes.module files[] = uc_taxes.install files[] = uc_taxes.admin.inc files[] = uc_taxes.ca.inc +files[] = uc_taxes.rules_defaults.inc === modified file 'uc_taxes/uc_taxes.module' --- uc_taxes/uc_taxes.module 2010-06-03 19:26:32 +0000 +++ uc_taxes/uc_taxes.module 2010-06-21 19:34:42 +0000 @@ -8,27 +8,11 @@ * Allows tax rules to be set up and applied to orders. */ -require_once('uc_taxes.ca.inc'); - /****************************************************************************** * Drupal Hooks * ******************************************************************************/ /** - * Implement hook_help(). - */ -function uc_taxes_help($path, $arg) { - $output = ''; - - switch ($path) { - case 'admin/store/settings/taxes': - return t('Add tax rates through this page and then use the conditional actions interface to add conditions to the taxes that limit which orders they are applied to. Especially important are the geographic area conditions for the delivery address. Use the conditions link to jump to a particular tax rate conditions configuration page.', array('!url' => url(CA_UI_PATH))); - } - - return $output; -} - -/** * Implement hook_permission(). */ function uc_taxes_permission() { @@ -276,6 +260,10 @@ drupal_write_record('uc_taxes', $rate, array('id')); } + if (module_exists('rules')) { + rules_clear_cache(); + } + return $rate; } @@ -328,8 +316,10 @@ ->condition('id', $rate_id) ->execute(); - // Delete the associated predicated if it has been saved to the database. - ca_delete_predicate('uc_taxes_' . $rate_id); + // Delete the associated conditions if they have been saved to the database. + if (module_exists('rules')) { + rules_config_delete(array('uc_taxes_' . $rate_id)); + } } /** @@ -351,17 +341,6 @@ * Calculate the amount and types of taxes that apply to an order. */ function uc_taxes_uc_calculate_tax($order) { - global $user; - if (is_numeric($order)) { - $order = uc_order_load($order); - $account = user_load($order->uid); - } - elseif ((int)$order->uid) { - $account = user_load(intval($order->uid)); - } - else { - $account = $user; - } if (!is_object($order)) { return array(); } @@ -385,25 +364,8 @@ $use_same_rates = FALSE; } - $arguments = array( - 'order' => array( - '#entity' => 'uc_order', - '#title' => t('Order'), - '#data' => $order, - ), - 'tax' => array( - '#entity' => 'tax', - '#title' => t('Tax rule'), - // #data => each $tax in the following foreach() loop; - ), - 'account' => array( - '#entity' => 'user', - '#title' => t('User'), - '#data' => $account, - ), - ); + $use_rules = module_exists('rules'); - $predicates = ca_load_trigger_predicates('calculate_taxes'); foreach (uc_taxes_rate_load() as $tax) { if ($use_same_rates) { foreach ((array)$order->line_items as $old_line) { @@ -414,9 +376,16 @@ } } - $arguments['tax']['#data'] = $tax; - if (ca_evaluate_conditions($predicates['uc_taxes_' . $tax->id], $arguments)) { - $line_item = uc_taxes_action_apply_tax($order, $tax); + if ($use_rules) { + $set = rules_config_load('uc_taxes_' . $tax->id); + $apply = $set->execute($order); + } + else { + $apply = TRUE; + } + + if ($apply) { + $line_item = uc_taxes_apply_tax($order, $tax); if ($line_item) { $order->taxes[$line_item->id] = $line_item; } === renamed file 'uc_taxes/uc_taxes.ca.inc' => 'uc_taxes/uc_taxes.rules_defaults.inc' --- uc_taxes/uc_taxes.ca.inc 2010-03-16 21:15:17 +0000 +++ uc_taxes/uc_taxes.rules_defaults.inc 2010-06-10 19:17:11 +0000 @@ -3,109 +3,27 @@ /** * @file - * This file contains the Conditional Action hooks and functions necessary to - * make the tax related entity, conditions, events, and actions work. - */ - -/****************************************************************************** - * Conditional Action Hooks * - ******************************************************************************/ - -/** - * Implement hook_ca_entity(). - */ -function uc_taxes_ca_entity() { - $entities['tax'] = array( - '#title' => t('Tax rule'), - '#type' => 'object', - ); - return $entities; -} - -/** - * Implement hook_ca_trigger(). - * - * Register an event for each tax rule in {uc_taxes}. - */ -function uc_taxes_ca_trigger() { - $triggers = array(); - - $triggers['calculate_taxes'] = array( - '#title' => t('Calculate taxes'), - '#category' => t('Taxes'), - '#arguments' => array( - 'order' => array('#entity' => 'uc_order', '#title' => t('Order')), - 'tax' => array('#entity' => 'tax', '#title' => t('Tax rule')), - 'account' => array('#entity' => 'user', '#title' => t('User account')), - ), - ); - - return $triggers; -} - -/** - * Implement hook_action_info(). - */ -function uc_taxes_ca_action() { - $actions = array(); - - // Loop through all the defined tax rates. - foreach (uc_taxes_rate_load() as $rate) { - $actions['uc_taxes_action_apply_tax_' . $rate->id] = array( - '#title' => t('Apply !name', array('!name' => $rate->name)), - '#category' => t('Taxes'), - '#callback' => 'uc_taxes_action_apply_tax', - '#arguments' => array( - 'order' => array('#entity' => 'uc_order', '#title' => t('Order')), - 'tax' => array('#entity' => 'tax', '#title' => t('Tax')), - ), - ); - } - - return $actions; -} - -/** - * Action callback to calculate a tax. - * - * @param $order - * The order object being considered. - * @param $tax - * The tax rule calculating the amount. - * @return - * The line item array representing the amount of tax. - */ -function uc_taxes_action_apply_tax($order, $tax) { - return uc_taxes_apply_tax($order, $tax); -} - -/** - * Implement hook_ca_predicate(). - * - * Create a predicate for each event corresponding to a tax rule. - */ -function uc_taxes_ca_predicate() { - $predicates = array(); - - // Loop through all the defined tax rates. - foreach (uc_taxes_rate_load() as $rate) { - $predicates['uc_taxes_' . $rate->id] = array( - '#title' => $rate->name, - '#class' => 'taxes', - '#trigger' => 'calculate_taxes', - '#status' => 1, - '#actions' => array( - array( - '#name' => 'uc_taxes_action_apply_tax_' . $rate->id, - '#title' => t('Apply !name', array('!name' => $rate->name)), - '#argument_map' => array( - 'order' => 'order', - 'tax' => 'tax', - ), - ), - ), - ); - } - - return $predicates; + * This file contains the default Rules configurations that allow conditions to + * be applied to taxes. + */ + +/** + * Implement hook_default_rules_configuration(). + * + * Create a condition set for each tax rule. + */ +function uc_taxes_default_rules_configuration() { + $configs = array(); + + // Loop through all the defined tax rates. + foreach (uc_taxes_rate_load() as $rate) { + $set = rules_and(array( + 'order' => array('type' => 'uc_order', 'label' => 'Order'), + )); + $set->label = t('@name conditions', array('@name' => $rate->name)); + + $configs['uc_taxes_' . $rate->id] = $set; + } + + return $configs; } # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWbx4wOAAo8tfgH9Uf/f///// /76////+YKDe88Fejy497Po66NPGw1ALDunOQLZcA0AAG5yPj1yvH3YSdq+7l2zrs+d4bw6feA+h 5G99dpIffanQqugOj1th9dmAbPr4lL2YrdfXr0aHPMD575pfVaM2rWzEbj76r71PPurttan3M9tC lT2bszirnvnffSmqNgNWmNBfdeHuhewDRpRKz3jtcr2tts1VT4eY6eZ8+9z2UobYBo++O3b2DVEg DPdNy71xoB11Dnjd61QAmwbe8c8exZoU9tdtbvoSpAEqIBattPVHRpyu7w6aocu1rVRQ8Wu9RVXQ XUtxItxutaz1T1lFzz2tmpN3dZKO9Sd9rta+AB0PvvWON9mq7W64Hgn1N9waXnT0kDTzIPQ2iwYt GgAqQqWbRabRlgDNsoNibbWw1qlKKGsrYArI0MtDIalpr58eKeS9WpbFmg967c0XswtLCFtDAFrT WmopSHu3SlISiAACEITTTQJMmon6ho0m1GgGgAABkNNAlAEEBJQRqNqjaepPJAHqDQABoaAAAABp iBFFCBgRE9Ro9EBoGQAAAA9QPUAAJNJEIghPSI0M01MCps1Tyn6JHlGTaho0z0kaZANAeoESSBAE wQBMjEE00aE9ATJqZBgVHlNM1NMPVPKBUkITEARNEwRiNBGmlNlR+k2lAw9UGQyGQAyM4iidsVXr GCIKf81EZAnlCqgSIRFnlQCipGP8KUFjF9wye2CfKStMw4xU+9toLL+X8ocflw8Lpfo8/q2cb1x9 I39RtympbKNazPNw85rBQdsvZm7cDBOXb5y7rak5Y2eZt1U7rpTMzU/lCBA+6fj+pQPUXLn1L6h+ QDFigS89a+W5mQ6kBoLLUyFG7DfCg+PXVVKhgSmcIDFxnG4kwaQVydH1C0doJqwEnOfeGpFpQMo0 VYSmACkAUW5ArKMqY3MtbVV7aNua337Z/fuurS9pXUGDXEmAuFcAZEMiCAzJkpox9m2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