Version 4.0.13.1
This commit is contained in:
1 parent
f9e857d255
commit
c6a86f0d9b
7517 files changed
+597400
-668041
No files matched your search
@@ -0,0 +1,180 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief EasyPost Shipping Rate
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Nexus
|
||||
* @since 19 Jun 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\Shipping;
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* EasyPost Shipping Rate
|
||||
*/
|
||||
class _EasyPostRate implements \IPS\nexus\Shipping\Rate
|
||||
{
|
||||
/**
|
||||
* @brief Data
|
||||
*/
|
||||
protected $data = array();
|
||||
|
||||
/**
|
||||
* Constuctor
|
||||
*
|
||||
* @param array $data Date from EasyPost
|
||||
*/
|
||||
public function __construct( $data )
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is available to destination?
|
||||
*
|
||||
* @param \IPS\GeoLocation $destination Desired destination
|
||||
* @return bool
|
||||
*/
|
||||
public function isAvailable( \IPS\GeoLocation $destination )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
$service = $this->data['carrier'];
|
||||
for ( $i=0; $i<\strlen( $this->data['service'] ); $i++ )
|
||||
{
|
||||
if ( \strtoupper( $this->data['service'][ $i ] ) === $this->data['service'][ $i ] )
|
||||
{
|
||||
$service .= " {$this->data['service'][ $i ]}";
|
||||
}
|
||||
else
|
||||
{
|
||||
$service .= $this->data['service'][ $i ];
|
||||
}
|
||||
}
|
||||
|
||||
return $service;
|
||||
}
|
||||
|
||||
/**
|
||||
* Price
|
||||
*
|
||||
* @param array $items Items
|
||||
* @param string $currency Desired currency
|
||||
* @param \IPS\nexus\Invoice|NULL $invoice The invoice
|
||||
* @return \IPS\nexus\Money
|
||||
*/
|
||||
public function getPrice( array $items, $currency, \IPS\nexus\Invoice $invoice = NULL )
|
||||
{
|
||||
$adjustment = 0;
|
||||
if ( \IPS\Settings::i()->easypost_price_adjustment and $adjustments = json_decode( \IPS\Settings::i()->easypost_price_adjustment, TRUE ) and isset( $adjustments[ $currency ] ) )
|
||||
{
|
||||
$adjustment = $adjustments[ $currency ]['amount'];
|
||||
}
|
||||
|
||||
return new \IPS\nexus\Money( $this->data['rate'] + $adjustment, $this->data['currency'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Tax
|
||||
*
|
||||
* @return \IPS\nexus\Tax|NULL
|
||||
*/
|
||||
public function getTax()
|
||||
{
|
||||
try
|
||||
{
|
||||
return \IPS\Settings::i()->easypost_tax ? \IPS\nexus\Tax::load( \IPS\Settings::i()->easypost_tax ) : NULL;
|
||||
}
|
||||
catch ( \OutOfRangeException $e ) {}
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Estimated delivery date
|
||||
*
|
||||
* @param array $items Items
|
||||
* @param \IPS\nexus\Invoice|NULL $invoice The invoice
|
||||
* @return string
|
||||
*/
|
||||
public function getEstimatedDelivery( array $items, \IPS\nexus\Invoice $invoice = NULL )
|
||||
{
|
||||
if ( $this->data['est_delivery_days'] )
|
||||
{
|
||||
return \IPS\Member::loggedIn()->language()->addToStack( 'easypost_delivery_estimate', FALSE, array( 'pluralize' => array( $this->data['est_delivery_days'] + \IPS\Settings::i()->easypost_delivery_adjustment ) ) );
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* API
|
||||
*
|
||||
* @param float $lengthInInches Parcel length
|
||||
* @param float $widthInInches Parcel width
|
||||
* @param float $heightInInches Parcel height
|
||||
* @param float $weightInOz Parcel weight
|
||||
* @param \IPS\nexus\Customer $toCustomer Customer to ship to
|
||||
* @param \IPS\Geolocation $toAddress Address to ship to
|
||||
* @param string $currency Desired currency for rates
|
||||
* @return array
|
||||
* @throws \IPS\Http\Request\Exception
|
||||
*/
|
||||
public static function getRates( $lengthInInches, $widthInInches, $heightInInches, $weightInOz, \IPS\nexus\Customer $toCustomer, \IPS\Geolocation $toAddress, $currency )
|
||||
{
|
||||
$fromAddress = \IPS\GeoLocation::buildFromJson( \IPS\Settings::i()->site_address );
|
||||
|
||||
return \IPS\Http\Url::external( 'https://api.easypost.com/v2/shipments' )->request()->login( \IPS\Settings::i()->easypost_api_key, '' )->post( array( 'shipment' => array(
|
||||
'to_address' => array(
|
||||
'street1' => array_shift( $toAddress->addressLines ),
|
||||
'street2' => count( $toAddress->addressLines ) ? implode( ', ', $toAddress->addressLines ) : NULL,
|
||||
'city' => $toAddress->city,
|
||||
'state' => $toAddress->region,
|
||||
'zip' => $toAddress->postalCode,
|
||||
'country' => $toAddress->country,
|
||||
'name' => $toCustomer->cm_first_name . ' ' . $toCustomer->cm_last_name,
|
||||
'phone' => $toCustomer->cm_phone,
|
||||
'email' => $toCustomer->email
|
||||
),
|
||||
'from_address' => array(
|
||||
'street1' => array_shift( $fromAddress->addressLines ),
|
||||
'street2' => count( $fromAddress->addressLines ) ? implode( ', ', $fromAddress->addressLines ) : NULL,
|
||||
'city' => $fromAddress->city,
|
||||
'state' => $fromAddress->region,
|
||||
'zip' => $fromAddress->postalCode,
|
||||
'country' => $fromAddress->country,
|
||||
'company' => \IPS\Settings::i()->board_name,
|
||||
'phone' => \IPS\Settings::i()->easypost_phone,
|
||||
'email' => \IPS\Settings::i()->email_in
|
||||
),
|
||||
'parcel' => array(
|
||||
'length' => round( $lengthInInches, 1 ),
|
||||
'width' => round( $widthInInches, 1 ),
|
||||
'height' => round( $heightInInches, 1 ),
|
||||
'weight' => round( $weightInOz, 1 )
|
||||
),
|
||||
'options' => array(
|
||||
'currency' => $currency
|
||||
)
|
||||
) ) )->decodeJson();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,509 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Flat Shipping Rate Node
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Nexus
|
||||
* @since 13 Feb 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\Shipping;
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flat Shipping Rate Node
|
||||
*/
|
||||
class _FlatRate extends \IPS\Node\Model implements \IPS\nexus\Shipping\Rate
|
||||
{
|
||||
/**
|
||||
* @brief [ActiveRecord] Multiton Store
|
||||
*/
|
||||
protected static $multitons;
|
||||
|
||||
/**
|
||||
* @brief [ActiveRecord] Database Table
|
||||
*/
|
||||
public static $databaseTable = 'nexus_shipping';
|
||||
|
||||
/**
|
||||
* @brief [ActiveRecord] Database Prefix
|
||||
*/
|
||||
public static $databasePrefix = 's_';
|
||||
|
||||
/**
|
||||
* @brief [Node] Order Database Column
|
||||
*/
|
||||
public static $databaseColumnOrder = 'order';
|
||||
|
||||
/**
|
||||
* @brief [Node] Node Title
|
||||
*/
|
||||
public static $nodeTitle = 'shipping_rates';
|
||||
|
||||
/**
|
||||
* @brief [Node] Title prefix. If specified, will look for a language key with "{$key}_title" as the key
|
||||
*/
|
||||
public static $titleLangPrefix = 'nexus_shiprate_';
|
||||
|
||||
/**
|
||||
* @brief [Node] ACP Restrictions
|
||||
* @code
|
||||
array(
|
||||
'app' => 'core', // The application key which holds the restrictrions
|
||||
'module' => 'foo', // The module key which holds the restrictions
|
||||
'map' => array( // [Optional] The key for each restriction - can alternatively use "prefix"
|
||||
'add' => 'foo_add',
|
||||
'edit' => 'foo_edit',
|
||||
'permissions' => 'foo_perms',
|
||||
'delete' => 'foo_delete'
|
||||
),
|
||||
'all' => 'foo_manage', // [Optional] The key to use for any restriction not provided in the map (only needed if not providing all 4)
|
||||
'prefix' => 'foo_', // [Optional] Rather than specifying each key in the map, you can specify a prefix, and it will automatically look for restrictions with the key "[prefix]_add/edit/permissions/delete"
|
||||
* @endcode
|
||||
*/
|
||||
protected static $restrictions = array(
|
||||
'app' => 'nexus',
|
||||
'module' => 'payments',
|
||||
'all' => 'shipmethods_manage'
|
||||
);
|
||||
|
||||
/**
|
||||
* [Node] Add/Edit Form
|
||||
*
|
||||
* @param \IPS\Helpers\Form $form The form
|
||||
* @return void
|
||||
*/
|
||||
public function form( &$form )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Translatable( 'shiprate_name', NULL, TRUE, array( 'app' => 'nexus', 'key' => $this->id ? "nexus_shiprate_{$this->id}" : NULL, 'placeholder' => \IPS\Member::loggedIn()->language()->addToStack('shiprate_name_placeholder') ) ) );
|
||||
$form->add( new \IPS\nexus\Form\StateSelect( 's_locations', ( $this->id and $this->locations != '*' ) ? json_decode( $this->locations, TRUE ) : '*', TRUE, array( 'unlimitedLang' => 'all_locations' ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Translatable( 'shiprate_delivery_estimate', NULL, TRUE, array( 'app' => 'nexus', 'key' => $this->id ? "nexus_shiprate_de_{$this->id}" : NULL, 'placeholder' => \IPS\Member::loggedIn()->language()->addToStack('shiprate_delivery_estimate_placeholder') ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Node( 's_tax', $this->id ? $this->tax : 0, FALSE, array( 'class' => '\IPS\nexus\Tax', 'zeroVal' => 'do_not_tax' ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 's_type', $this->type, TRUE, array(
|
||||
'options' => array(
|
||||
't' => 's_type_t',
|
||||
'w' => 's_type_w',
|
||||
'q' => 's_type_q'
|
||||
),
|
||||
'toggles' => array(
|
||||
'w' => array( 's_rates_w' ),
|
||||
't' => array( 's_rates_t' ),
|
||||
'q' => array( 's_rates_q' ),
|
||||
)
|
||||
) ) );
|
||||
|
||||
$weightMatrix = new \IPS\Helpers\Form\Matrix( 'w_matrix_' . ( $this->_id ?: 'new' ) );
|
||||
$weightMatrix->columns = array(
|
||||
'w_rate_min'=> function( $key, $value, $data )
|
||||
{
|
||||
return new \IPS\nexus\Form\Weight( $key, ( is_numeric( $value ) ) ? new \IPS\nexus\Shipping\Weight( $value ) : $value, FALSE, array( 'unlimitedLang' => 's_any_value' ) );
|
||||
},
|
||||
'w_rate_max'=> function( $key, $value, $data )
|
||||
{
|
||||
return new \IPS\nexus\Form\Weight( $key, ( is_numeric( $value ) ) ? new \IPS\nexus\Shipping\Weight( $value ) : $value, FALSE, array( 'unlimitedLang' => 's_any_value' ) );
|
||||
},
|
||||
'w_rate_price'=> function( $key, $value, $data )
|
||||
{
|
||||
return new \IPS\nexus\Form\Money( $key, $value, FALSE, array() );
|
||||
},
|
||||
);
|
||||
if ( $this->type === 'w' )
|
||||
{
|
||||
foreach ( json_decode( $this->rates, TRUE ) as $row )
|
||||
{
|
||||
$prices = array();
|
||||
foreach ( $row['price'] as $currency => $amount )
|
||||
{
|
||||
$prices[ $currency ] = new \IPS\nexus\Money( $amount, $currency );
|
||||
}
|
||||
|
||||
$weightMatrix->rows[] = array(
|
||||
'w_rate_min' => $row['min'],
|
||||
'w_rate_max' => $row['max'],
|
||||
'w_rate_price' => $prices,
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$weightMatrix->rows [] = array();
|
||||
}
|
||||
$form->addMatrix( 's_rates_w', $weightMatrix );
|
||||
|
||||
$totalMatrix = new \IPS\Helpers\Form\Matrix( 't_matrix_' . ( $this->_id ?: 'new' ) );
|
||||
$totalMatrix->columns = array(
|
||||
't_rate_min'=> function( $key, $value, $data )
|
||||
{
|
||||
return new \IPS\nexus\Form\Money( $key, $value, FALSE, array( 'unlimitedLang' => 's_any_value' ) );
|
||||
},
|
||||
't_rate_max'=> function( $key, $value, $data )
|
||||
{
|
||||
return new \IPS\nexus\Form\Money( $key, $value, FALSE, array( 'unlimitedLang' => 's_any_value' ) );
|
||||
},
|
||||
't_rate_price'=> function( $key, $value, $data )
|
||||
{
|
||||
return new \IPS\nexus\Form\Money( $key, $value, FALSE, array() );
|
||||
},
|
||||
);
|
||||
if ( $this->type === 't' )
|
||||
{
|
||||
foreach ( json_decode( $this->rates, TRUE ) as $row )
|
||||
{
|
||||
$prices = array();
|
||||
foreach ( $row['price'] as $currency => $amount )
|
||||
{
|
||||
$prices[ $currency ] = new \IPS\nexus\Money( $amount, $currency );
|
||||
}
|
||||
|
||||
$totalMatrix->rows[] = array(
|
||||
't_rate_min' => $row['min'],
|
||||
't_rate_max' => $row['max'],
|
||||
't_rate_price' => $prices,
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$totalMatrix->rows [] = array();
|
||||
}
|
||||
$form->addMatrix( 's_rates_t', $totalMatrix );
|
||||
|
||||
$itemsMatrix = new \IPS\Helpers\Form\Matrix( 'q_matrix_' . ( $this->_id ?: 'new' ) );
|
||||
$itemsMatrix->columns = array(
|
||||
'q_rate_min'=> function( $key, $value, $data )
|
||||
{
|
||||
return new \IPS\Helpers\Form\Number( $key, $value, FALSE, array( 'unlimited' => '*', 'unlimitedLang' => 's_any_value' ) );
|
||||
},
|
||||
'q_rate_max'=> function( $key, $value, $data )
|
||||
{
|
||||
return new \IPS\Helpers\Form\Number( $key, $value, FALSE, array( 'unlimited' => '*', 'unlimitedLang' => 's_any_value' ) );
|
||||
},
|
||||
'q_rate_price'=> function( $key, $value, $data )
|
||||
{
|
||||
return new \IPS\nexus\Form\Money( $key, $value, FALSE, array() );
|
||||
},
|
||||
);
|
||||
if ( $this->type === 'q' )
|
||||
{
|
||||
foreach ( json_decode( $this->rates, TRUE ) as $row )
|
||||
{
|
||||
$prices = array();
|
||||
foreach ( $row['price'] as $currency => $amount )
|
||||
{
|
||||
$prices[ $currency ] = new \IPS\nexus\Money( $amount, $currency );
|
||||
}
|
||||
|
||||
$itemsMatrix->rows[] = array(
|
||||
'q_rate_min' => $row['min'],
|
||||
'q_rate_max' => $row['max'],
|
||||
'q_rate_price' => $prices,
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$itemsMatrix->rows [] = array();
|
||||
}
|
||||
$form->addMatrix( 's_rates_q', $itemsMatrix );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* [Node] Format form values from add/edit form for save
|
||||
*
|
||||
* @param array $values Values from the form
|
||||
* @return array
|
||||
*/
|
||||
public function formatFormValues( $values )
|
||||
{
|
||||
if( isset( $values['s_locations'] ) )
|
||||
{
|
||||
$values['s_locations'] = $values['s_locations'] == '*' ? '*' : json_encode( $values['s_locations'] );
|
||||
}
|
||||
|
||||
if( isset( $values['s_type'] ) AND isset( $values[ "s_rates_{$values['s_type']}" ] ) )
|
||||
{
|
||||
$rates = array();
|
||||
/* Populate */
|
||||
foreach ( $values[ "s_rates_{$values['s_type']}" ] as $rate )
|
||||
{
|
||||
if ( $rate["{$values['s_type']}_rate_min"] == '*' )
|
||||
{
|
||||
$min = '*';
|
||||
}
|
||||
else
|
||||
{
|
||||
switch ( $values['s_type'] )
|
||||
{
|
||||
case 'w':
|
||||
$min = $rate["{$values['s_type']}_rate_min"]->kilograms;
|
||||
break;
|
||||
case 't':
|
||||
$min = array();
|
||||
foreach ( $rate["{$values['s_type']}_rate_min"] as $money )
|
||||
{
|
||||
$min[ $money->currency ] = $money->amount;
|
||||
}
|
||||
break;
|
||||
case 'q':
|
||||
$min = $rate["{$values['s_type']}_rate_min"];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $rate["{$values['s_type']}_rate_max"] == '*' )
|
||||
{
|
||||
$max = '*';
|
||||
}
|
||||
else
|
||||
{
|
||||
switch ( $values['s_type'] )
|
||||
{
|
||||
case 'w':
|
||||
$max = $rate["{$values['s_type']}_rate_max"]->kilograms;
|
||||
break;
|
||||
case 't':
|
||||
$max = array();
|
||||
foreach ( $rate["{$values['s_type']}_rate_max"] as $money )
|
||||
{
|
||||
$max[ $money->currency ] = $money->amount;
|
||||
}
|
||||
break;
|
||||
case 'q':
|
||||
$max = $rate["{$values['s_type']}_rate_max"];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !$min and !$max )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$price = array();
|
||||
foreach ( $rate["{$values['s_type']}_rate_price"] as $money )
|
||||
{
|
||||
$price[ $money->currency ] = $money->amount;
|
||||
}
|
||||
if ( !count( $price ) )
|
||||
{
|
||||
foreach ( \IPS\nexus\Money::currencies() as $currency )
|
||||
{
|
||||
$price[ $currency ] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$rates[] = array(
|
||||
'min' => $min,
|
||||
'max' => $max,
|
||||
'price' => $price
|
||||
);
|
||||
}
|
||||
|
||||
/* Remove duplicates */
|
||||
$_rates = array();
|
||||
foreach ( $rates as $k => $v )
|
||||
{
|
||||
$_rates[ $k ] = json_encode( $v );
|
||||
}
|
||||
$__rates = array_unique( $_rates );
|
||||
foreach( array_diff( array_keys( $_rates ), array_keys( $__rates ) ) as $k )
|
||||
{
|
||||
unset( $rates[$k] );
|
||||
}
|
||||
|
||||
/* Save */
|
||||
$values['rates'] = json_encode( $rates );
|
||||
}
|
||||
|
||||
$values['s_tax'] = $values['s_tax'] ? $values['s_tax']->id : 0;
|
||||
|
||||
if ( !$this->id )
|
||||
{
|
||||
$this->save();
|
||||
}
|
||||
|
||||
if( isset( $values['shiprate_name'] ) )
|
||||
{
|
||||
\IPS\Lang::saveCustom( 'nexus', "nexus_shiprate_{$this->id}", $values['shiprate_name'] );
|
||||
unset( $values['shiprate_name'] );
|
||||
}
|
||||
|
||||
if( isset( $values['shiprate_delivery_estimate'] ) )
|
||||
{
|
||||
\IPS\Lang::saveCustom( 'nexus', "nexus_shiprate_de_{$this->id}", $values['shiprate_delivery_estimate'] );
|
||||
unset( $values['shiprate_delivery_estimate'] );
|
||||
}
|
||||
|
||||
if( isset( $values['s_rates_w'] ) )
|
||||
{
|
||||
unset( $values['s_rates_w'] );
|
||||
}
|
||||
|
||||
if( isset( $values['s_rates_t'] ) )
|
||||
{
|
||||
unset( $values['s_rates_t'] );
|
||||
}
|
||||
|
||||
if( isset( $values['s_rates_q'] ) )
|
||||
{
|
||||
unset( $values['s_rates_q'] );
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is available to destination?
|
||||
*
|
||||
* @param \IPS\GeoLocation $destination Desired destination
|
||||
* @return bool
|
||||
*/
|
||||
public function isAvailable( \IPS\GeoLocation $destination )
|
||||
{
|
||||
if ( $this->locations === '*' )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
$locations = json_decode( $this->locations, TRUE );
|
||||
|
||||
if ( isset( $locations[ $destination->country ] ) )
|
||||
{
|
||||
if ( $locations[ $destination->country ] === '*' )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return in_array( $destination->region, $locations[ $destination->country ] );
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return \IPS\Member::loggedIn()->language()->get( 'nexus_shiprate_' . $this->id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Price
|
||||
*
|
||||
* @param array $items Items
|
||||
* @param string $currency Desired currency
|
||||
* @param \IPS\nexus\Invoice|NULL $invoice The invoice
|
||||
* @return \IPS\nexus\Money
|
||||
*/
|
||||
public function getPrice( array $items, $currency, \IPS\nexus\Invoice $invoice = NULL )
|
||||
{
|
||||
switch ( $this->type )
|
||||
{
|
||||
case 't':
|
||||
if ( $invoice )
|
||||
{
|
||||
$criteria = $invoice->total->amount;
|
||||
}
|
||||
else
|
||||
{
|
||||
$criteria = 0;
|
||||
foreach ( $items as $item )
|
||||
{
|
||||
$criteria += ( $item->price->amount * $item->quantity );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
$criteria = 0;
|
||||
foreach ( $items as $item )
|
||||
{
|
||||
$criteria += $item->quantity;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
$criteria = 0;
|
||||
foreach ( $items as $item )
|
||||
{
|
||||
if ( isset( $item->weight ) )
|
||||
{
|
||||
$criteria += ( $item->weight->kilograms * $item->quantity );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$rates = json_decode( $this->rates, TRUE );
|
||||
foreach ( $rates as $rate )
|
||||
{
|
||||
$min = $rate['min'];
|
||||
if ( is_array( $min ) )
|
||||
{
|
||||
$min = $min[ $currency ];
|
||||
}
|
||||
$max = $rate['max'];
|
||||
if ( is_array( $max ) )
|
||||
{
|
||||
$max = $max[ $currency ];
|
||||
}
|
||||
|
||||
if ( ( $min === '*' or $criteria >= $min ) and ( $max === '*' or $criteria <= $max ) )
|
||||
{
|
||||
return new \IPS\nexus\Money( $rate['price'][ $currency ], $currency );
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $rate ) )
|
||||
{
|
||||
return new \IPS\nexus\Money( $rate['price'][ $currency ], $currency );
|
||||
}
|
||||
|
||||
return new \IPS\nexus\Money( 0, $currency );
|
||||
}
|
||||
|
||||
/**
|
||||
* Tax
|
||||
*
|
||||
* @return \IPS\nexus\Tax|NULL
|
||||
*/
|
||||
public function getTax()
|
||||
{
|
||||
try
|
||||
{
|
||||
return $this->tax ? \IPS\nexus\Tax::load( $this->tax ) : NULL;
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Estimated delivery date
|
||||
*
|
||||
* @param array $items Items
|
||||
* @param \IPS\nexus\Invoice|NULL $invoice The invoice
|
||||
* @return string
|
||||
*/
|
||||
public function getEstimatedDelivery( array $items, \IPS\nexus\Invoice $invoice = NULL )
|
||||
{
|
||||
return \IPS\Member::loggedIn()->language()->addToStack( "nexus_shiprate_de_{$this->id}" );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Length Object
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Nexus
|
||||
* @since 19 Jun 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\Shipping;
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Length Object
|
||||
*/
|
||||
class _Length
|
||||
{
|
||||
/**
|
||||
* @brief Conversion rates
|
||||
*/
|
||||
public static $conversionRates = array(
|
||||
'm' => 1,
|
||||
'cm' => 0.01,
|
||||
'in' => 0.0254,
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Length in centimetres (naturally we use metres as per le Système international d'unités like good boys)
|
||||
*/
|
||||
public $metres = 0;
|
||||
|
||||
/**
|
||||
* Best display unit
|
||||
*
|
||||
* @param \IPS\Member|NULL $member The member
|
||||
* @return string
|
||||
*/
|
||||
public static function bestUnit( \IPS\Member $member = NULL )
|
||||
{
|
||||
$member = $member ?: \IPS\Member::loggedIn();
|
||||
|
||||
/* US uses lbs. This is a more reliable way to detect if locale
|
||||
if US, as Windows and Nix use different locale keys, but both
|
||||
will set the currency symbol to USD for US only */
|
||||
if ( trim( $member->language()->locale['int_curr_symbol'] ) === 'USD' )
|
||||
{
|
||||
return 'in';
|
||||
}
|
||||
|
||||
return 'cm';
|
||||
}
|
||||
|
||||
/**
|
||||
* Contructor
|
||||
*
|
||||
* @param float $amount Length
|
||||
* @param string $unit Unit
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( $amount, $unit='m' )
|
||||
{
|
||||
$this->metres = ( $amount * static::$conversionRates[ $unit ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get as float
|
||||
*
|
||||
* @param $unit Unit
|
||||
* @return float
|
||||
*/
|
||||
public function float( $unit='m' )
|
||||
{
|
||||
return $this->metres / static::$conversionRates[ $unit ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get as string
|
||||
*
|
||||
* @param string|NULL $unit Unit (NULL to autodetect)
|
||||
* @param int|NULL $round Decimal places to round to
|
||||
* @return float
|
||||
*/
|
||||
public function string( $unit=NULL, $round=2 )
|
||||
{
|
||||
if ( $unit === NULL )
|
||||
{
|
||||
$unit = static::bestUnit();
|
||||
}
|
||||
|
||||
return round( $this->float( $unit ), $round ) . $unit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,347 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Shipping Order Model
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Nexus
|
||||
* @since 19 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\Shipping;
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping Order Model
|
||||
*/
|
||||
class _Order extends \IPS\Patterns\ActiveRecord
|
||||
{
|
||||
const STATUS_SHIPPED = 'done';
|
||||
const STATUS_PENDING = 'pend';
|
||||
const STATUS_CANCELED = 'canc';
|
||||
|
||||
/**
|
||||
* @brief Multiton Store
|
||||
*/
|
||||
protected static $multitons;
|
||||
|
||||
/**
|
||||
* @brief Database Table
|
||||
*/
|
||||
public static $databaseTable = 'nexus_ship_orders';
|
||||
|
||||
/**
|
||||
* @brief Database Prefix
|
||||
*/
|
||||
public static $databasePrefix = 'o_';
|
||||
|
||||
/**
|
||||
* Set Default Values
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setDefaultValues()
|
||||
{
|
||||
$this->status = static::STATUS_PENDING;
|
||||
$this->date = new \IPS\DateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get invoice
|
||||
*
|
||||
* @return \IPS\nexus\Invoice
|
||||
*/
|
||||
public function get_invoice()
|
||||
{
|
||||
return \IPS\nexus\Invoice::load( $this->_data['invoice'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set invoice
|
||||
*
|
||||
* @param \IPS\nexus\Invoice
|
||||
* @return void
|
||||
*/
|
||||
public function set_invoice( \IPS\nexus\Invoice $invoice )
|
||||
{
|
||||
$this->_data['invoice'] = $invoice->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get data (name, address, phone number)
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_data()
|
||||
{
|
||||
return json_decode( $this->_data['data'], TRUE );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set data (name, address, phone number)
|
||||
*
|
||||
* @param mixed $data The data
|
||||
* @return void
|
||||
*/
|
||||
public function set_data( $data )
|
||||
{
|
||||
$this->_data['data'] = json_encode( $data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get method
|
||||
*
|
||||
* @return \IPS\nexus\Shipping\FlatRate
|
||||
*/
|
||||
public function get_method()
|
||||
{
|
||||
try
|
||||
{
|
||||
return \IPS\nexus\Shipping\FlatRate::load( $this->_data['method'] );
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set method
|
||||
*
|
||||
* @param \IPS\nexus\Shipping\FlatRate
|
||||
* @return void
|
||||
*/
|
||||
public function set_method( \IPS\nexus\Shipping\FlatRate $method )
|
||||
{
|
||||
$this->_data['method'] = $method->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get items
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_items()
|
||||
{
|
||||
return json_decode( $this->_data['items'], TRUE );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set items
|
||||
*
|
||||
* @note Is protected, as addItem should be used
|
||||
* @see \IPS\nexus\Invoice::addItem()
|
||||
* @param array $items The items
|
||||
* @return void
|
||||
*/
|
||||
protected function set_items( array $items )
|
||||
{
|
||||
$this->_data['items'] = json_encode( $items );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get date
|
||||
*
|
||||
* @return \IPS\DateTime
|
||||
*/
|
||||
public function get_date()
|
||||
{
|
||||
return \IPS\DateTime::ts( $this->_data['date'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set date
|
||||
*
|
||||
* @param \IPS\DateTime $date The invoice date
|
||||
* @return void
|
||||
*/
|
||||
public function set_date( \IPS\DateTime $date )
|
||||
{
|
||||
$this->_data['date'] = $date->getTimestamp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shipped date
|
||||
*
|
||||
* @return \IPS\DateTime|NULL
|
||||
*/
|
||||
public function get_shipped_date()
|
||||
{
|
||||
return $this->_data['shipped_date'] ? \IPS\DateTime::ts( $this->_data['shipped_date'] ) : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set shipped date
|
||||
*
|
||||
* @param \IPS\DateTime $date The invoice date
|
||||
* @return void
|
||||
*/
|
||||
public function set_shipped_date( \IPS\DateTime $date )
|
||||
{
|
||||
$this->_data['shipped_date'] = $date->getTimestamp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get label
|
||||
*
|
||||
* @return \IPS\Http\Url|string|NULL
|
||||
*/
|
||||
public function get_label()
|
||||
{
|
||||
try
|
||||
{
|
||||
return $this->_data['label'] ? \IPS\Http\Url::external( $this->_data['label'] ) : NULL;
|
||||
}
|
||||
catch ( \InvalidArgumentException $e )
|
||||
{
|
||||
return $this->_data['label'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Item Count
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function itemCount()
|
||||
{
|
||||
$count = 0;
|
||||
foreach ( $this->items as $item )
|
||||
{
|
||||
$count += $item['quantity'];
|
||||
}
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send Notification
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function sendNotification()
|
||||
{
|
||||
$email = \IPS\Email::buildFromTemplate( 'nexus', 'shipment', array( $this ) );
|
||||
$email->send( $this->invoice->member );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Address
|
||||
*/
|
||||
protected $_address;
|
||||
|
||||
/**
|
||||
* Get address
|
||||
*
|
||||
* @return \IPS\GeoLocation
|
||||
*/
|
||||
public function address()
|
||||
{
|
||||
if ( !$this->_address )
|
||||
{
|
||||
$data = $this->data;
|
||||
|
||||
if ( isset( $data['address'] ) )
|
||||
{
|
||||
$this->_address = \IPS\GeoLocation::buildFromJson( json_encode( $data['address'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_address = new \IPS\GeoLocation;
|
||||
$this->_address->addressLines[0] = $data['address_1'];
|
||||
if ( isset( $data['address_2'] ) and $data['address_2'] )
|
||||
{
|
||||
$this->_address->addressLines[1] = $data['address_2'];
|
||||
}
|
||||
$this->_address->city = $data['city'];
|
||||
$this->_address->state = $data['state'];
|
||||
$this->_address->zip = $data['zip'];
|
||||
$this->_address->country = $data['country'];
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracking URL
|
||||
*
|
||||
* @return \IPS\Http\Url|NULL
|
||||
*/
|
||||
public function trackingUrl()
|
||||
{
|
||||
if ( $this->status === static::STATUS_SHIPPED and $this->service )
|
||||
{
|
||||
try
|
||||
{
|
||||
return \IPS\Http\Url::external( $this->service );
|
||||
}
|
||||
catch ( \InvalidArgumentException $e )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* ACP "View Invoice" URL
|
||||
*
|
||||
* @return \IPS\Http\Url
|
||||
*/
|
||||
public function acpUrl()
|
||||
{
|
||||
return \IPS\Http\Url::internal( "app=nexus&module=payments&controller=shipping&do=view&id={$this->id}", 'admin' );
|
||||
}
|
||||
|
||||
/**
|
||||
* ACP Buttons
|
||||
*
|
||||
* @param string $ref Referer
|
||||
* @return array
|
||||
*/
|
||||
public function buttons( $ref='v' )
|
||||
{
|
||||
$url = $this->acpUrl()->setQueryString( 'r', $ref );
|
||||
$return = array();
|
||||
|
||||
if ( $this->status !== static::STATUS_SHIPPED and \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'payments', 'shiporders_edit' ) )
|
||||
{
|
||||
$return['ship'] = array(
|
||||
'title' => 'shipment_ship',
|
||||
'icon' => 'check',
|
||||
'link' => $url->setQueryString( 'do', 'ship' ),
|
||||
'data' => \IPS\Settings::i()->easypost_api_key ? NULL : array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('shipment_ship') )
|
||||
);
|
||||
|
||||
if ( $this->status !== static::STATUS_CANCELED )
|
||||
{
|
||||
$return['cancel'] = array(
|
||||
'title' => 'cancel',
|
||||
'icon' => 'times',
|
||||
'link' => $url->setQueryString( 'do', 'cancel' ),
|
||||
'data' => array( 'confirm' => '' )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'payments', 'shiporders_delete' ) )
|
||||
{
|
||||
$return['delete'] = array(
|
||||
'title' => 'delete',
|
||||
'icon' => 'times-circle',
|
||||
'link' => $url->setQueryString( 'do', 'delete' ),
|
||||
'data' => array( 'delete' => '' )
|
||||
);
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Shipping Rate Interface
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Nexus
|
||||
* @since 19 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\Shipping;
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping Rate Interface
|
||||
*/
|
||||
interface Rate
|
||||
{
|
||||
/**
|
||||
* Is available to destination?
|
||||
*
|
||||
* @param \IPS\GeoLocation $destination Desired destination
|
||||
* @return bool
|
||||
*/
|
||||
public function isAvailable( \IPS\GeoLocation $destination );
|
||||
|
||||
/**
|
||||
* Name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName();
|
||||
|
||||
/**
|
||||
* Price
|
||||
*
|
||||
* @param array $items Items
|
||||
* @param string $currency Desired currency
|
||||
* @param \IPS\nexus\Invoice|NULL $invoice The invoice
|
||||
* @return \IPS\nexus\Money
|
||||
*/
|
||||
public function getPrice( array $items, $currency, \IPS\nexus\Invoice $invoice = NULL );
|
||||
|
||||
/**
|
||||
* Tax
|
||||
*
|
||||
* @return \IPS\nexus\Tax|NULL
|
||||
*/
|
||||
public function getTax();
|
||||
|
||||
/**
|
||||
* Estimated delivery date
|
||||
*
|
||||
* @param array $items Items
|
||||
* @param \IPS\nexus\Invoice|NULL $invoice The invoice
|
||||
* @return string
|
||||
*/
|
||||
public function getEstimatedDelivery( array $items, \IPS\nexus\Invoice $invoice = NULL );
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Weight Object
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Nexus
|
||||
* @since 13 Feb 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\Shipping;
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Weight Object
|
||||
*/
|
||||
class _Weight
|
||||
{
|
||||
/**
|
||||
* @brief Conversion rates
|
||||
*/
|
||||
public static $conversionRates = array(
|
||||
'kg' => 1,
|
||||
'lb' => 0.45359237,
|
||||
'oz' => 0.028349523125
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Weight in kilograms (naturally we use kilograms as per le Syst�me international d'unitŽs like good boys)
|
||||
*/
|
||||
public $kilograms = 0;
|
||||
|
||||
/**
|
||||
* Best display unit
|
||||
*
|
||||
* @param \IPS\Member|NULL $member The member
|
||||
* @return string
|
||||
*/
|
||||
public static function bestUnit( \IPS\Member $member = NULL )
|
||||
{
|
||||
$member = $member ?: \IPS\Member::loggedIn();
|
||||
|
||||
/* US uses lbs. This is a more reliable way to detect if locale
|
||||
if US, as Windows and Nix use different locale keys, but both
|
||||
will set the currency symbol to USD for US only */
|
||||
if ( trim( $member->language()->locale['int_curr_symbol'] ) === 'USD' )
|
||||
{
|
||||
return 'lb';
|
||||
}
|
||||
|
||||
return 'kg';
|
||||
}
|
||||
|
||||
/**
|
||||
* Contructor
|
||||
*
|
||||
* @param float $weight Weight
|
||||
* @param string $unit Unit
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( $amount, $unit='kg' )
|
||||
{
|
||||
$this->kilograms = ( $amount * static::$conversionRates[ $unit ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get as float
|
||||
*
|
||||
* @param $unit Unit
|
||||
* @return float
|
||||
*/
|
||||
public function float( $unit='kg' )
|
||||
{
|
||||
return $this->kilograms / static::$conversionRates[ $unit ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get as string
|
||||
*
|
||||
* @param string|NULL $unit Unit (NULL to autodetect)
|
||||
* @param int|NULL $round Decimal places to round to
|
||||
* @return float
|
||||
*/
|
||||
public function string( $unit=NULL, $round=2 )
|
||||
{
|
||||
if ( $unit === NULL )
|
||||
{
|
||||
$unit = static::bestUnit();
|
||||
}
|
||||
|
||||
return round( $this->float( $unit ), $round ) . $unit;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
Reference in new issue
Block a user