<commit_before>// --
// Core.Agent.CustomerInformationCenterSearch.js - provides the special module functions for the CIC search
// Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
// --
// $Id: Core.Agent.CustomerInformationCenterSearch.js,v 1.3 2012-09-10 12:56:33 mg Exp $
// --
// This software comes with ABSOLUTELY NO WARRANTY. For details, see
// the enclosed file COPYING for license information (AGPL). If you
// did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
// --

"use strict";

var Core = Core || {};
Core.Agent = Core.Agent || {};

/**
 * @namespace
 * @exports TargetNS as Core.Agent.CustomerInformationCenterSearch
 * @description
 *      This namespace contains the special module functions for the search.
 */
Core.Agent.CustomerInformationCenterSearch = (function (TargetNS) {

    /**
     * @function
     * @private
     * @return nothing
     * @description Shows waiting dialog until screen is ready.
     */
    function ShowWaitingDialog(){
        Core.UI.Dialog.ShowContentDialog('<div class="Spacing Center"><span class="AJAXLoader" title="' + Core.Config.Get('LoadingMsg') + '"></span></div>', Core.Config.Get('LoadingMsg'), '10px', 'Center', true);
    }

    function Redirect(CustomerID, Event) {

        Event.preventDefault();
        Event.stopPropagation();
        ShowWaitingDialog();
        window.location.href = Core.Config.Get('Baselink')
            + 'Action=AgentCustomerInformationCenter;CustomerID='
            + encodeURIComponent(CustomerID);
    }

    /**
     * @function
     * @param {String} Action which is used in framework right now.
     * @param {String} Used profile name.
     * @return nothing
     *      This function open the search dialog after clicking on "search" button in nav bar.
     */

    TargetNS.OpenSearchDialog = function () {

        var Data = {
            Action: 'AgentCustomerInformationCenterSearch',
        };

        ShowWaitingDialog();

        Core.AJAX.FunctionCall(
            Core.Config.Get('CGIHandle'),
            Data,
            function (HTML) {
                // if the waiting dialog was cancelled, do not show the search
                //  dialog as well
                if (!$('.Dialog:visible').length) {
                    return;
                }

                Core.UI.Dialog.ShowContentDialog(HTML, Core.Config.Get('SearchMsg'), '10px', 'Center', true, undefined, true);

                $("#AgentCustomerInformationCenterSearchCustomerID").autocomplete({
                    minLength: Core.Config.Get('Autocomplete.MinQueryLength'),
                    delay: Core.Config.Get('Autocomplete.QueryDelay'),
                    open: function() {
                        // force a higher z-index than the overlay/dialog
                        $(this).autocomplete('widget').addClass('ui-overlay-autocomplete');
                        return false;
                    },
                    source: function (Request, Response) {
                        var URL = Core.Config.Get('Baselink'), Data = {
                            Action: 'AgentCustomerInformationCenterSearch',
                            Subaction: 'SearchCustomerID',
                            Term: Request.term,
                            MaxResults: Core.Config.Get('Autocomplete.MaxResultsDisplayed')
                        };
                        Core.AJAX.FunctionCall(URL, Data, function (Result) {

                            var Data = [];
                            $.each(Result, function () {
                                Data.push({
                                    label: this.Label,
                                    value: this.Value,
                                });
                            });
                            Response(Data);
                        });
                    },
                    select: function (Event, UI) {
                        Redirect(UI.item.value, Event);
                    }
                });

                $("#AgentCustomerInformationCenterSearchCustomerUser").autocomplete({
                    minLength: Core.Config.Get('Autocomplete.MinQueryLength'),
                    delay: Core.Config.Get('Autocomplete.QueryDelay'),
                    open: function() {
                        // force a higher z-index than the overlay/dialog
                        $(this).autocomplete('widget').addClass('ui-overlay-autocomplete');
                        return false;
                    },
                    source: function (Request, Response) {
                        var URL = Core.Config.Get('Baselink'), Data = {
                            Action: 'AgentCustomerInformationCenterSearch',
                            Subaction: 'SearchCustomerUser',
                            Term: Request.term,
                            MaxResults: Core.Config.Get('Autocomplete.MaxResultsDisplayed')
                        };
                        Core.AJAX.FunctionCall(URL, Data, function (Result) {

                            var Data = [];
                            $.each(Result, function () {
                                Data.push({
                                    label: this.Label,
                                    value: this.Value,
                                });
                            });
                            Response(Data);
                        });
                    },
                    select: function (Event, UI) {
                        Redirect(UI.item.value, Event);
                    }
                });
            }, 'html'
        );
    };

    return TargetNS;
}(Core.Agent.Search || {}));<commit_msg>Fixed conflict with global search.<commit_after>// --
// Core.Agent.CustomerInformationCenterSearch.js - provides the special module functions for the CIC search
// Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
// --
// $Id: Core.Agent.CustomerInformationCenterSearch.js,v 1.4 2012-09-11 09:30:47 mg Exp $
// --
// This software comes with ABSOLUTELY NO WARRANTY. For details, see
// the enclosed file COPYING for license information (AGPL). If you
// did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
// --

"use strict";

var Core = Core || {};
Core.Agent = Core.Agent || {};

/**
 * @namespace
 * @exports TargetNS as Core.Agent.CustomerInformationCenterSearch
 * @description
 *      This namespace contains the special module functions for the search.
 */
Core.Agent.CustomerInformationCenterSearch = (function (TargetNS) {

    /**
     * @function
     * @private
     * @return nothing
     * @description Shows waiting dialog until screen is ready.
     */
    function ShowWaitingDialog(){
        Core.UI.Dialog.ShowContentDialog('<div class="Spacing Center"><span class="AJAXLoader" title="' + Core.Config.Get('LoadingMsg') + '"></span></div>', Core.Config.Get('LoadingMsg'), '10px', 'Center', true);
    }

    function Redirect(CustomerID, Event) {

        Event.preventDefault();
        Event.stopPropagation();
        ShowWaitingDialog();
        window.location.href = Core.Config.Get('Baselink')
            + 'Action=AgentCustomerInformationCenter;CustomerID='
            + encodeURIComponent(CustomerID);
    }

    /**
     * @function
     * @param {String} Action which is used in framework right now.
     * @param {String} Used profile name.
     * @return nothing
     *      This function open the search dialog after clicking on "search" button in nav bar.
     */

    TargetNS.OpenSearchDialog = function () {

        var Data = {
            Action: 'AgentCustomerInformationCenterSearch',
        };

        ShowWaitingDialog();

        Core.AJAX.FunctionCall(
            Core.Config.Get('CGIHandle'),
            Data,
            function (HTML) {
                // if the waiting dialog was cancelled, do not show the search
                //  dialog as well
                if (!$('.Dialog:visible').length) {
                    return;
                }

                Core.UI.Dialog.ShowContentDialog(HTML, Core.Config.Get('SearchMsg'), '10px', 'Center', true, undefined, true);

                $("#AgentCustomerInformationCenterSearchCustomerID").autocomplete({
                    minLength: Core.Config.Get('Autocomplete.MinQueryLength'),
                    delay: Core.Config.Get('Autocomplete.QueryDelay'),
                    open: function() {
                        // force a higher z-index than the overlay/dialog
                        $(this).autocomplete('widget').addClass('ui-overlay-autocomplete');
                        return false;
                    },
                    source: function (Request, Response) {
                        var URL = Core.Config.Get('Baselink'), Data = {
                            Action: 'AgentCustomerInformationCenterSearch',
                            Subaction: 'SearchCustomerID',
                            Term: Request.term,
                            MaxResults: Core.Config.Get('Autocomplete.MaxResultsDisplayed')
                        };
                        Core.AJAX.FunctionCall(URL, Data, function (Result) {

                            var Data = [];
                            $.each(Result, function () {
                                Data.push({
                                    label: this.Label,
                                    value: this.Value,
                                });
                            });
                            Response(Data);
                        });
                    },
                    select: function (Event, UI) {
                        Redirect(UI.item.value, Event);
                    }
                });

                $("#AgentCustomerInformationCenterSearchCustomerUser").autocomplete({
                    minLength: Core.Config.Get('Autocomplete.MinQueryLength'),
                    delay: Core.Config.Get('Autocomplete.QueryDelay'),
                    open: function() {
                        // force a higher z-index than the overlay/dialog
                        $(this).autocomplete('widget').addClass('ui-overlay-autocomplete');
                        return false;
                    },
                    source: function (Request, Response) {
                        var URL = Core.Config.Get('Baselink'), Data = {
                            Action: 'AgentCustomerInformationCenterSearch',
                            Subaction: 'SearchCustomerUser',
                            Term: Request.term,
                            MaxResults: Core.Config.Get('Autocomplete.MaxResultsDisplayed')
                        };
                        Core.AJAX.FunctionCall(URL, Data, function (Result) {

                            var Data = [];
                            $.each(Result, function () {
                                Data.push({
                                    label: this.Label,
                                    value: this.Value,
                                });
                            });
                            Response(Data);
                        });
                    },
                    select: function (Event, UI) {
                        Redirect(UI.item.value, Event);
                    }
                });
            }, 'html'
        );
    };

    return TargetNS;
}(Core.Agent.CustomerInformationCenterSearch || {}));
{'fraction_non_alphanumeric': 0.10907657263010338, 'fraction_numerical': 0.0049062554757315574, 'mean_word_length': 1.3439425051334701, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2561050', 'n_tokens_mistral': 2728, 'n_tokens_neox': 2529, 'n_words': 584}