Revert "Merged from discovery and validated"
This reverts commit e744dd50eb
[formerly af2047a38913f2763b68a8ec15b8f0cd58b8e676].
Former-commit-id: b32e3295f770a72ee587754b0d63ac8df1fd70f8
This commit is contained in:
parent
e744dd50eb
commit
af90734436
|
@ -269,9 +269,6 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
|||
$sub2['godmode/setup/setup&section=ehorus']['text'] = __('eHorus');
|
||||
$sub2['godmode/setup/setup&section=ehorus']['refr'] = 0;
|
||||
|
||||
$sub2['godmode/setup/setup&section=notifications']['text'] = __('Notifications');
|
||||
$sub2['godmode/setup/setup&section=notifications']['refr'] = 0;
|
||||
|
||||
if ($config['activate_gis']) {
|
||||
$sub2['godmode/setup/gis']['text'] = __('Map conections GIS');
|
||||
}
|
||||
|
|
|
@ -107,12 +107,6 @@ $buttons['ehorus'] = [
|
|||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup§ion=ehorus">'.html_print_image('images/ehorus/ehorus.png', true, ['title' => __('eHorus')]).'</a>',
|
||||
];
|
||||
|
||||
// FIXME: Not definitive icon
|
||||
$buttons['notifications'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup§ion=notifications">'.html_print_image('images/alerts_template.png', true, ['title' => __('Notifications')]).'</a>',
|
||||
];
|
||||
|
||||
$help_header = '';
|
||||
if (enterprise_installed()) {
|
||||
$subpage = setup_enterprise_add_subsection_main($section, $buttons, $help_header);
|
||||
|
@ -149,11 +143,6 @@ switch ($section) {
|
|||
$buttons['ehorus']['active'] = true;
|
||||
$subpage = ' » '.__('eHorus');
|
||||
break;
|
||||
|
||||
case 'notifications':
|
||||
$buttons['notifications']['active'] = true;
|
||||
$subpage = ' » '.__('Notifications');
|
||||
break;
|
||||
}
|
||||
|
||||
// Header
|
||||
|
@ -194,10 +183,6 @@ switch ($section) {
|
|||
include_once $config['homedir'].'/godmode/setup/setup_ehorus.php';
|
||||
break;
|
||||
|
||||
case 'notifications':
|
||||
include_once $config['homedir'].'/godmode/setup/setup_notifications.php';
|
||||
break;
|
||||
|
||||
default:
|
||||
enterprise_hook('setup_enterprise_select_tab', [$section]);
|
||||
break;
|
||||
|
|
|
@ -156,65 +156,6 @@ function check_notification_readable(int $id_message)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the target users and groups assigned to be notified on
|
||||
* desired source.
|
||||
*
|
||||
* @param integer $id_source
|
||||
*
|
||||
* @return array [users] and [groups] with the targets.
|
||||
*/
|
||||
function get_notification_source_targets(int $id_source)
|
||||
{
|
||||
$ret = [];
|
||||
|
||||
$users = db_get_all_rows_sql(
|
||||
sprintf(
|
||||
'SELECT
|
||||
id_user,
|
||||
IF(ns.user_editable = 1,nsu.also_mail,ns.also_mail) AS also_mail
|
||||
FROM tnotification_source_user nsu
|
||||
INNER JOIN tnotification_source ns
|
||||
ON ns.id=nsu.id_source
|
||||
WHERE ns.id = %d
|
||||
AND ((ns.enabled is NULL OR ns.enabled != 0)
|
||||
OR (nsu.enabled is NULL OR nsu.enabled != 0))',
|
||||
$id_source
|
||||
)
|
||||
);
|
||||
|
||||
if ($users !== false) {
|
||||
$i = 0;
|
||||
foreach ($users as $user) {
|
||||
$ret['users'][$i]['id_user'] = $user['id_user'];
|
||||
$ret['users'][$i++]['also_mail'] = $user['also_mail'];
|
||||
}
|
||||
}
|
||||
|
||||
$groups = db_get_all_rows_sql(
|
||||
sprintf(
|
||||
'SELECT id_group,ns.also_mail
|
||||
FROM tnotification_source_group nsg
|
||||
INNER JOIN tnotification_source ns
|
||||
ON ns.id=nsg.id_source
|
||||
WHERE ns.id = %d
|
||||
AND (ns.enabled is NULL OR ns.enabled != 0)',
|
||||
$id_source
|
||||
)
|
||||
);
|
||||
|
||||
if ($groups !== false) {
|
||||
$i = 0;
|
||||
foreach ($groups as $group) {
|
||||
$ret['groups'][$i]['id_group'] = $group['id_group'];
|
||||
$ret['groups'][$i++]['also_mail'] = $group['also_mail'];
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return all info from tnotification_source
|
||||
*
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue