Skip to content

Commit

Permalink
Issue #1060: AJAX update round 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven committed Nov 8, 2021
1 parent 9a4e260 commit d9e1095
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
27 changes: 14 additions & 13 deletions Kernel/Modules/CustomerTicketProcess.pm
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ sub _RenderAjax {
push(
@JSONCollector,
{
Name => 'DynamicField_' . $DynamicFieldConfig->{Name},
Name => 'DynamicField_' . $DynamicFieldConfig->{Name} . $Self->{IDSuffix},
Data => $DataValues,
SelectedID => $DynamicFieldValues{ $DynamicFieldConfig->{Name} },
Translation => $DynamicFieldConfig->{Config}->{TranslatableValues} || 0,
Expand All @@ -557,7 +557,7 @@ sub _RenderAjax {
push(
@JSONCollector,
{
Name => $Self->{NameToID}{$CurrentField},
Name => $Self->{NameToID}{$CurrentField} . $Self->{IDSuffix},
Data => $Data,
SelectedID => $Param{GetParam}{ $Self->{NameToID}{$CurrentField} },
PossibleNone => 1,
Expand All @@ -580,7 +580,7 @@ sub _RenderAjax {
push(
@JSONCollector,
{
Name => 'StateID',
Name => 'StateID' . $Self->{IDSuffix},
Data => $Data,
SelectedID => $Param{GetParam}{ $Self->{NameToID}{$CurrentField} },
Translation => 1,
Expand All @@ -600,7 +600,7 @@ sub _RenderAjax {
push(
@JSONCollector,
{
Name => $Self->{NameToID}{$CurrentField},
Name => $Self->{NameToID}{$CurrentField} . $Self->{IDSuffix},
Data => $Data,
SelectedID => $Param{GetParam}{ $Self->{NameToID}{$CurrentField} },
Translation => 1,
Expand All @@ -621,7 +621,7 @@ sub _RenderAjax {
push(
@JSONCollector,
{
Name => $Self->{NameToID}{$CurrentField},
Name => $Self->{NameToID}{$CurrentField} . $Self->{IDSuffix},
Data => $Data,
SelectedID => $ParamObject->GetParam( Param => 'ServiceID' ) || '',
PossibleNone => 1,
Expand Down Expand Up @@ -653,7 +653,7 @@ sub _RenderAjax {
push(
@JSONCollector,
{
Name => $Self->{NameToID}{$CurrentField},
Name => $Self->{NameToID}{$CurrentField} . $Self->{IDSuffix},
Data => $Data,
SelectedID => $ParamObject->GetParam( Param => 'SLAID' ) || '',
PossibleNone => 1,
Expand All @@ -674,7 +674,7 @@ sub _RenderAjax {
push(
@JSONCollector,
{
Name => $Self->{NameToID}{$CurrentField},
Name => $Self->{NameToID}{$CurrentField} . $Self->{IDSuffix},
Data => $Data,
SelectedID => $ParamObject->GetParam( Param => 'TypeID' ) || '',
PossibleNone => 1,
Expand Down Expand Up @@ -1367,6 +1367,7 @@ sub _OutputActivityDialog {
my $AJAXUpdatableFields = $Self->_GetAJAXUpdatableFields(
ActivityDialogFields => $ActivityDialog->{Fields},
);
$AJAXUpdatableFields = [ map { $_ . $Self->{IDSuffix} } $AJAXUpdatableFields->@* ];

# some fields should be skipped for the customer interface
my $SkipFields = [ 'Owner', 'Responsible', 'Lock', 'PendingTime', 'CustomerID' ];
Expand Down Expand Up @@ -2286,7 +2287,7 @@ sub _RenderSLA {
);

# extend IDs to enable simultaneous activities
$Data{Content} =~ s/id="([\w\s_]+)"/id="$1_$Self->{IDSuffix}"/;
$Data{Content} =~ s/id="([\w\s_]+)"/id="$1$Self->{IDSuffix}"/;

# send data to JS
$LayoutObject->AddJSData(
Expand Down Expand Up @@ -2448,7 +2449,7 @@ sub _RenderService {
);

# extend IDs to enable simultaneous activities
$Data{Content} =~ s/id="([\w\s_]+)"/id="$1_$Self->{IDSuffix}"/;
$Data{Content} =~ s/id="([\w\s_]+)"/id="$1$Self->{IDSuffix}"/;

# send data to JS
$LayoutObject->AddJSData(
Expand Down Expand Up @@ -2589,7 +2590,7 @@ sub _RenderPriority {
);

# extend IDs to enable simultaneous activities
$Data{Content} =~ s/id="([\w\s_]+)"/id="$1_$Self->{IDSuffix}"/;
$Data{Content} =~ s/id="([\w\s_]+)"/id="$1$Self->{IDSuffix}"/;

# send data to JS
$LayoutObject->AddJSData(
Expand Down Expand Up @@ -2738,7 +2739,7 @@ sub _RenderQueue {
);

# extend IDs to enable simultaneous activities
$Data{Content} =~ s/id="([\w\s_]+)"/id="$1_$Self->{IDSuffix}"/;
$Data{Content} =~ s/id="([\w\s_]+)"/id="$1$Self->{IDSuffix}"/;

# send data to JS
$LayoutObject->AddJSData(
Expand Down Expand Up @@ -2873,7 +2874,7 @@ sub _RenderState {
);

# extend IDs to enable simultaneous activities
$Data{Content} =~ s/id="([\w\s_]+)"/id="$1_$Self->{IDSuffix}"/;
$Data{Content} =~ s/id="([\w\s_]+)"/id="$1$Self->{IDSuffix}"/;

# send data to JS
$LayoutObject->AddJSData(
Expand Down Expand Up @@ -3028,7 +3029,7 @@ sub _RenderType {
);

# extend IDs to enable simultaneous activities
$Data{Content} =~ s/id="([\w\s_]+)"/id="$1_$Self->{IDSuffix}"/;
$Data{Content} =~ s/id="([\w\s_]+)"/id="$1$Self->{IDSuffix}"/;

# send data to JS
$LayoutObject->AddJSData(
Expand Down
14 changes: 13 additions & 1 deletion Kernel/Modules/CustomerTicketZoom.pm
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,26 @@ sub Run {
my $ProcessModule = ( 'Kernel::Modules::CustomerTicketProcess' )->new(
%{ $Self },
Action => 'CustomerTicketProcess',
Subaction => 'StoreActivityDialog',
Subaction => $Self->{Subaction},
ModuleReg => $ConfigObject->Get('CustomerFrontend::Module')->{ 'CustomerTicketProcess' },
);

my $ActivityDialogEntityID = $ParamObject->GetParam( Param => 'ActivityDialogEntityID' );
$ActivityErrorHTML{ $ActivityDialogEntityID } = $ProcessModule->Run(%Param);
}

elsif ( $Self->{Subaction} eq 'AJAXUpdate' && $ParamObject->GetParam( Param => 'ActivityDialogEntityID' ) ) {
$Kernel::OM->Get('Kernel::System::Main')->Require("Kernel::Modules::CustomerTicketProcess");
my $ProcessModule = ( 'Kernel::Modules::CustomerTicketProcess' )->new(
%{ $Self },
Action => 'CustomerTicketProcess',
Subaction => $Self->{Subaction},
ModuleReg => $ConfigObject->Get('CustomerFrontend::Module')->{ 'CustomerTicketProcess' },
);

return $ProcessModule->Run(%Param);
}

# get ticket data
my %Ticket = $TicketObject->TicketGet(
TicketID => $Self->{TicketID},
Expand Down

0 comments on commit d9e1095

Please sign in to comment.