Version 4.2.0

This commit is contained in:
Neo committed 2025-12-19 05:44:59 -08:00
1 parent 0dc2aee5ed
commit 96997ddd8e
2074 files changed
+125454 -55780

No files matched your search

@@ -1,13 +1,12 @@
<?php
/**
* @brief View Customer
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Nexus
* @since 11 Feb 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\nexus\modules\admin\customers;
@@ -48,6 +47,12 @@ class _view extends \IPS\Dispatcher\Controller
}
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'customer.css', 'nexus', 'admin' ) );
if ( \IPS\Theme::i()->settings['responsive'] )
{
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'customer_responsive.css', 'nexus', 'admin' ) );
}
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'support.css', 'nexus', 'admin' ) );
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'admin_customer.js', 'nexus', 'admin' ) );
\IPS\Output::i()->title = "{$this->member->cm_name}";
@@ -254,6 +259,7 @@ class _view extends \IPS\Dispatcher\Controller
$cards[ $card->id ] = array(
'id' => $card->id,
'card_type' => $cardData->type,
'card_member' => $card->member->member_id,
'card_number' => $cardData->lastFour,
'card_expire' => ( !is_null( $cardData->expMonth ) AND !is_null( $cardData->expYear ) ) ? str_pad( $cardData->expMonth , 2, '0', STR_PAD_LEFT ). '/' . $cardData->expYear : NULL
);
@@ -355,7 +361,7 @@ class _view extends \IPS\Dispatcher\Controller
$alternativeContacts->parsers = array(
'alt_id' => function( $val )
{
return \IPS\nexus\Customer::load( $val )->name;
return "<a href='" . \IPS\nexus\Customer::load( $val )->acpUrl() . "'>" . \IPS\nexus\Customer::load( $val )->name . "</a>";
},
'email' => function ( $val, $row )
{
@@ -396,6 +402,11 @@ class _view extends \IPS\Dispatcher\Controller
$alternativeContacts->rowButtons = function( $row ) use ( $member )
{
return array(
'view' => array(
'link' => $member->acpUrl(),
'title' => 'view',
'icon' => 'search'
),
'edit' => array(
'link' => $member->acpUrl()->setQueryString( array( 'do' => 'alternativeContactForm', 'alt_id' => $row['alt_id'] ) ),
'title' => 'edit',
@@ -540,8 +551,10 @@ class _view extends \IPS\Dispatcher\Controller
$sparkline->addRow( array_merge( array( $datetime ), $row ) );
}
$sparkline = $sparkline->render( 'LineChart', array(
'backgroundColor' => '#F3F3F3',
$sparkline = $sparkline->render( 'AreaChart', array(
'areaOpacity' => 0.4,
'backgroundColor' => '#fff',
'colors' => array( '#10967e' ),
'chartArea' => array(
'left' => 0,
'top' => 0,
@@ -554,10 +567,11 @@ class _view extends \IPS\Dispatcher\Controller
'count' => 0,
)
),
'height' => 60 * ceil( ( ( count( \IPS\nexus\Money::currencies() ) * 2 ) + 2 ) / 4 ),
'height' => 60,
'legend' => array(
'position' => 'none',
),
'lineWidth' => 1,
'vAxis' => array(
'baselineColor' => '#F3F3F3',
'gridlines' => array(
@@ -576,7 +590,11 @@ class _view extends \IPS\Dispatcher\Controller
$support = \IPS\Theme::i()->getTemplate('support')->requestsTableResults( $results, NULL, FALSE, $tracked, $participatedIn, FALSE );
/* History */
$history = new \IPS\nexus\Customer\History( $this->member->acpUrl()->setQueryString( 'do', 'history' ), array( 'log_member=?', $this->member->member_id ) );
$extraHistoryTypes = array( 'email_change', 'password_change', 'display_name', 'mfa', 'merged' ); // define history types from other applications to include in commerce user history, i.e. changing MFA
$memberUrl = \IPS\Member::load( $this->member->member_id )->acpUrl();
$history = new \IPS\Member\History( $memberUrl->setQueryString( array( 'do' => 'history', 'nexus_return' => 1 ) ), array( array( 'log_member=? AND ( log_app=? OR ' . \IPS\Db::i()->in( 'log_type', $extraHistoryTypes ) . ' )', $this->member->member_id, 'nexus' ) ), TRUE, FALSE, TRUE );
$history->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'customers', 'nexus' ), 'historyTable' );
$history->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'customers', 'nexus' ), 'historyRows' );
$history->limit = 16;
/* Display */
@@ -590,11 +608,7 @@ class _view extends \IPS\Dispatcher\Controller
);
}
\IPS\Output::i()->sidebar['actions']['edit'] = array(
'title' => 'customer_edit_member',
'icon' => 'pencil',
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=edit&id=' . $this->member->member_id )
);
\IPS\Output::i()->customHeader = \IPS\Theme::i()->getTemplate( 'customers' )->viewHeader( $member );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('customers')->view( $member, (string) $notes, $noteCount, $primaryBillingAddress, (string) $cards, $cardCount, $parents, (string) $alternativeContacts, $altContactCount, $purchases, $purchaseCount, $invoices, $invoiceCount, $history, $referredBy, $referrals, $referCount, $support, $supportCount, $sparkline, $purchaseRootCount, $billingAgreements, $billingAgreementCount, $addressCount );
}
@@ -715,27 +729,6 @@ class _view extends \IPS\Dispatcher\Controller
\IPS\Output::i()->output = $purchases;
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'members_purchases', FALSE, array( 'sprintf' => array( $this->member->cm_name ) ) );
}
/**
* View History
*
* @return void
*/
public function history()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'customers_edit_details' );
$history = new \IPS\nexus\Customer\History( $this->member->acpUrl()->setQueryString( 'do', 'history' ), array( 'log_member=?', $this->member->member_id ) );
$history->limit = 30;
\IPS\Output::i()->output = $history;
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'customers_all_history', FALSE, array( 'sprintf' => array( $this->member->cm_name ) ) );
\IPS\Output::i()->sidebar['actions'][] = array(
'icon' => 'arrow-left',
'title' => 'view_account',
'link' => $this->member->acpUrl()
);
}
/**
* Edit Customer Fields