icingaweb2-module-director/application/views/scripts/syncrule/runSummary.phtml

56 lines
1.6 KiB
PHTML

<?php
$total = $run->objects_deleted + $run->objects_created + $run->objects_modified;
if ($total === 0) {
echo $this->translate('No changes have been made');
} else {
if ($total === 1) {
echo $this->translate('One object has been modified');
} else {
printf(
$this->translate('%s objects have been modified'),
$total
);
}
$activityUrl = sprintf(
'director/config/activities?id>%d&id<=%d',
$formerId,
$lastId
);
$links = array();
if ($run->objects_created > 0) {
$links[] = $this->qlink(
sprintf('%d created', $run->objects_created),
$activityUrl,
array('action_name' => 'create')
);
}
if ($run->objects_modified > 0) {
$links[] = $this->qlink(
sprintf('%d modified', $run->objects_modified),
$activityUrl,
array('action_name' => 'modify')
);
}
if ($run->objects_deleted > 0) {
$links[] = $this->qlink(
sprintf('%d deleted', $run->objects_deleted),
$activityUrl,
array('action_name' => 'delete')
);
}
if (count($links) > 1) {
$links[] = $this->qlink(
'Show all actions',
$activityUrl
);
}
if (! empty($links)) {
echo ': ' . implode(', ', $links);
}
}
?>