* Notifications: popup and email are enabled per default, default preference is "popup_or_email"

This commit is contained in:
Ralf Becker 2011-06-14 13:55:06 +00:00
parent 47439899a5
commit 7b2a5dd23f
3 changed files with 21 additions and 23 deletions

View File

@ -36,6 +36,11 @@ final class notifications {
*/
const _fallback = 'email_only';
/**
* backend to use if EGroupware user has no preferenc set and no default preference set
*/
const user_fallback = 'popup_or_email';
/**
* registered backends
* @var array
@ -376,7 +381,7 @@ final class notifications {
$notification_chain = $available_chains[self::_fallback];
}
} else {
$notification_chain = $available_chains[self::_fallback]; // fallback: no prefs
$notification_chain = $available_chains[self::user_fallback]; // fallback: no prefs
}
} else {
$notification_chain = $available_chains[self::_fallback]; // fallback: no rights to app
@ -535,6 +540,7 @@ final class notifications {
foreach($this->backends as $id => $backend) {
switch($backend) {
case 'email':
case 'popup':
$enabled_backends[$backend] = true; // fallback must always be enabled
break;
default:
@ -617,7 +623,7 @@ final class notifications {
/**
* Actions to take when an account is deleted
*
*
* @param settings array with keys account_id and new_owner (new_owner is optional)
*/
public function deleteaccount($settings) {

View File

@ -16,7 +16,7 @@ $verbosity_values = array(
'medium' => lang('medium'),
'high' => lang('high'),
);
$GLOBALS['settings'] = array(
'notification_chain' => array(
'type' => 'select',
@ -26,6 +26,7 @@ $GLOBALS['settings'] = array(
'help' => 'Choose a notification-chain. You will be notified over the backends included in the chain.<br />'
.'Note: If a notification-chain is marked as "disabled", your Administrator does not allow one or'
.' more of the backends included in the chain and notifications falls back to "E-Mail" while notifying you.',
'default'=> 'popup_or_email',
'xmlrpc' => True,
'admin' => False
),
@ -38,6 +39,7 @@ $GLOBALS['settings'] = array(
.'low: just display the notification bell in the topmenu - topmenu must be enabled!<br />'
.'medium: bring notification window to front<br />'
.'high: bring notification window to front and let the browser do something to announce itself',
'default'=> 'medium',
'xmlrpc' => True,
'admin' => False
),
@ -50,4 +52,3 @@ $GLOBALS['settings'] = array(
'admin' => False
),
);
?>

View File

@ -11,18 +11,21 @@
<!-- END header -->
<!-- BEGIN body -->
<tr class="th">
<td colspan="2">&nbsp;<b>{lang_eGroupWare-Popup_backend}</b></td>
<td colspan="2">&nbsp;<b>{lang_Mail_backend}</b></td>
</tr>
<tr class="row_on">
<td>{lang_Enable_eGroupWare-Popup_backend}</td>
<td>{lang_choose_from_mailsettings_used_for_notification}</td>
<td>
<select name="newsettings[popup_enable]">
<option value=""{selected_popup_enable_False}>{lang_No}</option>
<option value="True"{selected_popup_enable_True}>{lang_Yes}</option>
<select name="newsettings[dontUseUserDefinedProfiles]">
<option value=""{selected_dontUseUserDefinedProfiles_False}>{lang_Check_both_(first_try_(active)_User_defined_account,_if_none_use_emailadmin_profile)}</option>
<option value="True"{selected_dontUseUserDefinedProfiles_True}>{lang_Emailadmin_Profile_only_(Do_not_use_User_defined_(active)_Mail_Profiles_for_Notification)}</option>
</select>
</td>
</tr>
<tr class="row_off">
<tr class="th">
<td colspan="2">&nbsp;<b>{lang_eGroupWare-Popup_backend}</b></td>
</tr>
<tr class="row_on">
<td>{lang_Poll_interval}</td>
<td>
<select name="newsettings[popup_poll_interval]">
@ -55,7 +58,7 @@
<option value="True"{selected_sms_enable_True}>{lang_Yes}</option>
</select>
</td>
</tr>
</tr>
<tr class="row_off">
<td>{lang_Maximum_SMS_messages_per_notification}</td>
<td>
@ -66,18 +69,6 @@
</select>
</td>
</tr>
<tr class="th">
<td colspan="2">&nbsp;<b>{lang_Mail_backend}</b></td>
</tr>
<tr class="row_on">
<td>{lang_choose_from_mailsettings_used_for_notification}</td>
<td>
<select name="newsettings[dontUseUserDefinedProfiles]">
<option value=""{selected_dontUseUserDefinedProfiles_False}>{lang_Check_both_(first_try_(active)_User_defined_account,_if_none_use_emailadmin_profile)}</option>
<option value="True"{selected_dontUseUserDefinedProfiles_True}>{lang_Emailadmin_Profile_only_(Do_not_use_User_defined_(active)_Mail_Profiles_for_Notification)}</option>
</select>
</td>
</tr>
<!-- END body -->
<!-- BEGIN footer -->
<tr valign="bottom" style="height: 30px;">