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

Do not warn agents about empty article subjects by default (#88). #88

Merged
merged 3 commits into from
Jun 15, 2021

Conversation

reneeb
Copy link
Collaborator

@reneeb reneeb commented Jun 4, 2021

Proposed change

When an agent wants to reply to a ticket, they get a warning about empty article subjects when the mail only contains the ticket hook. This is annoying as the subject usually doesn't contain only the ticket hook.

This change implements a new subaction for AgentTicketCompose where the subject is checked. And in the JavaScript code this subaction is called when the dialog is opened and when the subject is changed. And the warning is shown when TicketSubjectClean() returns an empty subject (and the new subaction returns a value that the subject would be empty).

This new subaction has the nice effect, that a solution for znuny/znuny-feature-requests#19 would be recognized as well without any further code change.

Type of change

  • '1 - 🐞 bug 🐞' - Bugfix (non-breaking change which fixes an issue)

Additional information

Checklist

  • The code change is tested and works locally.(❗)
  • There is no commented out code in this PR.(❕)
  • You improved or added new unit tests.(❕)
  • Local ZnunyCodePolicy run passes successfully.(❕)
  • Local unit tests pass.(❕)
  • GitHub workflow ZnunyCodePolicy passes.(❗)
  • GitHub workflow unit tests pass.(❗)

@reneeb reneeb linked an issue Jun 4, 2021 that may be closed by this pull request
@dennykorsukewitz dennykorsukewitz self-assigned this Jun 15, 2021
@dennykorsukewitz dennykorsukewitz added this to the rel-6_0_35 milestone Jun 15, 2021
@dennykorsukewitz dennykorsukewitz changed the title do not warn agents about empty article subjects by default. Do not warn agents about empty article subjects by default. Jun 15, 2021
@dennykorsukewitz dennykorsukewitz added 3 - wait for merge Znuny, it's your turn. 4 - verified This issue or pull request was verified. and removed 3 - wait for reviewer Znuny, it's your turn. 3 - wait for merge Znuny, it's your turn. labels Jun 15, 2021
@dennykorsukewitz dennykorsukewitz changed the title Do not warn agents about empty article subjects by default. Do not warn agents about empty article subjects by default (#88). Jun 15, 2021
@dennykorsukewitz dennykorsukewitz merged commit d52b558 into rel-6_1-dev Jun 15, 2021
@dennykorsukewitz dennykorsukewitz deleted the bugfix/reneeb_issue_34 branch June 15, 2021 14:41
@eyazi
Copy link
Contributor

eyazi commented Jun 28, 2021

  1. I would suggest changing CheckSubject to:
function CheckSubject() {
    $('#SubjectWarning').remove();

    Core.AJAX.FunctionCall(
        Core.Config.Get('CGIHandle'),
        {
            Action: 'AgentTicketCompose',
            Subaction: 'CheckSubject',
            Subject: $('#Subject').val(),
            TicketID: $('input[name=TicketID]').val(),
        },
        function (Response) {
            if (Response.Empty) {
                $('#AppWrapper').prepend('<div class="MessageBox Notice" id="SubjectWarning"><p>' + Response.Message + '</div>');
            }
        }
    );
}
  1. There is still one notification left here https://github.com/znuny/Znuny/blob/rel-6_1-dev/Kernel/Modules/AgentTicketCompose.pm#L896 ($Error{LoadedFormDraft}).

  2. It's not that great to make an AJAX call on page load up. To fix that, however, there needs to be a way to add HTML classes or IDs to $LayoutObject->Notify() to distinguish between difference notifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - 🐞 bug 🐞 An issue with the system. 2 - Frontend 4 - verified This issue or pull request was verified.
Development

Successfully merging this pull request may close these issues.

Warning is shown with no need. - Proposal for fix
3 participants