Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -89,6 +89,22 @@ class _Rule extends \IPS\Node\Model
|
||||
{
|
||||
$conditions = array();
|
||||
$results = array();
|
||||
$warning = NULL;
|
||||
|
||||
/* Preceeding rules */
|
||||
foreach ( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'nexus_fraud_rules', array( 'f_order<?', $this->order ), 'f_order' ), 'IPS\nexus\Fraud\Rule' ) as $otherRule )
|
||||
{
|
||||
if ( !count( $conditions ) )
|
||||
{
|
||||
$conditions[] = \IPS\Member::loggedIn()->language()->addToStack('f_has_preceeding');
|
||||
}
|
||||
|
||||
if ( $otherRule->isSubsetOf( $this ) )
|
||||
{
|
||||
$warning = $otherRule;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Amount */
|
||||
if ( $this->amount )
|
||||
@@ -279,7 +295,7 @@ class _Rule extends \IPS\Node\Model
|
||||
$results[] = "→ " . \IPS\Member::loggedIn()->language()->addToStack( 'f_action_' . $this->action );
|
||||
|
||||
/* Return */
|
||||
return implode( \IPS\Member::loggedIn()->language()->addToStack( 'f_blurb_join' ), $conditions ) . '<br>' . implode( \IPS\Member::loggedIn()->language()->addToStack( 'f_blurb_join' ), $results );
|
||||
return \IPS\Theme::i()->getTemplate( 'store' )->fraudRuleDesc( $conditions, $results, $warning );//implode( \IPS\Member::loggedIn()->language()->addToStack( 'f_blurb_join' ), $conditions ) . '<br>' . implode( \IPS\Member::loggedIn()->language()->addToStack( 'f_blurb_join' ), $results );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -686,7 +702,7 @@ class _Rule extends \IPS\Node\Model
|
||||
if ( $this->amount )
|
||||
{
|
||||
$amounts = $this->amount_unit;
|
||||
if ( !$this->_checkCondition( $transaction->amount->amount, $this->amount, $amounts[ $transaction->currency ] ) )
|
||||
if ( !isset( $amounts[ $transaction->currency ] ) or !$this->_checkCondition( $transaction->amount->amount, $this->amount, $amounts[ $transaction->currency ] ) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -991,17 +1007,20 @@ class _Rule extends \IPS\Node\Model
|
||||
{
|
||||
case 'Checkbox':
|
||||
case 'YesNo':
|
||||
if ( $memberValue === NULL )
|
||||
if ( $valueToCheck != 0 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if ( $valueToCheck == 1 and !$memberValue )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if ( $valueToCheck == -1 and $memberValue )
|
||||
{
|
||||
return FALSE;
|
||||
if ( $memberValue === NULL )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if ( $valueToCheck == 1 and !$memberValue )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if ( $valueToCheck == -1 and $memberValue )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in new issue
Block a user