Version 5.0.6

This commit is contained in:
Neo committed 2025-12-19 18:55:49 -08:00
1 parent a3a4a9ccbd
commit b89858b2ff
1214 files changed
+92828 -14859

No files matched your search

+13 -4
View File
@@ -148,10 +148,17 @@ class Package extends Model
*/
public static function packageTypes() : array
{
return array(
$return = array(
'Product' => 'IPS\nexus\Package\Product',
'Ad' => 'IPS\nexus\Package\Ad'
);
foreach( Application::allExtensions( 'nexus', 'PackageType', null, null, null, false ) as $key => $ext )
{
$return[ $key ] = $ext;
}
return $return;
}
/* !ActiveRecord */
@@ -621,7 +628,7 @@ class Package extends Model
catch ( OutOfRangeException ) { }
}
return static::lowestPriceFromData( $customer, $currency, $this->id, json_decode( $this->base_price, TRUE ), json_decode( $this->discounts, TRUE ), $renewOptions, $this->stock, $tax, $priceMayChange, $priceNotIncludingDiscounts, $relevantRenewalTerm );
return static::lowestPriceFromData( $customer, $currency, $this->id, json_decode( $this->base_price, TRUE ), ( $this->discounts ? json_decode( $this->discounts, TRUE ) : [] ), $renewOptions, $this->stock, $tax, $priceMayChange, $priceNotIncludingDiscounts, $relevantRenewalTerm );
}
/**
@@ -1105,7 +1112,7 @@ class Package extends Model
);
}
return NULL;
return parent::get__badge();
}
/**
@@ -1330,7 +1337,9 @@ class Package extends Model
$form->addHeader( 'package_renewals' );
$form->add( new YesNo( 'p_renews', !empty( $renewOptions ), FALSE, array( 'togglesOn' => array( 'p_initial_term', 'p_renew_options', 'p_grace_period', 'p_renew', ( $this->id ? "form_{$this->id}" : 'form_new' ) . '_header_package_client_area_renewals', 'p_email_expire_soon_type', 'p_email_expire_type' ) ), NULL, NULL, NULL, 'p_renews' ) );
$form->add( new \IPS\nexus\Form\RenewalTerm( 'p_initial_term', $this->initial_term ?: NULL, FALSE, array( 'initialTerm' => TRUE, 'initialTermLang' => 'term_same_as_renewal', 'lockPrice' => TRUE ), NULL, NULL, NULL, 'p_initial_term' ) );
/* The price is ignored on this field anyway, so we can hard-code to $0 */
$form->add( new \IPS\nexus\Form\RenewalTerm( 'p_initial_term', $this->initial_term ? new RenewalTerm( new Money( "0", "USD" ), new DateInterval( "P" . $this->initial_term ) ) : NULL, FALSE, array( 'initialTerm' => TRUE, 'initialTermLang' => 'term_same_as_renewal', 'lockPrice' => TRUE ), NULL, NULL, NULL, 'p_initial_term' ) );
$form->add( new Stack( 'p_renew_options', $renewOptions, FALSE, array(
'stackFieldType' => 'IPS\nexus\Form\RenewalTerm',
'allCurrencies' => TRUE,