Version 4.1.2

This commit is contained in:
Neo committed 2025-12-19 05:32:19 -08:00
1 parent 3ba79295ee
commit 28bd025b35
1131 files changed
+63658 -20579

No files matched your search

+19 -16
View File
@@ -791,7 +791,13 @@ class _Package extends \IPS\Node\Model
$form->add( $field );
}
$form->addHeader('package_registration');
$form->add( new \IPS\Helpers\Form\YesNo( 'p_reg', $this->reg ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'p_reg', $this->reg, FALSE, array(), function( $val )
{
if ( $val and ( !\IPS\Request::i()->p_store_checkbox or ( \IPS\Request::i()->p_member_groups and !in_array( \IPS\Settings::i()->guest_group, \IPS\Request::i()->p_member_groups ) ) ) )
{
throw new \DomainException( \IPS\Member::loggedIn()->language()->addToStack( 'p_reg_err', FALSE, array( 'sprintf' => array( \IPS\Member\Group::load( \IPS\Settings::i()->guest_group )->name ) ) ) );
}
} ) );
$form->addHeader('package_associations');
$form->addMessage('package_associations_desc');
$form->add( new \IPS\Helpers\Form\Radio( 'p_associate', ( $this->force_assoc and count( $this->associablePackages() ) ) ? 2 : ( count( $this->associablePackages() ) ? 1 : 0 ), FALSE, array(
@@ -1300,19 +1306,22 @@ class _Package extends \IPS\Node\Model
{
$newRenewTerms = array();
}
$key = 'x';
foreach ( $changes['renew_options'] as $k => $data )
if ( $purchase->renewals )
{
if ( $data['old'] != 'x' )
foreach ( $changes['renew_options'] as $k => $data )
{
if ( $data['old']['cost'][ $purchase->renewals->cost->currency ]['amount'] == $purchase->renewals->cost->amount )
if ( $data['old'] != 'x' )
{
$term = $purchase->renewals->getTerm();
if ( $data['old']['term'] == $term['term'] and $data['old']['unit'] == $term['unit'] )
if ( $data['old']['cost'][ $purchase->renewals->cost->currency ]['amount'] == $purchase->renewals->cost->amount )
{
$key = $k;
break;
$term = $purchase->renewals->getTerm();
if ( $data['old']['term'] == $term['term'] and $data['old']['unit'] == $term['unit'] )
{
$key = $k;
break;
}
}
}
}
@@ -2802,13 +2811,7 @@ class _Package extends \IPS\Node\Model
catch ( \UnderflowException $e )
{
$purchase->member->member_group_id = $purchase->member->cm_return_group;
/* Don't move them back into validating */
if ( $purchase->member->member_group_id == \IPS\Settings::i()->auth_group )
{
$purchase->member->member_group_id = \IPS\Settings::i()->member_group;
}
/* Does this group exist? */
try
{