Plugin Directory

Changeset 676040


Ignore:
Timestamp:
03/04/2013 01:26:37 PM (13 years ago)
Author:
VaultDweller
Message:

mail notification fix for v1.0

Location:
leyka/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • leyka/trunk/includes/admin-modifications.php

    r675591 r676040  
    10381038            '{payment_method} - '.__('The method of payment used for this donation', 'leyka').'<br/>'.
    10391039            '{sitename} - '.__('Your site name', 'edd');
    1040         $settings['purchase_receipt']['std'] = __('Hello, {name}!<br /><br />
    1041                                                  You have chosed to make the following donations:<br />
    1042                                                  {download_list}<br />
    1043                                                  which totally cost {price}, by the {payment_method} gateway.
    1044                                                  <br /><br />
    1045                                                  Sincerely thank you,
    1046                                                  {sitename}, {date}', 'leyka');
     1040        $settings['purchase_receipt']['std'] = __('Hello, {name}!<br /><br />You have chosed to make the following donations:<br />{download_list}<br />which totally cost {price}, by the {payment_method} gateway.<br /><br />Sincerely thank you, {sitename}, {date}', 'leyka');
    10471041        $settings['admin_notice_emails']['name'] = __("Donations manager's emails", 'leyka');
     1042        $settings['admin_notice_emails']['std'] = get_bloginfo('admin_email');
    10481043
    10491044        array_push(
     
    13611356add_filter('edd_checkout_button_purchase', 'leyka_donate_submit_button');
    13621357
    1363 /** Process donor info placeholders in donor email notification text. */
    1364 function leyka_donor_donation_notification($email_body, $donation_id, $donation_data){
    1365     global $edd_options;
    1366 
    1367     $default_email_body = __('Hello, {name}!<br /><br />
    1368                              You have chosed to make the following donations:<br />
    1369                              {download_list}<br />
    1370                              which totally cost {price}, by the {payment_method} gateway.
    1371                              <br /><br />
    1372                              Sincerely thank you,
    1373                              {sitename}, {date}', 'leyka');
    1374 
    1375     $email = isset($edd_options['purchase_receipt']) ? $edd_options['purchase_receipt'] : $default_email_body;
    1376 
    1377     return edd_email_template_tags($email, $donation_data, $donation_id);
    1378 }
    1379 add_filter('edd_purchase_receipt', 'leyka_donor_donation_notification', 10, 3);
    1380 
    13811358/** Process admin placeholders in admin email notification text. */
    13821359function leyka_admin_donation_notification($admin_message, $payment_id, $payment_data){
  • leyka/trunk/includes/install.php

    r675591 r676040  
    1212function leyka_activation()
    1313{
     14    /** Set localization: */
     15    // Set filter for plugin's languages directory
     16    $plugin_lang_dir = dirname(LEYKA_PLUGIN_INNER_SHORT_NAME).'/languages/';
     17    $plugin_lang_dir = apply_filters('leyka_languages_directory', $plugin_lang_dir);
     18
     19    // Traditional WordPress plugin locale filter
     20    $locale = apply_filters('plugin_locale', get_locale(), 'leyka');
     21    $mofile = sprintf('%1$s-%2$s.mo', 'leyka', $locale);
     22
     23    // Setup paths to current locale file
     24    $mofile_local = $plugin_lang_dir.$mofile;
     25    $mofile_global = WP_LANG_DIR.'/leyka/'.$mofile;
     26
     27    if(file_exists($mofile_global)) {
     28        // Look in global /wp-content/languages/edd folder
     29        load_textdomain('leyka', $mofile_global);
     30    } elseif(file_exists(WP_PLUGIN_DIR.'/'.$mofile_local)) {
     31        // Look in local /wp-content/plugins/easy-digital-donates/languages/ folder
     32        load_textdomain('leyka', WP_PLUGIN_DIR.'/'.$mofile_local);
     33    } else {
     34        // Load the default language files
     35        load_plugin_textdomain('leyka', false, $plugin_lang_dir);
     36    }
     37    /** Localization ended */
     38
    1439    // Check if original EDD exists:
    1540    if( !file_exists(WP_PLUGIN_DIR.'/easy-digital-downloads/easy-digital-downloads.php') ) { // Base EDD is not found, fatal
    1641        echo __('<div id="message" class="error"><strong>Original EDD plugin is not found.</strong> Please, try to download and activate it before activating Leyka.</div>', 'leyka');
    17 //        exit;
    1842    }
     43
     44    global $edd_options;
     45
     46    /** Set default Email settings. */
     47    // Direct settings manipulation:
     48    $emails_options = get_option('edd_settings_emails');
     49
     50    if(empty($emails_options['purchase_receipt']))
     51        $emails_options['purchase_receipt'] = __('Hello, {name}!<br /><br />You have chosed to make the following donations:<br />{download_list}<br />which totally cost {price}, by the {payment_method} gateway.<br /><br />Sincerely thank you, {sitename}, {date}', 'leyka');
     52
     53    if(empty($emails_options['purchase_subject']))
     54        $emails_options['purchase_subject'] = __('Thank you for your donation!', 'leyka');
     55
     56    if(empty($emails_options['from_name'])) {
     57        $from_name = get_bloginfo('name');
     58        if( !$from_name )
     59            $from_name = trim(str_replace(array('http://', 'https://'), array('', ''), get_bloginfo('wpurl')), '/');
     60        $emails_options['from_name'] = $from_name;
     61    }
     62
     63    if(empty($emails_options['from_email']))
     64        $emails_options['from_email'] = get_bloginfo('admin_email');
     65
     66    if(empty($emails_options['admin_notice_emails']))
     67        $emails_options['admin_notice_emails'] = get_bloginfo('admin_email');
     68   
     69    if(empty($emails_options['admin_notifications_subject']))
     70        $emails_options['admin_notifications_subject'] = __('New donation came', 'leyka');
     71
     72    if(empty($emails_options['admin_donates_email_text']))
     73        $emails_options['admin_donates_email_text'] = __('Hello!<br /><br />Recently, there has been a new donation on a {sitename}:<br />{download_list}<br />which totally cost {price}, by the {payment_method} gateway.<br /><br />Donate ID: {donate_id}, donation hashcode: {receipt_id} | {edit_url}<br /><br />{sitename}, {date}', 'leyka');
     74   
     75    update_option('edd_settings_emails', $emails_options);
     76    // Direct settings manipulation END
     77
     78
    1979//    elseif( !is_plugin_active('easy-digital-downloads/easy-digital-downloads.php') ) {
    2080//        activate_plugin(WP_PLUGIN_DIR.'/easy-digital-downloads/easy-digital-downloads.php');
  • leyka/trunk/languages/leyka-ru_RU.po

    r675591 r676040  
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: \n"
    6 "PO-Revision-Date: 2013-03-02 10:24:47+0000\n"
     6"PO-Revision-Date: 2013-03-04 09:58:54+0000\n"
    77"Last-Translator: \n"
    88"Language-Team: \n"
     
    259259#: includes/admin/class-payments-table.php:70
    260260#: includes/admin-modifications.php:994
    261 #: includes/admin-modifications.php:1213
     261#: includes/admin-modifications.php:1207
    262262#@ edd
    263263#@ default
     
    266266
    267267#: includes/admin-modifications.php:995
    268 #: includes/admin-modifications.php:1212
     268#: includes/admin-modifications.php:1206
    269269#@ default
    270270msgid "Draft"
     
    272272
    273273#: includes/admin-modifications.php:996
    274 #: includes/admin-modifications.php:1210
     274#: includes/admin-modifications.php:1204
    275275#@ default
    276276msgid "Publish"
     
    303303
    304304#: includes/admin-modifications.php:1032
    305 #: includes/admin-modifications.php:1061
     305#: includes/admin-modifications.php:1055
    306306#@ leyka
    307307msgid "Enter the email that is sent to donations managers after completing a purchase. HTML is accepted. Available template tags:"
     
    309309
    310310#: includes/admin-modifications.php:1033
    311 #: includes/admin-modifications.php:1062
     311#: includes/admin-modifications.php:1056
    312312#@ leyka
    313313msgid "A list of donates given"
     
    320320
    321321#: includes/admin-modifications.php:1035
    322 #: includes/admin-modifications.php:1063
     322#: includes/admin-modifications.php:1057
    323323#@ leyka
    324324msgid "The date of the donation"
     
    326326
    327327#: includes/admin-modifications.php:1036
    328 #: includes/admin-modifications.php:1064
     328#: includes/admin-modifications.php:1058
    329329#@ leyka
    330330msgid "The total amount of the donation"
     
    332332
    333333#: includes/admin-modifications.php:1037
    334 #: includes/admin-modifications.php:1065
     334#: includes/admin-modifications.php:1059
    335335#@ leyka
    336336msgid "The unique ID number for this donation"
     
    338338
    339339#: includes/admin-modifications.php:1038
    340 #: includes/admin-modifications.php:1068
     340#: includes/admin-modifications.php:1062
    341341#@ leyka
    342342msgid "The method of payment used for this donation"
     
    344344
    345345#: includes/admin-modifications.php:1039
    346 #: includes/admin-modifications.php:1069
     346#: includes/admin-modifications.php:1063
    347347#@ edd
    348348msgid "Your site name"
    349349msgstr "Название вашего сайта"
    350350
    351 #: includes/admin-modifications.php:1040
    352 #@ leyka
    353 msgid ""
    354 "Hello, {name}!<br /><br />\n"
    355 "                                                 You have chosed to make the following donations:<br />\n"
    356 "                                                 {download_list}<br />\n"
    357 "                                                 which totally cost {price}, by the {payment_method} gateway.\n"
    358 "                                                 <br /><br />\n"
    359 "                                                 Sincerely thank you,\n"
    360 "                                                 {sitename}, {date}"
    361 msgstr "Здравствуйте, {name}!<br /><br />Вы желаете сделать следующие пожертвования:<br />                                                 {download_list}<br />на сумму {price}, с помощью платёжной системы {payment_method}.<br /><br />                                                 Спасибо за ваше неравнодушие,<br />{sitename}, {date}"
    362 
    363 #: includes/admin-modifications.php:1047
     351#: includes/admin-modifications.php:1041
    364352#@ leyka
    365353msgid "Donations manager's emails"
    366354msgstr "E-mail менеджеров пожертвований"
    367355
    368 #: includes/admin-modifications.php:1053
     356#: includes/admin-modifications.php:1047
    369357#@ leyka
    370358msgid "Donations manager's notification subject"
    371359msgstr "Тема уведомления для менеджеров пожертвований"
    372360
    373 #: includes/admin-modifications.php:1054
     361#: includes/admin-modifications.php:1048
    374362#@ leyka
    375363msgid "Enter the donations manager's notification email subject"
    376364msgstr "Введите тему письма-уведомления о новом пожертвовании для менеджеров пожертвований"
    377365
    378 #: includes/admin-modifications.php:1060
     366#: includes/admin-modifications.php:1054
    379367#@ leyka
    380368msgid "Donations manager's notification template"
    381369msgstr "Шаблон письма-уведомления о новом пожертвовании для менеджеров пожертвований"
    382370
    383 #: includes/admin-modifications.php:1066
     371#: includes/admin-modifications.php:1060
    384372#@ leyka
    385373msgid "The ID number for donation's purpose item"
    386374msgstr "Уникальный номер (ID) цели пожертвования."
    387375
    388 #: includes/admin-modifications.php:1067
     376#: includes/admin-modifications.php:1061
    389377#@ leyka
    390378msgid "The URL of the admin page where donation status can be changed"
    391379msgstr "URL страницы админ. панели сайта, на которой можно изменить статус пожертвования"
    392380
    393 #: includes/admin-modifications.php:1170
     381#: includes/admin-modifications.php:1164
    394382#@ default
    395383msgid "Title"
    396384msgstr "Наименование"
    397385
    398 #: includes/admin-modifications.php:1171
    399 #: includes/admin-modifications.php:1217
     386#: includes/admin-modifications.php:1165
     387#: includes/admin-modifications.php:1211
    400388#: includes/user-recalls-columns.php:18
    401389#@ leyka
     
    403391msgstr "Текст отзыва"
    404392
    405 #: includes/admin-modifications.php:1172
     393#: includes/admin-modifications.php:1166
    406394#@ leyka
    407395msgid "Recall author (donor)"
    408396msgstr "Автор отзыва (донор)"
    409397
    410 #: includes/admin-modifications.php:1173
     398#: includes/admin-modifications.php:1167
    411399#@ leyka
    412400msgid "Gateway"
     
    416404#: includes/admin/class-payments-table.php:84
    417405#: includes/admin-modifications.php:437
    418 #: includes/admin-modifications.php:1174
     406#: includes/admin-modifications.php:1168
    419407#: includes/user-recalls-columns.php:19
    420408#@ edd
     
    424412msgstr "Дата"
    425413
    426 #: includes/admin-modifications.php:1197
     414#: includes/admin-modifications.php:1191
    427415#@ default
    428416msgid "Quick&nbsp;Edit"
    429417msgstr "Быстрое&nbsp;Редактирование"
    430418
    431 #: includes/admin-modifications.php:1198
     419#: includes/admin-modifications.php:1192
    432420#@ default
    433421msgid "Move this item to the Trash"
    434422msgstr "Переместить этот элемент в мусорную корзину"
    435423
    436 #: includes/admin-modifications.php:1198
    437 #: includes/admin-modifications.php:1211
     424#: includes/admin-modifications.php:1192
     425#: includes/admin-modifications.php:1205
    438426#@ default
    439427msgid "Trash"
    440428msgstr "Мусорная корзина"
    441429
    442 #: includes/admin-modifications.php:1204
     430#: includes/admin-modifications.php:1198
    443431#@ leyka
    444432msgid "Edit user recall #"
     
    446434
    447435#: includes/admin/class-payments-table.php:86
    448 #: includes/admin-modifications.php:1208
     436#: includes/admin-modifications.php:1202
    449437#@ edd
    450438#@ default
     
    452440msgstr "Статус"
    453441
    454 #: includes/admin-modifications.php:1222
     442#: includes/admin-modifications.php:1216
    455443#@ default
    456444msgid "Cancel"
    457445msgstr "Отмена"
    458446
    459 #: includes/admin-modifications.php:1262
     447#: includes/admin-modifications.php:1256
    460448#@ leyka
    461449msgid "Permissions denied!"
    462450msgstr "В доступе отказано!"
    463451
    464 #: includes/admin-modifications.php:1378
     452#: includes/admin-modifications.php:1383
    465453#@ leyka
    466454msgid "Activate the donation"
    467455msgstr "Активировать пожертвование"
    468456
    469 #: includes/admin-modifications.php:1390
     457#: includes/admin-modifications.php:1395
    470458#@ leyka
    471459msgid "New donation payment"
    472460msgstr "Новый платеж по пожертвованию"
    473461
    474 #: includes/admin-modifications.php:1416
     462#: includes/admin-modifications.php:1421
    475463#@ leyka
    476464msgid "Error while editing the recall! Please try again later or e-mail the support team to fix it."
    477465msgstr "Ошибка при редактировании отзыва. Пожалуйста, попробуйте ещё раз. Если ошибка повторится, обратитесь в службу поддержки сайта."
    478466
    479 #: includes/admin-modifications.php:1417
     467#: includes/admin-modifications.php:1422
    480468#@ leyka
    481469msgid "PENDING"
    482470msgstr "В ОЖИДАНИИ"
    483471
    484 #: includes/admin-modifications.php:1418
     472#: includes/admin-modifications.php:1423
    485473#@ leyka
    486474msgid "COMPLETE"
     
    559547msgstr "Введите ваши комментарии, если нужно"
    560548
    561 #: includes/admin-modifications.php:1151
    562 #: includes/frontend-modifications.php:346
     549#: includes/admin-modifications.php:1145
     550#: includes/frontend-modifications.php:349
    563551#, php-format
    564552#@ leyka
     
    567555msgstr "Страница оплаты пожертвований не указана. Перейдите в раздел <a href=\"%s\">настроек модуля пожертвований</a>, чтобы указать её."
    568556
    569 #: includes/admin-modifications.php:1356
    570 #: includes/frontend-modifications.php:353
     557#: includes/frontend-modifications.php:356
    571558#@ edd
    572559msgid "Purchase"
    573560msgstr "Приобрести"
    574561
    575 #: includes/frontend-modifications.php:379
     562#: includes/frontend-modifications.php:382
    576563#@ leyka
    577564msgid "Make a donation with this sum"
    578565msgstr "Пожертвовать данную сумму"
    579566
    580 #: includes/frontend-modifications.php:380
     567#: includes/frontend-modifications.php:383
    581568#@ edd
    582569msgid "Checkout"
    583570msgstr "На кассу"
    584571
    585 #: includes/frontend-modifications.php:384
     572#: includes/frontend-modifications.php:387
    586573#@ edd
    587574msgid "Item successfully added to your cart."
    588575msgstr "Продукт был успешно добавлен в корзину."
    589576
    590 #: includes/frontend-modifications.php:405
     577#: includes/frontend-modifications.php:408
    591578#@ leyka
    592579msgid "The required parameters are not set"
    593580msgstr "Не указаны необходимые параметры"
    594581
    595 #: includes/frontend-modifications.php:473
     582#: includes/frontend-modifications.php:476
    596583#@ leyka
    597584msgid "Any sum"
    598585msgstr "Любая сумма"
    599586
    600 #: includes/frontend-modifications.php:481
     587#: includes/frontend-modifications.php:484
    601588#@ leyka
    602589msgid "Insert the sum of your donation"
    603590msgstr "Укажите размер вашего пожертвования"
    604591
    605 #: includes/frontend-modifications.php:485
     592#: includes/frontend-modifications.php:488
    606593#@ edd
    607594msgid "Add to cart"
    608595msgstr "Добавить в корзину"
    609596
    610 #: includes/frontend-modifications.php:512
     597#: includes/frontend-modifications.php:515
    611598#@ leyka
    612599msgid "Sorry, the donation amount is incorrect"
    613600msgstr "Указанный размер пожертвования некорректен"
    614601
    615 #: includes/frontend-modifications.php:513
     602#: includes/frontend-modifications.php:516
    616603#@ leyka
    617604msgid "Sorry, you must agree to the donation terms first"
     
    12411228msgstr ""
    12421229
    1243 #: includes/frontend-modifications.php:308
     1230#: includes/frontend-modifications.php:311
    12441231#@ leyka
    12451232msgid "Sorry, the amount of your donation is 0 somehow."
     
    12711258msgstr "Пожертвования"
    12721259
    1273 #: includes/admin-modifications.php:1056
     1260#: includes/admin-modifications.php:1050
    12741261#@ leyka
    12751262msgid "New donation came"
    12761263msgstr "Сделано новое пожертвование"
    12771264
    1278 #: includes/admin-modifications.php:1091
     1265#: includes/admin-modifications.php:1085
    12791266#@ leyka
    12801267msgid "Redirect to the checkout after adding the donation to the cart."
    12811268msgstr "Перенаправлять на страницу оплаты при каждом добавлении пожертвования в корзину."
    12821269
    1283 #: includes/admin-modifications.php:1092
     1270#: includes/admin-modifications.php:1086
    12841271#@ leyka
    12851272msgid "Show agreement to the terms checkbox. It will have to be checked to make a donation."
    12861273msgstr "Выводить поле согласия с условиями публичной оферты. Если это поле не отмечено, пожертвование не будет разрешено."
    12871274
    1288 #: includes/admin-modifications.php:1093
     1275#: includes/admin-modifications.php:1087
    12891276#@ leyka
    12901277msgid "I agree to the terms of donation making service."
    12911278msgstr "Я согласен с условиями сервиса пожертвований"
    12921279
    1293 #: includes/admin-modifications.php:1120
     1280#: includes/admin-modifications.php:1114
    12941281#@ leyka
    12951282msgid "A text on a button to complete a donation"
    12961283msgstr "Текст для кнопки выполнения пожертвования"
    12971284
    1298 #: includes/admin-modifications.php:1121
     1285#: includes/admin-modifications.php:1115
    12991286#@ leyka
    13001287msgid "A text on a button to complete a donation."
    13011288msgstr "Текст для кнопки выполнения пожертвования на странице оплаты."
    13021289
    1303 #: includes/admin-modifications.php:1124
     1290#: includes/admin-modifications.php:1118
    13041291#@ leyka
    13051292msgid "A text on \"add to cart\" button"
    13061293msgstr "Текст для кнопки добавления в корзину"
    13071294
    1308 #: includes/admin-modifications.php:1125
     1295#: includes/admin-modifications.php:1119
    13091296#@ leyka
    13101297msgid "Add donation to cart"
    13111298msgstr "Добавить в корзину"
    13121299
    1313 #: includes/admin-modifications.php:1071
     1300#: includes/admin-modifications.php:1065
    13141301#@ leyka
    13151302msgid "Hello!<br /><br />Recently, there has been a new donation on a {sitename}:<br />{download_list}<br />which totally cost {price}, by the {payment_method} gateway.<br /><br />Donate ID: {donate_id}, donation hashcode: {receipt_id} | {edit_url}<br /><br />{sitename}, {date}"
     
    13271314msgstr "для совершения пожертвования должна быть включена хотя бы одна платёжная система."
    13281315
    1329 #: includes/admin-modifications.php:1136
     1316#: includes/admin-modifications.php:1130
    13301317#@ leyka
    13311318msgid "The donations has been deleted."
    13321319msgstr "Пожертвования удалены."
    13331320
    1334 #: includes/admin-modifications.php:1140
     1321#: includes/admin-modifications.php:1134
    13351322#@ leyka
    13361323msgid "The donation notice has been resent."
    13371324msgstr "Уведомление о пожертвовании отправлено."
    13381325
    1339 #: includes/admin-modifications.php:1144
     1326#: includes/admin-modifications.php:1138
    13401327#, php-format
    13411328#@ leyka
     
    13731360msgstr "Спасибо за ваше пожертвование!"
    13741361
    1375 #: includes/admin-modifications.php:1122
     1362#: includes/admin-modifications.php:1116
    13761363#@ leyka
    13771364msgid "Make the donations"
    13781365msgstr "Пожертвовать"
    13791366
    1380 #: includes/admin-modifications.php:1359
     1367#: includes/admin-modifications.php:1351
    13811368#@ leyka
    13821369msgid "Make the donation"
    13831370msgstr "Пожертвовать"
    13841371
     1372#: includes/admin-modifications.php:1040
     1373#: includes/admin-modifications.php:1361
     1374#@ leyka
     1375msgid "Hello, {name}!<br /><br />You have chosed to make the following donations:<br />{download_list}<br />which totally cost {price}, by the {payment_method} gateway.<br /><br />Sincerely thank you, {sitename}, {date}"
     1376msgstr "Здравствуйте, {name}!<br /><br />Вы желаете сделать следующие пожертвования:<br /> {download_list}<br />на сумму {price}, с помощью платёжной системы {payment_method}.<br /><br /> Спасибо за ваше неравнодушие,<br />{sitename}, {date}"
     1377
Note: See TracChangeset for help on using the changeset viewer.