Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -83,8 +83,18 @@ class _packages extends \IPS\Node\Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* If something has changed, see if anyone has purchased */
|
||||
$purchases = 0;
|
||||
|
||||
if( count( $changes ) )
|
||||
{
|
||||
$purchases = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_purchases', array( 'ps_app=? AND ps_type=? AND ps_item_id=?', 'nexus', 'package', $new->id ) )->first();
|
||||
}
|
||||
|
||||
if ( !empty( $changes ) )
|
||||
/* Only show this screen if the package has been purchased. Otherwise even just copying a package and saving asks if you want to update
|
||||
existing purchases unnecessarily */
|
||||
if ( !empty( $changes ) AND $purchases )
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->decision( 'product_change_blurb', array(
|
||||
'product_change_blurb_existing' => \IPS\Http\Url::internal( "app=nexus&module=store&controller=packages&do=updateExisting&id={$new->_id}" )->setQueryString( 'changes', json_encode( $changes ) ),
|
||||
@@ -193,14 +203,14 @@ class _packages extends \IPS\Node\Controller
|
||||
$matrix->rows['x'] = array( 'any_other_amount', '-' );
|
||||
|
||||
if ( $values = $matrix->values() )
|
||||
{
|
||||
{
|
||||
$renewOptions = json_decode( $changes['renew_options'], TRUE );
|
||||
$changes['renew_options'] = array();
|
||||
foreach ( $renewOptions as $k => $data )
|
||||
{
|
||||
$changes['renew_options'][] = array( 'old' => $data, 'new' => $values[ $k ]['now_pay'] );
|
||||
$changes['renew_options'][ $k ] = array( 'old' => $data, 'new' => $values[ $k ]['now_pay'] );
|
||||
}
|
||||
$changes['renew_options'][] = array( 'old' => 'x', 'new' => $values['x']['now_pay'] );
|
||||
$changes['renew_options']['x'] = array( 'old' => 'x', 'new' => $values['x']['now_pay'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -334,7 +344,7 @@ class _packages extends \IPS\Node\Controller
|
||||
\IPS\Output::i()->error( 'node_error', '2X249/2', 404, '' );
|
||||
}
|
||||
|
||||
$table = new \IPS\Helpers\Table\Db( 'nexus_purchases', \IPS\Http\Url::internal( "app=nexus&module=store&controller=packages&do=view_purchases&id={$package->id}" ), array( 'ps_app=? AND ps_type=? AND ps_item_id=?', 'nexus', 'package', $package->id ) );
|
||||
$table = new \IPS\Helpers\Table\Db( 'nexus_purchases', \IPS\Http\Url::internal( "app=nexus&module=store&controller=packages&do=view_purchases&id={$package->id}" ), array( array( 'ps_app=? AND ps_type=? AND ps_item_id=?', 'nexus', 'package', $package->id ) ) );
|
||||
$table->include = array( 'ps_id', 'ps_member', 'purchase_status', 'ps_start', 'ps_expire', 'ps_renewals' );
|
||||
$table->quickSearch = 'ps_id';
|
||||
$table->advancedSearch = array(
|
||||
|
||||
Reference in new issue
Block a user