Skip to content

Commit

Permalink
Issue #1060: Extend the IDs in the activity forms. Adjust some ID bas…
Browse files Browse the repository at this point in the history
…ed css.
  • Loading branch information
Sven committed Nov 8, 2021
1 parent 0f12c47 commit d9e000a
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 39 deletions.
37 changes: 35 additions & 2 deletions Kernel/Modules/CustomerTicketProcess.pm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ sub Run {
my $ActivityDialogEntityID = $Param{ActivityDialogEntityID} || $ParamObject->GetParam( Param => 'ActivityDialogEntityID' );
my $ActivityDialogHashRef;

# extend used ids in html to enable multiple dialogs per page
$Self->{IDSuffix} = $ActivityDialogEntityID ? $ActivityDialogEntityID =~ s/^ActivityDialog-//r : '';

# get needed objects
my $LayoutObject = $Kernel::OM->Create('Kernel::Output::HTML::Layout');
my $TicketObject = $Kernel::OM->Get('Kernel::System::Ticket');
Expand Down Expand Up @@ -1930,6 +1933,10 @@ sub _RenderDynamicField {
Content => $DynamicFieldHTML->{Field},
);

# extend IDs to enable simultaneous activities; might be done directly in the dynamic fields if important at any other place, somewhen
$Data{Content} =~ s/id="([\w\s_]+)"/id="$1_$Self->{IDSuffix}"/;
$Data{Label} =~ s/(id|for)="([\w\s_]+)"/$1="$2_$Self->{IDSuffix}"/;

$LayoutObject->Block(
Name => $Param{ActivityDialogField}->{LayoutBlock} || 'rw:DynamicField',
Data => \%Data,
Expand Down Expand Up @@ -1987,6 +1994,7 @@ sub _RenderTitle {
Name => 'Title',
MandatoryClass => '',
ValidateRequired => '',
IDSuffix => $Self->{IDSuffix} || '',
);

# If field is required put in the necessary variables for
Expand Down Expand Up @@ -2089,9 +2097,10 @@ sub _RenderArticle {
Body => $Param{GetParam}{Body},
LabelSubject => $Param{ActivityDialogField}->{Config}->{LabelSubject}
|| $LayoutObject->{LanguageObject}->Translate("Subject"),
LabelBody => $Param{ActivityDialogField}->{Config}->{LabelBody}
LabelBody => $Param{ActivityDialogField}->{Config}->{LabelBody}
|| $LayoutObject->{LanguageObject}->Translate("Text"),
AttachmentList => $Param{AttachmentList},
AttachmentList => $Param{AttachmentList},
IDSuffix => $Self->{IDSuffix} || '',
);

# If field is required put in the necessary variables for
Expand Down Expand Up @@ -2343,6 +2352,7 @@ sub _RenderSLA {
FormID => $Param{FormID},
MandatoryClass => '',
ValidateRequired => '',
IDSuffix => $Self->{IDSuffix},
);

# If field is required put in the necessary variables for
Expand Down Expand Up @@ -2419,6 +2429,9 @@ sub _RenderSLA {
Max => 200,
);

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

# send data to JS
$LayoutObject->AddJSData(
Key => 'SLAFieldsToUpdate',
Expand Down Expand Up @@ -2493,6 +2506,7 @@ sub _RenderService {
FormID => $Param{FormID},
MandatoryClass => '',
ValidateRequired => '',
IDSuffix => $Self->{IDSuffix},
);

# If field is required put in the necessary variables for
Expand Down Expand Up @@ -2577,6 +2591,9 @@ sub _RenderService {
Max => 200,
);

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

# send data to JS
$LayoutObject->AddJSData(
Key => 'ServiceFieldsToUpdate',
Expand Down Expand Up @@ -2652,6 +2669,7 @@ sub _RenderPriority {
FormID => $Param{FormID},
MandatoryClass => '',
ValidateRequired => '',
IDSuffix => $Self->{IDSuffix},
);

# If field is required put in the necessary variables for
Expand Down Expand Up @@ -2714,6 +2732,9 @@ sub _RenderPriority {
Class => "Modernize $ServerError",
);

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

# send data to JS
$LayoutObject->AddJSData(
Key => 'PriorityFieldsToUpdate',
Expand Down Expand Up @@ -2788,6 +2809,7 @@ sub _RenderQueue {
FormID => $Param{FormID},
MandatoryClass => '',
ValidateRequired => '',
IDSuffix => $Self->{IDSuffix},
);

# If field is required put in the necessary variables for
Expand Down Expand Up @@ -2859,6 +2881,9 @@ sub _RenderQueue {
PossibleNone => 1,
);

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

# send data to JS
$LayoutObject->AddJSData(
Key => 'QueueFieldsToUpdate',
Expand Down Expand Up @@ -2931,6 +2956,7 @@ sub _RenderState {
FormID => $Param{FormID},
MandatoryClass => '',
ValidateRequired => '',
IDSuffix => $Self->{IDSuffix},
);

# If field is required put in the necessary variables for
Expand Down Expand Up @@ -2990,6 +3016,9 @@ sub _RenderState {
Class => "Modernize $ServerError",
);

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

# send data to JS
$LayoutObject->AddJSData(
Key => 'StateFieldsToUpdate',
Expand Down Expand Up @@ -3064,6 +3093,7 @@ sub _RenderType {
FormID => $Param{FormID},
MandatoryClass => '',
ValidateRequired => '',
IDSuffix => $Self->{IDSuffix},
);

# If field is required put in the necessary variables for
Expand Down Expand Up @@ -3141,6 +3171,9 @@ sub _RenderType {
Max => 200,
);

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

# send data to JS
$LayoutObject->AddJSData(
Key => 'TypeFieldsToUpdate',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<div class="Row">
<div class="Field">
<input type="text" id="Subject" name="Subject" value="[% Data.Subject | html %]" class="W75pc [% Data.ValidateRequired | html %] [% Data.SubjectServerError | html %] Validate_DependingRequiredAND Validate_Depending_RichText Validate_Depending_AttachmentExists Validate_Depending_TimeUnits"/>
<input type="text" id="Subject_[% Data.IDSuffix | html %]" name="Subject" value="[% Data.Subject | html %]" class="W75pc [% Data.ValidateRequired | html %] [% Data.SubjectServerError | html %] Validate_DependingRequiredAND Validate_Depending_RichText Validate_Depending_AttachmentExists Validate_Depending_TimeUnits"/>
</div>
[% RenderBlockStart("rw:Article:DescriptionLong") %]
<div class="Tooltip">
Expand All @@ -44,28 +44,28 @@
[% RenderBlockStart("rw:Article:DescriptionShort") %]
<p class="FieldExplanation ooo12g">[% Translate(Data.DescriptionShort) | html %]</p>
[% RenderBlockEnd("rw:Article:DescriptionShort") %]
<div id="SubjectError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="SubjectServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="Subject_[% Data.IDSuffix | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="Subject_[% Data.IDSuffix | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div class="Clear"></div>
</div>

<div class="RichTextHolder">
<div class="RichTextField">
<textarea id="RichText" class="RichText [% Data.ValidateRequired | html %] [% Data.BodyServerError | html %] Validate_DependingRequiredAND Validate_Depending_Subject Validate_Depending_AttachmentExists Validate_Depending_TimeUnits" name="Body" rows="15" cols="[% Config("Ticket::Frontend::TextAreaNote") %]">[% Data.Body | html %]</textarea>
<textarea id="RichText_[% Data.IDSuffix | html %]" class="RichText [% Data.ValidateRequired | html %] [% Data.BodyServerError | html %] Validate_DependingRequiredAND Validate_Depending_Subject Validate_Depending_AttachmentExists Validate_Depending_TimeUnits" name="Body" rows="15" cols="[% Config("Ticket::Frontend::TextAreaNote") %]">[% Data.Body | html %]</textarea>
</div>
<label class="[% Data.MandatoryClass | html %]" for="RichText">
<label class="[% Data.MandatoryClass | html %]" for="RichText_[% Data.IDSuffix | html %]">
[% RenderBlockStart("LabelSpanBody") %]
<span class="Marker">*</span>
[% RenderBlockEnd("LabelSpanBody") %]
[% Data.LabelBody | html %]:
</label>
<div id="RichTextError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="RichTextServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="RichText_[% Data.IDSuffix | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="RichText_[% Data.IDSuffix | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div class="Clear"></div>
</div>

<div class="Row">
<div id="oooAttachments" class="Field">
<div id="oooAttachments_[% Data.IDSuffix | html %]" class="Field">
<div class="DnDUploadBox">
[% INCLUDE "FormElements/CustomerAttachmentList.tt" %]
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<p>[% Translate(Data.DescriptionLong) | html | html_line_break %]</p>
</div>
[% RenderBlockEnd("rw:Priority:DescriptionLong") %]
<label for="[% Data.FieldID | html %]" class="[% Data.MandatoryClass | html %]">
<label for="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]" class="[% Data.MandatoryClass | html %]">
[% RenderBlockStart("LabelSpan") %]
<span class="Marker">*</span>
[% RenderBlockEnd("LabelSpan") %]
Expand All @@ -33,8 +33,8 @@
[% RenderBlockStart("rw:Priority:DescriptionShort") %]
<p class="FieldExplanation ooo12g">[% Data.DescriptionShort | html %]</p>
[% RenderBlockEnd("rw:Priority:DescriptionShort") %]
<div id="[% Data.FieldID | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div class="Clear"></div>
</div>
[% RenderBlockEnd("rw:Priority") %]
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<p>[% Translate(Data.DescriptionLong) | html | html_line_break %]</p>
</div>
[% RenderBlockEnd("rw:Queue:DescriptionLong") %]
<label for="[% Data.FieldID | html %]" class="[% Data.MandatoryClass | html %]">
<label for="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]" class="[% Data.MandatoryClass | html %]">
[% RenderBlockStart("LabelSpan") %]
<span class="Marker">*</span>
[% RenderBlockEnd("LabelSpan") %]
Expand All @@ -33,8 +33,8 @@
[% RenderBlockStart("rw:Queue:DescriptionShort") %]
<p class="FieldExplanation ooo12g">[% Translate(Data.DescriptionShort) | html %]</p>
[% RenderBlockEnd("rw:Queue:DescriptionShort") %]
<div id="[% Data.FieldID | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div class="Clear"></div>
</div>
[% RenderBlockEnd("rw:Queue") %]
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<p>[% Translate(Data.DescriptionLong) | html | html_line_break %]</p>
</div>
[% RenderBlockEnd("rw:SLA:DescriptionLong") %]
<label for="[% Data.FieldID | html %]" class="[% Data.MandatoryClass | html %]">
<label for="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]" class="[% Data.MandatoryClass | html %]">
[% RenderBlockStart("LabelSpan") %]
<span class="Marker">*</span>
[% RenderBlockEnd("LabelSpan") %]
Expand All @@ -33,8 +33,8 @@
[% RenderBlockStart("rw:SLA:DescriptionShort") %]
<p class="FieldExplanation ooo12g">[% Data.DescriptionShort %]</p>
[% RenderBlockEnd("rw:SLA:DescriptionShort") %]
<div id="[% Data.FieldID | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div class="Clear"></div>
</div>
[% RenderBlockEnd("rw:SLA") %]
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<p>[% Translate(Data.DescriptionLong) | html | html_line_break %]</p>
</div>
[% RenderBlockEnd("rw:Service:DescriptionLong") %]
<label for="[% Data.FieldID | html %]" class="[% Data.MandatoryClass | html %]">
<label for="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]" class="[% Data.MandatoryClass | html %]">
[% RenderBlockStart("LabelSpan") %]
<span class="Marker">*</span>
[% RenderBlockEnd("LabelSpan") %]
Expand All @@ -33,8 +33,8 @@
[% RenderBlockStart("rw:Service:DescriptionShort") %]
<p class="FieldExplanation ooo12g">[% Translate(Data.DescriptionShort) | html %]</p>
[% RenderBlockEnd("rw:Service:DescriptionShort") %]
<div id="[% Data.FieldID | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div class="Clear"></div>
</div>
[% RenderBlockEnd("rw:Service") %]
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<p>[% Translate(Data.DescriptionLong) | html | html_line_break %]</p>
</div>
[% RenderBlockEnd("rw:State:DescriptionLong") %]
<label for="[% Data.FieldID | html %]" class="[% Data.MandatoryClass | html %]">
<label for="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]" class="[% Data.MandatoryClass | html %]">
[% RenderBlockStart("LabelSpan") %]
<span class="Marker">*</span>
[% RenderBlockEnd("LabelSpan") %]
Expand All @@ -33,8 +33,8 @@
[% RenderBlockStart("rw:State:DescriptionShort") %]
<p class="FieldExplanation ooo12g">[% Translate(Data.DescriptionShort) | html %]</p>
[% RenderBlockEnd("rw:State:DescriptionShort") %]
<div id="[% Data.FieldID | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div class="Clear"></div>
</div>
[% RenderBlockEnd("rw:State") %]
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
[% RenderBlockStart("rw:Title") %]
<div class="Row">
<div class="Field">
<input class="W50pc DynamicFieldText [% Data.ValidateRequired | html %] [% Data.ServerError | html %]" type="text" name="[% Data.FieldID | html %]" id="[% Data.FieldID | html %]" value="[% Data.Value | html %]"/>
<input class="W50pc DynamicFieldText [% Data.ValidateRequired | html %] [% Data.ServerError | html %]" type="text" name="[% Data.FieldID | html %]" id="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]" value="[% Data.Value | html %]"/>
</div>
[% RenderBlockStart("rw:Title:DescriptionLong") %]
<div class="Tooltip">
<i class="ooofo ooofo-help"></i>
<p>[% Translate(Data.DescriptionLong) | html | html_line_break %]</p>
</div>
[% RenderBlockEnd("rw:Title:DescriptionLong") %]
<label for="[% Data.FieldID | html %]" class="[% Data.MandatoryClass | html %]">
<label for="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]" class="[% Data.MandatoryClass | html %]">
[% RenderBlockStart("LabelSpan") %]
<span class="Marker">*</span>
[% RenderBlockEnd("LabelSpan") %]
Expand All @@ -33,8 +33,8 @@
[% RenderBlockStart("rw:Title:DescriptionShort") %]
<p class="FieldExplanation ooo12g">[% Translate(Data.DescriptionShort) | html %]</p>
[% RenderBlockEnd("rw:Title:DescriptionShort") %]
<div id="[% Data.FieldID | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div class="Clear"></div>
</div>
[% RenderBlockEnd("rw:Title") %]
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<p>[% Translate(Data.DescriptionLong) | html | html_line_break %]</p>
</div>
[% RenderBlockEnd("rw:Type:DescriptionLong") %]
<label for="[% Data.FieldID | html %]" class="[% Data.MandatoryClass | html %]">
<label for="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]" class="[% Data.MandatoryClass | html %]">
[% RenderBlockStart("LabelSpan") %]
<span class="Marker">*</span>
[% RenderBlockEnd("LabelSpan") %]
Expand All @@ -33,8 +33,8 @@
[% RenderBlockStart("rw:Type:DescriptionShort") %]
<p class="FieldExplanation ooo12g">[% Translate(Data.DescriptionShort) | html %]</p>
[% RenderBlockEnd("rw:Type:DescriptionShort") %]
<div id="[% Data.FieldID | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]Error" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div id="[% Data.FieldID | html %]_[% Data.IDSuffix | html %]ServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
<div class="Clear"></div>
</div>
[% RenderBlockEnd("rw:Type") %]
12 changes: 6 additions & 6 deletions var/httpd/htdocs/skins/Customer/default/css/Core.InputFields.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fieldset.Columns .Column .InputField_ListContainer div {
height: 56px;
}

#cke_RichText {
.RichTextHolder .cke {
display: inline-block;
height: auto;
}
Expand Down Expand Up @@ -331,19 +331,19 @@ label.oooFocus.LabelError {
background-color: transparent;
}

#cke_RichText {
.RichTextHolder .cke {
border: none;
}
#cke_RichText > .cke_inner {
.RichTextHolder .cke > .cke_inner {
border-radius: 10px;
background-color: #f7f7f9;
background-color: var(--colBGLight);
}
#cke_1_contents {
.RichTextHolder .cke_contents {
border: solid 1px #e5e5eb;
}
#cke_1_bottom,
#cke_1_top {
.RichTextHolder .cke_bottom,
.RichTextHolder .cke_top {
background: none;
border: none;
}
Expand Down
12 changes: 12 additions & 0 deletions var/httpd/htdocs/skins/Customer/default/css/Core.Process.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
margin-bottom: -22px;
}

.Row input[name=Subject] {
display: inline-block;
font-size: 16px;
line-height: 1.25;
letter-spacing: 0.4px;
text-align: left;
height: 56px;
padding: 0px;
padding-left: 32px;
border-radius: 10px;
width: calc( 100% - 32px);
}
Loading

0 comments on commit d9e000a

Please sign in to comment.