Skip to content

Commit

Permalink
Merge branch 'prep-release-2.1.5' into 3.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Skouat committed Dec 31, 2020
2 parents ff823be + b4cb525 commit 979a31d
Show file tree
Hide file tree
Showing 46 changed files with 220 additions and 352 deletions.
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
.gitignore export-ignore
.travis.yml export-ignore
build.xml export-ignore
composer.lock export-ignore
CHANGELOG.md export-ignore
composer.lock export-ignore
crowdin.yml export-ignore
phpunit.xml.* export-ignore
README.md export-ignore
.tx/ export-ignore
travis/ export-ignore
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: php
sudo: required
dist: trusty

matrix:
include:
Expand Down Expand Up @@ -40,10 +40,6 @@ env:
- EPV="1" # Should we run EPV (Extension Pre Validator) on your code?
- PHPBB_BRANCH="3.2.x"

branches:
only:
- develop-3.2.x

install:
- travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH
- cd ../../phpBB3
Expand Down
50 changes: 0 additions & 50 deletions .tx/README.md

This file was deleted.

107 changes: 0 additions & 107 deletions .tx/config

This file was deleted.

20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
# Changelog
## 2.1.5 - 2020-12-16
- Fix: Typo
- Fix: Invalid lang keys in email templates
- Quick code cleanup

## 2.1.4 - 2020-05-03
- Fix: SQL error on transactions log

## 2.1.3 - 2020-01-25
- Code changes following phpBB Customisation Team reports

## 2.1.2 - 2019-11-19
- Change: Temporarily disable TLS check because PayPal TLS website is down
- Change: Add `payer_donated_amount` on `donors_group_user_add()` event (thanks Dark❶)
- Fix: Auto group feature does not work (#75)
- Fix: SQL Error when accessing on list of donors (#78)
- Fix: English wording
- Remove: Remove abilities to enable/disable text formatting on Donation Pages

## 2.1.1 - 2019-05-26
- Fix: The button `Add` for adding manual transaction is not visible when logs are empty
- Code changes following phpBB Customisation Team reports

## 2.1.0 - 2019-05-09
- Add: Donation on error can be manually approved
- Add: Allow to change transactions donor (thanks kasimi)
- Add: Allow changing transactions donor (thanks kasimi)
- Change: Make donor name a link to the profile when viewing a transaction (#61) (thanks kasimi)
- Change: Use built-in phpbb_email_hash() function (#59) (thanks kasimi)
- Fix: All transactions log are cleared when "Delete marked" is used
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ This extension add a PayPal Donation page on your site.

## Translations

* Translations should be added on the [Transifex](https://www.transifex.com/skouat/ppde-32x) repository.
* Feel free to [join](https://www.transifex.com/signup/?join_project=ppde-32x) the translation team, and read this [Quick User Guide](/.tx/README.md)
* This project use [Crowdin](https://crwd.in/skouat-ppde) for translations. Feel free to [join](https://crwd.in/skouat-ppde) the project.
* You can also send your translations in the [PayPal Donation translation topic at phpBB.com](https://www.phpbb.com/customise/db/extension/paypal_donation_extension/support/topic/216046)

## License
[GNU General Public License v2](http://opensource.org/licenses/GPL-2.0)
[GNU General Public License v2](https://opensource.org/licenses/GPL-2.0)
40 changes: 18 additions & 22 deletions actions/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class core
/**
* @var array
*/
private $payer_data;
private $payer_data = array();
/**
* phpBB root path
*
Expand Down Expand Up @@ -285,7 +285,7 @@ public function update_donor_stats()
{
if ($this->donor_is_member)
{
$this->update_user_stats((int) $this->payer_data['user_id'], (float) $this->payer_data['user_ppde_donated_amount'] + (float) $this->net_amount($this->transaction_data['mc_gross'], $this->transaction_data['mc_fee']));
$this->update_user_stats((int) $this->payer_data['user_id'], (float) $this->payer_data['user_ppde_donated_amount'] + (float) $this->transaction_data['mc_gross']);
}
}

Expand Down Expand Up @@ -317,24 +317,28 @@ public function donors_group_user_add()
$payer_id = (int) $this->payer_data['user_id'];
$payer_username = $this->payer_data['username'];
$default_group = $this->config['ppde_ipn_group_as_default'];
$payer_donated_amount = $this->payer_data['user_ppde_donated_amount'];

/**
* Event to modify data before a user is added to the donors group
*
* @event skouat.ppde.donors_group_user_add_before
* @var bool can_use_autogroup Whether or not to add the user to the group
* @var int group_id The ID of the group to which the user will be added
* @var int payer_id The ID of the user who will we added to the group
* @var string payer_username The user name
* @var bool default_group Whether or not the group should be made default for the user
* @var bool can_use_autogroup Whether or not to add the user to the group
* @var int group_id The ID of the group to which the user will be added
* @var int payer_id The ID of the user who will we added to the group
* @var string payer_username The user name
* @var bool default_group Whether or not the group should be made default for the user
* @var float payer_donated_amount The user donated amount
* @since 1.0.3
* @changed 2.1.2 Added var $payer_donated_amount
*/
$vars = array(
'can_use_autogroup',
'group_id',
'payer_id',
'payer_username',
'default_group',
'payer_donated_amount',
);
extract($this->dispatcher->trigger_event('skouat.ppde.donors_group_user_add_before', compact($vars)));

Expand Down Expand Up @@ -395,7 +399,10 @@ public function payment_status_is_completed()
*/
public function minimum_donation_raised()
{
return (float) $this->payer_data['user_ppde_donated_amount'] >= (float) $this->config['ppde_ipn_min_before_group'] ? true : false;
// Updates payer_data info before checking values
$this->check_donors_status('user', $this->payer_data['user_id']);

return (float) $this->payer_data['user_ppde_donated_amount'] >= (float) $this->config['ppde_ipn_min_before_group'];
}

/**
Expand Down Expand Up @@ -442,14 +449,7 @@ public function log_to_db($data)
*/
public function set_transaction_data($transaction_data)
{
if (!empty($this->transaction_data))
{
array_merge($this->transaction_data, $transaction_data);
}
else
{
$this->transaction_data = $transaction_data;
}
$this->transaction_data = !empty($this->transaction_data) ? array_merge($this->transaction_data, $transaction_data) : $transaction_data;
}

/**
Expand Down Expand Up @@ -525,11 +525,7 @@ public function check_post_data_length($value, $statement)
*/
public function check_post_data_ascii($value)
{
// We ensure that the value contains only ASCII chars...
$pos = strspn($value, self::ASCII_RANGE);
$len = strlen($value);

return $pos != $len ? false : true;
return strlen($value) != strspn($value, self::ASCII_RANGE) ? false : true;
}

/**
Expand All @@ -544,7 +540,7 @@ public function check_post_data_ascii($value)
*/
public function check_post_data_content($value, $content_ary)
{
return in_array($value, $content_ary) ? true : false;
return in_array($value, $content_ary);
}

/**
Expand Down
12 changes: 0 additions & 12 deletions adm/style/ppde_donation_pages.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,6 @@ <h3>{{ lang('WARNING') }}</h3>
</label>
{% endif %}
</dd>
<dd style="margin-{{ S_CONTENT_FLOW_BEGIN }}: 90px; margin-top: 5px;">
{% if loops.smiley|length %}<hr>{% endif %}
{% if S_BBCODE_ALLOWED %}
<label><input type="checkbox" class="radio" name="disable_bbcode"{% if S_BBCODE_DISABLE_CHECKED and (S_PPDE_DP_PREVIEW or not S_ADD_DONATION_PAGE) %} checked{% endif %}> {{ lang('DISABLE_BBCODE') }}</label>
{% endif %}
{% if S_SMILIES_ALLOWED %}
<label><input type="checkbox" class="radio" name="disable_smilies"{% if S_SMILIES_DISABLE_CHECKED and (S_PPDE_DP_PREVIEW or not S_ADD_DONATION_PAGE) %} checked{% endif %}> {{ lang('DISABLE_SMILIES') }}</label>
{% endif %}
{% if S_LINKS_ALLOWED %}
<label><input type="checkbox" class="radio" name="disable_magic_url"{% if S_MAGIC_URL_DISABLE_CHECKED and (S_PPDE_DP_PREVIEW or not S_ADD_DONATION_PAGE) %} checked{% endif %}> {{ lang('DISABLE_MAGIC_URL') }}</label>
{% endif %}
</dd>
<dd style="margin-{{ S_CONTENT_FLOW_BEGIN }}: 90px; margin-top: 10px;"><strong>{{ lang('OPTIONS') }}{{ lang('COLON') }} </strong>{{ BBCODE_STATUS }} :: {{ IMG_STATUS }} :: {{ FLASH_STATUS }} :: {{ URL_STATUS }} :: {{ SMILIES_STATUS }}</dd>
</dl>
</fieldset>
Expand Down
4 changes: 2 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
Remove some unnecessary files/directories
${dir}/ is the folder of your extension, e.g. ext/nickvergessen/newspage/
-->
<delete dir="${dir}/.tx" />
<delete dir="${dir}/tests" />
<delete dir="${dir}/travis" />

<delete file="${dir}/.gitattributes" />
<delete file="${dir}/.gitignore" />
<delete file="${dir}/.travis.yml" />
<delete file="${dir}/build.xml" />
<delete file="${dir}/composer.lock" />
<delete file="${dir}/CHANGELOG.md" />
<delete file="${dir}/composer.lock" />
<delete file="${dir}/crowdin.yml" />
<delete file="${dir}/phpunit.xml.dist" />
<delete file="${dir}/README.md" />
</target>
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "phpbb-extension",
"description": "An extension which adds a PayPal donation page to your phpBB board",
"homepage": "https://skouat.github.io/ext_paypal_donation",
"version": "2.1.1",
"version": "2.1.5",
"keywords": [
"phpbb",
"extension",
Expand Down
Loading

0 comments on commit 979a31d

Please sign in to comment.