? uc_fedex.5to6.diff.txt Index: uc_fedex.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/uc_fedex/uc_fedex.info,v retrieving revision 1.1 diff -u -F^f -r1.1 uc_fedex.info --- uc_fedex.info 18 Feb 2009 01:23:23 -0000 1.1 +++ uc_fedex.info 1 Mar 2009 20:56:02 -0000 @@ -1,5 +1,7 @@ -; $Id: uc_fedex.info,v 1.1 2009/02/18 01:23:23 tr Exp $ +; $Id: uc_fedex.info,v Exp $ name = FedEx description = Integration of FedEx Web Services API with Ubercart. -dependencies = uc_quote uc_store workflow_ng +dependencies[] = uc_quote package = Ubercart - fulfillment +core = 6.x +php = 5.0 Index: uc_fedex.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/uc_fedex/uc_fedex.module,v retrieving revision 1.1 diff -u -F^f -r1.1 uc_fedex.module --- uc_fedex.module 18 Feb 2009 01:23:23 -0000 1.1 +++ uc_fedex.module 1 Mar 2009 20:56:02 -0000 @@ -42,51 +42,48 @@ function uc_fedex_menu($may_cache) { $items = array(); - if ($may_cache) { - $items[] = array( - 'path' => 'admin/store/settings/quotes/methods/fedex', - 'title' => t('FedEx'), - 'access' => user_access('configure quotes'), - 'callback' => 'drupal_get_form', - 'callback arguments' => 'uc_fedex_admin_settings', - 'type' => MENU_LOCAL_TASK, - ); - } + $items['admin/store/settings/quotes/methods/fedex'] = array( + 'title' => t('FedEx'), + 'access arguments' => array('configure quotes'), + 'page callback' => 'drupal_get_form', + 'page arguments' => array('uc_fedex_admin_settings'), + 'type' => MENU_LOCAL_TASK, + ); return $items; } /****************************************************************************** - * Workflow-ng Hooks * + * Conditional Action Hooks * ******************************************************************************/ /** - * Implementation of hook_configuration(). + * Implementation of hook_ca_predicate(). * - * Connect FedEx quote action and event. - * - * @return Workflow_ng configuration array + * Connect the quote action with the quote event. */ -function uc_fedex_configuration() { - $enabled = variable_get('uc_quote_enabled', array('fedex' => true)); - - $configurations = array( - 'uc_fedex_get_quote' => array( - '#label' => t('Shipping quote from FedEx'), - '#event' => 'get_quote_from_fedex', - '#module' => 'uc_fedex', - '#active' => $enabled['fedex'], - ), +function uc_fedex_ca_predicate() { + $enabled = variable_get('uc_quote_enabled', array('fedex' => TRUE)); + $predicates = array(); + + $predicates['uc_fedex_get_quote'] = array( + '#title' => t('Shipping quote from FedEx'), + '#trigger' => 'get_quote_from_fedex', + '#class' => 'uc_fedex', + '#status' => $enabled['fedex'], + '#actions' => array( + '#name' => 'uc_quote_action_get_quote', + '#title' => ('Fetch a FedEx shipping quote'), + '#argument_map' => array( + 'order' => 'order', + 'method' => 'method' + ) + ) ); - - $action = workflow_ng_use_action('uc_quote_action_get_quote', array( - '#label' => t('Fetch a shipping quote'), - )); - $configurations['uc_fedex_get_quote'] = workflow_ng_configure($configurations['uc_fedex_get_quote'], $action); - - return $configurations; + + return $predicates; } @@ -370,11 +367,11 @@ function uc_fedex_admin_settings() { * @param form_value Values entered into form * @param form Form itself */ -function uc_fedex_admin_settings_validate($form_id, $form_values, $form) { +function uc_fedex_admin_settings_validate($form, &$form_state) { $old_password = variable_get('uc_fedex_user_credential_password', ''); - if (!$form_values['uc_fedex_user_credential_password']) { + if (!$form_state['values']['uc_fedex_user_credential_password']) { if ($old_password) { - form_set_value($form['uc_fedex_user_credential_password'], $old_password); + form_set_value($form_state['values']['uc_fedex_user_credential_password'], $old_password); } else { form_set_error('uc_fedex_user_credential_password', t('Password field is required.')); @@ -567,9 +564,9 @@ function uc_fedex_rate_request($packages $request['RateRequestTypes'] = strtoupper(variable_get('uc_fedex_quote_type', 'list')); // Need to allow admin to configure special services - $request['SpecialServicesRequested'] = array( - 'SpecialServiceTypes' => 'WEEKDAY_DELIVERY', - ); + //$request['SpecialServicesRequested'] = array( + //'SpecialServiceTypes' => 'WEEKDAY_DELIVERY', + //); // Need to iterate over $packages to account for multi-package // shipments. Right now everything is assumed to be one package. @@ -604,9 +601,9 @@ function uc_fedex_rate_request($packages 'Height' => '14', 'Units' => 'IN', // valid code IN and CM ), - 'SpecialServicesRequested' => array( - 'SpecialServiceTypes' => 'WEEKDAY_DELIVERY', - ) + //'SpecialServicesRequested' => array( + //'SpecialServiceTypes' => 'WEEKDAY_DELIVERY', + //) ) ); }