SyncruleController: distinct between failed and...

...no change
This commit is contained in:
Thomas Gelf 2016-06-24 16:59:36 +02:00
parent 695aa19f04
commit 3d0a31127c

View File

@ -61,7 +61,9 @@ class SyncruleController extends ActionController
{ {
$id = $this->params->get('id'); $id = $this->params->get('id');
$rule = SyncRule::load($id, $this->db()); $rule = SyncRule::load($id, $this->db());
if ($rule->applyChanges()) { $changed = $rule->applyChanges();
if ($changed) {
$runId = $rule->getCurrentSyncRunId(); $runId = $rule->getCurrentSyncRunId();
Notification::success('Source has successfully been synchronized'); Notification::success('Source has successfully been synchronized');
$this->redirectNow( $this->redirectNow(
@ -73,10 +75,13 @@ class SyncruleController extends ActionController
) )
) )
); );
} elseif ($rule->sync_state === 'in-sync') {
Notification::success('Nothing changed, rule is in sync');
} else { } else {
Notification::error('Synchronization failed'); Notification::error('Synchronization failed');
$this->redirectNow('director/list/syncrule');
} }
$this->redirectNow('director/syncrule?id=' . $id);
} }
public function propertyAction() public function propertyAction()