/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Ching En Cheng <c.cheng@metaways.de>
 * @copyright   Copyright (c) 2021 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Ching En Cheng <c.cheng@metaways.de>
 * @copyright   Copyright (c) 2022 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2017 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2019 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2021 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2023 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2025 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiß <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2015 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiß <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2020 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiß <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2025 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @package     Tinebase
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2017 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2007-2010 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 * @todo        refactor this (split file, use new windows, ...)
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2007-2010 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2007-2011 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 * TODO         split into two files (grid & edit dlg)
 * TODO         fix autoheight in edit dlg (use border layout?)
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2007-2011 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2009-2011 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2009-2017 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philip Schuele <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2007-2010 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 * TODO         refactor this (don't use Ext.getCmp, etc.)
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philip Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2007-2011 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 * TODO         refactor this (don't use Ext.getCmp, etc.)
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philip Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2007-2019 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 * TODO         refactor this (don't use Ext.getCmp, etc.)
 * TODO         extend Tine.widgets.dialog.EditDialog
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2007-2011 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 * TODO         refactor this
 * TODO         translate strings (enable/disable/settings)
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2007-2019 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2007-2020 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2011 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2011 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2011-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 * 
 * @package     Admin
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schuele <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2010 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Admin
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2009-2011 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Admin
 * @subpackage  SambaMachine
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2009 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Admin
 * @subpackage  User
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2007-2011 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 * TODO         refactor this (don't use Ext.getCmp, extend generic grid panel, ...)
 */

/*
 * Tine 2.0
 * 
 * @package     Admin
 * @subpackage  sambaMachine
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2009 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/* ["default"] */

/* ["default"].locals */

/* asset import */

/* binding */

/* default */

/* default.locals */

/* harmony default export */

/* harmony export */

/* harmony import */

/* if(_rights.editGrant === true) {
         Ext.getCmp('tagDialog').action_saveAndClose.enable();
         Ext.getCmp('tagDialog').action_applyChanges.enable();
     }
    */

/* import() */

/* import() | Tinebase/js/ace */

/* import() | Tinebase/js/ace-diff */

/* import() | Tinebase/js/ace-diff-styles */

/* import() | Tinebase/js/qrcode */

/* istanbul ignore if  */

/* istanbul ignore next  */

/* pkg: Admin FAT Client (css/Admin-FAT.css)*/

/* pkg: Admin FAT Client (js/Admin-FAT.js)*/

/*#__PURE__*/

/**
         * Return CSS class to apply to rows depending upon flags
         * - checks Flagged, Deleted and Seen
         * 
         * @param {Object} record
         * @param {Integer} index
         * @return {String}
         */

/**
       * Creates a new pop up dialog/window (acc. configuration)
       *
       * @returns {null}
       * TODO can we put this in the Tine.Tinebase.dialog.Dialog?
       */

/**
     * Load values if exists in field definition
     */

/**
     * create field for given configRecord value
     *
     * @param configRecord
     * @param options
     * @returns Ext.form.Field|null
     */

/**
     * onclick handler for addBtn
     */

/**
     * onclick handler for deleteBtn
     */

/**
     * onclick handler for editBtn
     */

/**
     * register editor field for given config
     *
     *  @static
     *  @param type string
     *  @param constructor Function
     */

/**
     * the datastore for lists
     */

/**
   * 
   * @param config
   *  account: user to create this panel for
   */

/**
   * @cfg
   */

/**
   * @cfg {String} type h|totp
   */

/**
   * @cfg {Tine.Tinebase.Application} app
   */

/**
   * @cfg {Tine.Tinebase.Model.Role}
   */

/**
   * @param o
       grid - This grid
       record - The record being edited
       field - The field name being edited
       value - The value being set
       originalValue - The original value for the field, before the edit.
       row - The grid row index
       column - The grid column index
   */

/**
   * @param o
       grid - This grid
       record - The record being edited
       field - The field name being edited
       value - The value for the field being edited.
       row - The grid row index
       column - The grid column index
       cancel - Set this to true to cancel the edit or return false from your handler.
   */

/**
   * @param value
   * @return boolean
   */

/**
   * @private
   * 
   * init email grids
   * @return Array
   * 
   * TODO     add ctx menus
   */

/**
   * @private
   */

/**
   * @property isLdapBackend
   * @type Boolean
   */

/**
   * @property {Ext.tree.treePanel}
   */

/**
   * @property {Object} holds allRights (possible rights)
   */

/**
   * @property {Tine.Tinebase.data.Record}
   */

/**
   * Apply changes handler
   *  - validate some additional data before saving
   *
   * @param {Ext.Button} button
   * @param {Ext.EventObject} event
   * @param {Boolean} closeWindow
   */

/**
   * Apply changes handler
   *  - validate some additional data before saving
   * 
   * @param {Ext.Button} button
   * @param {Ext.EventObject} event
   * @param {Boolean} closeWindow
   */

/**
   * Called on type combo select
   * 
   * @param {Ext.form.Combobox}   combo
   * @param {Ext.data.Recod}      record
   * @param {Int}                 index
   */

/**
   * Close store Window
   */

/**
   * Create store for record field
   * 
   * @returns {Ext.Panel}
   */

/**
   * Create store/grid for keyFields
   * 
   * @returns {Tine.widgets.grid.KeyFieldGridPanel}
   */

/**
   * Get current primary group (selected from combobox or default primary group)
   * 
   * @return {String} - id of current primary group
   */

/**
   * Init Fileserver tab items
   * 
   * @return {Array} - array ff fileserver tab items
   */

/**
   * Init Filesystem tab items
   *
   * @return {Array} - array of tab items
   */

/**
   * Init IMAP tab items
   * 
   * @return {Array} - array of IMAP tab items
   */

/**
   * Init User groups picker grid
   * 
   * @return {Tine.widgets.account.PickerGridPanel}
   */

/**
   * Init User roles picker grid
   * 
   * @return {Tine.widgets.account.PickerGridPanel}
   */

/**
   * Set field with store config
   */

/**
   * Show window for configuring field store
   */

/**
   * Validate confirmed password
   */

/**
   * add custom items to action toolbar
   * 
   * @return {Object}
   */

/**
   * add custom items to context menu
   * 
   * @return {Array}
   */

/**
   * app to configure with this config panel
   * @cfg {Tine.Tinebase.Application}
   */

/**
   * called when the store gets updated, e.g. from editgrid
   *
   * @param {Ext.data.store} store
   * @param {Tine.Tinebase.data.Record} record
   * @param {String} operation
   */

/**
   * check if customfield name already exists for this app
   * 
   * @return {Boolean}
   */

/**
   * check if right is set for application and get the record id
   * @private
   */

/**
   * create grants store + grid
   * 
   * @return {Tine.widgets.container.GrantsGrid}
   */

/**
   * create nodes for rights tree (apps + app rights)
   * 
   * @return {Ext.tree.TreePanel}
   */

/**
   * creates the address grid
   * 
   */

/**
   * creates the rights tree
   *
   */

/**
   * currently selected field type
   * @type 
   */

/**
   * definition properties for cusomfield
   * @type {Array}
   */

/**
   * do something after deletion of records
   * - reload the store
   * 
   * @param {Array} [ids]
   */

/**
   * executed after record got updated from proxy
   *  - load values for customfield definition and ui
   */

/**
   * executed after record got updated from proxy
   */

/**
   * executed when record gets updated from form
   *  - get values for customfield definition and ui
   */

/**
   * executed when record gets updated from form
   */

/**
   * function display
   */

/**
   * function updateRecord
   */

/**
   * function updateToolbarButtons
   */

/**
   * get config items
   *
   * @return {Array}
   */

/**
   * get grants store
   *
   * @return Ext.data.JsonStore
   */

/**
   * init actions with actionToolbar, contextMenu and actionUpdater
   * 
   * @private
   */

/**
   * init roles grid
   */

/**
   * initComponent
   */

/**
   * initialises filter toolbar
   */

/**
   * is form valid?
   *
   * @return {Boolean}
   */

/**
   * is form valid?
   * 
   * @return {Boolean}
   */

/**
   * need to unset localized datetime fields before saving
   * 
   * @param {Object} record
   * @param {Array} dateTimeDisplayFields
   */

/**
   * on update after edit
   *
   * @param {String|Tine.Tinebase.data.Record} record
   */

/**
   * on update after edit
   * 
   * @param {String|Tine.Tinebase.data.Record} record
   */

/**
   * onclick handler for edit action
   * 
   * TODO     make that more generic?
   */

/**
   * onclick handler for edit action
   */

/**
   * open edit window
   * 
   * @param {} record
   */

/**
   * render enabled field (translate)
   */

/**
   * require reload when node is collapsed
   */

/**
   * reset password
   *
   */

/**
   * result renderer
   * 
   * @param {} _value
   * @param {} _cellObject
   * @param {} _record
   * @param {} _rowIndex
   * @param {} _colIndex
   * @param {} _dataStore
   * @return String
   */

/**
   * returns cm
   * @private
   */

/**
   * returns column model
   * 
   * @return Ext.grid.ColumnModel
   * @private
   */

/**
   * returns columns
   * @private
   * @return Array
   */

/**
   * returns dialog
   */

/**
   * returns form
   * 
   */

/**
   * returns label name
   * 
   * @param {Object} value
   * @return {String}
   */

/**
   * returns translated type
   * 
   * @param {Object} value
   * @return {String}
   */

/**
   * returns type name
   * 
   * @param {Object} value
   * @return {String}
   */

/**
   * store a copy of the selected record
   *
   * @param {Tine.Tinebase.data.Record} record
   * @param {Number} index
   */

/**
   * translate and return app title
   * 
   * TODO try to generalize this fn as this gets used in Tags.js + Applications.js as well 
   *      -> this could be moved to Tine.Admin.Application after Admin js refactoring
   */

/**
   * translate and return app title
   * 
   * TODO try to generalize this fn as this gets used in Tags.js + RoleEditDialog.js as well 
   *      -> this could be moved to Tine.Admin.Application after Admin js refactoring
   */

/**
   * type of field with stores
   * @type {Array}
   */

/**
   * ui properties for customfield
   * @type {Array}
   */

/**
   * update datastore with node values and load datastore
   */

/**
   * updates enable/disable actions
   * 
   * @param {Ext.Action} action
   * @param {Object} grants grants sum of grants
   * @param {Object} records
   * @param {Boolean} isFilterSelect
   * @param {Array} requiredAccountStatus
   */

/**
   * value renderer
   * 
   * @param {Ext.data.Record} filter line
   * @param {Ext.Element} element to render to 
   */

/**
   * var tag
   */

/**
 * @namespace   Tine.Admin
 * @class       Tine.Admin.QuotaEditDialog
 * @extends     Tine.widgets.dialog.EditDialog
 */

/**
 * @namespace   Tine.Admin.Groups
 * @class       Tine.Admin.Groups.EditDialog
 * @extends     Tine.widgets.dialog.EditDialog
 */

/**
 * @namespace   Tine.Admin.Model
 * @class       Tine.Admin.Model.AccessLog
 * @extends     Tine.Tinebase.data.Record
 * 
 * AccessLog Record Definition
 */

/**
 * @namespace   Tine.Admin.Model
 * @class       Tine.Admin.Model.TagRight
 * @extends     Ext.data.Record
 *
 * TagRight Record Definition
 */

/**
 * @namespace   Tine.Admin.Model
 * @class       Tine.Admin.Model.TagRight
 * @extends     Ext.data.Record
 * 
 * CustomFieldRight Record Definition
 */

/**
 * @namespace   Tine.Admin.Roles
 * @class       Tine.Admin.Roles.EditDialog
 * @extends     Tine.widgets.dialog.EditRecord
 */

/**
 * @namespace   Tine.Admin.Tags
 * @class       Tine.Admin.Tags.EditDialog
 * @extends     Tine.widgets.dialog.EditRecord
 */

/**
 * @namespace   Tine.Admin.container
 * @class       Tine.Admin.ContainerEditDialog
 * @extends     Tine.widgets.dialog.EditDialog
 * 
 * <p>Container Edit Dialog</p>
 * <p>
 * </p>
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Admin.ContainerEditDialog
 * 
 * TODO add note for personal containers (note is sent to container owner)
 */

/**
 * @namespace   Tine.Admin.customfield
 * @class       Tine.Admin.CustomfieldEditDialog
 * @extends     Tine.widgets.dialog.EditDialog
 * 
 * <p>Customfield Edit Dialog</p>
 * <p>
 * </p>
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Admin.CustomfieldEditDialog
 * 
 */

/**
 * @namespace   Tine.Admin.sambaMachine
 * @class       Tine.Admin.SambaMachineEditDialog
 * @extends     Tine.widgets.dialog.EditDialog
 */

/**
 * @namespace   Tine.Admin.user
 * @class       Tine.Admin.UserEditDialog
 * @extends     Tine.widgets.dialog.EditDialog
 * 
 * NOTE: this class doesn't use the user namespace as this is not yet supported by generic grid
 * 
 * <p>User Edit Dialog</p>
 * <p>
 * </p>
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Admin.UserEditDialog
 */

/**
 * @namespace   Tine.widgets.tags
 * @class       Tine.Admin.ApplicationFilter
 * @extends     Tine.widgets.grid.FilterModel
 */

/**
 * @namespace Tine.Admin.Model
 * @class     Tine.Admin.Model.Application
 * @extends   Tine.Admin.data.Record
 * 
 * Model of an application
 */

/**
 * @namespace Tine.Admin.Model
 * @class     Tine.Admin.Model.Config
 * @extends   Tine.Admin.data.Record
 *
 * Model of a application config settings
 */

/**
 * @namespace Tine.Admin.Model
 * @class     Tine.Tinebase.Model.Group
 * @extends   Tine.Admin.data.Record
 * 
 * Model of a user group
 */

/**
 * @namespace Tine.Tinebase
 * @class     Tine.Tinebase.CashBookEditDialog
 * @extends   Tine.widgets.dialog.EditDialog
 */

/**
 * AccessLog 'mainScreen'
 * 
 * @static
 */

/**
 * AccessLog data proxy
 * 
 * @type Tine.Tinebase.data.RecordProxy
 */

/**
 * AccessLog grid panel
 * 
 * @namespace   Tine.Admin.accessLog
 * @class       Tine.Admin.accessLog.GridPanel
 * @extends     Tine.widgets.grid.GridPanel
 */

/**
 * Admin Tag Edit Popup
 */

/**
 * Admin admin settings popup
 * 
 * @param   {Object} config
 * @return  {Ext.ux.Window}
 */

/**
 * Container Edit Popup
 *
 * @param   {Object} config
 * @return  {Ext.ux.Window}
 */

/**
 * Container Edit Popup
 * 
 * @param   {Object} config
 * @return  {Ext.ux.Window}
 */

/**
 * Container grid panel
 * 
 * @namespace   Tine.Admin.container
 * @class       Tine.Admin.container.GridPanel
 * @extends     Tine.widgets.grid.GridPanel
 */

/**
 * Containers 'mainScreen'
 * 
 * @static
 */

/**
 * Customfield Edit Popup
 * 
 * @param   {Object} config
 * @return  {Ext.ux.Window}
 */

/**
 * Customfield grid panel
 * 
 * @namespace   Tine.Admin.customfield
 * @class       Tine.Admin.customfield.GridPanel
 * @extends     Tine.widgets.grid.GridPanel
 */

/**
 * Customfields 'mainScreen'
 * 
 * @static
 */

/**
 * LogEntries 'mainScreen' (Admin grid panel)
 *
 * @static
 */

/**
 * Model of a container
 */

/**
 * Model of a customfield
 */

/**
 * Model of a right
 */

/**
 * Model of an account
 */

/**
 * NOTE: device type is a combination of mfa_config_id (should be speaking) and provider
 *       this way we can distinguish between two mfa configs of the same provider!
 *       
 * @param config_class
 * @param metadata
 * @param record
 * @return {string|string}
 */

/**
 * Roles Edit Popup
 */

/**
 * Samba machine 'mainScreen'
 */

/**
 * SambaMachine grid panel
 *
 * @namespace   Tine.Admin.sambaMachine
 * @class       Tine.Admin.SambaMachineGridPanel
 * @extends     Tine.widgets.grid.GridPanel
 */

/**
 * Tine 2.0
 * 
 * @package     Admin
 * @subpackage  AccessLog
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philip Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2010-2014 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/**
 * User Edit Popup
 *
 * @param   {Object} config
 * @return  {Ext.ux.Window}
 */

/**
 * User Edit Popup
 * 
 * @param   {Object} config
 * @return  {Ext.ux.Window}
 */

/**
 * User edit popup
 */

/**
 * User grid panel
 * 
 * @namespace   Tine.Admin.user
 * @class       Tine.Admin.user.GridPanel
 * @extends     Tine.widgets.grid.GridPanel
 */

/**
 * Users 'mainScreen'
 * 
 * @static
 */

/**
 * admin panel on update function
 *
 * TODO         update registry without reloading the mainscreen
 */

/**
 * admin settings panel
 * 
 * @namespace   Tine.Admin
 * @class       Tine.Admin.AdminPanel
 * @extends     Tine.widgets.dialog.AdminPanel
 * 
 * <p>Admin Admin Panel</p>
 * <p><pre>
 * </pre></p>
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schuele <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2010 Metaways Infosystems GmbH (http://www.metaways.de)
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Admin.AdminPanel
 */

/**
 * config edit field manager
 *
 *  @singleton
 */

/**
 * config grid panel
 *
 * @namespace   Tine.Admin.config
 * @class       Tine.Admin.config.GridPanel
 * @extends     Tine.widgets.grid.GridPanel
 */

/**
 * get default data for a new customfield
 *
 * @return {Object} default data
 * @static
 */

/**
 * importexportdefinitions 'mainScreen' (Admin grid panel)
 *
 * @static
 */

/**
 * returns default account data
 * 
 * @namespace Tine.Admin.Model.Container
 * @static
 * @return {Object} default data
 */

/**
 * returns default account data
 * 
 * @namespace Tine.Admin.Model.User
 * @static
 * @return {Object} default data
 */

/**
 * returns default group data
 * 
 * @namespace Tine.Tinebase.Model.Group
 * @static
 * @return {Object} default data
 */

/*********** save role members & form ************/

/************** backend *****************/

/************** backends *****************/

/************** models *****************/

/*********************************** MAIN DIALOG ********************************************/

/***/

/*global Ext, Tine*/

/*global Ext, Tine, Locale*/

/*use SoftQuota*/

//                

//                        data : ['Starts with', 'Ends with', 'Any match']

//                        expandData: true,

//                        fields: ['text'],

//                      displayField: 'text'

//                      id:'search-type',

//                      store: new Ext.data.SimpleStore({

//                      value:'Starts with',

//                      width:90,

//                      }),

//                    border: false,

//                    columnWidth: 1

//                    items: this.comboPanel,

//                    items: this.getSearchCombo(),

//                    layout: 'column'

//                    layout: 'hfit',

//                    listClass:'x-combo-list-small',

//                Tine.widgets.grid.PickerGridPanel.prototype.initActionsAndToolbars.call(this);

//                new Ext.ux.SelectBox({

//                this.comboPanel = new Ext.Container({

//                this.tbar = new Ext.Toolbar({

//                }),

//                });

//     enableResponsive: true

//     text: i18n._("Please note: After saving you cannot view this auto-generated secret key again!")

//     {field: 'employee_id', operator: 'equals', value: null}*/

//     {field: 'month', operator: 'equals', value: new Date().format('Y-m')}/*,

//  references to created toolbar and grid panel

// #endif

// #if process.env.NODE_ENV !== 'unittest'

// 5 minutes

// === requiredAccountStatus;

// @FIXME twing can't cope with null values yet, remove this once twing fixed it

// @see 0008226: when tabbing in user edit dialog, wrong tab content is displayed

// @see https://github.com/ericmorand/twing/issues/332

// CONCATENATED MODULE: ../../Admin/js/TwigTemplate/DiffAction.js

// CONCATENATED MODULE: ../../Admin/js/TwigTemplatePanel.js

// CONCATENATED MODULE: ./ux/form/FieldTriggerPlugin.js

// ESM COMPAT FLAG

// EXPORTS

// EXTERNAL MODULE: ../../Admin/js/TwigTemplate/GridPanel.js

// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js

// EXTERNAL MODULE: ./widgets/dialog/DiffDialog.js

// Exports

// For old IE

// If url is already wrapped in quotes, remove them

// Module

// NOTE: JSON fields do not store a JSON strings - they store js strings!

// NOTE: in case we are rendered after record was load

// NOTE: publicKeyCredential is a browser object which can't be JSON.serilized

// NOTE: too early for appMgr :-(

// NOTE: we can't use Ext.Msg.prompt because field has to be of inputType: 'password'

// See https://drafts.csswg.org/css-values-3/#urls

// Should url be wrapped?

// Special case to return head of iframe instead of iframe itself

// TODO add correct Tine 2.0 Toolbar layout with border

// TODO do this in parent window?

// TODO find a generic hooking mechanism

// TODO should be hidden if feature is disabled

// TODO use hooking mechanism

// TODO use hooking mechanism below

// This will throw an exception if access to iframe is blocked

// ];

// _('Quota Management')

// _('Scheduler')

// _('Templates')

// accountFullName (cn im AD) + accountDisplayName(displayname im AD) + accountLoginName + accountEmailAddress

// ace: window.ace,

// add models for select application

// add nodes to tree        

// add selected primary group to new groups if not exists

// add the grid to the layout

// alert(window.formatMessage('This installation requires user verification for FIDO2 devices. Firefox does not support user verification. You need to use a different browser to use FIDO2.'));

// append children          

// call OK button handler

// can other email accounts process aliasse and forward too ? check request

// check if already in

// check if app has admin panel and is enabled

// check if confirm form is valid (we need this if special key called button handler)

// check if right is set

// check manage personal/shared quota right

// chrome://settings/securityKeys

// clear old childs

// create buttongroup to be consistent

// ctrl + return

// directly remove records from the store (only for non-filter-selection)

// disable container_id combo if hidden

// disable remove of group if equal to current primary group

// do/check registry reload

// don't allow to disable Admin, Tinebase or Addressbook as we can't deal with this yet

// don't duplicate tree nodes on 'apply changes'

// don't open 'applications' if user has no right to manage apps

// due to cross-origin restrictions

// dynamically calculated value, not a persisted property

// e.g Tine.Tinebase.Model.Group

// email user

// emptyText: 'Built in configs',

// evalGrants: false,

// expand child node to the deepest

// fetch contexts

// fetch rights

// field definition

// fieldLabel: 'Task Type',

// focus email field

// for now removed abillity to edit role membership

// forcing blur of quickadd grids

// format dates

// freeOTP only?;

// generalized keybord map for edit dlgs

// get aliases / forwards

// get definition

// get grants from grants grid

// get group members

// get role members

// get role rights                

// get translated app title

// how to init them in email account edit dialog ?

// if grid panel was allready created set active content panel and return

// if roleData is empty (=array), set to empty object because array won't work!

// if tagData is empty (=array), set to empty object because array wont work!

// if toolbar was allready created set active toolbar and return

// import a list of modules into the list

// init rights store

// init role members store

// inline paging toolbar

// interrupt process flow until dialog is rendered

// istanbul ignore if

// istanbul ignore next

// layoutConfig: {

// load combo with found models for selected application

// load definition values

// load dynamic list of possible mfa devices for user

// load grants store if editing record

// load records based on application combo and set value

// load specific values for fields with store

// load stores for memberships

// load ui config values

// model generics

// more than one row selected

// move cursor to first input field (skip display fields)

// ngettext('Access Log', 'Access Logs', n);

// ngettext('Application', 'Applications', n); gettext('Applications');

// ngettext('Computer', 'Computers', n);

// ngettext('Config', 'Configs', n); gettext('Configs');

// ngettext('Container', 'Containers', n);

// ngettext('Custom Field', 'Custom Fields', n);

// ngettext('Email User', 'Email Users', n);

// ngettext('Group', 'Groups', n); gettext('Groups');

// ngettext('Samba User', 'Samba Users', n);

// ngettext('User', 'Users', n); gettext('Users');

// no row selected

// only one row selected

// only update sam record if something changed

// password must be changed no matter whether the flag is set

// path is the nodePath get from BE

// preserve space for triggers

// prevent value override from empty ed.getValue()

// private

// put it in the storage or remove it                        

// references to crated toolbar and grid panel

// refresh grid

// reload app if current user changed

// reload mainscreen because apps have to be loaded / unloaded

// reload mainscreen to make sure registry gets updated

// remove listeners for this grid selection model

// return the list of modules as css string

// samba user

// save definition

// save ui config

// se current usage/quota but can not press ok button

// search current folder record based on its parent path

// selected mfa device needs to set config_class as well

// set specific values for fields with stores

// set the root node

// set value for application combo

// show password confirmation

// skip email without configured domain

// sort nodes by text property

// sort nodes in context panel by text property

// store real value of the flag, so it is not overwritten later

// suggest for new users only!

// suggest for unchanged fields only

// the columnmodel

// the datastore

// the gridpanel

// the paging toolbar

// this needs to be modal atm, popup does not work due to issues with this in tineInit.js

// this.defaultFilters = [

// this.elementId = `ace-diff-${Ext.id()}`

// this.explainText = new Ext.form.Label({

// this.explainText,

// this.explainText.setText(i18n._("Existing secret keys can't be viewed. You need to generate a new one if the old one is lost."));

// this.qrField.el.child('img').dom.src = imgURL;

// turn on remote sorting

// update form               

// update record with form data

// uri += "&algorithm=" + this.editDialog.record.get('algorithm');

// uri += "&digits=" + this.editDialog.record.get('digits');

// uri += "&lock=" + ???; // freeOTP only?

// uri += "&period=" + this.editDialog.record.get('period');

// use account_id here because that simplifies the adding of new records with the search comboboxes

// virtual path is the same as current treenode structure

// });

// },

//@TODO clipboard plugin!

//ds_applications.load({params:{start:0, limit:50}});

//height: 26,

//icon :false,

//if (Tine.Tinebase.registry.get('manageImapEmailUser')) {

//pos: 850,

//shared with Tine.Felamimail.admin.showAccountGridPanel

//this.unsetLocalizedDateTimeFields(this.record, ['accountLastLogin', 'accountLastPasswordChange']);

//todo!

//vtype: 'email',

//{ name: 'kickoffTime',   type: 'date', dateFormat: Date.patterns.ISO8601Long },

//{ name: 'logoffTime',    type: 'date', dateFormat: Date.patterns.ISO8601Long },

//{ name: 'logonTime',     type: 'date', dateFormat: Date.patterns.ISO8601Long },

//{ name: 'pwdCanChange',  type: 'date', dateFormat: Date.patterns.ISO8601Long },

//{ name: 'pwdLastSet',    type: 'date', dateFormat: Date.patterns.ISO8601Long },

//}
