mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-04 21:23:36 +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
|
||||
|
||||
Reference in New Issue
Block a user