WIP: App wiz

Former-commit-id: aa969dc2fead693977959374c747f046676c5fed
This commit is contained in:
fbsanchez 2019-02-19 14:36:16 +01:00
parent 8c09b945c7
commit 1b82a970b1
5 changed files with 36 additions and 22 deletions

View File

@ -33,6 +33,9 @@ function get_wiz_class($str)
case 'tasklist':
return 'DiscoveryTaskList';
case 'app':
return 'Applications';
default:
// Ignore.
return null;
@ -50,6 +53,19 @@ foreach ($classes as $classpath) {
include_once $classpath;
}
// Load enterprise wizards.
if (enterprise_installed() === true) {
$enterprise_classes = glob(
$config['homedir'].'/'.ENTERPRISE_DIR.'/wizards/*.class.php'
);
foreach ($enterprise_classes as $classpath) {
$r = enterprise_include_once(
'wizards/'.basename($classpath)
);
}
}
$classes = array_merge($classes, $enterprise_classes);
$wiz_in_use = get_parameter('wiz', null);
$page = get_parameter('page', 0);

View File

@ -156,24 +156,6 @@ class HostDevices extends Wizard
}
/**
* Checks if environment is ready,
* returns array
* icon: icon to be displayed
* label: label to be displayed
*
* @return array With data.
**/
public function load()
{
return [
'icon' => $this->icon,
'label' => $this->label,
'url' => $this->url,
];
}
// Extra methods.

View File

@ -92,12 +92,20 @@ class Wizard
/**
* To be overwritten.
* Checks if environment is ready,
* returns array
* icon: icon to be displayed
* label: label to be displayed
*
* @return void
*/
* @return array With data.
**/
public function load()
{
return [
'icon' => $this->icon,
'label' => $this->label,
'url' => $this->url,
];
}

View File

@ -340,6 +340,14 @@ class ConsoleSupervisor
enterprise_hook('cron_supervisor_release_lock');
}
/*
* Check if CRON is running.
* NOTIF.CRON.CONFIGURED
*/
if (enterprise_installed()) {
$this->checkCronRunning();
}
}

View File

@ -375,7 +375,7 @@ function messages_get_count(
tnotification_source ns
LEFT JOIN tnotification_source_user nsu
ON ns.id=nsu.id_source
AND nsu.id_user="test")
AND nsu.id_user="%s")
ON tm.id_source=ns.id',
$user
);