﻿var TsHd = {};

var UserType = {
  Rep: 'Rep',
  User: 'User'  
};

var RepAccessLevel = {
    Normal: 'Normal',
    Restricted: 'Restricted',
    ReadOnly: 'ReadOnly',
    Admin: 'Admin'
};

function HdUser(id, uid, fname, userType, repAccessLevel, firstName, lastName, canViewCompanyTickets, companyAdmin){
    ///<Summary>Creates a new instance of HdUser.</Summary>
    ///<param name="id" type="integer">The id of the HelpDesk User.</param>
    ///<param name="uid" type="string">The username of the HelpDesk User.</param>
    ///<param name="fname" type="string">The user's full name.</param>
    ///<param name="userType" type="UserType">Indicates the type of HelpDesk User. (Rep, User)</param>
    ///<param name="repAccessLevel" type="RepAccessLevel">Indicates the access level of HelpDesk Rep. (Normal, Restricted, ReadOnly, Admin)</param>
    this.Id = id;
    this.Uid = uid;
    this.FName = fname;
    this.UserType = userType;
    this.RepAccessLevel = repAccessLevel;
    this.FirstName = firstName;
    this.LastName = lastName;
    this.CanViewCompanyTickets = (canViewCompanyTickets != null) ? canViewCompanyTickets : false;
    this.CompanyAdmin = (companyAdmin != null) ? companyAdmin : false;
}
HdUser.prototype = {
    Uid: null,
    Id: null,
    FName: null,
    UserType: null,
    RepAccessLevel: null,
    FirstName: null,
    LastName: null,
    CanViewCompanyTickets: false,
    CompanyAdmin: false,
    Permissions: null,
    getPermissions: null
}
var HelpDeskApp = {
    CurrentUser: null,
    UserToolbar: null,
    BaseUrl: null,
    UseJsTabs: null,
    LogonProcessingUrl: null,
    RedirectUrl: null,
    RedirectOnLogonSuccess: true,
    OnLogonSuccess: null,
    Version: null,
    AllItemsChoiceId: -1
};

HelpDeskApp.CurrentUser = new HdUser();