Version 4.7.13
This commit is contained in:
1 parent
fd22d99e69
commit
7124a02564
954 files changed
+29277
-59308
No files matched your search
@@ -231,13 +231,34 @@ class _clubs extends \IPS\Dispatcher\Controller
|
||||
/* Settings */
|
||||
if ( $activeTab === 'settings' )
|
||||
{
|
||||
if ( $form = $club->form( TRUE ) )
|
||||
$form = $club->form( TRUE );
|
||||
|
||||
if( $values = $form->values() )
|
||||
{
|
||||
$activeTabContents = (string) $form;
|
||||
$club->skipCloneDuplication = TRUE;
|
||||
$old = clone $club;
|
||||
|
||||
$club->processForm( $values, TRUE, FALSE, NULL );
|
||||
|
||||
$changes = $club::renewalChanges( $old, $club );
|
||||
|
||||
if ( !empty( $changes ) )
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->decision( 'product_change_blurb', array(
|
||||
'product_change_blurb_existing' => \IPS\Http\Url::internal( "app=core&module=clubs&controller=clubs&do=updateExisting&id={$club->id}" )->setQueryString( 'changes', json_encode( $changes ) )->csrf(),
|
||||
'product_change_blurb_new' => \IPS\Http\Url::internal( "app=core&module=clubs&controller=clubs" ),
|
||||
) );
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal("app=core&module=clubs&controller=clubs"), "saved" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal("app=core&module=clubs&controller=clubs"), "saved" );
|
||||
$activeTabContents = (string) $form;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -641,4 +662,29 @@ class _clubs extends \IPS\Dispatcher\Controller
|
||||
$node->description
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Existing Purchases
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function updateExisting()
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
try
|
||||
{
|
||||
$club = \IPS\Member\Club::load( \IPS\Request::i()->id );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission', '3C352/8', 403, '' );
|
||||
}
|
||||
|
||||
$changes = json_decode( \IPS\Request::i()->changes, TRUE );
|
||||
|
||||
\IPS\Task::queue( 'core', 'UpdateClubRenewals', array( 'changes' => $changes, 'club' => $club->id ), 5 );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=clubs&controller=clubs" ), 'saved' );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user