/usr/share/otrs/scripts/DBUpdateTo6/AddAppointmentCalendarNotification.pm is in otrs2 6.0.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | # --
# Copyright (C) 2001-2018 OTRS AG, http://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --
package scripts::DBUpdateTo6::AddAppointmentCalendarNotification; ## no critic
use strict;
use warnings;
use parent qw(scripts::DBUpdateTo6::Base);
our @ObjectDependencies = (
'Kernel::System::NotificationEvent',
'Kernel::System::Valid',
);
=head1 NAME
scripts::DBUpdateTo6::AddAppointmentCalendarNotification - Add AppointmentCalendar notification.
=cut
sub Run {
my ( $Self, %Param ) = @_;
my %AppointmentNotifications = (
'Appointment reminder notification' => {
Data => {
NotificationType => ['Appointment'],
VisibleForAgent => [1],
VisibleForAgentTooltip => [
'You will receive a notification each time a reminder time is reached for one of your appointments.'
],
Events => ['AppointmentNotification'],
Recipients => ['AppointmentAgentReadPermissions'],
SendOnOutOfOffice => [1],
Transports => ['Email'],
AgentEnabledByDefault => ['Email'],
},
Message => {
'de' => {
'Body' => 'Hallo <OTRS_NOTIFICATION_RECIPIENT_UserFirstname>,<br />
<br />
Termin "<OTRS_APPOINTMENT_TITLE>" hat seine Benachrichtigungszeit erreicht.<br />
<br />
Beschreibung: <OTRS_APPOINTMENT_DESCRIPTION><br />
Standort: <OTRS_APPOINTMENT_LOCATION><br />
Kalender: <span style="color: <OTRS_CALENDAR_COLOR>;">■</span> <OTRS_CALENDAR_CALENDARNAME><br />
Startzeitpunkt: <OTRS_APPOINTMENT_STARTTIME><br />
Endzeitpunkt: <OTRS_APPOINTMENT_ENDTIME><br />
Ganztägig: <OTRS_APPOINTMENT_ALLDAY><br />
Wiederholung: <OTRS_APPOINTMENT_RECURRING><br />
<br />
<a href="<OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentAppointmentCalendarOverview;AppointmentID=<OTRS_APPOINTMENT_APPOINTMENTID>" title="<OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentAppointmentCalendarOverview;AppointmentID=<OTRS_APPOINTMENT_APPOINTMENTID>"><OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentAppointmentCalendarOverview;AppointmentID=<OTRS_APPOINTMENT_APPOINTMENTID></a><br />
<br />
-- <OTRS_CONFIG_NotificationSenderName>',
'ContentType' => 'text/html',
'Subject' => 'Erinnerung: <OTRS_APPOINTMENT_TITLE>',
},
'en' => {
'Body' => 'Hi <OTRS_NOTIFICATION_RECIPIENT_UserFirstname>,<br />
<br />
appointment "<OTRS_APPOINTMENT_TITLE>" has reached its notification time.<br />
<br />
Description: <OTRS_APPOINTMENT_DESCRIPTION><br />
Location: <OTRS_APPOINTMENT_LOCATION><br />
Calendar: <span style="color: <OTRS_CALENDAR_COLOR>;">■</span> <OTRS_CALENDAR_CALENDARNAME><br />
Start date: <OTRS_APPOINTMENT_STARTTIME><br />
End date: <OTRS_APPOINTMENT_ENDTIME><br />
All-day: <OTRS_APPOINTMENT_ALLDAY><br />
Repeat: <OTRS_APPOINTMENT_RECURRING><br />
<br />
<a href="<OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentAppointmentCalendarOverview;AppointmentID=<OTRS_APPOINTMENT_APPOINTMENTID>" title="<OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentAppointmentCalendarOverview;AppointmentID=<OTRS_APPOINTMENT_APPOINTMENTID>"><OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentAppointmentCalendarOverview;AppointmentID=<OTRS_APPOINTMENT_APPOINTMENTID></a><br />
<br />
-- <OTRS_CONFIG_NotificationSenderName>',
'ContentType' => 'text/html',
'Subject' => 'Reminder: <OTRS_APPOINTMENT_TITLE>',
},
'hu' => {
'Body' => 'Kedves <OTRS_NOTIFICATION_RECIPIENT_UserFirstname>!<br />
<br />
A következő esemény elérte az értesítési idejét: <OTRS_APPOINTMENT_TITLE><br />
<br />
Leírás: <OTRS_APPOINTMENT_DESCRIPTION><br />
Hely: <OTRS_APPOINTMENT_LOCATION><br />
Naptár: <span style="color: <OTRS_CALENDAR_COLOR>;">■</span> <OTRS_CALENDAR_CALENDARNAME><br />
Kezdési dátum: <OTRS_APPOINTMENT_STARTTIME><br />
Befejezési dátum: <OTRS_APPOINTMENT_ENDTIME><br />
Egész napos: <OTRS_APPOINTMENT_ALLDAY><br />
Ismétlődés: <OTRS_APPOINTMENT_RECURRING><br />
<br />
<a href="<OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentAppointmentCalendarOverview;AppointmentID=<OTRS_APPOINTMENT_APPOINTMENTID>" title="<OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentAppointmentCalendarOverview;AppointmentID=<OTRS_APPOINTMENT_APPOINTMENTID>"><OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentAppointmentCalendarOverview;AppointmentID=<OTRS_APPOINTMENT_APPOINTMENTID></a><br />
<br />
-- <OTRS_CONFIG_NotificationSenderName>',
'ContentType' => 'text/html',
'Subject' => 'Emlékeztető: <OTRS_APPOINTMENT_TITLE>',
},
'sr_Cyrl' => {
'Body' => 'Здраво <OTRS_NOTIFICATION_RECIPIENT_UserFirstname>,<br />
<br />
време је за обавештење у вези термина "<OTRS_APPOINTMENT_TITLE>".<br />
<br />
Опис: <OTRS_APPOINTMENT_DESCRIPTION><br />
Локација: <OTRS_APPOINTMENT_LOCATION><br />
Календар: <span style="color: <OTRS_CALENDAR_COLOR>;">■</span> <OTRS_CALENDAR_CALENDARNAME><br />
Датум почетка: <OTRS_APPOINTMENT_STARTTIME><br />
Датум краја: <OTRS_APPOINTMENT_ENDTIME><br />
Целодневно: <OTRS_APPOINTMENT_ALLDAY><br />
Понављање: <OTRS_APPOINTMENT_RECURRING><br />
<br />
<a href="<OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentAppointmentCalendarOverview;AppointmentID=<OTRS_APPOINTMENT_APPOINTMENTID>" title="<OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentAppointmentCalendarOverview;AppointmentID=<OTRS_APPOINTMENT_APPOINTMENTID>"><OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentAppointmentCalendarOverview;AppointmentID=<OTRS_APPOINTMENT_APPOINTMENTID></a><br />
<br />
-- <OTRS_CONFIG_NotificationSenderName>',
'ContentType' => 'text/html',
'Subject' => 'Подсетник: <OTRS_APPOINTMENT_TITLE>',
},
'sr_Latn' => {
'Body' => 'Zdravo <OTRS_NOTIFICATION_RECIPIENT_UserFirstname>,<br />
<br />
vreme je za obaveštenje u vezi termina "<OTRS_APPOINTMENT_TITLE>".<br />
<br />
Opis: <OTRS_APPOINTMENT_DESCRIPTION><br />
Lokacije: <OTRS_APPOINTMENT_LOCATION><br />
Kalendar: <span style="color: <OTRS_CALENDAR_COLOR>;">■</span> <OTRS_CALENDAR_CALENDARNAME><br />
Datum početka: <OTRS_APPOINTMENT_STARTTIME><br />
Datum kraja: <OTRS_APPOINTMENT_ENDTIME><br />
Celodnevno: <OTRS_APPOINTMENT_ALLDAY><br />
Ponavljanje: <OTRS_APPOINTMENT_RECURRING><br />
<br />
<a href="<OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentAppointmentCalendarOverview;AppointmentID=<OTRS_APPOINTMENT_APPOINTMENTID>" title="<OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentAppointmentCalendarOverview;AppointmentID=<OTRS_APPOINTMENT_APPOINTMENTID>"><OTRS_CONFIG_HttpType>://<OTRS_CONFIG_FQDN>/<OTRS_CONFIG_ScriptAlias>index.pl?Action=AgentAppointmentCalendarOverview;AppointmentID=<OTRS_APPOINTMENT_APPOINTMENTID></a><br />
<br />
-- <OTRS_CONFIG_NotificationSenderName>',
'ContentType' => 'text/html',
'Subject' => 'Podsetnik: <OTRS_APPOINTMENT_TITLE>',
},
},
},
);
my %ValidList = $Kernel::OM->Get('Kernel::System::Valid')->ValidList();
my %ValidListReverse = reverse %ValidList;
my $NotificationEventObject = $Kernel::OM->Get('Kernel::System::NotificationEvent');
# Get all notifications of appointment type.
my %NotificationList = $NotificationEventObject->NotificationList(
Type => 'Appointment',
);
my %NotificationListReverse = reverse %NotificationList;
NEWNOTIFICATION:
for my $NotificationName ( sort keys %AppointmentNotifications ) {
# Do not add new notification if one with the same name exists.
next NEWNOTIFICATION if $NotificationListReverse{$NotificationName};
# Add new event notification.
my $ID = $NotificationEventObject->NotificationAdd(
Name => $NotificationName,
Data => $AppointmentNotifications{$NotificationName}->{Data},
Message => $AppointmentNotifications{$NotificationName}->{Message},
Comment => '',
ValidID => $ValidListReverse{valid},
UserID => 1,
);
return if !$ID;
}
return 1;
}
1;
=head1 TERMS AND CONDITIONS
This software is part of the OTRS project (L<http://otrs.org/>).
This software comes with ABSOLUTELY NO WARRANTY. For details, see
the enclosed file COPYING for license information (AGPL). If you
did not receive this file, see L<http://www.gnu.org/licenses/agpl.txt>.
=cut
|