Re: доработка AgentTicketPriority
Добавлено: 11 мар 2015, 14:22
Что-то я как pm подопиливаю, так и апач не рестартуется
Русскоязычное сообщество OTRS Helpdesk и OTRS ITSM
https://otrs.ru/forum/
Код: Выделить всё
perl -c полный-путь-к-файлу
Код: Выделить всё
Usage: perl [switches] [--] [programfile] [arguments]
...
-c check syntax only (runs BEGIN and CHECK blocks)
...
[Tue Mar 10 14:00:49.204732 2015] [perl:error] [pid 41280:tid 140547857450880] syntax error at /opt/otrs/Kernel/Modules/AgentTicketActi
onCommon.pm line 1, near "rtf1\\"\nsyntax error at /opt/otrs/Kernel/Modules/AgentTicketActionCommon.pm line 1, near "}}"\nsyntax error
at /opt/otrs/Kernel/Modules/AgentTicketActionCommon.pm line 14, near "par\r\n\\"\n"use" not allowed in expression at /opt/otrs/Kernel/M
odules/AgentTicketActionCommon.pm line 15, at end of line\n"use" not allowed in expression at /opt/otrs/Kernel/Modules/AgentTicketActio
nCommon.pm line 16, at end of line\nsyntax error at /opt/otrs/Kernel/Modules/AgentTicketActionCommon.pm line 16, near "par\r\nuse warni
ngs"\nsyntax error at /opt/otrs/Kernel/Modules/AgentTicketActionCommon.pm line 17, near "par\r\n\\"\n"use" not allowed in expression at
/opt/otrs/Kernel/Modules/AgentTicketActionCommon.pm line 18, at end of line\n"use" not allowed in expression at /opt/otrs/Kernel/Modul
es/AgentTicketActionCommon.pm line 19, at end of line\nsyntax error at /opt/otrs/Kernel/Modules/AgentTicketActionCommon.pm line 19, nea
r "par\r\nuse Kernel::System::Web::UploadCache"\n/opt/otrs/Kernel/Modules/AgentTicketActionCommon.pm has too many errors.\nCompilation
failed in require at (eval 68) line 2, <DATA> line 751.\n\t...propagated at /usr/share/perl/5.18/base.pm line 83, <DATA> line 751.\nBEG
IN failed--compilation aborted at /opt/otrs/Kernel/Modules/AgentTicketNote.pm line 15, <DATA> line 751.\nCompilation failed in require
at /opt/otrs/scripts/apache2-perl-startup.pl line 134, <DATA> line 751.\nBEGIN failed--compilation aborted at /opt/otrs/scripts/apache2
-perl-startup.pl line 134, <DATA> line 751.\nCompilation failed in require at (eval 2) line 1, <DATA> line 751.\n
[Tue Mar 10 14:00:49.204777 2015] [perl:error] [pid 41280:tid 140547857450880] Can't load Perl file: /opt/otrs/scripts/apache2-perl-sta
rtup.pl for server co-lnx-02
Точно, спасибо. Надо ж было в папку КАСТОМ их записывать.1. Не правьте родные файлы - /opt/otrs/Custom/README
2. Ошибки в синатксисе загружаемых модулей могут вызывать падение Apache при старте
Код: Выделить всё
[% RenderBlockStart("Queue") %]
[b]<label class="Mandatory" for="NewQueueID"><span class="Marker">*</span>[% Translate("Queue") | html %]:</label>[/b]
<div class="Field">
[% Data.QueuesStrg %]
<div id="NewQueueIDError" class="TooltipErrorMessage" ><p>[% Translate("This field is required.") | html %]</p></div>
<div id="NewQueueIDServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
</div>
<div class="Clear"></div>
Код: Выделить всё
# check queue
if (
( $Self->{ConfigObject}->Get('Ticket::Queue') )
&&
( $Self->{Config}->{TicketQueue} ) &&
( !$GetParam{NewQueueID} )
)
{
$Error{'NewQueueIDInvalid'} = ' ServerError';
}
Код: Выделить всё
my $Tos = $Self->_GetTos(
%GetParam,
CustomerUserID => $CustomerUser,
QueueID => $QueueID,
);
Код: Выделить всё
{
Name => 'NewQueueID',
Data => $Tos,
SelectedID => $GetParam{NewQueueID},
PossibleNone => 0,
Translation => 1,
Max => 100,
},
Код: Выделить всё
# set move queues
$Param{QueuesStrg} = $Self->{LayoutObject}->AgentQueueListOption(
Data => { %MoveQueues, '' => '-' },
Multiple => 0,
Size => 0,
#Class => 'NewQueueID',
Class => 'Validate_Required' . ( $Param{Errors}->{NewQueueIDInvalid} || '' ),
Name => 'NewQueueID',
SelectedID => $Param{NewQueueID} || $Param{QueueID},
TreeView => $TreeView,
CurrentQueueID => $Param{QueueID},
OnChangeSubmit => 0,
);
Код: Выделить всё
sub _GetTos {
my ( $Self, %Param ) = @_;
# check own selection
my %NewTos;
if ( $Self->{ConfigObject}->Get('Ticket::Frontend::NewQueueOwnSelection') ) {
%NewTos = %{ $Self->{ConfigObject}->Get('Ticket::Frontend::NewQueueOwnSelection') };
}
else {
# SelectionType Queue or SystemAddress?
my %Tos;
if ( $Self->{ConfigObject}->Get('Ticket::Frontend::NewQueueSelectionType') eq 'Queue' ) {
%Tos = $Self->{TicketObject}->MoveList(
%Param,
Type => 'create',
Action => $Self->{Action},
QueueID => $Self->{QueueID},
UserID => $Self->{UserID},
);
}
else {
%Tos = $Self->{DBObject}->GetTableData(
Table => 'system_address',
What => 'queue_id, id',
Valid => 1,
Clamp => 1,
);
}
# get create permission queues
my %UserGroups = $Self->{GroupObject}->GroupMemberList(
UserID => $Self->{UserID},
Type => 'create',
Result => 'HASH',
);
# build selection string
QUEUEID:
for my $QueueID ( sort keys %Tos ) {
my %QueueData = $Self->{QueueObject}->QueueGet( ID => $QueueID );
# permission check, can we create new tickets in queue
next QUEUEID if !$UserGroups{ $QueueData{GroupID} };
my $String = $Self->{ConfigObject}->Get('Ticket::Frontend::NewQueueSelectionString')
|| '<Realname> <<Email>> - Queue: <Queue>';
$String =~ s/<Queue>/$QueueData{Name}/g;
$String =~ s/<QueueComment>/$QueueData{Comment}/g;
if ( $Self->{ConfigObject}->Get('Ticket::Frontend::NewQueueSelectionType') ne 'Queue' )
{
my %SystemAddressData = $Self->{SystemAddress}->SystemAddressGet(
ID => $Tos{$QueueID},
);
$String =~ s/<Realname>/$SystemAddressData{Realname}/g;
$String =~ s/<Email>/$SystemAddressData{Name}/g;
}
$NewTos{$QueueID} = $String;
}
}
# add empty selection
$NewTos{''} = '-';
return \%NewTos;
}