Projet

Général

Profil

Révision dbb0c974

Ajouté par Assos Assos il y a plus de 9 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/colorbox/colorbox.info
6 6

  
7 7
files[] = views/colorbox_handler_field_colorbox.inc
8 8

  
9
; Information added by Drupal.org packaging script on 2014-06-25
10
version = "7.x-2.7"
9
; Information added by Drupal.org packaging script on 2014-09-12
10
version = "7.x-2.8"
11 11
core = "7.x"
12 12
project = "colorbox"
13
datestamp = "1403692729"
13
datestamp = "1410514129"
14 14

  
drupal7/sites/all/modules/colorbox/colorbox.module
82 82
    'download url' => 'https://github.com/jackmoore/colorbox/archive/1.x.zip',
83 83
    'version arguments' => array(
84 84
      'file' => 'jquery.colorbox-min.js',
85
      'pattern' => '@(?i:Colorbox) v([0-9\.a-z]+)@',
85
      'pattern' => '@(?i:Colorbox)\sv?([0-9\.a-z]+)@',
86 86
      'lines' => 5,
87 87
    ),
88 88
    'files' => array(
......
142 142
    return FALSE;
143 143
  }
144 144

  
145
  // Code from the block_list funtion in block.module.
145
  // Code from the block_list function in block.module.
146 146
  $path = drupal_get_path_alias($_GET['q']);
147 147
  $colorbox_pages = variable_get('colorbox_pages', "admin*\nimagebrowser*\nimg_assist*\nimce*\nnode/add/*\nnode/*/edit\nprint/*\nprintpdf/*\nsystem/ajax\nsystem/ajax/*");
148 148
  // Compare with the internal and path alias (if any).
......
178 178
      'slideshowSpeed' => variable_get('colorbox_slideshowspeed', 2500),
179 179
      'slideshowStart' => variable_get('colorbox_text_start', 'start slideshow'),
180 180
      'slideshowStop' => variable_get('colorbox_text_stop', 'stop slideshow'),
181
      'current' => variable_get('colorbox_text_current', '{current} of {total}'),
182
      'previous' => variable_get('colorbox_text_previous', '« Prev'),
183
      'next' => variable_get('colorbox_text_next', 'Next »'),
184
      'close' => variable_get('colorbox_text_close', 'Close'),
181
      'current' => strip_tags(variable_get('colorbox_text_current', '{current} of {total}')),
182
      'previous' => strip_tags(variable_get('colorbox_text_previous', '« Prev')),
183
      'next' => strip_tags(variable_get('colorbox_text_next', 'Next »')),
184
      'close' => strip_tags(variable_get('colorbox_text_close', 'Close')),
185 185
      'overlayClose' => variable_get('colorbox_overlayclose', 1) ? TRUE : FALSE,
186 186
      'maxWidth' => variable_get('colorbox_maxwidth', '98%'),
187 187
      'maxHeight' => variable_get('colorbox_maxheight', '98%'),
......
219 219

  
220 220
  // Add and initialise the Colorbox plugin.
221 221
  $variant = variable_get('colorbox_compression_type', 'minified');
222
  libraries_load('colorbox', $variant);
222
  if (module_exists('libraries')) {
223
    libraries_load('colorbox', $variant);
224
  }
223 225
  drupal_add_js($path . '/js/colorbox.js');
224 226

  
225 227
  // Add JS and CSS based on selected style.
......
347 349
    '#type' => 'select',
348 350
    '#default_value' => $settings['colorbox_caption'],
349 351
    '#options' => $caption,
350
    '#description' => t('Automatic will use the first none empty value of the title, the alt text and the content title.'),
352
    '#description' => t('Automatic will use the first non-empty value of the title, the alt text and the content title.'),
351 353
  );
352 354
  $element['colorbox_caption_custom'] = array(
353 355
    '#title' => t('Custom caption'),
drupal7/sites/all/modules/colorbox/colorbox.theme.inc
43 43
    $image['attributes'] = $item['attributes'];
44 44
  }
45 45

  
46
  // Allow image attributes to be overridden.
47
  if (isset($variables['item']['override']['attributes'])) {
48
    foreach (array('width', 'height', 'alt', 'title') as $key) {
49
      if (isset($variables['item']['override']['attributes'][$key])) {
50
        $image[$key] = $variables['item']['override']['attributes'][$key];
51
        unset($variables['item']['override']['attributes'][$key]);
52
      }
53
    }
54
    if (isset($image['attributes'])) {
55
      $image['attributes'] = $variables['item']['override']['attributes'] + $image['attributes'];
56
    }
57
    else {
58
      $image['attributes'] = $variables['item']['override']['attributes'];
59
    }
60
  }
61

  
46 62
  $entity_title = entity_label($entity_type, $entity);
47 63

  
48 64
  switch ($settings['colorbox_caption']) {
drupal7/sites/all/modules/commerce/commerce.info
12 12
; Central Entity Controller.
13 13
files[] = includes/commerce.controller.inc
14 14

  
15
; Information added by Drupal.org packaging script on 2014-03-05
16
version = "7.x-1.9"
15
; Information added by Drupal.org packaging script on 2014-09-10
16
version = "7.x-1.10"
17 17
core = "7.x"
18 18
project = "commerce"
19
datestamp = "1394061805"
19
datestamp = "1410366834"
20 20

  
drupal7/sites/all/modules/commerce/commerce_ui.info
4 4
dependencies[] = commerce
5 5
core = 7.x
6 6

  
7
; Information added by Drupal.org packaging script on 2014-03-05
8
version = "7.x-1.9"
7
; Information added by Drupal.org packaging script on 2014-09-10
8
version = "7.x-1.10"
9 9
core = "7.x"
10 10
project = "commerce"
11
datestamp = "1394061805"
11
datestamp = "1410366834"
12 12

  
drupal7/sites/all/modules/commerce/modules/cart/commerce_cart.info
21 21
; Simple tests
22 22
files[] = tests/commerce_cart.test
23 23

  
24
; Information added by Drupal.org packaging script on 2014-03-05
25
version = "7.x-1.9"
24
; Information added by Drupal.org packaging script on 2014-09-10
25
version = "7.x-1.10"
26 26
core = "7.x"
27 27
project = "commerce"
28
datestamp = "1394061805"
28
datestamp = "1410366834"
29 29

  
drupal7/sites/all/modules/commerce/modules/cart/commerce_cart.module
12 12
define('COMMERCE_CART_REFRESH_ALWAYS', 'always');
13 13
define('COMMERCE_CART_REFRESH_OWNER_ONLY', 'owner_only');
14 14
define('COMMERCE_CART_REFRESH_ACTIVE_CART_ONLY', 'active_cart_only');
15
define('COMMERCE_CART_REFRESH_DEFAULT_FREQUENCY', 15);
15 16

  
16 17
/**
17 18
 * Implements hook_menu().
......
106 107

  
107 108
  // Returns TRUE if the link is enabled via the order settings form and the
108 109
  // user has access to update the order.
109
  return variable_get('commerce_order_apply_pricing_rules_link', TRUE) && commerce_order_access('update', 3);
110
  return variable_get('commerce_order_apply_pricing_rules_link', TRUE) && commerce_order_access('update', $order);
110 111
}
111 112

  
112 113
/**
......
379 380
    '#type' => 'textfield',
380 381
    '#title' => t('Shopping cart refresh frequency'),
381 382
    '#description' => t('Shopping carts will only be refreshed if more than the specified number of seconds have passed since they were last refreshed.'),
382
    '#default_value' => variable_get('commerce_cart_refresh_frequency', 30),
383
    '#default_value' => variable_get('commerce_cart_refresh_frequency', COMMERCE_CART_REFRESH_DEFAULT_FREQUENCY),
383 384
    '#required' => TRUE,
384 385
    '#size' => 32,
385 386
    '#field_suffix' => t('seconds'),
......
663 664
        // Build the variables array to send to the cart block template.
664 665
        $variables = array(
665 666
          'order' => $order,
666
          'contents_view' => commerce_embed_view('commerce_cart_block', 'defaults', array($order->order_id), $_GET['q']),
667
          'contents_view' => commerce_embed_view('commerce_cart_block', 'default', array($order->order_id), $_GET['q']),
667 668
        );
668 669

  
669 670
        $content = theme('commerce_cart_block', $variables);
......
721 722
  }
722 723

  
723 724
  // Check to see if the last cart refresh happened long enough ago.
724
  $seconds = variable_get('commerce_cart_refresh_frequency', 15);
725
  $seconds = variable_get('commerce_cart_refresh_frequency', COMMERCE_CART_REFRESH_DEFAULT_FREQUENCY);
725 726

  
726 727
  if (!empty($seconds) && !empty($order->data['last_cart_refresh']) &&
727 728
    REQUEST_TIME - $order->data['last_cart_refresh'] < $seconds) {
drupal7/sites/all/modules/commerce/modules/checkout/commerce_checkout.info
12 12
; Simple tests
13 13
files[] = tests/commerce_checkout.test
14 14

  
15
; Information added by Drupal.org packaging script on 2014-03-05
16
version = "7.x-1.9"
15
; Information added by Drupal.org packaging script on 2014-09-10
16
version = "7.x-1.10"
17 17
core = "7.x"
18 18
project = "commerce"
19
datestamp = "1394061805"
19
datestamp = "1410366834"
20 20

  
drupal7/sites/all/modules/commerce/modules/checkout/commerce_checkout.install
101 101
  variable_set('enable_commerce_checkout_order_created_date_update', FALSE);
102 102
  return t('A new core checkout completion rule has been added that updates order creation timestamps to the time of checkout completion. It has been disabled by default to not interfere with existing order workflows, but you may enable it in your checkout settings if desired.');
103 103
}
104

  
105
/**
106
 * If the variable commerce_checkout_run_update_7103 is set, change all user
107
 * names that contain @ and look like an e-mail address to prevent the
108
 * disclosure of e-mail addresses to non-trusted users. Refer to the release
109
 * notes for Commerce 1.10 for instructions on how to set this variable.
110
 * Otherwise you are responsible to clean the usernames on your own.
111
 */
112
function commerce_checkout_update_7103(&$sandbox) {
113
  // Every site may not want to disrupt all their account usernames with this
114
  // update, so we require sites to set a variable explicitly to run the update.
115
  // Sites that do not must do their own handling of the security issue.
116
  if (!variable_get('commerce_checkout_run_update_7103', FALSE)) {
117
    return t('Skipped update 7103 because the variable commerce_checkout_run_update_7103 is not set. You must make sure usernames are not valid e-mail adresses on your own.');
118
  }
119

  
120
  if (!isset($sandbox['progress'])) {
121
    $sandbox['progress'] = 0;
122
    $sandbox['max'] = db_query("SELECT COUNT(*) FROM {users} WHERE name LIKE '%@%'")->fetchField();
123
  }
124

  
125
  // Update 100 user names at a time.
126
  $names = db_query("SELECT uid, name FROM {users} WHERE name LIKE '%@%' LIMIT 100")->fetchAllKeyed();
127
  $order = new stdClass();
128
  foreach ($names as $uid => $name) {
129
    $order->mail = $name;
130
    $new_name = commerce_order_get_properties($order, array(), 'mail_username');
131
    db_update('users')
132
      ->fields(array(
133
        'name' => $new_name,
134
      ))
135
      ->condition('uid', $uid)
136
      ->execute();
137
    $sandbox['progress']++;
138
  }
139

  
140
  $sandbox['#finished'] = empty($names) ? 1 : ($sandbox['progress'] / $sandbox['max']);
141

  
142
  return t('Usernames resembling e-mail addresses have been cleaned.');
143
}
drupal7/sites/all/modules/commerce/modules/checkout/commerce_checkout.module
108 108
function commerce_checkout_complete_form_access($order) {
109 109
  // Returns TRUE if the link is enabled via the order settings form and the
110 110
  // user has access to update the order.
111
  return variable_get('commerce_order_simulate_checkout_link', TRUE) && commerce_order_access('update', 3);
111
  return variable_get('commerce_order_simulate_checkout_link', TRUE) && commerce_order_access('update', $order);
112 112
}
113 113

  
114 114
/**
drupal7/sites/all/modules/commerce/modules/checkout/includes/commerce_checkout.pages.inc
90 90
    $form_errors = $form_state['storage']['errors'];
91 91
  }
92 92

  
93
  $form['#after_build'][] = 'commerce_checkout_form_process_errors';
94

  
93 95
  // Catch and clear already pushed messages.
94 96
  $previous_messages = drupal_get_messages();
95 97
  $show_errors_message = FALSE;
......
220 222
  return $form;
221 223
}
222 224

  
225
/**
226
 * After build callback for the checkout form.
227
 */
228
function commerce_checkout_form_process_errors($form, $form_state) {
229
  // Do this only on form rebuild (when the form will not be validated anymore):
230
  if (!empty($form_state['storage']['errors']) && !empty($form_state['rebuild'])) {
231
    foreach (array_keys($form_state['storage']['errors']) as $element_name) {
232
      // Look for all elements which have $element_name as parents, and
233
      // restore their #validated property (so _form_set_class() will set
234
      // the error class even though the rebuilt form is not validated).
235
      // We can't simply use drupal_array_get_nested_value(), since the #parents
236
      // property may have been changed and not match the form structure.
237
      _commerce_checkout_set_validated($form, $element_name);
238
    }
239
  }
240

  
241
  return $form;
242
}
243

  
244
/**
245
 * Set '#validated' on elements which have the specified parents.
246
 */
247
function _commerce_checkout_set_validated(&$element, $imploded_parents) {
248
  // Recurse to child elements if the current element is a container.
249
  foreach (element_children($element) as $key) {
250
    _commerce_checkout_set_validated($element[$key], $imploded_parents);
251
  }
252

  
253
  // This will also set #validated on all elements where #needs_validation would
254
  // be FALSE, but that doesn't hurt anything.
255
  if (!empty($element['#parents']) && strpos($imploded_parents, implode('][', $element['#parents'])) === 0) {
256
    $element['#validated'] = TRUE;
257
  }
258
}
259

  
223 260
/**
224 261
 * Validate handler for the continue button of the checkout form.
225 262
 *
drupal7/sites/all/modules/commerce/modules/customer/commerce_customer.info
21 21
; Simple tests
22 22
; files[] = tests/commerce_customer.test
23 23

  
24
; Information added by Drupal.org packaging script on 2014-03-05
25
version = "7.x-1.9"
24
; Information added by Drupal.org packaging script on 2014-09-10
25
version = "7.x-1.10"
26 26
core = "7.x"
27 27
project = "commerce"
28
datestamp = "1394061805"
28
datestamp = "1410366834"
29 29

  
drupal7/sites/all/modules/commerce/modules/customer/commerce_customer_ui.info
12 12
; Simple tests
13 13
files[] = tests/commerce_customer_ui.test
14 14

  
15
; Information added by Drupal.org packaging script on 2014-03-05
16
version = "7.x-1.9"
15
; Information added by Drupal.org packaging script on 2014-09-10
16
version = "7.x-1.10"
17 17
core = "7.x"
18 18
project = "commerce"
19
datestamp = "1394061805"
19
datestamp = "1410366834"
20 20

  
drupal7/sites/all/modules/commerce/modules/customer/tests/commerce_customer_profile_dummy_type.info
5 5
core = 7.x
6 6
hidden = TRUE
7 7

  
8
; Information added by Drupal.org packaging script on 2014-03-05
9
version = "7.x-1.9"
8
; Information added by Drupal.org packaging script on 2014-09-10
9
version = "7.x-1.10"
10 10
core = "7.x"
11 11
project = "commerce"
12
datestamp = "1394061805"
12
datestamp = "1410366834"
13 13

  
drupal7/sites/all/modules/commerce/modules/line_item/commerce_line_item.info
22 22
; Simple tests
23 23
; files[] = tests/commerce_line_item.test
24 24

  
25
; Information added by Drupal.org packaging script on 2014-03-05
26
version = "7.x-1.9"
25
; Information added by Drupal.org packaging script on 2014-09-10
26
version = "7.x-1.10"
27 27
core = "7.x"
28 28
project = "commerce"
29
datestamp = "1394061805"
29
datestamp = "1410366834"
30 30

  
drupal7/sites/all/modules/commerce/modules/line_item/commerce_line_item_ui.info
9 9
core = 7.x
10 10
configure = admin/commerce/config/line-items
11 11

  
12
; Information added by Drupal.org packaging script on 2014-03-05
13
version = "7.x-1.9"
12
; Information added by Drupal.org packaging script on 2014-09-10
13
version = "7.x-1.10"
14 14
core = "7.x"
15 15
project = "commerce"
16
datestamp = "1394061805"
16
datestamp = "1410366834"
17 17

  
drupal7/sites/all/modules/commerce/modules/order/commerce_order.info
36 36
files[] = tests/commerce_order.rules.test
37 37
files[] = tests/commerce_order.test
38 38

  
39
; Information added by Drupal.org packaging script on 2014-03-05
40
version = "7.x-1.9"
39
; Information added by Drupal.org packaging script on 2014-09-10
40
version = "7.x-1.10"
41 41
core = "7.x"
42 42
project = "commerce"
43
datestamp = "1394061805"
43
datestamp = "1410366834"
44 44

  
drupal7/sites/all/modules/commerce/modules/order/commerce_order.module
1398 1398
      // We also limit the username to the maximum length for usernames.
1399 1399
      // @see user_validate_name()
1400 1400
      $username = preg_replace('/[^\x{80}-\x{F7} a-z0-9@_.\'-]/i', '-', trim($order->mail));
1401
      // Remove the e-mail host name so usernames are not valid email adresses.
1402
      // Since usernames are considered public information in Drupal, we must
1403
      // not leak e-mail adresses through usernames.
1404
      $username = preg_replace('/@.*$/', '', $username);
1401 1405
      $username = substr($username, 0, USERNAME_MAX_LENGTH);
1402 1406
      return commerce_order_unique_username($username);
1403 1407
  }
drupal7/sites/all/modules/commerce/modules/order/commerce_order_ui.info
16 16
; Simple tests
17 17
files[] = tests/commerce_order_ui.test
18 18

  
19
; Information added by Drupal.org packaging script on 2014-03-05
20
version = "7.x-1.9"
19
; Information added by Drupal.org packaging script on 2014-09-10
20
version = "7.x-1.10"
21 21
core = "7.x"
22 22
project = "commerce"
23
datestamp = "1394061805"
23
datestamp = "1410366834"
24 24

  
drupal7/sites/all/modules/commerce/modules/order/commerce_order_ui.module
63 63
    'page callback' => 'commerce_order_ui_order_delete_form_wrapper',
64 64
    'page arguments' => array(3),
65 65
    'access callback' => 'commerce_order_access',
66
    'access arguments' => array('update', 3),
66
    'access arguments' => array('delete', 3),
67 67
    'type' => MENU_LOCAL_TASK,
68 68
    'weight' => 20,
69 69
    'context' => MENU_CONTEXT_INLINE,
drupal7/sites/all/modules/commerce/modules/order/includes/commerce_order.forms.inc
294 294
  foreach (entity_metadata_wrapper('commerce_order', $order)->commerce_line_items as $delta => $line_item_wrapper) {
295 295
    if ($line_item_wrapper->order_id->value() == 0) {
296 296
      $line_item_wrapper->order_id = $order->order_id;
297
      $line_item_wrapper->save();
297
      commerce_line_item_save($line_item_wrapper->value());
298 298
    }
299 299
  }
300 300
}
drupal7/sites/all/modules/commerce/modules/payment/commerce_payment.info
30 30
files[] = tests/commerce_payment.rules.test
31 31
;files[] = tests/commerce_payment.test
32 32

  
33
; Information added by Drupal.org packaging script on 2014-03-05
34
version = "7.x-1.9"
33
; Information added by Drupal.org packaging script on 2014-09-10
34
version = "7.x-1.10"
35 35
core = "7.x"
36 36
project = "commerce"
37
datestamp = "1394061805"
37
datestamp = "1410366834"
38 38

  
drupal7/sites/all/modules/commerce/modules/payment/commerce_payment.module
454 454
      // Check the order balance and invoke the event.
455 455
      $balance = commerce_payment_order_balance($order);
456 456

  
457
      if ($balance['amount'] <= 0) {
457
      if (!empty($balance) && $balance['amount'] <= 0) {
458 458
        // Invoke the event including a hook of the same name.
459 459
        rules_invoke_all('commerce_payment_order_paid_in_full', $order, $transaction);
460 460

  
drupal7/sites/all/modules/commerce/modules/payment/commerce_payment_ui.info
12 12
; Simple tests
13 13
files[] = tests/commerce_payment_ui.test
14 14

  
15
; Information added by Drupal.org packaging script on 2014-03-05
16
version = "7.x-1.9"
15
; Information added by Drupal.org packaging script on 2014-09-10
16
version = "7.x-1.10"
17 17
core = "7.x"
18 18
project = "commerce"
19
datestamp = "1394061805"
19
datestamp = "1410366834"
20 20

  
drupal7/sites/all/modules/commerce/modules/payment/includes/commerce_payment.checkout_pane.inc
5 5
 * Callback functions for the Payment module's checkout panes.
6 6
 */
7 7

  
8
// Constants that govern the behavior of the payment method checkout pane when
9
// no payment methods are enabled for an order.
10
define('COMMERCE_PAYMENT_PANE_NO_METHOD_EMPTY', 'empty');
11
define('COMMERCE_PAYMENT_PANE_NO_METHOD_EMPTY_EVENT', 'empty_event');
12
define('COMMERCE_PAYMENT_PANE_NO_METHOD_MESSAGE', 'message');
13
define('COMMERCE_PAYMENT_PANE_NO_METHOD_MESSAGE_EVENT', 'message_event');
14

  
15

  
8 16
/**
9 17
 * Checkout pane callback: returns the payment pane's settings form.
10 18
 */
......
16 24
    '#title' => t('Require a payment method at all times, preventing checkout if none is available.'),
17 25
    '#default_value' => variable_get('commerce_payment_pane_require_method', FALSE),
18 26
  );
27
  $form['commerce_payment_pane_no_method_behavior'] = array(
28
    '#type' => 'radios',
29
    '#title' => t('Checkout pane behavior when no payment methods are enabled for an order'),
30
    '#description' => t('Note: regardless of your selection, no payment transaction will be created for the order upon checkout completion as they represent actual financial transactions.'),
31
    '#options' => array(
32
      COMMERCE_PAYMENT_PANE_NO_METHOD_EMPTY => t('Leave the payment checkout pane empty.'),
33
      COMMERCE_PAYMENT_PANE_NO_METHOD_EMPTY_EVENT => t('Leave the payment checkout pane empty and trigger <em>When an order is first paid in full</em> on submission of free orders.'),
34
      COMMERCE_PAYMENT_PANE_NO_METHOD_MESSAGE => t('Display a message in the pane indicating payment is not required for the order.'),
35
      COMMERCE_PAYMENT_PANE_NO_METHOD_MESSAGE_EVENT => t('Display a message in the pane indicating payment is not required and trigger <em>When an order is first paid in full</em> on submission of free orders.'),
36
    ),
37
    '#default_value' => variable_get('commerce_payment_pane_no_method_behavior', COMMERCE_PAYMENT_PANE_NO_METHOD_MESSAGE),
38
    '#states' => array(
39
      'visible' => array(
40
        ':input[name="commerce_payment_pane_require_method"]' => array('checked' => FALSE),
41
      ),
42
    ),
43
  );
19 44

  
20 45
  return $form;
21 46
}
......
50 75
  // If no payment methods were found, return the empty form.
51 76
  if (empty($options)) {
52 77
    if (!variable_get('commerce_payment_pane_require_method', FALSE)) {
78
      $behavior = variable_get('commerce_payment_pane_no_method_behavior', COMMERCE_PAYMENT_PANE_NO_METHOD_MESSAGE);
79

  
80
      switch ($behavior) {
81
        case COMMERCE_PAYMENT_PANE_NO_METHOD_MESSAGE:
82
        case COMMERCE_PAYMENT_PANE_NO_METHOD_MESSAGE_EVENT:
83
          $pane_form['message'] = array(
84
            '#markup' => '<div>' . t('Payment is not required to complete your order.') . '</div>',
85
          );
86
          break;
87

  
88
        case COMMERCE_PAYMENT_PANE_NO_METHOD_EMPTY:
89
        case COMMERCE_PAYMENT_PANE_NO_METHOD_EMPTY_EVENT:
90
        default:
91
          break;
92
      }
93

  
53 94
      return $pane_form;
54 95
    }
55 96
    else {
......
224 265
      }
225 266
    }
226 267
  }
268
  else {
269
    // If there were no payment methods on the form, check to see if the pane is
270
    // configured to trigger "When an order is first paid in full" on submission
271
    // for free orders.
272
    $behavior = variable_get('commerce_payment_pane_no_method_behavior', COMMERCE_PAYMENT_PANE_NO_METHOD_MESSAGE);
273

  
274
    if (in_array($behavior, array(COMMERCE_PAYMENT_PANE_NO_METHOD_EMPTY_EVENT, COMMERCE_PAYMENT_PANE_NO_METHOD_MESSAGE_EVENT))) {
275
      // Check the balance of the order.
276
      $balance = commerce_payment_order_balance($order);
277

  
278
      if (!empty($balance) && $balance['amount'] <= 0) {
279
        // Trigger the event now for free orders, simulating payment being
280
        // submitted on pane submission that brings the balance to 0. Use an
281
        // empty transaction, as we wouldn't typically save a transaction where
282
        // a financial transaction has not actually occurred.
283
        rules_invoke_all('commerce_payment_order_paid_in_full', $order, commerce_payment_transaction_new('', $order->order_id));
284

  
285
        // Update the order's data array to indicate this just happened.
286
        $order->data['commerce_payment_order_paid_in_full_invoked'] = TRUE;
287
      }
288
    }
289
  }
227 290
}
228 291

  
229 292
/**
drupal7/sites/all/modules/commerce/modules/payment/modules/commerce_payment_example.info
5 5
dependencies[] = commerce_payment
6 6
core = 7.x
7 7

  
8
; Information added by Drupal.org packaging script on 2014-03-05
9
version = "7.x-1.9"
8
; Information added by Drupal.org packaging script on 2014-09-10
9
version = "7.x-1.10"
10 10
core = "7.x"
11 11
project = "commerce"
12
datestamp = "1394061805"
12
datestamp = "1410366834"
13 13

  
drupal7/sites/all/modules/commerce/modules/payment/modules/commerce_payment_example.module
98 98
  );
99 99

  
100 100
  commerce_payment_transaction_save($transaction);
101
  return $transaction;
101 102
}
drupal7/sites/all/modules/commerce/modules/payment/tests/commerce_payment_dummy_offsite.info
5 5
core = 7.x
6 6
hidden = TRUE
7 7

  
8
; Information added by Drupal.org packaging script on 2014-03-05
9
version = "7.x-1.9"
8
; Information added by Drupal.org packaging script on 2014-09-10
9
version = "7.x-1.10"
10 10
core = "7.x"
11 11
project = "commerce"
12
datestamp = "1394061805"
12
datestamp = "1410366834"
13 13

  
drupal7/sites/all/modules/commerce/modules/price/commerce_price.info
11 11
files[] = includes/views/handlers/commerce_price_handler_field_commerce_price.inc
12 12
files[] = includes/views/handlers/commerce_price_handler_filter_commerce_price_amount.inc
13 13

  
14
; Information added by Drupal.org packaging script on 2014-03-05
15
version = "7.x-1.9"
14
; Information added by Drupal.org packaging script on 2014-09-10
15
version = "7.x-1.10"
16 16
core = "7.x"
17 17
project = "commerce"
18
datestamp = "1394061805"
18
datestamp = "1410366834"
19 19

  
drupal7/sites/all/modules/commerce/modules/price/commerce_price.module
149 149
      // Serialize data arrays before saving.
150 150
      foreach ($items as $delta => $item) {
151 151
        // Serialize an existing data array.
152
        if (!empty($item['data']) && is_array($item['data'])) {
152
        if (isset($item['data']) && is_array($item['data'])) {
153 153
          $entity->{$field_name}[$langcode][$delta]['data'] = serialize($item['data']);
154 154
        }
155 155
      }
drupal7/sites/all/modules/commerce/modules/product/commerce_product.info
25 25
; Simple tests
26 26
files[] = tests/commerce_product.test
27 27

  
28
; Information added by Drupal.org packaging script on 2014-03-05
29
version = "7.x-1.9"
28
; Information added by Drupal.org packaging script on 2014-09-10
29
version = "7.x-1.10"
30 30
core = "7.x"
31 31
project = "commerce"
32
datestamp = "1394061805"
32
datestamp = "1410366834"
33 33

  
drupal7/sites/all/modules/commerce/modules/product/commerce_product.module
832 832
 * Returns an array of products matching the specific parameters.
833 833
 */
834 834
function _commerce_product_match_products_standard($instance, $string = '', $match = 'contains', $ids = array(), $limit = NULL, $access_tag = FALSE) {
835
  // Build the query object with the necessary fields.
836
  $query = db_select('commerce_product', 'cp');
835
  $query = new EntityFieldQuery;
836

  
837
  $query->entityCondition('entity_type', 'commerce_product');
837 838

  
838 839
  // Add the access control tag if specified.
839 840
  if ($access_tag) {
......
843 844
  // Add a global query tag so anyone can alter this query.
844 845
  $query->addTag('commerce_product_match');
845 846

  
846
  $product_id_alias = $query->addField('cp', 'product_id');
847
  $product_sku_alias = $query->addField('cp', 'sku');
848
  $product_title_alias = $query->addField('cp', 'title');
849
  $product_type_alias = $query->addField('cp', 'type');
850

  
851 847
  // Add a condition to the query to filter by matching product types.
852 848
  if (!empty($instance['settings']['referenceable_types'])) {
853 849
    $types = array_diff(array_values($instance['settings']['referenceable_types']), array(0, NULL));
854 850

  
855 851
    // Only filter by type if some types have been specified.
856 852
    if (!empty($types)) {
857
      $query->condition('cp.type', $types, 'IN');
853
      $query->propertyCondition('type', $types, 'IN');
858 854
    }
859 855
  }
860 856

  
861 857
  if ($string !== '') {
862
    $args = array();
863

  
864
    // Build a where clause matching on either the SKU or title.
865
    switch ($match) {
866
      case 'contains':
867
        $where = '(cp.sku LIKE :sku_match OR cp.title LIKE :title_match)';
868
        $args['sku_match'] = '%' . $string . '%';
869
        $args['title_match'] = '%' . $string . '%';
870
        break;
871

  
872
      case 'starts_with':
873
        $where = '(cp.sku LIKE :sku_match OR cp.title LIKE :title_match)';
874
        $args['sku_match'] = $string . '%';
875
        $args['title_match'] = $string . '%';
876
        break;
858
    // EntityFieldQuery cannot do OR clauses, so we use hook_query_TAG_alter.
859
    $query->addTag('commerce_sku_or_title_match');
877 860

  
878
      case 'equals':
879
      default:
880
        $where = '(cp.sku = :sku_match OR cp.title = :title_match)';
881
        $args['sku_match'] = $string;
882
        $args['title_match'] = $string;
883
        break;
884
    }
861
    $sku_title_meta = new stdClass();
862
    $sku_title_meta->properties = array(
863
      'sku',
864
      'title',
865
    );
866
    $sku_title_meta->string = $string;
867
    $sku_title_meta->match = $match;
885 868

  
886
    $query->where($where, $args);
869
    $query->addMetaData('commerce_sku_or_title_match', $sku_title_meta);
887 870
  }
888 871
  elseif ($ids) {
889 872
    // Otherwise add a product_id specific condition if specified.
890
    $query->condition($product_id_alias, $ids, 'IN', $ids);
873
    $query->propertyCondition('product_id', $ids, 'IN');
891 874
  }
892 875

  
893 876
  // Order the results by SKU, title, and then product type.
894 877
  $query
895
    ->orderBy($product_sku_alias)
896
    ->orderBy($product_title_alias)
897
    ->orderBy($product_type_alias);
878
    ->propertyOrderBy('sku')
879
    ->propertyOrderBy('title')
880
    ->propertyOrderBy('type');
898 881

  
899 882
  // Add a limit if specified.
900 883
  if ($limit) {
901 884
    $query->range(0, $limit);
902 885
  }
903 886

  
904
  // Execute the query and build the results array.
905
  $result = $query->execute();
887
  $entities = $query->execute();
906 888

  
907 889
  $matches = array();
908 890

  
909
  foreach ($result->fetchAll() as $product) {
910
    $matches[$product->product_id] = array(
911
      'sku' => $product->sku,
912
      'type' => $product->type,
913
      'title' => $product->title,
914
      'rendered' => t('@sku: @title', array('@sku' => $product->sku, '@title' => $product->title)),
915
    );
891
  if (isset($entities['commerce_product'])) {
892
    $pids = array_keys($entities['commerce_product']);
893

  
894
    // EntityFieldQuery doesn't return sku and title, so we have to load again.
895
    $products = commerce_product_load_multiple($pids);
896
    foreach ($products AS $product) {
897
      $matches[$product->product_id] = array(
898
        'sku' => $product->sku,
899
        'type' => $product->type,
900
        'title' => $product->title,
901
        'rendered' => t('@sku: @title', array('@sku' => $product->sku, '@title' => $product->title)),
902
      );
903
    }
916 904
  }
917 905

  
918 906
  return $matches;
919 907
}
920 908

  
909
/**
910
 * Implements hook_query_TAG_alter.
911
 *
912
 * EntityFieldQuery used in _commerce_product_match_products_standard() does not
913
 * allow OR clauses. Alter the SQL query to string match on sku OR title.
914
 *
915
 * @param QueryAlterableInterface $query
916
 */
917
function commerce_product_query_commerce_sku_or_title_match_alter(QueryAlterableInterface $query) {
918
  $string = $query->alterMetaData['commerce_sku_or_title_match']->string;
919
  $match = $query->alterMetaData['commerce_sku_or_title_match']->match;
920

  
921
  if (isset($string, $match)) {
922
    // Build a where clause matching on either the SKU or title.
923
    switch ($match) {
924
      case 'contains':
925
        $or = db_or()->condition('sku', '%' . $string . '%', 'LIKE')
926
          ->condition('title', '%' . $string . '%', 'LIKE');
927
        break;
928

  
929
      case 'starts_with':
930
        $or = db_or()->condition('sku', $string . '%', 'LIKE')
931
          ->condition('title', $string . '%', 'LIKE');
932
        break;
933

  
934
      case 'equals':
935
      default:
936
        $or = db_or()->condition('sku', $string, '=')
937
          ->condition('title', $string, '=');
938
        break;
939
    }
940

  
941
    $query->condition($or);
942
  }
943
}
944

  
921 945
/**
922 946
 * Access callback: determines access to a product's translation tab.
923 947
 */
drupal7/sites/all/modules/commerce/modules/product/commerce_product_ui.info
12 12
; Simple tests
13 13
files[] = tests/commerce_product_ui.test
14 14

  
15
; Information added by Drupal.org packaging script on 2014-03-05
16
version = "7.x-1.9"
15
; Information added by Drupal.org packaging script on 2014-09-10
16
version = "7.x-1.10"
17 17
core = "7.x"
18 18
project = "commerce"
19
datestamp = "1394061805"
19
datestamp = "1410366834"
20 20

  
drupal7/sites/all/modules/commerce/modules/product/commerce_product_ui.module
56 56
    'page callback' => 'commerce_product_ui_product_delete_form_wrapper',
57 57
    'page arguments' => array(3),
58 58
    'access callback' => 'commerce_product_access',
59
    'access arguments' => array('update', 3),
59
    'access arguments' => array('delete', 3),
60 60
    'type' => MENU_LOCAL_TASK,
61 61
    'weight' => 20,
62 62
    'context' => MENU_CONTEXT_INLINE,
drupal7/sites/all/modules/commerce/modules/product/tests/commerce_product_crud_test.info
6 6
core = 7.x
7 7
hidden = TRUE
8 8

  
9
; Information added by Drupal.org packaging script on 2014-03-05
10
version = "7.x-1.9"
9
; Information added by Drupal.org packaging script on 2014-09-10
10
version = "7.x-1.10"
11 11
core = "7.x"
12 12
project = "commerce"
13
datestamp = "1394061805"
13
datestamp = "1410366834"
14 14

  
drupal7/sites/all/modules/commerce/modules/product_pricing/commerce_product_pricing.info
6 6
dependencies[] = commerce_product_reference
7 7
dependencies[] = entity
8 8
dependencies[] = rules
9
dependencies[] = rules_admin
10 9
core = 7.x
11 10

  
12
; Information added by Drupal.org packaging script on 2014-03-05
13
version = "7.x-1.9"
11
; Information added by Drupal.org packaging script on 2014-09-10
12
version = "7.x-1.10"
14 13
core = "7.x"
15 14
project = "commerce"
16
datestamp = "1394061805"
15
datestamp = "1410366834"
17 16

  
drupal7/sites/all/modules/commerce/modules/product_pricing/commerce_product_pricing_ui.info
10 10
core = 7.x
11 11
configure = admin/commerce/config/product-pricing
12 12

  
13
; Information added by Drupal.org packaging script on 2014-03-05
14
version = "7.x-1.9"
13
; Information added by Drupal.org packaging script on 2014-09-10
14
version = "7.x-1.10"
15 15
core = "7.x"
16 16
project = "commerce"
17
datestamp = "1394061805"
17
datestamp = "1410366834"
18 18

  
drupal7/sites/all/modules/commerce/modules/product_reference/commerce_product_reference.info
17 17
; Simple tests
18 18
files[] = tests/commerce_product_reference.test
19 19

  
20
; Information added by Drupal.org packaging script on 2014-03-05
21
version = "7.x-1.9"
20
; Information added by Drupal.org packaging script on 2014-09-10
21
version = "7.x-1.10"
22 22
core = "7.x"
23 23
project = "commerce"
24
datestamp = "1394061805"
24
datestamp = "1410366834"
25 25

  
drupal7/sites/all/modules/commerce/modules/tax/commerce_tax.info
12 12
; Simple tests
13 13
;files[] = tests/commerce_tax.test
14 14

  
15
; Information added by Drupal.org packaging script on 2014-03-05
16
version = "7.x-1.9"
15
; Information added by Drupal.org packaging script on 2014-09-10
16
version = "7.x-1.10"
17 17
core = "7.x"
18 18
project = "commerce"
19
datestamp = "1394061805"
19
datestamp = "1410366834"
20 20

  
drupal7/sites/all/modules/commerce/modules/tax/commerce_tax_ui.info
10 10
; Simple tests
11 11
files[] = tests/commerce_tax_ui.test
12 12

  
13
; Information added by Drupal.org packaging script on 2014-03-05
14
version = "7.x-1.9"
13
; Information added by Drupal.org packaging script on 2014-09-10
14
version = "7.x-1.10"
15 15
core = "7.x"
16 16
project = "commerce"
17
datestamp = "1394061805"
17
datestamp = "1410366834"
18 18

  

Formats disponibles : Unified diff