Version 4.2.0
This commit is contained in:
1 parent
0dc2aee5ed
commit
96997ddd8e
2074 files changed
+125454
-55780
No files matched your search
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Comission Rules
|
||||
* @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 15 Aug 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\customers;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief fields
|
||||
* @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 12 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\customers;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Purchases
|
||||
* @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;
|
||||
@@ -109,7 +108,7 @@ class _purchases extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
try
|
||||
{
|
||||
$customFields[ $k ] = \IPS\nexus\Package\CustomField::load( $k )->displayValue( $v );
|
||||
$customFields[ $k ] = \IPS\nexus\Package\CustomField::load( $k )->displayValue( $v, TRUE );
|
||||
}
|
||||
catch ( \OutOfRangeException $e ) { }
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief referralbanners
|
||||
* @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 18 Aug 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\customers;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Referrals
|
||||
* @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 15 Aug 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\customers;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Referral Settings
|
||||
* @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 15 Aug 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\customers;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Customer Search
|
||||
* @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 12 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\customers;
|
||||
@@ -42,12 +41,12 @@ class _search extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
$table = new \IPS\Helpers\Table\Db( 'nexus_customers', \IPS\Http\Url::internal('app=nexus&module=customers&controller=search') );
|
||||
$table = new \IPS\Helpers\Table\Db( 'core_members', \IPS\Http\Url::internal('app=nexus&module=customers&controller=search') );
|
||||
$table->langPrefix = 'customerTable_';
|
||||
$table->joins = array(
|
||||
array(
|
||||
'select' => 'core_members.*',
|
||||
'from' => 'core_members',
|
||||
'select' => 'nexus_customers.cm_first_name, nexus_customers.cm_last_name',
|
||||
'from' => 'nexus_customers',
|
||||
'where' => 'core_members.member_id=nexus_customers.member_id'
|
||||
),
|
||||
array(
|
||||
@@ -56,7 +55,7 @@ class _search extends \IPS\Dispatcher\Controller
|
||||
'where' => 'nexus_customer_addresses.member=nexus_customers.member_id AND primary_billing=1'
|
||||
)
|
||||
);
|
||||
$table->include = array( 'photo', 'cm_last_name', 'cm_first_name', 'email', 'address' );
|
||||
$table->include = array( 'photo', 'name', 'cm_last_name', 'cm_first_name', 'email', 'address' );
|
||||
$table->parsers = array(
|
||||
'photo' => function( $val, $row )
|
||||
{
|
||||
@@ -69,6 +68,7 @@ class _search extends \IPS\Dispatcher\Controller
|
||||
);
|
||||
$table->noSort = array( 'photo', 'address' );
|
||||
$table->quickSearch = 'email';
|
||||
$table->rowClasses = array( 'address' => array( 'ipsTable_wrap' ) );
|
||||
|
||||
$table->advancedSearch = array(
|
||||
'cm_first_name' => \IPS\Helpers\Table\SEARCH_CONTAINS_TEXT,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Hosting Server Errors
|
||||
* @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 12 Aug 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\hosting;
|
||||
@@ -46,6 +45,8 @@ class _errors extends \IPS\Dispatcher\Controller
|
||||
$table = new \IPS\Helpers\Table\Db( 'nexus_hosting_errors', \IPS\Http\Url::internal( 'app=nexus&module=hosting&controller=errors' ) );
|
||||
$table->include = array( 'e_time', 'e_server', 'e_account', 'e_function', 'e_message' );
|
||||
$table->langPrefix = 'hosting_';
|
||||
$table->rowClasses = array( 'e_message' => array( 'ipsTable_wrap' ) );
|
||||
$table->mainColumn = 'e_account';
|
||||
if ( !$table->sortBy )
|
||||
{
|
||||
$table->sortBy = 'e_time';
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Monitoring Settings
|
||||
* @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 07 Aug 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\hosting;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Hosting Queues
|
||||
* @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 06 Aug 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\hosting;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Hosting Servers
|
||||
* @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 06 Aug 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\hosting;
|
||||
@@ -65,12 +64,11 @@ class _servers extends \IPS\Node\Controller
|
||||
/* Buttons */
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'hosting', 'servers_add' ) )
|
||||
{
|
||||
$table->rootButtons = array(
|
||||
'add' => array(
|
||||
'title' => 'add',
|
||||
'icon' => 'plus',
|
||||
'link' => \IPS\Http\Url::internal('app=nexus&module=hosting&controller=servers&do=form')
|
||||
)
|
||||
\IPS\Output::i()->sidebar['actions']['add'] = array(
|
||||
'primary' => true,
|
||||
'title' => 'add',
|
||||
'icon' => 'plus',
|
||||
'link' => \IPS\Http\Url::internal('app=nexus&module=hosting&controller=servers&do=form')
|
||||
);
|
||||
}
|
||||
$table->rowButtons = function( $row )
|
||||
@@ -272,7 +270,13 @@ class _servers extends \IPS\Node\Controller
|
||||
}
|
||||
catch ( \IPS\nexus\Hosting\Exception $e )
|
||||
{
|
||||
\IPS\Output::i()->error( $e->getMessage(), '3X243/2', 500, '' );
|
||||
$message = $e->getMessage();
|
||||
if ( \IPS\Member::loggedIn()->language()->checkKeyExists( 'hosting_ex_' . $message ) )
|
||||
{
|
||||
$message = \IPS\Member::loggedIn()->language()->addToStack( 'hosting_ex_' . $message );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->error( $message, '3X243/2', 500, '' );
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplogs__server_reboot', array( $server->hostname => FALSE ) );
|
||||
@@ -358,7 +362,13 @@ class _servers extends \IPS\Node\Controller
|
||||
}
|
||||
catch ( \IPS\nexus\Hosting\Exception $e )
|
||||
{
|
||||
\IPS\Output::i()->error( $e->getMessage(), '3X243/4', 403, '' );
|
||||
$message = $e->getMessage();
|
||||
if ( \IPS\Member::loggedIn()->language()->checkKeyExists( 'hosting_ex_' . $message ) )
|
||||
{
|
||||
$message = \IPS\Member::loggedIn()->language()->addToStack( 'hosting_ex_' . $message );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->error( $message, '3X243/4', 403, '' );
|
||||
}
|
||||
|
||||
/* Init */
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Hosting Settings
|
||||
* @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 08 Aug 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\hosting;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Billing Agreememts
|
||||
* @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 16 Dec 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Checkout Settings
|
||||
* @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 28 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Currencies
|
||||
* @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 26 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief donations
|
||||
* @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 05 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief donations
|
||||
* @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 17 Jun 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Notification Copy Settings
|
||||
* @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 19 Aug 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Anti-Fraud Rules
|
||||
* @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 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Payment Gateways
|
||||
* @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 10 Feb 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Invoice Timeline
|
||||
* @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 19 Jun 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Invoices
|
||||
* @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\payments;
|
||||
@@ -67,6 +66,7 @@ class _invoices extends \IPS\Dispatcher\Controller
|
||||
'i_date' => \IPS\Helpers\Table\SEARCH_DATE_RANGE,
|
||||
);
|
||||
$table->quickSearch = 'i_id';
|
||||
$table->mainColumn = 'i_title';
|
||||
if ( $customer )
|
||||
{
|
||||
unset( $table->advancedSearch['i_member'] );
|
||||
@@ -98,8 +98,8 @@ class _invoices extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Display */
|
||||
\IPS\Output::i()->title = $customer ? \IPS\Member::loggedIn()->language()->addToStack( 'members_invoices', FALSE, array( 'sprintf' => array( $customer->cm_name ) ) ) : \IPS\Member::loggedIn()->language()->addToStack('menu__nexus_payments_invoices');
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->block( 'title', (string) $table );
|
||||
\IPS\Output::i()->title = $customer ? \IPS\Member::loggedIn()->language()->addToStack( 'members_invoices', FALSE, array( 'sprintf' => array( $customer->cm_name ) ) ) : \IPS\Member::loggedIn()->language()->addToStack('menu__nexus_payments_invoices');
|
||||
\IPS\Output::i()->output = (string) $table;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -764,7 +764,7 @@ class _invoices extends \IPS\Dispatcher\Controller
|
||||
$invoice->delete();
|
||||
|
||||
/* Redirect */
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=nexus&module=payments&controller=invoices') );
|
||||
$this->_redirect( $invoice );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Payment Settings
|
||||
* @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 26 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Payouts
|
||||
* @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 07 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Transaction Review
|
||||
* @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 26 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Shipments
|
||||
* @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 20 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
@@ -134,7 +133,7 @@ class _shipping extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Display */
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('shipping');
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->block( 'title', (string) $table );
|
||||
\IPS\Output::i()->output = (string) $table;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -667,12 +666,12 @@ class _shipping extends \IPS\Dispatcher\Controller
|
||||
|
||||
if ( \IPS\Request::i()->print === 'label' )
|
||||
{
|
||||
$output = \IPS\Theme::i()->getTemplate('shiporders')->packingLabel( $shipment );
|
||||
$output = \IPS\Theme::i()->getTemplate('shiporders', 'nexus', 'global')->packingLabel( $shipment );
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'shipping.css', 'nexus' ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = \IPS\Theme::i()->getTemplate('shiporders')->packingSheet( $shipment );
|
||||
$output = \IPS\Theme::i()->getTemplate('shiporders', 'nexus', 'global')->packingSheet( $shipment );
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'shipping.css', 'nexus' ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Shipping Rates
|
||||
* @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 13 Feb 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Tax Classes
|
||||
* @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 12 Feb 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\payments;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Transactions
|
||||
* @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\payments;
|
||||
@@ -60,7 +59,7 @@ class _transactions extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Display */
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__nexus_payments_transactions');
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->block( 'title', (string) $table );
|
||||
\IPS\Output::i()->output = (string) $table;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -318,7 +317,7 @@ class _transactions extends \IPS\Dispatcher\Controller
|
||||
$form = new \IPS\Helpers\Form;
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'refund_method', ( $method and $method::SUPPORTS_REFUNDS ) ? 'gateway' : 'credit', TRUE, array( 'options' => $refundMethods, 'toggles' => $refundMethodToggles ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'refund_amount', ( $transaction->status === \IPS\nexus\Transaction::STATUS_PART_REFUNDED ? $transaction->amount->amount->subtract( $transaction->partial_refund->amount ) : 0 ), TRUE, array( 'unlimited' => 0, 'unlimitedLang' => \IPS\Member::loggedIn()->language()->addToStack( 'refund_full', FALSE, array( 'sprintf' => array( $transaction->amount ) ) ), 'max' => (string) $transaction->amount->amount->subtract( $transaction->partial_refund->amount ), 'decimals' => TRUE ), NULL, NULL, $transaction->amount->currency, 'refund_amount' ) );
|
||||
if ( $transaction->invoice->status === \IPS\nexus\Invoice::STATUS_PAID )
|
||||
if ( $transaction->invoice !== NULL and $transaction->invoice->status === \IPS\nexus\Invoice::STATUS_PAID )
|
||||
{
|
||||
$field = new \IPS\Helpers\Form\Radio( 'refund_invoice_status', \IPS\nexus\Invoice::STATUS_PENDING, TRUE, array(
|
||||
'options' => array(
|
||||
@@ -353,20 +352,23 @@ class _transactions extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Handle invoice */
|
||||
if ( isset( $values['refund_invoice_status'] ) and $values['refund_invoice_status'] !== \IPS\nexus\Invoice::STATUS_PAID )
|
||||
if( $transaction->invoice !== NULL )
|
||||
{
|
||||
$transaction->invoice->markUnpaid( $values['refund_invoice_status'] );
|
||||
if ( isset( $values['refund_invoice_status'] ) and $values['refund_invoice_status'] !== \IPS\nexus\Invoice::STATUS_PAID )
|
||||
{
|
||||
$transaction->invoice->markUnpaid( $values['refund_invoice_status'] );
|
||||
|
||||
$transaction->invoice->member->log( 'invoice', array(
|
||||
'type' => 'status',
|
||||
'new' => $values['refund_invoice_status'],
|
||||
'id' => $transaction->invoice->id,
|
||||
'title' => $transaction->invoice->title
|
||||
) );
|
||||
$transaction->invoice->member->log( 'invoice', array(
|
||||
'type' => 'status',
|
||||
'new' => $values['refund_invoice_status'],
|
||||
'id' => $transaction->invoice->id,
|
||||
'title' => $transaction->invoice->title
|
||||
) );
|
||||
}
|
||||
|
||||
/* Send Email */
|
||||
$transaction->sendNotification();
|
||||
}
|
||||
|
||||
/* Send Email */
|
||||
$transaction->sendNotification();
|
||||
|
||||
/* Redirect */
|
||||
$this->_redirect( $transaction );
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Income Report
|
||||
* @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 14 Aug 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\reports;
|
||||
@@ -50,13 +49,19 @@ class _income extends \IPS\Dispatcher\Controller
|
||||
|
||||
$activeTab = ( isset( \IPS\Request::i()->tab ) and array_key_exists( \IPS\Request::i()->tab, $tabs ) ) ? \IPS\Request::i()->tab : 'totals';
|
||||
|
||||
$chart = new \IPS\Helpers\Chart\Dynamic(
|
||||
$chart = new \IPS\Helpers\Chart\Database(
|
||||
\IPS\Http\Url::internal( 'app=nexus&module=reports&controller=income&tab=' . $activeTab ),
|
||||
'nexus_transactions',
|
||||
't_date',
|
||||
'',
|
||||
array(),
|
||||
'LineChart',
|
||||
array(
|
||||
'backgroundColor' => '#ffffff',
|
||||
'colors' => array( '#10967e', '#ea7963', '#de6470', '#6b9dde', '#b09be4', '#eec766', '#9fc973', '#e291bf', '#55c1a6', '#5fb9da' ),
|
||||
'hAxis' => array( 'gridlines' => array( 'color' => '#f5f5f5' ) ),
|
||||
'lineWidth' => 1,
|
||||
'areaOpacity' => 0.4,
|
||||
),
|
||||
'AreaChart',
|
||||
'monthly',
|
||||
array( 'start' => 0, 'end' => 0 ),
|
||||
array(),
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Markets Report
|
||||
* @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 14 Aug 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\reports;
|
||||
@@ -50,12 +49,18 @@ class _markets extends \IPS\Dispatcher\Controller
|
||||
|
||||
$activeTab = ( isset( \IPS\Request::i()->tab ) and array_key_exists( \IPS\Request::i()->tab, $tabs ) ) ? \IPS\Request::i()->tab : 'count';
|
||||
|
||||
$chart = new \IPS\Helpers\Chart\Dynamic(
|
||||
$chart = new \IPS\Helpers\Chart\Database(
|
||||
\IPS\Http\Url::internal( 'app=nexus&module=reports&controller=markets&tab=' . $activeTab ),
|
||||
'nexus_invoices',
|
||||
'i_paid',
|
||||
'',
|
||||
array(),
|
||||
array(
|
||||
'backgroundColor' => '#ffffff',
|
||||
'colors' => array( '#10967e', '#ea7963', '#de6470', '#6b9dde', '#b09be4', '#eec766', '#9fc973', '#e291bf', '#55c1a6', '#5fb9da' ),
|
||||
'hAxis' => array( 'gridlines' => array( 'color' => '#f5f5f5' ) ),
|
||||
'lineWidth' => 1,
|
||||
'areaOpacity' => 0.4,
|
||||
),
|
||||
'GeoChart',
|
||||
'monthly',
|
||||
array( 'start' => 0, 'end' => 0 ),
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Purchases Reports
|
||||
* @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 14 Aug 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\reports;
|
||||
@@ -42,10 +41,18 @@ class _purchases extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
$chart = new \IPS\Helpers\Chart\Dynamic(
|
||||
$chart = new \IPS\Helpers\Chart\Database(
|
||||
\IPS\Http\Url::internal('app=nexus&module=reports&controller=purchases'),
|
||||
'nexus_purchases',
|
||||
'ps_start'
|
||||
'ps_start',
|
||||
'',
|
||||
array(
|
||||
'backgroundColor' => '#ffffff',
|
||||
'colors' => array( '#10967e', '#ea7963', '#de6470', '#6b9dde', '#b09be4', '#eec766', '#9fc973', '#e291bf', '#55c1a6', '#5fb9da' ),
|
||||
'hAxis' => array( 'gridlines' => array( 'color' => '#f5f5f5' ) ),
|
||||
'lineWidth' => 1,
|
||||
'areaOpacity' => 0.4,
|
||||
)
|
||||
);
|
||||
$chart->where[] = array( 'ps_app=? AND ps_type=?', 'nexus', 'package' );
|
||||
$chart->groupBy = 'ps_item_id';
|
||||
@@ -61,7 +68,7 @@ class _purchases extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$chart->addSeries( $name, 'number', 'COUNT(*)', TRUE, $id );
|
||||
}
|
||||
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__nexus_reports_purchases');
|
||||
\IPS\Output::i()->output = (string) $chart;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Coupons
|
||||
* @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 05 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\store;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief fields
|
||||
* @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 01 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\store;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Packages
|
||||
* @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 29 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\store;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Store Settings
|
||||
* @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 05 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\store;
|
||||
@@ -61,9 +60,14 @@ class _settings extends \IPS\Dispatcher\Controller
|
||||
|
||||
$form = new \IPS\Helpers\Form;
|
||||
$form->addTab('nexus_store_display');
|
||||
$form->addHeader('nexus_store_tax');
|
||||
$form->addHeader('nexus_store_prices');
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'nexus_show_tax', \IPS\Settings::i()->nexus_show_tax ) );
|
||||
$form->add( new \IPS\Helpers\Form\Translatable( 'nexus_tax_explain', NULL, FALSE, array( 'app' => 'nexus', 'key' => 'nexus_tax_explain_val', 'placeholder' => \IPS\Member::loggedIn()->language()->addToStack('nexus_tax_explain_placeholder') ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'nexus_show_renew_option_savings', \IPS\Settings::i()->nexus_show_renew_option_savings, FALSE, array( 'options' => array(
|
||||
'none' => 'nexus_show_renew_option_savings_none',
|
||||
'amount' => 'nexus_show_renew_option_savings_amount',
|
||||
'percent' => 'nexus_show_renew_option_savings_percent',
|
||||
) ) ) );
|
||||
$form->addHeader( 'nexus_store_index' );
|
||||
$form->add( new \IPS\Helpers\Form\Custom( 'nexus_store_new', explode( ',', \IPS\Settings::i()->nexus_store_new ), FALSE, array(
|
||||
'getHtml' => function( $field )
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Autoresolve Settings
|
||||
* @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 25 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\support;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Customer Feedback Settings
|
||||
* @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 23 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\support;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Support Departments
|
||||
* @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 08 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\support;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Support Custom Fields
|
||||
* @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 16 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\support;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Incoming Email Setup
|
||||
* @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 16 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\support;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Outgoing Email Settings
|
||||
* @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 18 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\support;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Support Reports
|
||||
* @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 23 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\support;
|
||||
@@ -136,12 +135,17 @@ class _reports extends \IPS\Dispatcher\Controller
|
||||
/* Replies */
|
||||
elseif ( $activeTab === 'replies' )
|
||||
{
|
||||
$staffRepliesChart = new \IPS\Helpers\Chart\Dynamic( \IPS\Http\Url::internal( 'app=nexus&module=support&controller=reports&tab=replies' ), 'nexus_support_replies', 'reply_date', '',
|
||||
$staffRepliesChart = new \IPS\Helpers\Chart\Database( \IPS\Http\Url::internal( 'app=nexus&module=support&controller=reports&tab=replies' ), 'nexus_support_replies', 'reply_date', '',
|
||||
array(
|
||||
'vAxis' => array( 'title' => \IPS\Member::loggedIn()->language()->addToStack('replies_made') ),
|
||||
'height' => 700
|
||||
'height' => 700,
|
||||
'backgroundColor' => '#ffffff',
|
||||
'colors' => array( '#10967e', '#ea7963', '#de6470', '#6b9dde', '#b09be4', '#eec766', '#9fc973', '#e291bf', '#55c1a6', '#5fb9da' ),
|
||||
'hAxis' => array( 'gridlines' => array( 'color' => '#f5f5f5' ) ),
|
||||
'lineWidth' => 1,
|
||||
'areaOpacity' => 0.4
|
||||
),
|
||||
'LineChart', 'daily', array( 'start' => \IPS\DateTime::create()->sub( new \DateInterval( 'P1M' ) ), 'end' => 0 )
|
||||
'AreaChart', 'daily', array( 'start' => \IPS\DateTime::create()->sub( new \DateInterval( 'P1M' ) ), 'end' => 0 )
|
||||
);
|
||||
$staffRepliesChart->where[] = array( 'reply_type=?', \IPS\nexus\Support\Reply::REPLY_STAFF );
|
||||
$staffRepliesChart->groupBy = 'reply_member';
|
||||
@@ -156,10 +160,15 @@ class _reports extends \IPS\Dispatcher\Controller
|
||||
/* Replies */
|
||||
elseif ( $activeTab === 'feedback_ratings' )
|
||||
{
|
||||
$staffRatingsChart = new \IPS\Helpers\Chart\Dynamic( \IPS\Http\Url::internal( 'app=nexus&module=support&controller=reports&tab=feedback_ratings' ), 'nexus_support_ratings', 'rating_date', '',
|
||||
$staffRatingsChart = new \IPS\Helpers\Chart\Database( \IPS\Http\Url::internal( 'app=nexus&module=support&controller=reports&tab=feedback_ratings' ), 'nexus_support_ratings', 'rating_date', '',
|
||||
array(
|
||||
'vAxis' => array( 'title' => \IPS\Member::loggedIn()->language()->addToStack('average_rating'), 'viewWindow' => array( 'min' => 0, 'max' => 5 ) ),
|
||||
'height' => 700
|
||||
'height' => 700,
|
||||
'backgroundColor' => '#ffffff',
|
||||
'colors' => array( '#10967e', '#ea7963', '#de6470', '#6b9dde', '#b09be4', '#eec766', '#9fc973', '#e291bf', '#55c1a6', '#5fb9da' ),
|
||||
'hAxis' => array( 'gridlines' => array( 'color' => '#f5f5f5' ) ),
|
||||
'lineWidth' => 1,
|
||||
'areaOpacity' => 0.4
|
||||
),
|
||||
'ColumnChart', 'monthly', array( 'start' => \IPS\DateTime::create()->sub( new \DateInterval( 'P1M' ) ), 'end' => \IPS\DateTime::create() )
|
||||
);
|
||||
@@ -367,11 +376,21 @@ class _reports extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Display */
|
||||
$activeTabContents = \IPS\Theme::i()->getTemplate('supportreports')->timeChart( $chart->render( 'ColumnChart' ), \IPS\Http\Url::internal( "app=nexus&module=support&controller=reports&do=staff&id={$staff->member_id}&tab=productivity" )->setQueryString( array(
|
||||
'span' => $span,
|
||||
'timeframe' => $timeframe,
|
||||
'type' => $type
|
||||
) ) );
|
||||
$activeTabContents = \IPS\Theme::i()->getTemplate('supportreports')->timeChart(
|
||||
$chart->render( 'SteppedAreaChart', array(
|
||||
'legend' => array( 'position' => 'none' ),
|
||||
'areaOpacity' => 0.4,
|
||||
'lineWidth' => 1,
|
||||
'backgroundColor' => '#ffffff',
|
||||
'colors' => array( '#10967e' ),
|
||||
'hAxis' => array( 'gridlines' => array( 'color' => '#f5f5f5' ) ),
|
||||
) ),
|
||||
\IPS\Http\Url::internal( "app=nexus&module=support&controller=reports&do=staff&id={$staff->member_id}&tab=productivity" )->setQueryString( array(
|
||||
'span' => $span,
|
||||
'timeframe' => $timeframe,
|
||||
'type' => $type
|
||||
) )
|
||||
);
|
||||
}
|
||||
|
||||
/* Latest Replies */
|
||||
@@ -388,7 +407,7 @@ class _reports extends \IPS\Dispatcher\Controller
|
||||
/* Feedback */
|
||||
elseif ( $activeTab === 'feedback_ratings' )
|
||||
{
|
||||
$staffRatingsChart = new \IPS\Helpers\Chart\Dynamic( \IPS\Http\Url::internal( "app=nexus&module=support&controller=reports&do=staff&id={$staff->member_id}&tab=feedback_ratings" ), 'nexus_support_ratings', 'rating_date', '',
|
||||
$staffRatingsChart = new \IPS\Helpers\Chart\Database( \IPS\Http\Url::internal( "app=nexus&module=support&controller=reports&do=staff&id={$staff->member_id}&tab=feedback_ratings" ), 'nexus_support_ratings', 'rating_date', '',
|
||||
array(
|
||||
'vAxis' => array( 'title' => \IPS\Member::loggedIn()->language()->addToStack('average_rating'), 'viewWindow' => array( 'min' => 0, 'max' => 5 ) ),
|
||||
'legend' => 'none'
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Support Request View
|
||||
* @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 09 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\support;
|
||||
@@ -140,7 +139,7 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
}
|
||||
|
||||
/* Init buttons */
|
||||
\IPS\Output::i()->sidebar['actions'] = array(
|
||||
$requestActions = array(
|
||||
'status' => array(
|
||||
'icon' => 'tag',
|
||||
'title' => $this->request->status->_title,
|
||||
@@ -165,21 +164,6 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
'data' => array( 'role' => 'departmentMenu', 'controller' => 'nexus.admin.support.metamenu' ),
|
||||
'tooltip' => \IPS\Member::loggedIn()->language()->addToStack('keyboard_shortcut_department')
|
||||
),
|
||||
'staff' => array(
|
||||
'icon' => 'user',
|
||||
'title' => $this->request->staff ? $this->request->staff->name : 'unassigned',
|
||||
'menu' => array(),
|
||||
'menuClass' => 'ipsMenu_selectable',
|
||||
'data' => array( 'controller' => 'nexus.admin.support.metamenu', 'role' => 'staffMenu' ),
|
||||
'tooltip' => \IPS\Member::loggedIn()->language()->addToStack('keyboard_shortcut_staff')
|
||||
),
|
||||
'purchase' => array(
|
||||
'icon' => 'cube',
|
||||
'title' => 'associate_purchase',
|
||||
'link' => $this->request->acpUrl()->setQueryString( 'do', 'associate' ),
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('associate'), 'ipsDialog-size' => 'narrow', 'role' => 'associatePurchaseMenu' ),
|
||||
'tooltip' => \IPS\Member::loggedIn()->language()->addToStack('keyboard_shortcut_purchase')
|
||||
),
|
||||
'track' => array(
|
||||
'icon' => 'bookmark',
|
||||
'title' => $trackLang,
|
||||
@@ -203,22 +187,21 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
'menuClass' => 'ipsMenu_selectable',
|
||||
'data' => array( 'role' => 'trackMenu', 'controller' => 'nexus.admin.support.metamenu' ),
|
||||
'tooltip' => \IPS\Member::loggedIn()->language()->addToStack('keyboard_shortcut_tracking')
|
||||
)
|
||||
),
|
||||
'staff' => array(
|
||||
'icon' => 'user',
|
||||
'title' => $this->request->staff ? $this->request->staff->name : 'unassigned',
|
||||
'menu' => array(),
|
||||
'menuClass' => 'ipsMenu_selectable',
|
||||
'data' => array( 'controller' => 'nexus.admin.support.metamenu', 'role' => 'staffMenu' ),
|
||||
'tooltip' => \IPS\Member::loggedIn()->language()->addToStack('keyboard_shortcut_staff')
|
||||
),
|
||||
);
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'support', 'requests_delete' ) )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['delete'] = array(
|
||||
'icon' => 'times-circle',
|
||||
'title' => 'delete',
|
||||
'link' => $this->request->acpUrl()->setQueryString( 'do', 'delete' ),
|
||||
'data' => array( 'confirm' => '' )
|
||||
);
|
||||
}
|
||||
|
||||
/* Populate statuses */
|
||||
foreach ( Support\Status::roots() as $status )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['status']['menu'][] = array(
|
||||
$requestActions['status']['menu'][] = array(
|
||||
'class' => $status->id === $this->request->status->id ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => $status->_title,
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'status', 'status' => $status->id ) )
|
||||
@@ -234,7 +217,7 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
{
|
||||
foreach ( Support\Severity::roots() as $severity )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['severity']['menu'][] = array(
|
||||
$requestActions['severity']['menu'][] = array(
|
||||
'class' => $severity->id === $this->request->severity->id ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => $severity->_title,
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'severity', 'severity' => $severity->id ) ),
|
||||
@@ -244,14 +227,14 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
|
||||
if ( $this->request->member and \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'support', 'requests_block_sev' ) )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['severity']['menu'][] = array( 'hr' => TRUE );
|
||||
\IPS\Output::i()->sidebar['actions']['severity']['menu'][] = array(
|
||||
$requestActions['severity']['menu'][] = array( 'hr' => TRUE );
|
||||
$requestActions['severity']['menu'][] = array(
|
||||
'class' => !$this->request->author()->cm_no_sev ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'cm_no_sev_off', FALSE, array( 'sprintf' => array( $this->request->supportAuthor()->name() ) ) ),
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'noSev', 'no_sev' => 0 ) ),
|
||||
'data' => array( 'group' => 'no_sev', 'noSet' => 'true' ),
|
||||
);
|
||||
\IPS\Output::i()->sidebar['actions']['severity']['menu'][] = array(
|
||||
$requestActions['severity']['menu'][] = array(
|
||||
'class' => $this->request->author()->cm_no_sev ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'cm_no_sev_on', FALSE, array( 'sprintf' => array( $this->request->supportAuthor()->name() ) ) ),
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'noSev', 'no_sev' => 1 ) ),
|
||||
@@ -263,7 +246,7 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
/* Populate departments */
|
||||
foreach ( Support\Department::roots() as $department )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['department']['menu'][] = array(
|
||||
$requestActions['department']['menu'][] = array(
|
||||
'class' => $department->id === $this->request->department->id ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => $department->_title,
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'department', 'department' => $department->id ) )
|
||||
@@ -273,34 +256,56 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
/* Populate staff */
|
||||
foreach ( Support\Request::staff() as $id => $name )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['staff']['menu'][] = array(
|
||||
$requestActions['staff']['menu'][] = array(
|
||||
'class' => ( $this->request->staff and $id === $this->request->staff->member_id ) ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => $name,
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'staff', 'staff' => $id ) ),
|
||||
'data' => array( 'group' => 'staff', 'id' => $id ),
|
||||
);
|
||||
}
|
||||
\IPS\Output::i()->sidebar['actions']['staff']['menu'][] = array(
|
||||
$requestActions['staff']['menu'][] = array(
|
||||
'class' => !$this->request->staff ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => 'unassigned',
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'staff', 'staff' => 0 ) ),
|
||||
'data' => array( 'group' => 'staff', 'id' => 0 ),
|
||||
);
|
||||
\IPS\Output::i()->sidebar['actions']['staff']['menu'][] = array( 'hr' => TRUE );
|
||||
\IPS\Output::i()->sidebar['actions']['staff']['menu'][] = array(
|
||||
$requestActions['staff']['menu'][] = array( 'hr' => TRUE );
|
||||
$requestActions['staff']['menu'][] = array(
|
||||
'class' => $this->request->staff_lock ? 'ipsMenu_itemChecked' : '',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'request_staff_lock_on' ),
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'staffLock', 'lock' => 1 ) ),
|
||||
'data' => array( 'group' => 'staff_lock', 'noSet' => 'true' ),
|
||||
);
|
||||
\IPS\Output::i()->sidebar['actions']['staff']['menu'][] = array(
|
||||
$requestActions['staff']['menu'][] = array(
|
||||
'class' => !$this->request->staff_lock ? 'ipsMenu_itemChecked' : '',
|
||||
'title' =>\IPS\Member::loggedIn()->language()->addToStack( 'request_staff_lock_off' ),
|
||||
'link' => $this->request->acpUrl()->setQueryString( array( 'do' => 'staffLock', 'lock' => 0 ) ),
|
||||
'data' => array( 'group' => 'staff_lock', 'noSet' => 'true' ),
|
||||
);
|
||||
|
||||
/* Regular actions */
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'support', 'requests_delete' ) )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['delete'] = array(
|
||||
'icon' => 'times-circle',
|
||||
'title' => 'delete',
|
||||
'link' => $this->request->acpUrl()->setQueryString( 'do', 'delete' ),
|
||||
'data' => array( 'confirm' => '' )
|
||||
);
|
||||
}
|
||||
|
||||
\IPS\Output::i()->sidebar['actions']['purchase'] = array(
|
||||
'icon' => 'cube',
|
||||
'title' => 'associate_purchase',
|
||||
'link' => $this->request->acpUrl()->setQueryString( 'do', 'associate' ),
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('associate'), 'ipsDialog-size' => 'narrow', 'role' => 'associatePurchaseMenu' ),
|
||||
'tooltip' => \IPS\Member::loggedIn()->language()->addToStack('keyboard_shortcut_purchase')
|
||||
);
|
||||
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'support' )->request( $this->request, $requestActions );
|
||||
|
||||
/* Display */
|
||||
\IPS\Output::i()->customHeader = \IPS\Theme::i()->getTemplate( 'support' )->requestHeader( $this->request );
|
||||
\IPS\Output::i()->title = "#{$this->request->id} " . $this->request->mapped('title');
|
||||
\IPS\Output::i()->showTitle = FALSE;
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'admin_support.js', 'nexus', 'admin' ) );
|
||||
@@ -498,7 +503,11 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Discard the message and any related changes */
|
||||
$url = $message->item()->acpUrl();
|
||||
$message->delete();
|
||||
|
||||
\IPS\Output::i()->redirect( $url );
|
||||
}
|
||||
|
||||
if ( isset( \IPS\Request::i()->department ) and \IPS\Request::i()->department != -1 )
|
||||
@@ -944,6 +953,7 @@ class _request extends \IPS\nexus\modules\front\support\view
|
||||
{
|
||||
$request = Support\Request::loadAndCheckPerms( \IPS\Request::i()->id );
|
||||
$request->mergeIn( array( Support\Request::loadAndCheckPerms( \IPS\Request::i()->merge ) ) ) ;
|
||||
$request->log( 'merge', 0, 0 );
|
||||
\IPS\Output::i()->redirect( $request->acpUrl() );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Support Requests
|
||||
* @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 09 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\support;
|
||||
@@ -982,13 +981,15 @@ class _requests extends \IPS\Dispatcher\Controller
|
||||
$datetime->setTime( 0, 0, 0 );
|
||||
$chart->addRow( array( $datetime, $count ) );
|
||||
}
|
||||
$chart = $chart->render( 'ColumnChart', array(
|
||||
'backgroundColor' => '#f5f5f5',
|
||||
$chart = $chart->render( 'SteppedAreaChart', array(
|
||||
'backgroundColor' => '#fff',
|
||||
'areaOpacity' => 0.4,
|
||||
'chartArea' => array( 'width' => '97%', 'height' => '81%' ),
|
||||
'colors' => array( '#394248' ),
|
||||
'colors' => array( '#10967e' ),
|
||||
'fontSize' => 10,
|
||||
'height' => 150,
|
||||
'vAxis' => array( 'gridlines' => array( 'count' => 4 ), 'maxValue' => max( $data ), 'textPosition' => 'none' ),
|
||||
'lineWidth' => 1,
|
||||
'vAxis' => array( 'gridlines' => array( 'color' => '#f0f0f0', 'count' => 4 ), 'maxValue' => max( $data ), 'textPosition' => 'none' ),
|
||||
'hAxis' => array( 'gridlines' => array( 'color' => '#f5f5f5' ) ),
|
||||
'legend' => array( 'position' => 'none' )
|
||||
) );
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Support Settings
|
||||
* @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 15 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\support;
|
||||
@@ -89,6 +88,11 @@ class _settings extends \IPS\Dispatcher\Controller
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'forms', 'core' )->blurb( $tabs[ $activeTab ] . '_blurb', TRUE, TRUE ) . \IPS\Output::i()->output;
|
||||
}
|
||||
|
||||
if ( $method !== 'form' )
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->paddedBlock( \IPS\Output::i()->output );
|
||||
}
|
||||
|
||||
if ( $method !== 'manage' or \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief severities
|
||||
* @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 09 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\support;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Support Statuses
|
||||
* @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 09 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\support;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief stockactions
|
||||
* @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 15 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\support;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief New Support Request Volumme
|
||||
* @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 25 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\admin\support;
|
||||
@@ -42,18 +41,23 @@ class _volume extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
$chart = new \IPS\Helpers\Chart\Dynamic( \IPS\Http\Url::internal( 'app=nexus&module=support&controller=volume' ), 'nexus_support_requests', 'r_started', '',
|
||||
$chart = new \IPS\Helpers\Chart\Database( \IPS\Http\Url::internal( 'app=nexus&module=support&controller=volume' ), 'nexus_support_requests', 'r_started', '',
|
||||
array(
|
||||
'vAxis' => array( 'title' => \IPS\Member::loggedIn()->language()->addToStack('support_requests_created') ),
|
||||
'backgroundColor' => '#ffffff',
|
||||
'colors' => array( '#10967e', '#ea7963', '#de6470', '#6b9dde', '#b09be4', '#eec766', '#9fc973', '#e291bf', '#55c1a6', '#5fb9da' ),
|
||||
'hAxis' => array( 'gridlines' => array( 'color' => '#f5f5f5' ) ),
|
||||
'lineWidth' => 1,
|
||||
'areaOpacity' => 0.4,
|
||||
),
|
||||
'LineChart'
|
||||
'AreaChart'
|
||||
);
|
||||
$chart->groupBy = 'r_department';
|
||||
foreach( \IPS\nexus\Support\Department::roots() as $department )
|
||||
{
|
||||
$chart->addSeries( $department->_title, 'number', 'COUNT(*)', TRUE, $department->id );
|
||||
}
|
||||
|
||||
|
||||
\IPS\Output::i()->output = (string) $chart;
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__nexus_support_volume');
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Checkout
|
||||
* @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 10 Feb 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\checkout;
|
||||
@@ -189,7 +188,7 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/* Init */
|
||||
$buttonLang = 'continue_to_review';
|
||||
$needBillingInfo = $this->invoice->hasItemsRequiringBillingAddress() or $this->invoice->hasPhysicalItems();
|
||||
$needBillingInfo = ( $this->invoice->hasItemsRequiringBillingAddress() or $this->invoice->hasPhysicalItems() );
|
||||
|
||||
if ( $this->invoice->hasPhysicalItems() )
|
||||
{
|
||||
@@ -529,7 +528,8 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
if ( $field->purchase_show )
|
||||
{
|
||||
$column = $field->column;
|
||||
$member->$column = $values["nexus_ccfield_{$field->id}"];
|
||||
$helper = $field->buildHelper();
|
||||
$member->$column = $helper::stringValue( $values["nexus_ccfield_{$field->id}"] );
|
||||
}
|
||||
|
||||
if ( $field->type === 'Editor' )
|
||||
@@ -575,10 +575,10 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
foreach ( array( 'cm_first_name', 'cm_last_name' ) as $k )
|
||||
{
|
||||
if ( $values[ $k ] != $this->invoice->member->$k )
|
||||
if ( $values[ $k ] != \IPS\nexus\Customer::loggedIn()->$k )
|
||||
{
|
||||
$changes['name'] = $this->invoice->member->cm_name;
|
||||
$this->invoice->member->$k = $values[ $k ];
|
||||
$changes['name'] = \IPS\nexus\Customer::loggedIn()->cm_name;
|
||||
\IPS\nexus\Customer::loggedIn()->$k = $values[ $k ];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -587,27 +587,29 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
if ( $field->purchase_show )
|
||||
{
|
||||
$column = $field->column;
|
||||
if ( $this->invoice->member->$column != $values["nexus_ccfield_{$field->id}"] )
|
||||
$helper = $field->buildHelper();
|
||||
$valueToSave = $helper::stringValue( $values["nexus_ccfield_{$field->id}"] );
|
||||
if ( \IPS\nexus\Customer::loggedIn()->$column != $valueToSave )
|
||||
{
|
||||
$changes['other'][] = array( 'name' => 'nexus_ccfield_' . $field->id, 'value' => $field->displayValue( $values["nexus_ccfield_{$field->id}"] ), 'old' => $this->invoice->member->$column );
|
||||
$changes['other'][] = array( 'name' => 'nexus_ccfield_' . $field->id, 'value' => $field->displayValue( $valueToSave ), 'old' => $field->displayValue( \IPS\nexus\Customer::loggedIn()->$column ) );
|
||||
}
|
||||
$this->invoice->member->$column = $values["nexus_ccfield_{$field->id}"];
|
||||
\IPS\nexus\Customer::loggedIn()->$column = $valueToSave;
|
||||
}
|
||||
}
|
||||
if ( !empty( $changes ) )
|
||||
{
|
||||
$this->invoice->member->log( 'info', $changes );
|
||||
\IPS\nexus\Customer::loggedIn()->log( 'info', $changes );
|
||||
}
|
||||
|
||||
/* We only want to do this if it's an actual account */
|
||||
if ( $this->invoice->member->member_id )
|
||||
if ( \IPS\nexus\Customer::loggedIn()->member_id )
|
||||
{
|
||||
$this->invoice->member->save();
|
||||
\IPS\nexus\Customer::loggedIn()->save();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Otherwise, we need to store this as guest data */
|
||||
$this->invoice->guest_data = array( 'member' => $this->invoice->member->changed, 'profileFields' => array(), 'securityAnswers' => array() );
|
||||
$this->invoice->guest_data = array( 'member' => \IPS\nexus\Customer::loggedIn()->changed, 'profileFields' => array(), 'securityAnswers' => array() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -704,14 +706,13 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
\IPS\Session::i()->setAnon();
|
||||
}
|
||||
$member->checkLoginKey();
|
||||
if ( $rememberMe )
|
||||
{
|
||||
$expire = new \IPS\DateTime;
|
||||
$expire->add( new \DateInterval( 'P3M' ) );
|
||||
\IPS\Request::i()->setCookie( 'member_id', $member->member_id, $expire );
|
||||
\IPS\Request::i()->setCookie( 'pass_hash', $member->member_login_key, $expire );
|
||||
}
|
||||
|
||||
/* Log device */
|
||||
$device = \IPS\Member\Device::loadOrCreate( $member, FALSE );
|
||||
$device->anonymous = $anonymous and !\IPS\Settings::i()->disable_anonymous;
|
||||
$device->updateAfterAuthentication( $rememberMe );
|
||||
|
||||
/* Member Sync */
|
||||
$member->memberSync( 'onLogin', array( $this->invoice->checkoutUrl() ) );
|
||||
|
||||
/* Set the invoice owner */
|
||||
@@ -1047,10 +1048,12 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$addressLines = $address->addressLines;
|
||||
|
||||
$response = \IPS\Http\Url::external( 'https://api.easypost.com/v2/addresses' )->request()->login( \IPS\Settings::i()->easypost_api_key, '' )->post( array( 'address' => array(
|
||||
'street1' => array_shift( $address->addressLines ),
|
||||
'street2' => count( $address->addressLines ) ? implode( ', ', $address->addressLines ) : NULL,
|
||||
'street1' => array_shift( $addressLines ),
|
||||
'street2' => count( $addressLines ) ? implode( ', ', $addressLines ) : NULL,
|
||||
'city' => $address->city,
|
||||
'state' => $address->region,
|
||||
'zip' => $address->postalCode,
|
||||
@@ -1117,6 +1120,7 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
if ( $memberJustCreated )
|
||||
{
|
||||
\IPS\Session::i()->setMember( $memberJustCreated );
|
||||
\IPS\Member\Device::loadOrCreate( $memberJustCreated, FALSE )->updateAfterAuthentication( NULL );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->redirect( $destination );
|
||||
@@ -1332,7 +1336,7 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
't_member=? AND t_invoice=? AND t_method=? AND t_status=? AND t_amount=? AND t_currency=?',
|
||||
\IPS\Member::loggedIn()->member_id,
|
||||
$this->invoice->id,
|
||||
$gateway->_id,
|
||||
( $gateway === NULL ) ? 0 : $gateway->_id,
|
||||
\IPS\nexus\Transaction::STATUS_WAITING,
|
||||
(string) $amountToPay->amount,
|
||||
$amountToPay->currency
|
||||
@@ -1391,7 +1395,7 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Create a MaxMind request */
|
||||
$maxMind = NULL;
|
||||
if ( \IPS\Settings::i()->maxmind_key )
|
||||
if ( \IPS\Settings::i()->maxmind_key and ( !\IPS\Settings::i()->maxmind_gateways or \IPS\Settings::i()->maxmind_gateways == '*' or in_array( $transaction->method->id, explode( ',', \IPS\Settings::i()->maxmind_gateways ) ) ) )
|
||||
{
|
||||
$maxMind = new \IPS\nexus\Fraud\MaxMind\Request;
|
||||
$maxMind->setTransaction( $transaction );
|
||||
@@ -1437,6 +1441,7 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
if ( $memberJustCreated )
|
||||
{
|
||||
\IPS\Session::i()->setMember( $memberJustCreated );
|
||||
\IPS\Member\Device::loadOrCreate( $memberJustCreated, FALSE )->updateAfterAuthentication( NULL );
|
||||
}
|
||||
|
||||
/* Send email receipt */
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Addresses
|
||||
* @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 06 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\clients;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Alternative Contacts
|
||||
* @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 08 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\clients;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Billing Agreements
|
||||
* @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 17 Dec 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\clients;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Cards
|
||||
* @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 08 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\clients;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Account Credit
|
||||
* @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 08 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\clients;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Donations
|
||||
* @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 17 Jun 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\clients;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Custom Fields
|
||||
* @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 08 Sep 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\clients;
|
||||
@@ -95,10 +94,12 @@ class _info extends \IPS\Dispatcher\Controller
|
||||
foreach ( \IPS\nexus\Customer\CustomField::roots() as $field )
|
||||
{
|
||||
$column = $field->column;
|
||||
if ( \IPS\nexus\Customer::loggedIn()->$column != $values["nexus_ccfield_{$field->id}"] )
|
||||
$helper = $field->buildHelper();
|
||||
$valueToSave = $helper::stringValue( $values["nexus_ccfield_{$field->id}"] );
|
||||
if ( \IPS\nexus\Customer::loggedIn()->$column != $valueToSave )
|
||||
{
|
||||
$changes['other'][] = array( 'name' => 'nexus_ccfield_' . $field->id, 'value' => $field->displayValue( $values["nexus_ccfield_{$field->id}"] ), 'old' => \IPS\nexus\Customer::loggedIn()->$column );
|
||||
\IPS\nexus\Customer::loggedIn()->$column = $values["nexus_ccfield_{$field->id}"];
|
||||
$changes['other'][] = array( 'name' => 'nexus_ccfield_' . $field->id, 'value' => $field->displayValue( $valueToSave ), 'old' => $field->displayValue( \IPS\nexus\Customer::loggedIn()->$column ) );
|
||||
\IPS\nexus\Customer::loggedIn()->$column = $valueToSave;
|
||||
}
|
||||
|
||||
if ( $field->type === 'Editor' )
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Invoices
|
||||
* @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 06 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\clients;
|
||||
@@ -113,10 +112,10 @@ class _invoices extends \IPS\Dispatcher\Controller
|
||||
|
||||
if ( $page > $pages )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=nexus&module=clients&controller=invoices", 'front', 'clients' ) );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=nexus&module=clients&controller=invoices", 'front', 'clientsinvoices' ) );
|
||||
}
|
||||
|
||||
$pagination = \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination( \IPS\Http\Url::internal( "app=nexus&module=clients&controller=invoices", 'front', 'clients' ), $pages, $page, static::$invoicesPerPage );
|
||||
$pagination = \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination( \IPS\Http\Url::internal( "app=nexus&module=clients&controller=invoices", 'front', 'clientsinvoices' ), $pages, $page, static::$invoicesPerPage );
|
||||
|
||||
$invoices = new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'nexus_invoices', $where, 'i_date DESC', array( ( $page - 1 ) * static::$invoicesPerPage, static::$invoicesPerPage ) ), 'IPS\nexus\Invoice' );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('clients')->invoices( $invoices, $pagination );
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Network Status
|
||||
* @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 Sep 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\clients;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Purchases
|
||||
* @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 06 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\clients;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Referrals
|
||||
* @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 15 Aug 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\clients;
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Controller to redirect /clients to something sensible
|
||||
* @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 19 May 2017
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\clients;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Controller to redirect /clients to something sensible
|
||||
*/
|
||||
class _splash extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
if ( \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
$where = array( array( 'ps_member=?', \IPS\Member::loggedIn()->member_id ) );
|
||||
$parentContacts = \IPS\nexus\Customer::loggedIn()->parentContacts();
|
||||
if ( count( $parentContacts ) )
|
||||
{
|
||||
$or = array();
|
||||
foreach ( $parentContacts as $contact )
|
||||
{
|
||||
$where[0][0] .= ' OR ' . \IPS\Db::i()->in( 'ps_id', $contact->purchaseIds() );
|
||||
}
|
||||
}
|
||||
$where[] = array( 'ps_show=1' );
|
||||
|
||||
if ( \IPS\Db::i()->select( 'COUNT(*)', 'nexus_purchases', $where )->first() )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=nexus&module=clients&controller=purchases', 'front', 'clientspurchases' ) );
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=nexus&module=clients&controller=invoices', 'front', 'clientsinvoices' ) );
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Incoming Referrals
|
||||
* @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 15 Aug 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\promotion;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief View Cart
|
||||
* @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 29 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\store;
|
||||
@@ -212,7 +211,7 @@ class _cart extends \IPS\Dispatcher\Controller
|
||||
$canRegister = TRUE;
|
||||
}
|
||||
|
||||
$itemId = $invoice->addItem( $item );
|
||||
$itemId = $invoice->addItem( $item, $k );
|
||||
|
||||
$ids = array();
|
||||
foreach ( \IPS\Db::i()->select( 'id', 'nexus_cart_uploads', array( 'session_id=? AND item_id=?', \IPS\Session::i()->id, $k ) ) as $id )
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Gift Vouchers
|
||||
* @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 5 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\store;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief View product
|
||||
* @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 29 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\store;
|
||||
@@ -200,6 +199,50 @@ class _product extends \IPS\Content\Controller
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('store')->package( $package, $item, $this->_getForm( $package, $inCart, TRUE ), array_sum( $inCart ), $shippingMethods, $itemDataForShipping, $locationType, $renewalTerm );
|
||||
}
|
||||
|
||||
$price = $package->price();
|
||||
|
||||
\IPS\Output::i()->jsonLd['package'] = array(
|
||||
'@context' => "http://schema.org",
|
||||
'@type' => "Product",
|
||||
'name' => $package->_title,
|
||||
'description' => strip_tags( $item->truncated() ),
|
||||
'category' => $item->container()->_title,
|
||||
'url' => (string) $package->url(),
|
||||
'sku' => $package->id,
|
||||
'offers' => array(
|
||||
'@type' => 'Offer',
|
||||
'availability' => ( $package->stock > 0 OR $package->stock == -1 ) ? 'http://schema.org/InStock' : 'http://schema.org/OutOfStock',
|
||||
'price' => $price->amountAsString(),
|
||||
'priceCurrency' => $price->currency,
|
||||
'seller' => array(
|
||||
'@type' => 'Organization',
|
||||
'name' => \IPS\Settings::i()->board_name
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
if( $package->image )
|
||||
{
|
||||
\IPS\Output::i()->jsonLd['package']['image'] = (string) $package->image;
|
||||
}
|
||||
|
||||
if( $package->reviewable )
|
||||
{
|
||||
\IPS\Output::i()->jsonLd['package']['aggregateRating'] = array(
|
||||
'@type' => 'AggregateRating',
|
||||
'ratingValue' => $item->averageReviewRating(),
|
||||
'ratingCount' => $item->reviews
|
||||
);
|
||||
}
|
||||
|
||||
if( isset( $length ) )
|
||||
{
|
||||
\IPS\Output::i()->jsonLd['package']['depth'] = array( '@type' => 'Distance', 'name' => $length->string() );
|
||||
\IPS\Output::i()->jsonLd['package']['width'] = array( '@type' => 'Distance', 'name' => $width->string() );
|
||||
\IPS\Output::i()->jsonLd['package']['height'] = array( '@type' => 'Distance', 'name' => $height->string() );
|
||||
\IPS\Output::i()->jsonLd['package']['weight'] = array( '@type' => 'QuantitativeValue', 'name' => $weight->string() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,9 +306,9 @@ class _product extends \IPS\Content\Controller
|
||||
{
|
||||
$customFields = \IPS\nexus\Package\CustomField::roots();
|
||||
$stickyFields = array();
|
||||
foreach ( $item->details as $j => $v )
|
||||
foreach ( $item->details as $k => $v )
|
||||
{
|
||||
if ( $v and isset( $customFields[ $j ] ) and $customFields[ $j ]->sticky )
|
||||
if ( $v and isset( $customFields[ $k ] ) and $customFields[ $k ]->sticky )
|
||||
{
|
||||
$stickyFields[] = $v;
|
||||
}
|
||||
@@ -302,35 +345,55 @@ class _product extends \IPS\Content\Controller
|
||||
$renewOptions = $package->renew_options ? json_decode( $package->renew_options, TRUE ) : array();
|
||||
if ( count( $renewOptions ) > 1 )
|
||||
{
|
||||
$options = array();
|
||||
$sortedRenewOptions = array();
|
||||
foreach ( $renewOptions as $k => $option )
|
||||
{
|
||||
if ( isset( $option['cost'][ $memberCurrency ] ) )
|
||||
if ( isset( $renewOptions[ $k ]['cost'][ $memberCurrency ] ) )
|
||||
{
|
||||
switch ( $option['unit'] )
|
||||
$sortedRenewOptions[ $k ] = new \IPS\nexus\Purchase\RenewalTerm( new \IPS\nexus\Money( $option['cost'][ $memberCurrency ]['amount'], $memberCurrency ), new \DateInterval( 'P' . $option['term'] . mb_strtoupper( $option['unit'] ) ), $package->tax ? \IPS\nexus\Tax::load( $package->tax ) : NULL, $option['add'], $package->grace_period ? new \DateInterval( 'P' . $package->grace_period . 'D' ) : NULL );
|
||||
}
|
||||
}
|
||||
uasort( $sortedRenewOptions, function( $a, $b ) {
|
||||
return $a->days() - $b->days();
|
||||
} );
|
||||
|
||||
$options = array();
|
||||
$first = NULL;
|
||||
foreach ( $sortedRenewOptions as $k => $term )
|
||||
{
|
||||
$saving = NULL;
|
||||
if ( \IPS\Settings::i()->nexus_show_renew_option_savings != 'none' )
|
||||
{
|
||||
if ( $first === NULL )
|
||||
{
|
||||
case 'd':
|
||||
$term = \IPS\Member::loggedIn()->language()->addToStack('renew_days', FALSE, array( 'pluralize' => array( $option['term'] ) ) );
|
||||
break;
|
||||
case 'm':
|
||||
$term = \IPS\Member::loggedIn()->language()->addToStack('renew_months', FALSE, array( 'pluralize' => array( $option['term'] ) ) );
|
||||
break;
|
||||
case 'y':
|
||||
$term = \IPS\Member::loggedIn()->language()->addToStack('renew_years', FALSE, array( 'pluralize' => array( $option['term'] ) ) );
|
||||
break;
|
||||
$first = $term;
|
||||
}
|
||||
|
||||
$options[ $k ] =
|
||||
\IPS\Member::loggedIn()->language()->addToStack( 'renew_option', FALSE, array( 'sprintf' => array(
|
||||
(string) new \IPS\nexus\Money( $option['cost'][ $memberCurrency ]['amount'], $memberCurrency ),
|
||||
$term
|
||||
) ) );
|
||||
else
|
||||
{
|
||||
$saving = $term->diff( $first, \IPS\Settings::i()->nexus_show_renew_option_savings == 'percent' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $saving and ( ( \IPS\Settings::i()->nexus_show_renew_option_savings == 'percent' and $saving->isGreaterThanZero() ) or ( \IPS\Settings::i()->nexus_show_renew_option_savings == 'amount' and $saving->amount->isGreaterThanZero() ) ) )
|
||||
{
|
||||
if ( \IPS\Settings::i()->nexus_show_renew_option_savings == 'percent' )
|
||||
{
|
||||
$options[ $k ] = \IPS\Member::loggedIn()->language()->addToStack( 'renewal_amount_with_pc_saving', FALSE, array( 'sprintf' => array( $term->toDisplay(), $saving->round(1) ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$options[ $k ] = \IPS\Member::loggedIn()->language()->addToStack( 'renewal_amount_with_cost_saving', FALSE, array( 'sprintf' => array( $term->toDisplay(), $saving ) ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$options[ $k ] = $term->toDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'renewal_term', NULL, TRUE, array( 'options' => $options ) ) );
|
||||
}
|
||||
|
||||
|
||||
/* Custom Fields */
|
||||
$customFields = \IPS\nexus\Package\CustomField::roots( NULL, NULL, array( array( 'cf_purchase=1' ), array( \IPS\Db::i()->findInSet( 'cf_packages', array( $package->id ) ) ) ) );
|
||||
foreach ( $customFields as $field )
|
||||
@@ -461,7 +524,7 @@ class _product extends \IPS\Content\Controller
|
||||
}
|
||||
else
|
||||
{
|
||||
$return['price'] = \IPS\Theme::i()->getTemplate( 'store', 'nexus' )->price( $data['price'], FALSE );
|
||||
$return['price'] = \IPS\Theme::i()->getTemplate( 'store', 'nexus' )->price( $data['price'], FALSE, FALSE );
|
||||
}
|
||||
\IPS\Output::i()->json( $return );
|
||||
}
|
||||
@@ -475,7 +538,7 @@ class _product extends \IPS\Content\Controller
|
||||
{
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->json( $additionalPage );
|
||||
\IPS\Output::i()->json( array( 'dialog' => $additionalPage ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Browse Store
|
||||
* @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 29 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\store;
|
||||
@@ -152,6 +151,50 @@ class _store extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
\IPS\Output::i()->breadcrumb[] = array( NULL, $category->_title );
|
||||
\IPS\Output::i()->title = $category->_title;
|
||||
|
||||
/* Add JSON-LD
|
||||
@note Google does not like categories marked up and instead recommends marking up each product separately.
|
||||
@link https://developers.google.com/search/docs/guides/intro-structured-data#multiple-entities-on-the-same-page */
|
||||
foreach( $packages as $package )
|
||||
{
|
||||
$item = \IPS\nexus\Package\Item::load( $package->id );
|
||||
$price = $package->price();
|
||||
|
||||
\IPS\Output::i()->jsonLd['package' . $package->id ] = array(
|
||||
'@context' => "http://schema.org",
|
||||
'@type' => "Product",
|
||||
'name' => $package->_title,
|
||||
'description' => strip_tags( $item->truncated() ),
|
||||
'category' => $category->_title,
|
||||
'url' => (string) $package->url(),
|
||||
'sku' => $package->id,
|
||||
'offers' => array(
|
||||
'@type' => 'Offer',
|
||||
'availability' => ( $package->stock > 0 OR $package->stock == -1 ) ? 'http://schema.org/InStock' : 'http://schema.org/OutOfStock',
|
||||
'price' => $price->amountAsString(),
|
||||
'priceCurrency' => $price->currency,
|
||||
'seller' => array(
|
||||
'@type' => 'Organization',
|
||||
'name' => \IPS\Settings::i()->board_name
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
if( $package->image )
|
||||
{
|
||||
\IPS\Output::i()->jsonLd['package' . $package->id ]['image'] = (string) $package->image;
|
||||
}
|
||||
|
||||
if( $package->reviewable )
|
||||
{
|
||||
\IPS\Output::i()->jsonLd['package' . $package->id ]['aggregateRating'] = array(
|
||||
'@type' => 'AggregateRating',
|
||||
'ratingValue' => $item->averageReviewRating(),
|
||||
'ratingCount' => $item->reviews
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
catch ( \OutofRangeException $e )
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Support Index
|
||||
* @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 08 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\support;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Legacy Redirector
|
||||
* @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 Commerce
|
||||
* @since 07 Sep 2016
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\support;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Support Request View
|
||||
* @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 09 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\modules\front\support;
|
||||
|
||||
Reference in new issue
Block a user