Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form cache #3061

Merged
merged 5 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Kernel/Modules/AgentReferenceSearch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ sub Run {
MaxResults => $MaxResults,
UserID => 1, # TODO: what about Permission check
ParamObject => $ParamObject,
LayoutObject => $LayoutObject,
);

my @Results;
Expand Down
14 changes: 6 additions & 8 deletions Kernel/Modules/AgentTicketActionCommon.pm
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,10 @@ sub new {
}

# get form id
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::Request')->GetParam( Param => 'FormID' );

# create form id
if ( !$Self->{FormID} ) {
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::UploadCache')->FormIDCreate();
}
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::FormCache')->PrepareFormID(
ParamObject => $Kernel::OM->Get('Kernel::System::Web::Request'),
LayoutObject => $Kernel::OM->Get('Kernel::Output::HTML::Layout'),
);

# methods which are used to determine the possible values of the standard fields
$Self->{FieldMethods} = [
Expand Down Expand Up @@ -1302,8 +1300,8 @@ sub Run {
);
}

# remove pre submitted attachments
$UploadCacheObject->FormIDRemove( FormID => $Self->{FormID} );
# remove all form data
$Kernel::OM->Get('Kernel::System::Web::FormCache')->FormIDRemove( FormID => $Self->{FormID} );

# delete hidden fields cache
$Kernel::OM->Get('Kernel::System::Cache')->Delete(
Expand Down
14 changes: 6 additions & 8 deletions Kernel/Modules/AgentTicketCompose.pm
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,10 @@ sub new {
}

# get form id
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::Request')->GetParam( Param => 'FormID' );

# create form id
if ( !$Self->{FormID} ) {
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::UploadCache')->FormIDCreate();
}
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::FormCache')->PrepareFormID(
ParamObject => $Kernel::OM->Get('Kernel::System::Web::Request'),
LayoutObject => $Kernel::OM->Get('Kernel::Output::HTML::Layout'),
);

return $Self;
}
Expand Down Expand Up @@ -1155,8 +1153,8 @@ sub Run {
CreateUserID => $Self->{UserID},
);

# remove pre submited attachments
$UploadCacheObject->FormIDRemove( FormID => $GetParam{FormID} );
# remove all form data
$Kernel::OM->Get('Kernel::System::Web::FormCache')->FormIDRemove( FormID => $Self->{FormID} );

# If form was called based on a draft,
# delete draft since its content has now been used.
Expand Down
14 changes: 6 additions & 8 deletions Kernel/Modules/AgentTicketEmail.pm
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,10 @@ sub new {
}

# get form id
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::Request')->GetParam( Param => 'FormID' );

# create form id
if ( !$Self->{FormID} ) {
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::UploadCache')->FormIDCreate();
}
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::FormCache')->PrepareFormID(
ParamObject => $Kernel::OM->Get('Kernel::System::Web::Request'),
LayoutObject => $Kernel::OM->Get('Kernel::Output::HTML::Layout'),
);

# methods which are used to determine the possible values of the standard fields
$Self->{FieldMethods} = [
Expand Down Expand Up @@ -2053,8 +2051,8 @@ sub Run {
);
}

# remove pre-submitted attachments
$UploadCacheObject->FormIDRemove( FormID => $Self->{FormID} );
# remove all form data
$Kernel::OM->Get('Kernel::System::Web::FormCache')->FormIDRemove( FormID => $Self->{FormID} );

# delete hidden fields cache
$Kernel::OM->Get('Kernel::System::Cache')->Delete(
Expand Down
12 changes: 9 additions & 3 deletions Kernel/Modules/AgentTicketEmailOutbound.pm
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,19 @@ sub Run {
NewStateID NewPriorityID TimeUnits IsVisibleForCustomer Title Body Subject NewQueueID
Year Month Day Hour Minute NewOwnerID NewOwnerType OldOwnerID NewResponsibleID
TypeID ServiceID SLAID Expand ReplyToArticle StandardTemplateID CreateArticle
FormID ElementChanged
ElementChanged
)
)
{
$GetParam{$Key} = $Kernel::OM->Get('Kernel::System::Web::Request')->GetParam( Param => $Key );
}

# get form id
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::FormCache')->PrepareFormID(
ParamObject => $Kernel::OM->Get('Kernel::System::Web::Request'),
LayoutObject => $LayoutObject,
);

my %Ticket = $TicketObject->TicketGet( TicketID => $Self->{TicketID} );
my $CustomerUser = $Ticket{CustomerUserID};
my $QueueID = $Ticket{QueueID};
Expand Down Expand Up @@ -1516,8 +1522,8 @@ sub SendEmail {
}
}

# remove pre-submitted attachments
$UploadCacheObject->FormIDRemove( FormID => $GetParam{FormID} );
# remove all form data
$Kernel::OM->Get('Kernel::System::Web::FormCache')->FormIDRemove( FormID => $Self->{FormID} );

# If form was called based on a draft,
# delete draft since its content has now been used.
Expand Down
14 changes: 6 additions & 8 deletions Kernel/Modules/AgentTicketEmailResend.pm
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ sub new {
$Self->{Debug} = $Param{Debug} || 0;

# Get form ID.
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::Request')->GetParam( Param => 'FormID' );

# Create new form ID.
if ( !$Self->{FormID} ) {
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::UploadCache')->FormIDCreate();
}
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::FormCache')->PrepareFormID(
ParamObject => $Kernel::OM->Get('Kernel::System::Web::Request'),
LayoutObject => $Kernel::OM->Get('Kernel::Output::HTML::Layout'),
);

return $Self;
}
Expand Down Expand Up @@ -679,8 +677,8 @@ sub Run {
);
}

# Remove pre-submitted attachments.
$UploadCacheObject->FormIDRemove( FormID => $GetParam{FormID} );
# remove all form data
$Kernel::OM->Get('Kernel::System::Web::FormCache')->FormIDRemove( FormID => $Self->{FormID} );

# Load new URL in parent window and close popup.
return $LayoutObject->PopupClose(
Expand Down
15 changes: 8 additions & 7 deletions Kernel/Modules/AgentTicketForward.pm
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ sub new {

for (
qw(To Cc Bcc Subject Body InReplyTo References ComposeStateID IsVisibleForCustomerPresent
IsVisibleForCustomer ArticleID TimeUnits Year Month Day Hour Minute FormID FormDraftID Title)
IsVisibleForCustomer ArticleID TimeUnits Year Month Day Hour Minute FormDraftID Title)
)
{
my $Value = $ParamObject->GetParam( Param => $_ );
Expand All @@ -124,10 +124,11 @@ sub new {
# ACL compatibility translation
$Self->{ACLCompatGetParam}->{NextStateID} = $Self->{GetParam}->{ComposeStateID};

# create form id
if ( !$Self->{GetParam}->{FormID} ) {
$Self->{GetParam}->{FormID} = $Kernel::OM->Get('Kernel::System::Web::UploadCache')->FormIDCreate();
}
# Get form ID.
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::FormCache')->PrepareFormID(
ParamObject => $ParamObject,
LayoutObject => $Kernel::OM->Get('Kernel::Output::HTML::Layout'),
);

return $Self;
}
Expand Down Expand Up @@ -1415,8 +1416,8 @@ sub SendEmail {
}
}

# remove pre-submitted attachments
$UploadCacheObject->FormIDRemove( FormID => $GetParam{FormID} );
# remove all form data
$Kernel::OM->Get('Kernel::System::Web::FormCache')->FormIDRemove( FormID => $Self->{FormID} );

# If form was called based on a draft,
# delete draft since its content has now been used.
Expand Down
14 changes: 6 additions & 8 deletions Kernel/Modules/AgentTicketMove.pm
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,10 @@ sub new {
}

# get form id
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::Request')->GetParam( Param => 'FormID' );

# create form id
if ( !$Self->{FormID} ) {
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::UploadCache')->FormIDCreate();
}
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::FormCache')->PrepareFormID(
ParamObject => $Kernel::OM->Get('Kernel::System::Web::Request'),
LayoutObject => $Kernel::OM->Get('Kernel::Output::HTML::Layout'),
);

return $Self;
}
Expand Down Expand Up @@ -1250,8 +1248,8 @@ sub Run {
);
}

# remove pre-submitted attachments
$UploadCacheObject->FormIDRemove( FormID => $Self->{FormID} );
# remove all form data
$Kernel::OM->Get('Kernel::System::Web::FormCache')->FormIDRemove( FormID => $Self->{FormID} );
}

# only set the dynamic fields if the new window was displayed (link), otherwise if ticket was
Expand Down
14 changes: 6 additions & 8 deletions Kernel/Modules/AgentTicketPhone.pm
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,10 @@ sub new {
}

# get form id
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::Request')->GetParam( Param => 'FormID' );

# create form id
if ( !$Self->{FormID} ) {
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::UploadCache')->FormIDCreate();
}
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::FormCache')->PrepareFormID(
ParamObject => $Kernel::OM->Get('Kernel::System::Web::Request'),
LayoutObject => $Kernel::OM->Get('Kernel::Output::HTML::Layout'),
);

# methods which are used to determine the possible values of the standard fields
$Self->{FieldMethods} = [
Expand Down Expand Up @@ -1911,8 +1909,8 @@ sub Run {
);
}

# remove pre submited attachments
$UploadCacheObject->FormIDRemove( FormID => $Self->{FormID} );
# remove all form data
$Kernel::OM->Get('Kernel::System::Web::FormCache')->FormIDRemove( FormID => $Self->{FormID} );

# delete hidden fields cache
$Kernel::OM->Get('Kernel::System::Cache')->Delete(
Expand Down
14 changes: 6 additions & 8 deletions Kernel/Modules/AgentTicketPhoneCommon.pm
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,10 @@ sub new {
}

# get form id
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::Request')->GetParam( Param => 'FormID' );

# create form id
if ( !$Self->{FormID} ) {
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::UploadCache')->FormIDCreate();
}
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::FormCache')->PrepareFormID(
ParamObject => $Kernel::OM->Get('Kernel::System::Web::Request'),
LayoutObject => $Kernel::OM->Get('Kernel::Output::HTML::Layout'),
);

return $Self;
}
Expand Down Expand Up @@ -978,8 +976,8 @@ sub Run {
);
}

# remove pre submitted attachments
$UploadCacheObject->FormIDRemove( FormID => $Self->{FormID} );
# remove all form data
$Kernel::OM->Get('Kernel::System::Web::FormCache')->FormIDRemove( FormID => $Self->{FormID} );

# set dynamic fields
# cycle through the activated Dynamic Fields for this screen
Expand Down
14 changes: 6 additions & 8 deletions Kernel/Modules/AgentTicketProcess.pm
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,10 @@ sub Run {
}

# get form id
$Self->{FormID} = $ParamObject->GetParam( Param => 'FormID' );

# create form id
if ( !$Self->{FormID} ) {
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::UploadCache')->FormIDCreate();
}
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::FormCache')->PrepareFormID(
ParamObject => $ParamObject,
LayoutObject => $LayoutObject,
);

# if we have no subaction display the process list to start a new one
if ( !$Self->{Subaction} ) {
Expand Down Expand Up @@ -5526,8 +5524,8 @@ sub _StoreActivityDialog {
);
}

# Remove pre submitted attachments.
$UploadCacheObject->FormIDRemove( FormID => $Self->{FormID} );
# remove all form data
$Kernel::OM->Get('Kernel::System::Web::FormCache')->FormIDRemove( FormID => $Self->{FormID} );

# time accounting
if ( $Param{GetParam}->{TimeUnits} ) {
Expand Down
14 changes: 6 additions & 8 deletions Kernel/Modules/CustomerTicketMessage.pm
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,10 @@ sub new {
}

# get form id
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::Request')->GetParam( Param => 'FormID' );

# create form id
if ( !$Self->{FormID} ) {
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::UploadCache')->FormIDCreate();
}
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::FormCache')->PrepareFormID(
ParamObject => $Kernel::OM->Get('Kernel::System::Web::Request'),
LayoutObject => $Kernel::OM->Get('Kernel::Output::HTML::Layout'),
);

# methods which are used to determine the possible values of the standard fields
$Self->{FieldMethods} = [
Expand Down Expand Up @@ -900,8 +898,8 @@ sub Run {
# if no article has to be created clean up and return
if ( !$VisibilityStd{Article} ) {

# remove pre submitted attachments
$UploadCacheObject->FormIDRemove( FormID => $Self->{FormID} );
# remove all form data
$Kernel::OM->Get('Kernel::System::Web::FormCache')->FormIDRemove( FormID => $Self->{FormID} );

# delete hidden fields cache
$Kernel::OM->Get('Kernel::System::Cache')->Delete(
Expand Down
14 changes: 6 additions & 8 deletions Kernel/Modules/CustomerTicketProcess.pm
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,10 @@ sub Run {
}

# get form id
$Self->{FormID} = $ParamObject->GetParam( Param => 'FormID' );

# create form id
if ( !$Self->{FormID} ) {
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::UploadCache')->FormIDCreate();
}
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::FormCache')->PrepareFormID(
ParamObject => $ParamObject,
LayoutObject => $LayoutObject,
);

# if invalid process is detected on a ActivityDilog popup screen show an error message
if (
Expand Down Expand Up @@ -3474,8 +3472,8 @@ sub _StoreActivityDialog {
);
}

# remove pre submitted attachments
$UploadCacheObject->FormIDRemove( FormID => $Self->{FormID} );
# remove all form data
$Kernel::OM->Get('Kernel::System::Web::FormCache')->FormIDRemove( FormID => $Self->{FormID} );
}
}

Expand Down
14 changes: 6 additions & 8 deletions Kernel/Modules/CustomerTicketZoom.pm
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,10 @@ sub new {
}

# get form id
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::Request')->GetParam( Param => 'FormID' );

# create form id
if ( !$Self->{FormID} ) {
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::UploadCache')->FormIDCreate();
}
$Self->{FormID} = $Kernel::OM->Get('Kernel::System::Web::FormCache')->PrepareFormID(
ParamObject => $Kernel::OM->Get('Kernel::System::Web::Request'),
LayoutObject => $Kernel::OM->Get('Kernel::Output::HTML::Layout'),
);

# methods which are used to determine the possible values of the standard fields
$Self->{FieldMethods} = [
Expand Down Expand Up @@ -1254,8 +1252,8 @@ sub Run {
}
}

# remove pre submited attachments
$UploadCacheObject->FormIDRemove( FormID => $Self->{FormID} );
# remove all form data
$Kernel::OM->Get('Kernel::System::Web::FormCache')->FormIDRemove( FormID => $Self->{FormID} );

# delete hidden fields cache
$Kernel::OM->Get('Kernel::System::Cache')->Delete(
Expand Down
Loading
Loading