mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Small bugfixes for issues in beta 2
This commit is contained in:
@@ -258,29 +258,6 @@ class RuleRepository implements RuleRepositoryInterface
|
||||
return $filtered;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Rule $rule
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function moveDown(Rule $rule): bool
|
||||
{
|
||||
$order = $rule->order;
|
||||
|
||||
// find the rule with order+1 and give it order-1
|
||||
$other = $rule->ruleGroup->rules()->where('order', $order + 1)->first();
|
||||
if ($other) {
|
||||
--$other->order;
|
||||
$other->save();
|
||||
}
|
||||
|
||||
++$rule->order;
|
||||
$rule->save();
|
||||
$this->resetRuleOrder($rule->ruleGroup);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@@ -295,29 +272,6 @@ class RuleRepository implements RuleRepositoryInterface
|
||||
return $rule;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Rule $rule
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function moveUp(Rule $rule): bool
|
||||
{
|
||||
$order = $rule->order;
|
||||
|
||||
// find the rule with order-1 and give it order+1
|
||||
$other = $rule->ruleGroup->rules()->where('order', $order - 1)->first();
|
||||
if ($other) {
|
||||
++$other->order;
|
||||
$other->save();
|
||||
}
|
||||
|
||||
--$rule->order;
|
||||
$rule->save();
|
||||
$this->resetRuleOrder($rule->ruleGroup);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Rule $rule
|
||||
* @param array $ids
|
||||
|
@@ -123,13 +123,6 @@ interface RuleRepositoryInterface
|
||||
*/
|
||||
public function getUpdateRules(): Collection;
|
||||
|
||||
/**
|
||||
* @param Rule $rule
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function moveDown(Rule $rule): bool;
|
||||
|
||||
/**
|
||||
* @param Rule $rule
|
||||
* @param RuleGroup $ruleGroup
|
||||
@@ -139,13 +132,6 @@ interface RuleRepositoryInterface
|
||||
*/
|
||||
public function moveRule(Rule $rule, RuleGroup $ruleGroup, int $order): Rule;
|
||||
|
||||
/**
|
||||
* @param Rule $rule
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function moveUp(Rule $rule): bool;
|
||||
|
||||
/**
|
||||
* @param Rule $rule
|
||||
* @param array $ids
|
||||
|
Reference in New Issue
Block a user