// --
// Core.Installer.js - provides the special module functions for Installer
// Copyright (C) 2001-2010 OTRS AG, http://otrs.org/\n";
// --
// $Id: Core.Installer.js,v 1.2 2010-06-23 15:48:16 cg 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 || {};

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

    Core.Config.Set('Installer.CheckDBDataLabel', 'Database check successful.');
    Core.Config.Set('Installer.CheckMailLabelOne', 'Mail check successful.');
    Core.Config.Set('Installer.CheckMailLabelTwo', 'Error in the mail settings. Please correct and try again.');
/*
InstallerDBStart
*/
    /**
     * @function
     * @return nothing
     *      This function initializes the special module functions
     */
    TargetNS.CheckDBData = function () {
        $('input[name=Subaction]').val('CheckRequirements');
        var Data = Core.AJAX.SerializeForm( $('#FormDB') );
        Data += 'CheckMode=DB;';
        Core.AJAX.FunctionCall(Core.Config.Get('Baselink'), Data, CheckDBDataCallback );
        $('input[name=Subaction]').val('DB');
    };


    /**
     * @function
     * @return nothing
     *      This function initializes the special module functions
     */
    function CheckDBDataCallback(json) {
        if (parseInt(json['Successful']) < 1) {
            $('#FormDBResultMessage').html(json['Message']);
            $('#FormDBResultComment').html(json['Comment']);
            $('fieldset.ErrorMsg').show();
        }
        else {
            alert(Core.Config.Get('Installer.CheckDBDataLabel'));
            $('#FormDBSubmit').attr('disabled', false);
            $('fieldset.ErrorMsg, fieldset.CheckDB').hide();
            $('fieldset.HideMe, div.HideMe').show();
        }
    };


/*
InstallerConfiguredMail
*/
    /**
     * @function
     * @return nothing
     *      This function initializes the special module functions
     */
    TargetNS.SelectOutboundMailType = function (obj) {
        var value = $(obj).val();
        if (value == "smtp") {
            $('.infosmtp').show();
        }
        else {
            $('.infosmtp, .infosmtpauth').hide().find('input[name=SMTPAuth]').removeAttr('checked');
        }
    };
    
    /**
     * @function
     * @return nothing
     *      This function initializes the special module functions
     */
    TargetNS.CheckSMTPAuth = function (obj) {
        if ($(obj).is(':checked')) {
            $('.infosmtpauth').show().find('input').removeAttr('disabled');
        }
        else {
            $('.infosmtpauth input').attr('disabled', 'disabled').val("");
            $('.infosmtpauth').hide();
        }
    };

    TargetNS.SkipMailConfig = function () {
        $('input[name=Skip]').val('1');
        $('form').submit();
    };

    TargetNS.CheckMailConfig = function () {
        $('input[name=Skip]').val('0');
        // Check mail data via AJAX
        $('input[name=Subaction]').val('CheckRequirements');
        var Data = Core.AJAX.SerializeForm( $('#FormMail') );
        Data += 'CheckMode=Mail;';
        Core.AJAX.FunctionCall(Core.Config.Get('Baselink'), Data, CheckMailConfigCallback );
        $('input[name=Subaction]').val('Finish');
    };

    function CheckMailConfigCallback(json) {
        if (parseInt(json['Successful']) == 1) {
            alert(Core.Config.Get('Installer.CheckMailLabelOne'));
            $('fieldset.errormsg').hide();
            $('form').submit();
        }
        else {
            $('#FormMailResultMessage').html(json['Message']);
            $('fieldset.ErrorMsg').show();
            alert(Core.Config.Get('Installer.CheckMailLabelTwo'));
        }
    };
    return TargetNS;
}(Core.Installer || {}));
@@ -167,17 +167,17 @@
 .js,v 1.
-2
+3
  2010-06
@@ -184,19 +184,19 @@
 -23 
-15:48:16 cg
+20:46:46 mp
  Exp
@@ -655,281 +655,8 @@
 S) %7B
-%0A%0A    Core.Config.Set('Installer.CheckDBDataLabel', 'Database check successful.');%0A    Core.Config.Set('Installer.CheckMailLabelOne', 'Mail check successful.');%0A    Core.Config.Set('Installer.CheckMailLabelTwo', 'Error in the mail settings. Please correct and try again.');
 %0A/*%0A
@@ -753,48 +753,55 @@
 ion 
-initializes the special module func
+check the values for the database configura
 tion
-s
 %0A   
@@ -1222,48 +1222,57 @@
 ion 
-initializes the special module functions
+display the results for the check on the database
 %0A   
@@ -1831,17 +1831,16 @@
 onfigure
-d
 Mail%0A*/%0A
@@ -1847,126 +1847,8 @@
     
-/**%0A     * @function%0A     * @return nothing%0A     *      This function initializes the special module functions%0A     */
 %0A   
@@ -2225,48 +2225,40 @@
 ion 
-initializes the special module func
+check for the SMTP configura
 tion
-s
 %0A   
@@ -2569,32 +2569,152 @@
        %7D%0A    %7D;%0A
+    %0A    /**%0A     * @function%0A     * @return nothing%0A     *      This function skip check the mail configuration%0A     */
 %0A    TargetNS.Sk
@@ -2813,24 +2813,139 @@
 t();%0A    %7D;%0A
+    %0A    /**%0A     * @function%0A     * @return nothing%0A     *      This function check the mail configuration%0A     */
 %0A    TargetN

Remove Core.Config.Set to dtl files