Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

@@ -12,7 +12,7 @@
namespace IPS\nexus\modules\front\clients;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -60,7 +60,7 @@ class _billingagreements extends \IPS\Dispatcher\Controller
$where = array( 'ba_member=?', \IPS\Member::loggedIn()->member_id );
$parentContacts = \IPS\nexus\Customer::loggedIn()->parentContacts( array( 'billing=1' ) );
if ( count( $parentContacts ) )
if ( \count( $parentContacts ) )
{
$or = array();
foreach ( array_keys( iterator_to_array( $parentContacts ) ) as $id )
@@ -131,7 +131,7 @@ class _billingagreements extends \IPS\Dispatcher\Controller
}
/* Transactions */
$currentPage = isset( \IPS\Request::i()->page ) ? intval( \IPS\Request::i()->page ) : 1;
$currentPage = isset( \IPS\Request::i()->page ) ? \intval( \IPS\Request::i()->page ) : 1;
$perPage = 25;
$invoices = new \IPS\Patterns\ActiveRecordIterator(
\IPS\Db::i()->select(
@@ -139,14 +139,12 @@ class _billingagreements extends \IPS\Dispatcher\Controller
'nexus_invoices',
array( 'i_id IN(?)', \IPS\Db::i()->select( 't_invoice', 'nexus_transactions', array( 't_billing_agreement=?', $billingAgreement->id ) ) ),
'i_date DESC',
array( ( $currentPage - 1 ) * $perPage, $perPage ),
NULL,
NULL,
\IPS\Db::SELECT_SQL_CALC_FOUND_ROWS
array( ( $currentPage - 1 ) * $perPage, $perPage )
),
'IPS\nexus\Invoice'
);
$pagination = \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination( $billingAgreement->url(), ceil( $invoices->count( TRUE ) / $perPage ), $currentPage, $perPage );
$invoicesCount = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_invoices', array( 'i_id IN(?)', \IPS\Db::i()->select( 't_invoice', 'nexus_transactions', array( 't_billing_agreement=?', $billingAgreement->id ) ) ) )->first();
$pagination = \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination( $billingAgreement->url(), ceil( $invoicesCount / $perPage ), $currentPage, $perPage );
\IPS\Output::i()->breadcrumb[] = array( $billingAgreement->url(), $billingAgreement->gw_id );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('clients')->billingAgreement( $billingAgreement, $purchases, $invoices, $pagination );
@@ -163,7 +161,7 @@ class _billingagreements extends \IPS\Dispatcher\Controller
/* Check act */
$act = \IPS\Request::i()->act;
if ( !in_array( $act, array( 'suspend', 'reactivate', 'cancel' ) ) )
if ( !\in_array( $act, array( 'suspend', 'reactivate', 'cancel' ) ) )
{
\IPS\Output::i()->error( 'node_error', '3X321/3', 403, '' );
}