Version 4.7.13

This commit is contained in:
Neo committed 2025-12-19 16:14:56 -08:00
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' );
}
}
@@ -45,9 +45,11 @@ class _settings extends \IPS\Dispatcher\Controller
*/
protected function manage()
{
$fields = array( 'clubs_default_sort', 'clubs_header', 'clubs_locations', 'clubs_modperms', 'clubs_require_approval', 'form_header_club_display_settings', 'form_header_club_moderation', 'clubs_default_view', 'clubs_allow_view_change', 'club_nodes_in_apps', 'form_header_clubs_paid_settings', 'clubs_paid_on', '_allow_club_moderators', 'club_max_cover' );
$form = new \IPS\Helpers\Form;
$form->addHeader( 'club_settings' );
$form->add( new \IPS\Helpers\Form\YesNo( 'clubs_enabled_setting', \IPS\Settings::i()->clubs, FALSE, array( 'togglesOn' => array( 'clubs_default_sort', 'clubs_header', 'clubs_locations', 'clubs_modperms', 'clubs_require_approval', 'form_header_club_display_settings', 'form_header_club_moderation', 'clubs_default_view', 'clubs_allow_view_change', 'club_nodes_in_apps', 'form_header_clubs_paid_settings', 'clubs_paid_on', '_allow_club_moderators' ) ) ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'clubs_enabled_setting', \IPS\Settings::i()->clubs, FALSE, array( 'togglesOn' => $fields ) ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'clubs_require_approval', \IPS\Settings::i()->clubs_require_approval, FALSE, array(), NULL, NULL, NULL, 'clubs_require_approval' ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'clubs_locations', \IPS\Settings::i()->clubs_locations, FALSE, array(), NULL, NULL, NULL, 'clubs_locations' ) );
if ( \IPS\Application::appIsEnabled( 'nexus' ) )
@@ -104,7 +106,7 @@ class _settings extends \IPS\Dispatcher\Controller
'delete' => 'club_modperm_delete',
'split_merge' => 'club_modperm_split_merge',
) ), NULL, NULL, NULL, 'clubs_modperms' ) );
if ( $values = $form->values() )
{
$values['clubs'] = $values['clubs_enabled_setting'];