Skip to content

Commit

Permalink
Issue #2251: Unify Read"O"nly to Read"o"nly at some additional places.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven committed Sep 19, 2023
1 parent 4ed8ac2 commit 10d8bdc
Show file tree
Hide file tree
Showing 21 changed files with 28 additions and 29 deletions.
1 change: 0 additions & 1 deletion Kernel/Modules/AgentTicketProcess.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2668,7 +2668,6 @@ sub _RenderDynamicField {
UpdatableFields => $Param{AJAXUpdatableFields},
ServerError => $ServerError,
ErrorMessage => $ErrorMessage,
ReadOnly => $Param{ReadOnly},
);

my %Data = (
Expand Down
1 change: 0 additions & 1 deletion Kernel/Modules/CustomerTicketProcess.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,6 @@ sub _RenderDynamicField {
ServerError => $ServerError,
ErrorMessage => $ErrorMessage,
CustomerInterface => 1,
ReadOnly => $Param{ReadOnly},
);

my %Data = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

<input type="text" class="[% Data.FieldClass %]" id="[% Data.FieldID %]" title="[% Data.FieldLabel %]" value="[% Data.Value %]"[% IF Data.ReadOnly %] readonly[% END %] />
[% IF !Data.ReadOnly %]
<input type="text" class="[% Data.FieldClass %]" id="[% Data.FieldID %]" title="[% Data.FieldLabel %]" value="[% Data.Value %]"[% IF Data.Readonly %] readonly[% END %] />
[% IF !Data.Readonly %]
<a href="#" id="DynamicFieldDBDetailedSearch_[% Data.FieldID %]" field="[% Data.FieldID || Data.FieldName %]" alt="[% Data.DetailedSearchMsg %]" title="[% Data.DetailedSearchMsg %]"><i class="fa fa-search"></i></a>
[% END %]
<input type="hidden" class="[% Data.FieldClass %]" width="100%" id="[% Data.FieldID %]Data" name="[% Data.FieldName %]" title="[%Data.FieldLabel%]" value="[% Data.Value %]" />
<div class="Field Hidden">
<div class="ResultElementTemplate[% Data.FieldID %] Hidden">
<input id="ResultElementText" class="ResultElementText Radio" type="text" readonly value="" name="ResultElementText" title="" />
<a href="#" class="DynamicFieldDBDetails_[% Data.FieldName %] AddButton" field="[% Data.FieldID || Data.FieldName %]" alt="[% Data.DetailsMsg %]" title="[% Data.DetailsMsg %]"><i class="fa fa-list-alt"></i></a>
[% IF !Data.ReadOnly %]
[% IF !Data.Readonly %]
<a id="RemoveDynamicFieldDBEntry" class="RemoveButton" title="[% Data.RemoveValueMsg %]" href="#"><i class="fa fa-minus-square-o"></i></a>
[% END %]
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

<input type="text" class="[% Data.FieldClass %]" id="[% Data.FieldID || Data.FieldName %]" name="[% Data.FieldName %]" title="[% Data.FieldLabelEscaped %]" value="[% Data.ValueEscaped %]"[% IF Data.ReadOnly %] readonly[% END %] />
<input type="text" class="[% Data.FieldClass %]" id="[% Data.FieldID || Data.FieldName %]" name="[% Data.FieldName %]" title="[% Data.FieldLabelEscaped %]" value="[% Data.ValueEscaped %]"[% IF Data.Readonly %] readonly[% END %] />
[% IF Data.Mandatory %]
<div id="[% Data.DivIDMandatory %]" class="TooltipErrorMessage">
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

<input type="text" class="[% Data.FieldClass | html %]" id="[% Data.FieldID | html %]" title="[% Data.FieldLabel | html %]" name="[% Data.FieldName | html %]" value="[% Data.Value | html %]"[% IF Data.ReadOnly %] readonly[% END %] data-customer-search-type="CustomerUser" >
<input type="text" class="[% Data.FieldClass | html %]" id="[% Data.FieldID | html %]" title="[% Data.FieldLabel | html %]" name="[% Data.FieldName | html %]" value="[% Data.Value | html %]"[% IF Data.Readonly %] readonly[% END %] data-customer-search-type="CustomerUser" >
[% IF Data.Mandatory %]
<div id="[% Data.DivIDMandatory | html %]" class="TooltipErrorMessage">
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

<textarea class="[% Data.FieldClass %]" id="[% Data.FieldName %]" name="[% Data.FieldName %]" title="[% Data.FieldLabelEscaped %]" rows="[% Data.RowsNumber %]" cols="[% Data.ColsNumber %]" data-maxlength="[% Data.MaxLength %]">[% Data.ValueEscaped %]</textarea>
<textarea class="[% Data.FieldClass %]" id="[% Data.FieldName %]" name="[% Data.FieldName %]" title="[% Data.FieldLabelEscaped %]" rows="[% Data.RowsNumber %]" cols="[% Data.ColsNumber %]" data-maxlength="[% Data.MaxLength %]"[% IF Data.Readonly %] readonly[% END %]>[% Data.ValueEscaped %]</textarea>
<div id="[% Data.DivID %]" class="TooltipErrorMessage">
<p>
[% IF Data.Mandatory %][% Data.ErrorMessage1 %] [% END %][% Data.ErrorMessage2 %] [% Data.ErrorMessage3 %]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

<input type="text" class="[% Data.FieldClass %]" id="[% Data.FieldID %]" title="[% Data.FieldLabel %]" value="[% Data.Value %]"[% IF Data.ReadOnly %] readonly[% END %] />
[% IF !Data.ReadOnly %]
<input type="text" class="[% Data.FieldClass %]" id="[% Data.FieldID %]" title="[% Data.FieldLabel %]" value="[% Data.Value %]"[% IF Data.Readonly %] readonly[% END %] />
[% IF !Data.Readonly %]
<a href="#" id="DynamicFieldDBDetailedSearch_[% Data.FieldID %]" class="[% Data.WithTooltip %]" field="[% Data.FieldID || Data.FieldName %]" alt="[% Data.DetailedSearchMsg %]" title="[% Data.DetailedSearchMsg %]"><i class="fa fa-search"></i></a>
[% END %]
<input type="hidden" class="[% Data.FieldClass %]" width="100%" id="[% Data.FieldID %]Data" name="[% Data.FieldName %]" title="[%Data.FieldLabel%]" value="[% Data.Value %]" />
<div class="Field Hidden">
<div class="ResultElementTemplate[% Data.FieldID %] Hidden">
<input id="ResultElementText" class="ResultElementText Radio" type="text" readonly value="" name="ResultElementText" title="" />
<a href="#" class="DynamicFieldDBDetails_[% Data.FieldName %] AddButton" field="[% Data.FieldID || Data.FieldName %]" alt="[% Data.DetailsMsg %]" title="[% Data.DetailsMsg %]"><i class="fa fa-list-alt"></i></a>
[% IF !Data.ReadOnly %]
[% IF !Data.Readonly %]
<a id="RemoveDynamicFieldDBEntry" class="RemoveButton" title="[% Data.RemoveValueMsg %]" href="#"><i class="fa fa-minus-square-o"></i></a>
[% END %]
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

<input type="text" class="[% Data.FieldClass %]" id="[% Data.FieldID || Data.FieldName %]" name="[% Data.FieldName %]" title="[% Data.FieldLabelEscaped %]" value="[% Data.ValueEscaped %]"[% IF Data.ReadOnly %] readonly[% END %] />
<input type="text" class="[% Data.FieldClass %]" id="[% Data.FieldID || Data.FieldName %]" name="[% Data.FieldName %]" title="[% Data.FieldLabelEscaped %]" value="[% Data.ValueEscaped %]"[% IF Data.Readonly %] readonly[% END %] />
[% IF Data.Mandatory %]
<div id="[% Data.DivIDMandatory %]" class="TooltipErrorMessage">
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

<textarea class="[% Data.FieldClass %]" id="[% Data.FieldName %]" name="[% Data.FieldName %]" title="[% Data.FieldLabelEscaped %]" rows="[% Data.RowsNumber %]" cols="[% Data.ColsNumber %]" data-maxlength="[% Data.MaxLength %]">[% Data.ValueEscaped %]</textarea>
<textarea class="[% Data.FieldClass %]" id="[% Data.FieldName %]" name="[% Data.FieldName %]" title="[% Data.FieldLabelEscaped %]" rows="[% Data.RowsNumber %]" cols="[% Data.ColsNumber %]" data-maxlength="[% Data.MaxLength %]"[% IF Data.Readonly %] readonly[% END %]>[% Data.ValueEscaped %]</textarea>
<div id="[% Data.DivID %]" class="TooltipErrorMessage">
<p>
[% IF Data.Mandatory %][% Data.ErrorMessage1 %] [% END %][% Data.ErrorMessage2 %] [% Data.ErrorMessage3 %]
Expand Down
1 change: 1 addition & 0 deletions Kernel/System/DynamicField/Backend.pm
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ creates the field and label HTML to be used in edit masks.
],
MaxLength => 100 # Optional, defines the maximum number of characters on fields
# where applies (like TextArea)
Readonly => 1, # Optional
);
Returns:
Expand Down
4 changes: 2 additions & 2 deletions Kernel/System/DynamicField/Driver/BaseDatabase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ sub EditFieldRender {
RemoveValueMsg => $RemoveValueMsg,
DynamicFieldDBContainer => $DynamicFieldDBContainer,
MultiValue => $FieldConfig->{MultiValue} || 0,
ReadOnly => $Param{ReadOnly},
Readonly => $Param{Readonly},
);

if ( $FieldConfig->{Tooltip} ) {
Expand Down Expand Up @@ -407,7 +407,7 @@ sub EditFieldRender {
}

my $TemplateHTML;
if ( $FieldConfig->{MultiValue} && !$Param{ReadOnly} ) {
if ( $FieldConfig->{MultiValue} && !$Param{Readonly} ) {
$FieldTemplateData{FieldID} = $FieldName . '_Template';

$TemplateHTML = $Param{LayoutObject}->Output(
Expand Down
3 changes: 2 additions & 1 deletion Kernel/System/DynamicField/Driver/BaseDateTime.pm
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ sub EditFieldRender {
$FieldName . Required => $Param{Mandatory} || 0,
$FieldName . Optional => 1,
Validate => 1,
Disabled => $Param{Readonly},
$FieldConfig->%*,
%YearsPeriodRange,
);
Expand All @@ -346,7 +347,7 @@ sub EditFieldRender {
}

my $TemplateHTML;
if ( $FieldConfig->{MultiValue} && !$Param{ReadOnly} ) {
if ( $FieldConfig->{MultiValue} && !$Param{Readonly} ) {

$FieldTemplateData{DivID} = $FieldName . '_Template';
$FieldTemplateData{DivIDMandatory} = $FieldName . 'UsedError_Template';
Expand Down
2 changes: 1 addition & 1 deletion Kernel/System/DynamicField/Driver/BaseEntity.pm
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ sub EditFieldRender {

my $SelectionHTML = $Param{LayoutObject}->BuildSelection(
Data => $PossibleValues || {},
Disabled => $Param{ReadOnly},
Disabled => $Param{Readonly},
Name => $FieldName,
ID => $FieldTemplateData{FieldID},
Translation => $FieldConfig->{TranslatableValues} || 0,
Expand Down
4 changes: 2 additions & 2 deletions Kernel/System/DynamicField/Driver/BaseScript.pm
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ sub EditFieldRender {
FieldName => $FieldName,
FieldLabelEscaped => $FieldLabelEscaped,
MultiValue => $FieldConfig->{MultiValue} || 0,
ReadOnly => $Param{ReadOnly},
Readonly => $Param{Readonly},
);

my $FieldTemplateFile = $Param{CustomerInterface}
Expand All @@ -266,7 +266,7 @@ sub EditFieldRender {
}

my $TemplateHTML;
if ( $FieldConfig->{MultiValue} && !$Param{ReadOnly} ) {
if ( $FieldConfig->{MultiValue} && !$Param{Readonly} ) {

$FieldTemplateData{FieldID} = $FieldTemplateData{FieldName} . '_Template';

Expand Down
3 changes: 1 addition & 2 deletions Kernel/System/DynamicField/Driver/BaseSelect.pm
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ sub EditFieldRender {

my $SelectionHTML = $Param{LayoutObject}->BuildSelection(
Data => $DataValues || {},
Disabled => $Param{ReadOnly},
Disabled => $Param{Readonly},
Name => $FieldName,
ID => $FieldID,
SelectedID => $Value->[$ValueIndex],
Expand Down Expand Up @@ -379,7 +379,6 @@ sub EditFieldRender {

my $SelectionHTML = $Param{LayoutObject}->BuildSelection(
Data => $DataValues || {},
Disabled => $Param{ReadOnly},
Name => $FieldName,
ID => $FieldID,
Translation => $FieldConfig->{TranslatableValues} || 0,
Expand Down
2 changes: 1 addition & 1 deletion Kernel/System/DynamicField/Driver/BaseText.pm
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ sub EditFieldRender {
}

my $TemplateHTML;
if ( $FieldConfig->{MultiValue} && !$Param{ReadOnly} ) {
if ( $FieldConfig->{MultiValue} && !$Param{Readonly} ) {

$FieldTemplateData{FieldID} = $FieldTemplateData{FieldName} . '_Template';

Expand Down
2 changes: 1 addition & 1 deletion Kernel/System/DynamicField/Driver/Checkbox.pm
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ sub EditFieldRender {

# build template html
my $TemplateHTML;
if ( $FieldConfig->{MultiValue} && !$Param{ReadOnly} ) {
if ( $FieldConfig->{MultiValue} && !$Param{Readonly} ) {

# adjust ids for template
$FieldTemplateData{FieldID} = $FieldName . '_Template';
Expand Down
3 changes: 2 additions & 1 deletion Kernel/System/DynamicField/Driver/Date.pm
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ sub EditFieldRender {
$FieldName . Required => $Param{Mandatory} || 0,
$FieldName . Optional => 1,
Validate => 1,
Disabled => $Param{Readonly},
$FieldConfig->%*,
%YearsPeriodRange,
OverrideTimeZone => 1,
Expand All @@ -448,7 +449,7 @@ sub EditFieldRender {
}

my $TemplateHTML;
if ( $FieldConfig->{MultiValue} && !$Param{ReadOnly} ) {
if ( $FieldConfig->{MultiValue} && !$Param{Readonly} ) {

$FieldTemplateData{DivID} = $FieldName . '_Template';
$FieldTemplateData{DivIDMandatory} = $FieldName . 'UsedError_Template';
Expand Down
2 changes: 1 addition & 1 deletion Kernel/System/DynamicField/Driver/TextArea.pm
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ sub EditFieldRender {
}

my $TemplateHTML;
if ( $FieldConfig->{MultiValue} && !$Param{ReadOnly} ) {
if ( $FieldConfig->{MultiValue} && !$Param{Readonly} ) {

$FieldTemplateData{FieldID} = $FieldTemplateData{FieldName} . '_Template';

Expand Down
5 changes: 2 additions & 3 deletions Kernel/System/DynamicField/Driver/WebService.pm
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ sub EditFieldRender {

my $SelectionHTML = $Param{LayoutObject}->BuildSelection(
Data => $DataValues || {},
Disabled => $Param{ReadOnly},
Disabled => $Param{Readonly},
Name => $FieldName,
ID => $FieldID,
SelectedID => $Value->[$ValueIndex],
Expand All @@ -303,7 +303,7 @@ sub EditFieldRender {
}

my $TemplateHTML;
if ( $FieldConfig->{MultiValue} && !$Param{ReadOnly} ) {
if ( $FieldConfig->{MultiValue} && !$Param{Readonly} ) {
my $FieldID = $FieldName . '_Template';

# TODO: is this necessary?
Expand All @@ -314,7 +314,6 @@ sub EditFieldRender {

my $SelectionHTML = $Param{LayoutObject}->BuildSelection(
Data => $DataValues || {},
Disabled => $Param{ReadOnly},
Name => $FieldName,
ID => $FieldID,
Translation => $FieldConfig->{TranslatableValues} || 0,
Expand Down
2 changes: 1 addition & 1 deletion Kernel/System/DynamicField/Mask.pm
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ sub EditSectionRender {
AJAXUpdate => 1,
UpdatableFields => $Param{UpdatableFields},
Mandatory => $Field->{Mandatory},
ReadOnly => $Field->{Readonly},
Readonly => $Field->{Readonly},
CustomerInterface => $Param{CustomerInterface},
Object => $Param{Object},
%Error,
Expand Down

0 comments on commit 10d8bdc

Please sign in to comment.