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
1 changed files with 7 additions and 2 deletions

View File

@ -61,7 +61,9 @@ class SyncruleController extends ActionController
{
$id = $this->params->get('id');
$rule = SyncRule::load($id, $this->db());
if ($rule->applyChanges()) {
$changed = $rule->applyChanges();
if ($changed) {
$runId = $rule->getCurrentSyncRunId();
Notification::success('Source has successfully been synchronized');
$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 {
Notification::error('Synchronization failed');
$this->redirectNow('director/list/syncrule');
}
$this->redirectNow('director/syncrule?id=' . $id);
}
public function propertyAction()