mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-23 12:27:05 +00:00
Small bugfixes for issues in beta 2
This commit is contained in:
@@ -277,52 +277,6 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface
|
||||
return (int)$this->user->ruleGroups()->max('order');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RuleGroup $ruleGroup
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function moveDown(RuleGroup $ruleGroup): bool
|
||||
{
|
||||
$order = $ruleGroup->order;
|
||||
|
||||
// find the rule with order+1 and give it order-1
|
||||
$other = $this->user->ruleGroups()->where('order', $order + 1)->first();
|
||||
if ($other) {
|
||||
--$other->order;
|
||||
$other->save();
|
||||
}
|
||||
|
||||
++$ruleGroup->order;
|
||||
$ruleGroup->save();
|
||||
$this->resetRuleGroupOrder();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RuleGroup $ruleGroup
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function moveUp(RuleGroup $ruleGroup): bool
|
||||
{
|
||||
$order = $ruleGroup->order;
|
||||
|
||||
// find the rule with order-1 and give it order+1
|
||||
$other = $this->user->ruleGroups()->where('order', $order - 1)->first();
|
||||
if ($other) {
|
||||
++$other->order;
|
||||
$other->save();
|
||||
}
|
||||
|
||||
--$ruleGroup->order;
|
||||
$ruleGroup->save();
|
||||
$this->resetRuleGroupOrder();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
@@ -128,20 +128,6 @@ interface RuleGroupRepositoryInterface
|
||||
*/
|
||||
public function maxOrder(): int;
|
||||
|
||||
/**
|
||||
* @param RuleGroup $ruleGroup
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function moveDown(RuleGroup $ruleGroup): bool;
|
||||
|
||||
/**
|
||||
* @param RuleGroup $ruleGroup
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function moveUp(RuleGroup $ruleGroup): bool;
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
Reference in New Issue
Block a user