Version 4.7.13
This commit is contained in:
1 parent
fd22d99e69
commit
7124a02564
954 files changed
+29277
-59308
No files matched your search
@@ -77,9 +77,10 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
array( \IPS\Http\Url::internal( 'app=core&module=clubs&controller=directory', 'front', 'clubs_list' ), \IPS\Member::loggedIn()->language()->addToStack('module__core_clubs') )
|
||||
);
|
||||
|
||||
/* Add a "Search in this club" contextual search option */
|
||||
/* Add a "Search in this club" contextual search option and set to default*/
|
||||
\IPS\Output::i()->contextualSearchOptions[ \IPS\Member::loggedIn()->language()->addToStack( 'search_contextual_item_club' ) ] = array( 'type' => '', 'club' => "c{$this->club->id}" );
|
||||
|
||||
\IPS\Output::i()->defaultSearchOption = array( '', 'search_contextual_item_club' );
|
||||
|
||||
/* CSS */
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'styles/clubs.css', 'core', 'front' ) );
|
||||
if ( \IPS\Theme::i()->settings['responsive'] )
|
||||
@@ -265,22 +266,42 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
\IPS\Output::i()->error( 'no_module_permission', '2C350/A', 403, '' );
|
||||
}
|
||||
|
||||
if ( $form = $this->club->form() )
|
||||
$form = $this->club->form();
|
||||
|
||||
if( $values = $form->values() )
|
||||
{
|
||||
\IPS\Output::i()->title = $this->club->name;
|
||||
if( \IPS\Request::i()->isAjax() )
|
||||
$this->club->skipCloneDuplication = TRUE;
|
||||
$old = clone $this->club;
|
||||
|
||||
$this->club->processForm( $values, FALSE, FALSE, NULL );
|
||||
|
||||
$changes = $this->club::renewalChanges( $old, $this->club );
|
||||
|
||||
if ( !empty( $changes ) )
|
||||
{
|
||||
\IPS\Output::i()->output = $form->customTemplate( array( \IPS\Theme::i()->getTemplate( 'forms', 'core' ), 'popupTemplate' ) );
|
||||
\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=view&do=updateExisting&id={$this->club->id}" )->setQueryString( 'changes', json_encode( $changes ) )->csrf(),
|
||||
'product_change_blurb_new' => $this->club->url(),
|
||||
) );
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->output = $form;
|
||||
\IPS\Output::i()->redirect( $this->club->url() );
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Output::i()->title = $this->club->name;
|
||||
if( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->output = $form->customTemplate( array( \IPS\Theme::i()->getTemplate( 'forms', 'core' ), 'popupTemplate' ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->redirect( $this->club->url() );
|
||||
\IPS\Output::i()->output = $form;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1776,4 +1797,27 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
\IPS\Output::i()->metaTags['og:description'] = $this->club->about;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Existing Purchases
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function updateExisting()
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
/* Make sure logged-in user has permission */
|
||||
if ( !( $this->club->owner and $this->club->owner->member_id == \IPS\Member::loggedIn()->member_id ) and !\IPS\Member::loggedIn()->modPermission('can_access_all_clubs') )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission', '3C350/Q', 403, '' );
|
||||
}
|
||||
|
||||
$changes = json_decode( \IPS\Request::i()->changes, TRUE );
|
||||
|
||||
\IPS\Task::queue( 'core', 'UpdateClubRenewals', array( 'changes' => $changes, 'club' => $this->club->id ), 5 );
|
||||
|
||||
/* Redirect */
|
||||
\IPS\Output::i()->redirect( $this->club->url(), 'saved' );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user