Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -359,7 +359,15 @@ class _Club extends \IPS\Patterns\ActiveRecord implements \IPS\Content\Embeddabl
|
||||
}
|
||||
|
||||
\IPS\Member::loggedIn()->language()->words['club_fee_desc'] = $commissionBlurb;
|
||||
$form->add( new \IPS\nexus\Form\Money( 'club_fee', $this->id ? json_decode( $this->fee, TRUE ) : array(), NULL, array(), NULL, NULL, NULL, 'club_fee' ) );
|
||||
$form->add( new \IPS\nexus\Form\Money( 'club_fee', $this->id ? json_decode( $this->fee, TRUE ) : array(), NULL, array(), function( $value ){
|
||||
foreach( $value as $currency => $fee )
|
||||
{
|
||||
if( !$fee->amount->isGreaterThanZero() )
|
||||
{
|
||||
throw new \DomainException( 'form_required' );
|
||||
}
|
||||
}
|
||||
}, NULL, NULL, 'club_fee' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'club_renewals', $this->id ? ( $this->renewal_term ? 1 : 0 ) : 0, TRUE, array(
|
||||
'options' => array( 0 => 'club_renewals_off', 1 => 'club_renewals_on' ),
|
||||
'toggles' => array( 1 => array( 'club_renewal_term' ) )
|
||||
@@ -696,7 +704,7 @@ class _Club extends \IPS\Patterns\ActiveRecord implements \IPS\Content\Embeddabl
|
||||
}
|
||||
|
||||
/**
|
||||
* Joining fee
|
||||
* Renewal fee
|
||||
*
|
||||
* @param string|NULL $currency Desired currency, or NULL to choose based on member's chosen currency
|
||||
* @return \IPS\nexus\Money|NULL
|
||||
@@ -740,7 +748,11 @@ class _Club extends \IPS\Patterns\ActiveRecord implements \IPS\Content\Embeddabl
|
||||
try
|
||||
{
|
||||
$renewalTerm = $this->renewalTerm( $fee->currency );
|
||||
if ( $renewalTerm->cost->amount == $fee->amount )
|
||||
if ( !$renewalTerm )
|
||||
{
|
||||
return $fee;
|
||||
}
|
||||
else if ( $renewalTerm AND $renewalTerm->cost->amount == $fee->amount )
|
||||
{
|
||||
return $renewalTerm;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user