Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

@@ -12,7 +12,7 @@
namespace IPS\nexus\Purchase;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -58,7 +58,7 @@ class _RenewalTerm
* @param \DateInterval|NULL $gracePeriod Grace period
* @return void
*/
public function __construct( $cost, \DateInterval $interval, \IPS\nexus\Tax $tax = NULL, $addToBase = FALSE, \DateInterval $gracePeriod = NULL )
public function __construct( $cost, \DateInterval $interval = NULL, \IPS\nexus\Tax $tax = NULL, $addToBase = FALSE, \DateInterval $gracePeriod = NULL )
{
$this->cost = $cost;
$this->interval = $interval;
@@ -100,7 +100,14 @@ class _RenewalTerm
switch( $term['unit'] )
{
case 'd':
return $lang->pluralize( $lang->get('renew_days'), array( $term['term'] ) );
if ( $term['term'] % 7 == 0 )
{
return $lang->pluralize( $lang->get('renew_weeks'), array( $term['term'] / 7 ) );
}
else
{
return $lang->pluralize( $lang->get('renew_days'), array( $term['term'] ) );
}
case 'm':
return $lang->pluralize( $lang->get('renew_months'), array( $term['term'] ) );
case 'y':
@@ -341,7 +348,7 @@ class _RenewalTerm
$cost = new \IPS\nexus\Money( $cost->amount->multiply( new \IPS\Math\Number( "$quantity" ) ), $cost->currency );
}
return sprintf( \IPS\Member::loggedIn()->language()->get( 'renew_option'), $cost, $this->getTermUnit() ) ;
return sprintf( \IPS\Member::loggedIn()->language()->get( 'renew_option'), $cost, $this->getTermUnit() );
}
/**