/[drupal]/contributions/modules/donation/donation.module
ViewVC logotype

Diff of /contributions/modules/donation/donation.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.5, Wed Jan 14 21:14:47 2009 UTC revision 1.1.2.6, Fri Jan 16 17:37:37 2009 UTC
# Line 27  define('DONATION_DONORS_TEXT', Line 27  define('DONATION_DONORS_TEXT',
27  define('DONATION_CURRENCY_OPTIONS',        'donation_currency_options');  define('DONATION_CURRENCY_OPTIONS',        'donation_currency_options');
28  define('DONATION_DONOR_USER_TEXT',         'donation_donor_user_text');  define('DONATION_DONOR_USER_TEXT',         'donation_donor_user_text');
29    
30  // Default texts  // Default strings
31    define('DONATION_EMAIL_DEFAULT',           'nowhere@example.com');
32  define('DONATION_THANKS_DEFAULT_TEXT',     'Thank you for your donation.');  define('DONATION_THANKS_DEFAULT_TEXT',     'Thank you for your donation.');
33  define('DONATION_DONOR_USER_DEFAULT_TEXT', 'If the user is registered on this site, enter his/her the Drupal uid.');  define('DONATION_DONOR_USER_DEFAULT_TEXT', 'If the user is registered on this site, enter his/her the Drupal uid.');
34  define('DONATION_TARGET_DEFAULT_TEXT',     'Donation to the Drupal Association');  define('DONATION_TARGET_DEFAULT_TEXT',     'Donation to the Drupal Association');
# Line 188  function donation_settings() { Line 189  function donation_settings() {
189    $form[DONATION_EMAIL] = array(    $form[DONATION_EMAIL] = array(
190      '#type' => 'textfield',      '#type' => 'textfield',
191      '#title' => t('Donations email address'),      '#title' => t('Donations email address'),
192      '#default_value' => variable_get(DONATION_EMAIL, 'donations@drupal.org'),      '#default_value' => variable_get(DONATION_EMAIL, DONATION_EMAIL_DEFAULT),
193      '#description' => t('Only donations to this email address are considered by this module.'),      '#description' => t('Only donations to this email address are considered by this module.'),
194    );    );
195    
# Line 419  function donation_import_submit($form_id Line 420  function donation_import_submit($form_id
420        $insurance_amount, $sales_tax, $opt_1_name, $opt_1_value, $opt_2_name, $opt_2_value, $auction_site,        $insurance_amount, $sales_tax, $opt_1_name, $opt_1_value, $opt_2_name, $opt_2_value, $auction_site,
421        $buyer_id, $item_url, $closing_date, $escrow_id, $invoice_id, $ref_txn_id, $invoice_number,        $buyer_id, $item_url, $closing_date, $escrow_id, $invoice_id, $ref_txn_id, $invoice_number,
422        $custom_number, $receipt_id, $contact_phone_number ) = explode('","', $line);        $custom_number, $receipt_id, $contact_phone_number ) = explode('","', $line);
423      if ($to_email == variable_get(DONATION_EMAIL, 'donations@drupal.org') && $name && $net) {      if ($to_email == variable_get(DONATION_EMAIL, DONATION_EMAIL_DEFAULT) && $name && $net) {
424        // We need to swap the day and month in Paypal's date format:        // We need to swap the day and month in Paypal's date format:
425        list($month, $day, $year) = explode('/', substr($date, 1), 3);        list($month, $day, $year) = explode('/', substr($date, 1), 3);
426    
# Line 515  function donation_ipn() { Line 516  function donation_ipn() {
516      return;      return;
517    }    }
518    
519    if ($_POST['business'] != variable_get(DONATION_EMAIL, 'donations@drupal.org')) {    if ($_POST['business'] != variable_get(DONATION_EMAIL, DONATION_EMAIL_DEFAULT)) {
520      // Payment is not for the email address configured      // Payment is not for the email address configured
521      return;      return;
522    }    }
# Line 569  function donation_form_build() { Line 570  function donation_form_build() {
570    $form['business'] = array(    $form['business'] = array(
571      '#type' => 'hidden',      '#type' => 'hidden',
572      '#name' => 'business',      '#name' => 'business',
573      '#value' => variable_get(DONATION_EMAIL, 'donations@drupal.org'));      '#value' => variable_get(DONATION_EMAIL, DONATION_EMAIL_DEFAULT));
574    $form['cmd'] = array(    $form['cmd'] = array(
575      '#type' => 'hidden',      '#type' => 'hidden',
576      '#value' => '_xclick',      '#value' => '_xclick',

Legend:
Removed from v.1.1.2.5  
changed lines
  Added in v.1.1.2.6

  ViewVC Help
Powered by ViewVC 1.1.2