Verantwortlicher als Pflichtfeld

Hilfe zu Znuny Problemen aller Art
Locked
ct78
Znuny newbie
Posts: 48
Joined: 26 Aug 2010, 16:11
Znuny Version: 3.0beta

Verantwortlicher als Pflichtfeld

Post by ct78 »

Hallo zusammen,

ich würde gerne das Feld "Verantwortlicher" bei einem neuen Telefon Ticket als Pflichtfeld definieren. In der AgentPhone.dtl dürfte es sich ja um diesen Teil handeln:

Code: Select all

<!-- dtl:block:ResponsibleSelection -->
                    <label for="NewResponsibleID">$Text{"Responsible"}:</label>
                    <div class="Field">
                        $Data{"ResponsibleOptionStrg"}
                        <a href="#" id="ResponsibleSelectionGetAll" class="GetAllAJAX" title="$Text{"Get all"}">$Text{"Get all"}</a>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#ResponsibleSelectionGetAll').bind('click', function (Event) {
        $('#ResponsibleAll').val('1'); // Needed? Why?
        Core.AJAX.FormUpdate($('#NewPhoneTicket'), 'AJAXUpdate', 'ResponsibleAll', ['NewResponsibleID'], function() {
            $('#NewResponsibleID').focus();
        });
        return false;
    });
//]]></script>
<!--dtl:js_on_document_complete-->
                    </div>
                    <div class="Clear"></div>
<!-- dtl:block:ResponsibleSelection -->
Was müsste ich ändern damit es als Pflichtfeld erscheint?

Gruß
Christian
Produktiv: OTRS 3.0.6 mit ITSM 3.0.1
SLES 11SP1 x86
reneeb
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: Verantwortlicher als Pflichtfeld

Post by reneeb »

Die "label"-Zeile müsste so aussehen:

Code: Select all

<label for="NewResponsibleID" class="Mandatory"><span class="Marker">*</span>$Text{"Responsible"}:</label>
Und in der Kernel/Modules/AgentTicketPhone.pm musst Du beim "AJAXUpdate" das so machen:

Code: Select all

                {
                    Name         => 'NewResponsibleID',
                    Data         => $ResponsibleUsers,
                    SelectedID   => $GetParam{NewResponsibleID},
                    Translation  => 0,
                    Class   => 'Validate_Required',   # diese zeile wurde jetzt hinzugefügt
                    PossibleNone => 1,
                    Max          => 100,
                },
Und an anderer Stelle:

Code: Select all

        $Param{ResponsibleOptionStrg} = $Self->{LayoutObject}->BuildSelection(
            Data       => $Param{ResponsibleUsers},
            SelectedID => $Param{ResponsibleUserSelected},
            Name       => 'NewResponsibleID',
            Class     => 'Validate_Required',   # diese zeile wurde jetzt hinzugefügt
        );
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
Locked