[SOLVED] Next State as Mandatory Field
Moderator: crythias
[SOLVED] Next State as Mandatory Field
How can I do the "Next State" field as Mandatory (like the Body or a mandatory TicketFreeText) in the Customer interface? Or at least you have to choose a state,
not leaving it as '-'.
I can't see the option to change it anywhere.
Thanks a lot.
not leaving it as '-'.
I can't see the option to change it anywhere.
Thanks a lot.
Last edited by rafaqf on 13 Dec 2012, 18:19, edited 1 time in total.
OTRS 3.0.11 and KIX4OTRS on Linux
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Next State as Mandatory Field
How is this beneficial?
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Re: Next State as Mandatory Field
It's not a matter of benefit, it's a request from our customer.crythias wrote:How is this beneficial?
OTRS 3.0.11 and KIX4OTRS on Linux
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Next State as Mandatory Field
I don't see how this is going to be anything but annoying, unless every action changes a state, plus you won't have any clue what the previous state is. nonetheless, add class="Mandatory" everywhere.
Likely candidates:
AdminITSMStateMachine.dtl: <label for="StateID">$Text{"State"}:</label>
AdminNotificationEvent.dtl: <label for="StateID">$Text{"State"}: </label>
AgentFAQAdd.dtl: <label for="StateID">$Text{"State"}:</label>
AgentFAQEdit.dtl: <label for="StateID">$Text{"State"}:</label>
AgentTicketBulk.dtl: <label for="StateID">$Text{"Next state"}:</label>
AgentTicketCompose.dtl: <label for="StateID">$Text{"Next ticket state"}:</label>
CustomerTicketZoom.dtl: <label for="StateID">$Text{"Next state"}:</label> $Data{"NextStatesStrg"}
AgentTicketActionCommon.dtl: <label for="NewStateID">$Text{"Next state"}:</label>
AgentTicketBulk.dtl: <label for="StateID">$Text{"Next state"}:</label>
Likely candidates:
AdminITSMStateMachine.dtl: <label for="StateID">$Text{"State"}:</label>
AdminNotificationEvent.dtl: <label for="StateID">$Text{"State"}: </label>
AgentFAQAdd.dtl: <label for="StateID">$Text{"State"}:</label>
AgentFAQEdit.dtl: <label for="StateID">$Text{"State"}:</label>
AgentTicketBulk.dtl: <label for="StateID">$Text{"Next state"}:</label>
AgentTicketCompose.dtl: <label for="StateID">$Text{"Next ticket state"}:</label>
CustomerTicketZoom.dtl: <label for="StateID">$Text{"Next state"}:</label> $Data{"NextStatesStrg"}
AgentTicketActionCommon.dtl: <label for="NewStateID">$Text{"Next state"}:</label>
AgentTicketBulk.dtl: <label for="StateID">$Text{"Next state"}:</label>
Code: Select all
<label class="Mandatory" for="StateID"><span class="Marker">*</span> $Text{"Next ticket state"}:</label>
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Re: Next State as Mandatory Field
Thank you so much.crythias wrote:I don't see how this is going to be anything but annoying, unless every action changes a state, plus you won't have any clue what the previous state is. nonetheless, add class="Mandatory" everywhere.
I know that shouldn't be like that because the system is like it is; the customer even doesn't know what happens if they don't change the state, because they believe they have to, that's just in the possible case that they do. I'm just a worker, with project managers on me, I will test it tomorrow, if it's so bad of course I will explain it.
Actually, can you explain with more detail why it is so bad? If it is possible to update articles and the ticket without changing the state, why the mandatory class is so annoying?
Thanks again.
OTRS 3.0.11 and KIX4OTRS on Linux
Re: Next State as Mandatory Field
why the customer should change state everytime he goes into the system? Also per default there should not be a - in next state.
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Next State as Mandatory Field
General work flow:rafaqf wrote:can you explain with more detail why it is so bad?
Click the button relative to the task (move/respond/whatever)
do that task. maybe add a note.
If you have the option to next state, the default state is the previous state, though it doesn't show up as the highlighted state. It doesn't change the state if you don't change it.
Why is bad to make it mandatory?
Well, now you have to choose a state for every action that shows a next state. This is prone to error, as you could change it to a state you don't want/isn't the previous state. You have to choose "something". By default you don't have to think about it unless you *want* to choose something.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Re: Next State as Mandatory Field
Anyway, with the class Mandatory I still can submit without changing the state.crythias wrote:General work flow:rafaqf wrote:can you explain with more detail why it is so bad?
Click the button relative to the task (move/respond/whatever)
do that task. maybe add a note.
If you have the option to next state, the default state is the previous state, though it doesn't show up as the highlighted state. It doesn't change the state if you don't change it.
The state '-' comes from KIX4OTRS, it modifies the perl code thus some behaviours are different, and that's also maybe what makes the mandatory class not working for the "Next State".
I've re-written the code like the original one (I guess!):
Code: Select all
if ( $Self->{Config}->{State} ) {
# set state
my %NextStateData = $Self->{StateObject}->StateGet( ID => $GetParam{StateID} );
my $NextState = $NextStateData{Name}
|| $Self->{Config}->{StateDefault}
|| 'open';
$Self->{TicketObject}->StateSet(
TicketID => $Self->{TicketID},
ArticleID => $ArticleID,
State => $NextState,
UserID => $Self->{ConfigObject}->Get('CustomerPanelUserID'),
);
}
Thanks a lot.
OTRS 3.0.11 and KIX4OTRS on Linux
-
- Znuny guru
- Posts: 5018
- Joined: 13 Mar 2011, 09:54
- Znuny Version: 6.0.x
- Real Name: Renée Bäcker
- Company: Perl-Services.de
- Contact:
Re: Next State as Mandatory Field
The DropDown needs the additional class "Validate_Required"...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Re: Next State as Mandatory Field
Like that?reneeb wrote:The DropDown needs the additional class "Validate_Required"...
Code: Select all
<!-- dtl:block:FollowUpState -->
<div>
<label for="StateID" class="Mandatory"><span class="Marker">* </span>$Text{"Next State"}:</label>
<div class="Validate_Required">$Data{"NextStatesStrg"}</div>
</div>
<!-- dtl:block:FollowUpState -->
OTRS 3.0.11 and KIX4OTRS on Linux
Re: Next State as Mandatory Field
Ok, I think I found where is the problem:
Code: Select all
# build next states string
if ( $Self->{Config}->{State} ) {
my %NextStates = $Self->{TicketObject}->TicketStateList(
TicketID => $Self->{TicketID},
Action => $Self->{Action},
CustomerUserID => $Self->{UserID},
);
my %StateSelected;
if ( $Param{StateID} ) {
$StateSelected{SelectedID} = $Param{StateID};
}
else {
# KIX4OTRS-capeIT
# preselect current ticket state, if no default state configured
#$StateSelected{SelectedValue} = $Self->{Config}->{StateDefault};
$StateSelected{SelectedValue} = $Self->{Config}->{StateDefault}
|| $InitialSelected{State}
|| '';
# EO KIX4OTRS-capeIT
}
# KIX4OTRS-capeIT
# default state can be disabled (offers empty selection)
if ( !$Self->{Config}->{StateDefault} ) {
$NextStates{''} = '-';
}
# EO KIX4OTRS-capeIT
$Param{NextStatesStrg} = $Self->{LayoutObject}->BuildSelection(
Data => \%NextStates,
Name => 'StateID',
%StateSelected,
);
$Self->{LayoutObject}->Block(
Name => 'FollowUpState',
Data => \%Param,
);
}
OTRS 3.0.11 and KIX4OTRS on Linux
-
- Znuny guru
- Posts: 5018
- Joined: 13 Mar 2011, 09:54
- Znuny Version: 6.0.x
- Real Name: Renée Bäcker
- Company: Perl-Services.de
- Contact:
Re: Next State as Mandatory Field
There should be a "BuildSelection" call a few lines later. There you can add CSS-classes...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Re: Next State as Mandatory Field
Is not that? Or you mean a explicit function definition?reneeb wrote:There should be a "BuildSelection" call a few lines later. There you can add CSS-classes...
Code: Select all
$Param{NextStatesStrg} = $Self->{LayoutObject}->BuildSelection(
Data => \%NextStates,
Name => 'StateID',
%StateSelected,
);
OTRS 3.0.11 and KIX4OTRS on Linux
-
- Znuny guru
- Posts: 5018
- Joined: 13 Mar 2011, 09:54
- Znuny Version: 6.0.x
- Real Name: Renée Bäcker
- Company: Perl-Services.de
- Contact:
Re: Next State as Mandatory Field
It's exactly that code snippet. Replace it with
Code: Select all
$Param{NextStatesStrg} = $Self->{LayoutObject}->BuildSelection(
Data => \%NextStates,
Name => 'StateID',
Class => 'Validate_Required',
%StateSelected,
);
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
[SOLVED] Next State as Mandatory Field
Thanks a lot, that's itreneeb wrote:It's exactly that code snippet. Replace it withCode: Select all
$Param{NextStatesStrg} = $Self->{LayoutObject}->BuildSelection( Data => \%NextStates, Name => 'StateID', Class => 'Validate_Required', %StateSelected, );

OTRS 3.0.11 and KIX4OTRS on Linux